1919 */
2020class 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