Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

PHPStan fixes #296

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/test/ export-ignore
/phpstan.neon export-ignore
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
global:
- COMPOSER_ARGS="--no-interaction"
- COVERAGE_DEPS="php-coveralls/php-coveralls"
- PHPSTAN_DEPS="phpstan/phpstan:^0.10.3"

matrix:
include:
Expand Down Expand Up @@ -41,6 +42,7 @@ matrix:
- DEPS=locked
- CS_CHECK=true
- TEST_COVERAGE=true
- PHPSTAN_TEST=true
- php: 7.1
env:
- DEPS=latest
Expand All @@ -63,11 +65,13 @@ install:
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- if [[ $PHPSTAN_TEST == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $PHPSTAN_DEPS ; fi
- stty cols 120 && composer show

script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
- if [[ $PHPSTAN_TEST == 'true' ]]; then ./vendor/bin/phpstan analyse -l 7 -c ./phpstan.neon --no-progress . ; fi

after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then vendor/bin/php-coveralls -v ; fi
Expand Down
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"zendframework",
"mvc"
],
"version": "3.1.2",
"support": {
"docs": "https://docs.zendframework.com/zend-mvc/",
"issues": "https://github.com/zendframework/zend-mvc/issues",
Expand All @@ -30,8 +31,15 @@
"http-interop/http-middleware": "^0.4.1",
"phpunit/phpunit": "^6.4.4 || ^5.7.14",
"zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-filter": "^2.6",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a helluvalot of added dependencies that may as well fail in production too :|

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are classes used in LazyControllerAbstractFactory. The static analyser throws an exception if they are not found. We can convert the ::class notation in strings, probably is the best thing to do.

Btw, they are included only in require-dev directive so shouldn't be a problem in production.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they are in ::class form, then using the string notation is preferable over adding dependencies here

"zendframework/zend-hydrator": "^2.2.1",
"zendframework/zend-inputfilter": "^2.6",
"zendframework/zend-json": "^2.6.1 || ^3.0",
"zendframework/zend-log": "^2.6",
"zendframework/zend-mvc-console": "^1.1.11",
"zendframework/zend-paginator": "^2.0.0",
"zendframework/zend-psr7bridge": "^1.0",
"zendframework/zend-serializer": "^2.6",
"zendframework/zend-stratigility": "^2.0.1"
},
"suggest": {
Expand Down
Loading