Skip to content

Commit b50e912

Browse files
Merge branch '5.1' into 5.2
* 5.1: Changed private static array-properties to const
2 parents 0dce521 + 6be9a02 commit b50e912

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,14 +19,14 @@
1919
*/
2020
class UndefinedCallableHandler
2121
{
22-
private static $filterComponents = [
22+
private const FILTER_COMPONENTS = [
2323
'humanize' => 'form',
2424
'trans' => 'translation',
2525
'yaml_encode' => 'yaml',
2626
'yaml_dump' => 'yaml',
2727
];
2828

29-
private static $functionComponents = [
29+
private const FUNCTION_COMPONENTS = [
3030
'asset' => 'asset',
3131
'asset_version' => 'asset',
3232
'dump' => 'debug-bundle',
@@ -56,7 +56,7 @@ class UndefinedCallableHandler
5656
'workflow_marked_places' => 'workflow',
5757
];
5858

59-
private static $fullStackEnable = [
59+
private const FULL_STACK_ENABLE = [
6060
'form' => 'enable "framework.form"',
6161
'security-core' => 'add the "SecurityBundle"',
6262
'security-http' => 'add the "SecurityBundle"',
@@ -66,30 +66,30 @@ class UndefinedCallableHandler
6666

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

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

7575
return true;
7676
}
7777

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

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

8686
return true;
8787
}
8888

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

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

0 commit comments

Comments
 (0)