Skip to content

Commit 4a74b79

Browse files
authored
Merge pull request #129 from brambaud/phpstan-deprecated-autoload_files
Replace deprecated autoload_files parameter
2 parents 242a3f5 + 2bb80a3 commit 4a74b79

File tree

7 files changed

+9
-10
lines changed

7 files changed

+9
-10
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
name: Run against a module
7878
command: |
7979
cd /tmp/drupal
80-
./vendor/bin/phpstan analyze core/modules/dynamic_page_cache --debug
80+
./vendor/bin/phpstan analyze --memory-limit=256M core/modules/dynamic_page_cache --debug
8181
test_drupal_project:
8282
<<: *defaults
8383
steps:
@@ -93,7 +93,7 @@ jobs:
9393
name: Run against a module
9494
command: |
9595
cd /tmp/drupal
96-
./vendor/bin/phpstan analyze web/core/modules/dynamic_page_cache --debug
96+
./vendor/bin/phpstan analyze --memory-limit=256M web/core/modules/dynamic_page_cache --debug
9797
test_upgrade_status:
9898
<<: *defaults
9999
steps:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"require": {
1313
"php": "^7.1",
1414
"nette/finder": "^2.5",
15-
"phpstan/phpstan": "^0.12.0",
15+
"phpstan/phpstan": "^0.12.26",
1616
"symfony/yaml": "~3.4.5|^4.2",
1717
"webflo/drupal-finder": "^1.2"
1818
},

extension.neon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
parameters:
2-
autoload_files:
2+
bootstrapFiles:
33
- drupal-autoloader.php
44
excludes_analyse:
5-
- *.api.php
6-
- */tests/fixtures/*.php
5+
- '*.api.php'
6+
- '*/tests/fixtures/*.php'
77
fileExtensions:
88
- module
99
- theme

tests/fixtures/drupal/modules/phpstan_fixtures/src/TestServicesMappingExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class TestServicesMappingExtension {
88
public function test() {
99
$entity_manager = \Drupal::getContainer()->get('entity.manager');
1010
$doesNotExist = $entity_manager->thisMethodDoesNotExist();
11-
// @todo this should be throwing deprecations...
1211
$definitions = $entity_manager->getDefinitions();
1312
}
1413
}

tests/src/AnalyzerTestBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function runAnalyze(string $path) {
2424
$fileHelper = $container->getByType(FileHelper::class);
2525
assert($fileHelper !== null);
2626

27-
$autoloadFiles = $container->getParameter('autoload_files');
27+
$autoloadFiles = $container->getParameter('bootstrapFiles');
2828
$this->assertEquals([dirname(__DIR__, 2) . '/drupal-autoloader.php'], $autoloadFiles);
2929
if ($autoloadFiles !== null) {
3030
foreach ($autoloadFiles as $autoloadFile) {

tests/src/BootstrapTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private function doDrupalBootstrap()
5555
$fileHelper = $container->getByType(FileHelper::class);
5656
assert($fileHelper !== null);
5757

58-
$autoloadFiles = $container->getParameter('autoload_files');
58+
$autoloadFiles = $container->getParameter('bootstrapFiles');
5959
$this->assertEquals([dirname(__DIR__, 2) . '/drupal-autoloader.php'], $autoloadFiles);
6060
if ($autoloadFiles !== null) {
6161
foreach ($autoloadFiles as $autoloadFile) {

tests/src/DrupalIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testServiceMapping() {
7171
instead.'
7272
];
7373
$errors = $this->runAnalyze(__DIR__ . '/../fixtures/drupal/modules/phpstan_fixtures/src/TestServicesMappingExtension.php');
74-
$this->assertCount(3, $errors->getErrors(), var_export($errors->getErrors(), true));
74+
$this->assertCount(3, $errors->getErrors());
7575
$this->assertCount(0, $errors->getInternalErrors());
7676
foreach ($errors->getErrors() as $key => $error) {
7777
$this->assertEquals($errorMessages[$key], $error->getMessage());

0 commit comments

Comments
 (0)