@@ -28,8 +28,8 @@ public static function strictGet(string $class, string $name): void
2828 {
2929 $ rc = new \ReflectionClass ($ class );
3030 $ hint = self ::getSuggestion (array_merge (
31- array_filter ($ rc ->getProperties (\ReflectionProperty::IS_PUBLIC ), function ($ p ) { return !$ p ->isStatic (); } ),
32- self ::parseFullDoc ($ rc , '~^[ \t*]*@property(?:-read)?[ \t]+(?:\S+[ \t]+)??\$(\w+)~m ' )
31+ array_filter ($ rc ->getProperties (\ReflectionProperty::IS_PUBLIC ), fn ($ p ) => !$ p ->isStatic ()),
32+ self ::parseFullDoc ($ rc , '~^[ \t*]*@property(?:-read)?[ \t]+(?:\S+[ \t]+)??\$(\w+)~m ' ),
3333 ), $ name );
3434 throw new MemberAccessException ("Cannot read an undeclared property $ class:: \$$ name " . ($ hint ? ", did you mean \$$ hint? " : '. ' ));
3535 }
@@ -43,8 +43,8 @@ public static function strictSet(string $class, string $name): void
4343 {
4444 $ rc = new \ReflectionClass ($ class );
4545 $ hint = self ::getSuggestion (array_merge (
46- array_filter ($ rc ->getProperties (\ReflectionProperty::IS_PUBLIC ), function ($ p ) { return !$ p ->isStatic (); } ),
47- self ::parseFullDoc ($ rc , '~^[ \t*]*@property(?:-write)?[ \t]+(?:\S+[ \t]+)??\$(\w+)~m ' )
46+ array_filter ($ rc ->getProperties (\ReflectionProperty::IS_PUBLIC ), fn ($ p ) => !$ p ->isStatic ()),
47+ self ::parseFullDoc ($ rc , '~^[ \t*]*@property(?:-write)?[ \t]+(?:\S+[ \t]+)??\$(\w+)~m ' ),
4848 ), $ name );
4949 throw new MemberAccessException ("Cannot write to an undeclared property $ class:: \$$ name " . ($ hint ? ", did you mean \$$ hint? " : '. ' ));
5050 }
@@ -76,7 +76,7 @@ public static function strictCall(string $class, string $method, array $addition
7676 $ hint = self ::getSuggestion (array_merge (
7777 get_class_methods ($ class ),
7878 self ::parseFullDoc (new \ReflectionClass ($ class ), '~^[ \t*]*@method[ \t]+(?:\S+[ \t]+)??(\w+)\(~m ' ),
79- $ additionalMethods
79+ $ additionalMethods,
8080 ), $ method );
8181 throw new MemberAccessException ("Call to undefined method $ class:: $ method() " . ($ hint ? ", did you mean $ hint()? " : '. ' ));
8282 }
@@ -107,8 +107,8 @@ public static function strictStaticCall(string $class, string $method): void
107107
108108 } else {
109109 $ hint = self ::getSuggestion (
110- array_filter ((new \ReflectionClass ($ class ))->getMethods (\ReflectionMethod::IS_PUBLIC ), function ($ m ) { return $ m ->isStatic (); } ),
111- $ method
110+ array_filter ((new \ReflectionClass ($ class ))->getMethods (\ReflectionMethod::IS_PUBLIC ), fn ($ m ) => $ m ->isStatic ()),
111+ $ method,
112112 );
113113 throw new MemberAccessException ("Call to undefined static method $ class:: $ method() " . ($ hint ? ", did you mean $ hint()? " : '. ' ));
114114 }
@@ -133,7 +133,7 @@ public static function getMagicProperties(string $class): array
133133 '~^ [ \t*]* @property(|-read|-write) [ \t]+ [^\s$]+ [ \t]+ \$ (\w+) ()~mx ' ,
134134 (string ) $ rc ->getDocComment (),
135135 $ matches ,
136- PREG_SET_ORDER
136+ PREG_SET_ORDER ,
137137 );
138138
139139 $ props = [];
@@ -196,7 +196,7 @@ private static function parseFullDoc(\ReflectionClass $rc, string $pattern): arr
196196 $ traits += $ trait ->getTraits ();
197197 }
198198 } while ($ rc = $ rc ->getParentClass ());
199- return preg_match_all ($ pattern , implode ($ doc ), $ m ) ? $ m [1 ] : [];
199+ return preg_match_all ($ pattern , implode ('' , $ doc ), $ m ) ? $ m [1 ] : [];
200200 }
201201
202202
0 commit comments