Skip to content

Commit

Permalink
Make PHPStan not nag about changing values in $GLOBALS (see contao#2789)
Browse files Browse the repository at this point in the history
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | -
| Docs PR or issue | -

Fixes the issues reported in the CI.

Commits
-------

d73cf13 make PHPStan not nag about changing values in $GLOBALS
5c03c62 CS
  • Loading branch information
m-vo committed Feb 22, 2021
1 parent 9fc3041 commit 1873bcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions core-bundle/tests/Config/Loader/XliffFileLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public function testOverridesKeysInLanguageArray(): void
$loader = new XliffFileLoader($this->getFixturesDir().'/app', true);
$loader->load($this->getFixturesDir().'/vendor/contao/test-bundle/Resources/contao/languages/en/default.xlf', 'en');

$this->assertIsArray($GLOBALS['TL_LANG']['MSC']['third']);
$this->assertSame('This is the third source', $GLOBALS['TL_LANG']['MSC']['third']['with'][1]);
}
}
5 changes: 5 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ parameters:
message: '#PHPDoc tag @param references unknown parameter: \$options#'
path: %currentWorkingDirectory%/core-bundle/src/Image/PictureFactoryInterface.php

# Ignore PHPStan not being able to trace changes in $GLOBALS
-
message: '#Call to method PHPUnit\\Framework\\Assert::assertSame\(\) with .* will always evaluate to false\.#'
path: %currentWorkingDirectory%/core-bundle/tests/Framework/ContaoFrameworkTest.php

# Ignore the wrong return type hint of the UrlGeneratorInterface::generate() method
- '#Method Contao\\CoreBundle\\Picker\\AbstractPickerProvider::generateUrl\(\) never returns null so it can be removed from the return typehint\.#'

Expand Down

0 comments on commit 1873bcc

Please sign in to comment.