Skip to content

Commit e84e046

Browse files
committed
Changed private static array-properties to const
1 parent 3ad25e3 commit e84e046

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

UndefinedCallableHandler.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
*/
2020
class UndefinedCallableHandler
2121
{
22-
private static $filterComponents = [
22+
private const FILTER_COMPONENTS = [
2323
'humanize' => 'form',
2424
'trans' => 'translation',
2525
'transchoice' => 'translation',
2626
'yaml_encode' => 'yaml',
2727
'yaml_dump' => 'yaml',
2828
];
2929

30-
private static $functionComponents = [
30+
private const FUNCTION_COMPONENTS = [
3131
'asset' => 'asset',
3232
'asset_version' => 'asset',
3333
'dump' => 'debug-bundle',
@@ -57,7 +57,7 @@ class UndefinedCallableHandler
5757
'workflow_marked_places' => 'workflow',
5858
];
5959

60-
private static $fullStackEnable = [
60+
private const FULL_STACK_ENABLE = [
6161
'form' => 'enable "framework.form"',
6262
'security-core' => 'add the "SecurityBundle"',
6363
'security-http' => 'add the "SecurityBundle"',
@@ -67,30 +67,30 @@ class UndefinedCallableHandler
6767

6868
public static function onUndefinedFilter(string $name): bool
6969
{
70-
if (!isset(self::$filterComponents[$name])) {
70+
if (!isset(self::FILTER_COMPONENTS[$name])) {
7171
return false;
7272
}
7373

74-
self::onUndefined($name, 'filter', self::$filterComponents[$name]);
74+
self::onUndefined($name, 'filter', self::FILTER_COMPONENTS[$name]);
7575

7676
return true;
7777
}
7878

7979
public static function onUndefinedFunction(string $name): bool
8080
{
81-
if (!isset(self::$functionComponents[$name])) {
81+
if (!isset(self::FUNCTION_COMPONENTS[$name])) {
8282
return false;
8383
}
8484

85-
self::onUndefined($name, 'function', self::$functionComponents[$name]);
85+
self::onUndefined($name, 'function', self::FUNCTION_COMPONENTS[$name]);
8686

8787
return true;
8888
}
8989

9090
private static function onUndefined(string $name, string $type, string $component)
9191
{
92-
if (class_exists(FullStack::class) && isset(self::$fullStackEnable[$component])) {
93-
throw new SyntaxError(sprintf('Did you forget to %s? Unknown %s "%s".', self::$fullStackEnable[$component], $type, $name));
92+
if (class_exists(FullStack::class) && isset(self::FULL_STACK_ENABLE[$component])) {
93+
throw new SyntaxError(sprintf('Did you forget to %s? Unknown %s "%s".', self::FULL_STACK_ENABLE[$component], $type, $name));
9494
}
9595

9696
throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown %s "%s".', $component, $type, $name));

0 commit comments

Comments
 (0)