File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 7
7
before_script :
8
8
- if php --ri xdebug >/dev/null; then phpenv config-rm xdebug.ini; fi
9
9
before_install :
10
- - composer self-update
11
10
- composer global require "hirak/prestissimo:^0.3"
12
11
install :
13
12
- composer install --no-interaction
14
13
script :
14
+ # Inspections
15
15
- ./vendor/bin/phpcs src
16
16
- ./vendor/bin/phpstan analyze src
17
+
18
+ # Try to add to a Drupal setup.
19
+ - composer create-project drupal-composer/drupal-project:8.x-dev $TRAVIS_BUILD_DIR/../drupal --no-interaction
20
+ - cd $TRAVIS_BUILD_DIR/../drupal
21
+
22
+ # Install dependency.
23
+ - composer config repositories.0 path $TRAVIS_BUILD_DIR
24
+ - cat composer.json
25
+ - composer require mglaman/phpstan-drupal *@dev
26
+ - cp $TRAVIS_BUILD_DIR/tests/fixtures/drupal-phpstan.neon phpstan.neon
27
+ - ./vendor/bin/phpstan analyze web/core/install.php
28
+
17
29
cache :
18
30
directories :
19
31
- $HOME/.composer/cache
Original file line number Diff line number Diff line change @@ -120,8 +120,13 @@ public function loadConfiguration(): void
120
120
// Prevent \Nette\DI\ContainerBuilder::completeStatement from array_walk_recursive into the arguments
121
121
// and thinking these are real services for PHPStan's container.
122
122
if (isset ($ serviceDefinition ['arguments ' ]) && is_array ($ serviceDefinition ['arguments ' ])) {
123
- array_walk ($ serviceDefinition ['arguments ' ], function (string &$ argument ) : void {
124
- $ argument = str_replace ('@ ' , '' , $ argument );
123
+ array_walk ($ serviceDefinition ['arguments ' ], function (&$ argument ) : void {
124
+ if (is_array ($ argument )) {
125
+ // @todo fix for @http_kernel.controller.argument_metadata_factory
126
+ $ argument = '' ;
127
+ } else {
128
+ $ argument = str_replace ('@ ' , '' , $ argument );
129
+ }
125
130
});
126
131
}
127
132
unset($ serviceDefinition ['tags ' ]);
Original file line number Diff line number Diff line change
1
+ parameters :
2
+ excludes_analyse :
3
+ - *Test.php
4
+ - *TestBase.php
5
+ level : 0
6
+ includes :
7
+ - vendor/mglaman/phpstan-drupal/extension.neon
You can’t perform that action at this time.
0 commit comments