@@ -520,13 +520,14 @@ protected function parseNativeAttributeParams(string $text): array
520
520
$ colonPos = strpos ($ text , ': ' );
521
521
$ name = substr ($ text , 0 , $ colonPos );
522
522
523
- if (strpos ($ name , ' ' ) !== false ) {
523
+ if (strpos ($ name , ' ' ) !== false && strpos ( $ name , "\n" ) === false ) {
524
524
$ name = trim ($ name );
525
525
$ error = 'Found extra space before attribute "%s" name ' ;
526
526
$ data = [$ name ];
527
527
$ this ->reportError ($ error , $ this ->tagStart , 'ExtraSpace ' , $ data );
528
528
}
529
529
530
+ $ name = trim ($ name , " \r\n" );
530
531
$ valuePos = $ colonPos + 1 ;
531
532
532
533
if (substr ($ text , $ valuePos , 1 ) !== ' ' ) {
@@ -777,7 +778,7 @@ protected function validateAnnotationAttributeType(string $name, string $attrNam
777
778
break ;
778
779
779
780
case 'class ' :
780
- $ valid = (ucfirst ($ value ) === $ value ) && (
781
+ $ valid = (ucfirst ($ value ) === $ value || $ value === ' self::class ' ) && (
781
782
(strpos ($ value , "\\" ) !== false )
782
783
|| strpos ($ value , self ::CLASS_SUFFIX , -self ::CLASS_SUFFIX_LENGTH )
783
784
);
@@ -821,8 +822,8 @@ protected function validateAnnotationColumn(string $name, array $attributes): vo
821
822
}
822
823
}
823
824
824
- $ columnType = null ;
825
- $ expectedType = null ;
825
+ $ expectedType = $ this -> memberType ;
826
+
826
827
if (isset ($ attributes ['type ' ])) {
827
828
$ columnType = $ attributes ['type ' ];
828
829
@@ -1215,6 +1216,10 @@ protected function getShortClassName(string $className): string
1215
1216
$ className = substr ($ className , 0 , -self ::CLASS_SUFFIX_LENGTH );
1216
1217
}
1217
1218
1219
+ if ($ className === 'self ' ) {
1220
+ $ className = $ this ->getMethodClassName ($ this ->memberPtr );
1221
+ }
1222
+
1218
1223
return $ className ;
1219
1224
}
1220
1225
0 commit comments