Skip to content

Commit 5c40f1a

Browse files
committed
phpstan
1 parent c21a1f5 commit 5c40f1a

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ before_script:
99
- mkdir -p build/logs
1010
- composer self-update
1111
- travis_retry composer install --prefer-source --no-interaction
12-
- composer require --dev phpstan/phpstan
1312
- composer dump-autoload -o
1413

1514
script:

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
],
2727
"require": {
2828
"php": "^7.1",
29+
"webmozart/assert": "^1.4",
2930
"zendframework/zend-console": "^2.5"
3031
},
3132
"conflict": {
@@ -35,11 +36,14 @@
3536
"require-dev": {
3637
"kahlan/kahlan": "^4.0",
3738
"php-coveralls/php-coveralls": "^2.1",
39+
"phpstan/phpstan": "^0.10.8",
40+
"phpstan/phpstan-webmozart-assert": "^0.10.0",
3841
"zendframework/zend-expressive": "^3.0",
3942
"zendframework/zend-mvc": "^3.0"
4043
},
4144
"config": {
42-
"bin-dir": "bin"
45+
"bin-dir": "bin",
46+
"sort-packages": true
4347
},
4448
"extra": {
4549
"zf": {

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
includes:
2+
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
3+

src/HttpsTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace ForceHttpsModule;
66

77
use Psr\Http\Message\ResponseInterface;
8+
use Webmozart\Assert\Assert;
89
use Zend\Expressive\Router\RouteResult;
910
use Zend\Http\PhpEnvironment\Response;
1011
use Zend\Router\RouteMatch;
@@ -41,6 +42,7 @@ private function isGoingToBeForcedToHttps($match = null) : bool
4142
return false;
4243
}
4344

45+
Assert::notNull($match);
4446
if (! $this->config['force_all_routes'] &&
4547
! \in_array(
4648
$match->getMatchedRouteName(),

0 commit comments

Comments
 (0)