@@ -54,21 +54,21 @@ public function reflect($object, string $method) {
5454 if ($ docs !== false ) {
5555 // extract everything prefixed by @ and first letter uppercase
5656 preg_match_all ('/^\h+\*\h+@(?P<annotation>[A-Z]\w+)((?P<parameter>.*))?$/m ' , $ docs , $ matches );
57- foreach ($ matches ['annotation ' ] as $ key => $ annontation ) {
58- $ annontation = strtolower ($ annontation );
57+ foreach ($ matches ['annotation ' ] as $ key => $ annotation ) {
58+ $ annotation = strtolower ($ annotation );
5959 $ annotationValue = $ matches ['parameter ' ][$ key ];
60- if (isset ($ annotationValue[ 0 ]) && $ annotationValue [ 0 ] === '( ' && $ annotationValue [ \strlen ($ annotationValue) - 1 ] === ') ' ) {
60+ if (str_starts_with ($ annotationValue, '( ' ) && str_ends_with ($ annotationValue, ') ' ) ) {
6161 $ cutString = substr ($ annotationValue , 1 , -1 );
6262 $ cutString = str_replace (' ' , '' , $ cutString );
6363 $ splittedArray = explode (', ' , $ cutString );
6464 foreach ($ splittedArray as $ annotationValues ) {
6565 [$ key , $ value ] = explode ('= ' , $ annotationValues );
66- $ this ->annotations [$ annontation ][$ key ] = $ value ;
66+ $ this ->annotations [$ annotation ][$ key ] = $ value ;
6767 }
6868 continue ;
6969 }
7070
71- $ this ->annotations [$ annontation ] = [$ annotationValue ];
71+ $ this ->annotations [$ annotation ] = [$ annotationValue ];
7272 }
7373
7474 // extract type parameter information
0 commit comments