Skip to content

Commit

Permalink
adding grumphp, fixing style, narrowing autoload namespace (#1)
Browse files Browse the repository at this point in the history
* adding grumphp, fixing style, narrowing autoload namespace

* removing travis matrix to see if default test stages go away
  • Loading branch information
jaydiablo committed May 31, 2018
1 parent 6040ae9 commit 6a6f88e
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repository:
name: zf1-service
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor
/composer.lock
/composer.lock
.php_cs.cache
25 changes: 25 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->files()
->in(__DIR__)
;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@PHPUnit60Migration:risky' => true,
'binary_operator_spaces' => [
'default' => 'align_single_space_minimal',
'operators' => ['||' => null, '&&' => null]
],
'single_quote' => true,
'array_syntax' => ['syntax' => 'long'],
'concat_space' => ['spacing' => 'one'],
'psr0' => true
])
->setUsingCache(true)
->setFinder($finder);
;
22 changes: 14 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ language: php

sudo: false

php:
- 7
- 7.1
- 7.2
- nightly

env: TMPDIR=/tmp

branches:
Expand All @@ -18,10 +12,22 @@ install:
- phpenv rehash
- travis_retry composer install --no-interaction --prefer-source

script:
- composer phpstan
stages:
- style check
- phpstan analysis

jobs:
fast_finish: true
allow_failures:
- php: nightly
include:
- stage: style check
php: 7.1
env: TMPDIR=/tmp USE_XDEBUG=false
script:
- composer style-check
- stage: phpstan analysis
php: 7.1
env: TMPDIR=/tmp USE_XDEBUG=false
script:
- composer phpstan
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@
},
"autoload": {
"psr-0": {
"Zend_": "src/"
"Zend_Service_": "src/"
}
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"phpstan/phpstan": "^0.9.2"
"phpstan/phpstan": "^0.9.2",
"friendsofphp/php-cs-fixer": "^2.11",
"maglnet/composer-require-checker": "^0.1.6 | ^0.2.1",
"phpro/grumphp": "^0.14.0"
},
"scripts": {
"phpstan": "phpstan analyze -l7 -c phpstan.neon --no-progress ./src --ansi"
"phpstan": "phpstan analyze -l7 -c phpstan.neon --no-progress ./ --ansi",
"style-check": "php-cs-fixer fix --dry-run -vv"
}
}
12 changes: 12 additions & 0 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# grumphp.yml
parameters:
tasks:
composer:
strict: true
composer_require_checker: ~
phpcsfixer2:
allow_risky: true
config: .php_cs
phpstan:
level: 7
configuration: phpstan.neon
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
parameters:
excludes_analyse:
- %rootDir%/../../../vendor/*
ignoreErrors:
1 change: 0 additions & 1 deletion src/Zend/Service/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ final public static function getHttpClient()
return self::$_httpClient;
}
}

4 changes: 2 additions & 2 deletions src/Zend/Service/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Service_Exception extends Zend_Exception
{}

{
}

0 comments on commit 6a6f88e

Please sign in to comment.