Skip to content

Commit 164c63b

Browse files
committed
revert class exists check and add phpstan ignore rule
1 parent 5259e77 commit 164c63b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Controller/WebUIController.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,9 @@ private function getLocale2LanguageMap(): array
208208
{
209209
$configuredLocales = $this->getParameter('php_translation.locales');
210210

211-
$names = [];
212-
if (\class_exists(Locales::class)) {
213-
$names = Locales::getNames('en');
214-
} elseif (\method_exists(Intl::class, 'getLocaleBundle')) {
215-
$names = Intl::getLocaleBundle()->getLocaleNames('en');
216-
}
211+
$names = \class_exists(Locales::class)
212+
? Locales::getNames('en')
213+
: Intl::getLocaleBundle()->getLocaleNames('en');
217214

218215
$map = [];
219216
foreach ($configuredLocales as $l) {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"twig/twig": "^1.42 || ^2.11"
2626
},
2727
"require-dev": {
28-
"symfony/phpunit-bridge": "^4.4 | ^5.0",
28+
"symfony/phpunit-bridge": "^4.4 || ^5.0",
2929
"php-translation/translator": "^1.0",
3030
"php-http/curl-client": "^1.7",
3131
"php-http/message": "^1.6",

phpstan.neon.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ parameters:
3333
-
3434
path: %currentWorkingDirectory%/Command
3535
message: '#Call to an undefined method Symfony\\Component\\Console\\Application::getKernel()#'
36+
-
37+
path: %currentWorkingDirectory%/Controller/WebUIController.php
38+
message: '#Call to an undefined static method Symfony\\Component\\Intl\\Intl::getLocaleBundle()#'
39+
-
40+
path: %currentWorkingDirectory%/DependencyInjection/Configuration.php
41+
message: '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder::root()#'

0 commit comments

Comments
 (0)