@@ -62,7 +62,7 @@ public static function allTags(
6262 $ closeType = T_DOC_COMMENT_CLOSE_TAG ;
6363 $ closeTag = $ file ->findPrevious ($ closeType , $ position - 1 , null , false , null , true );
6464
65- if (! $ closeTag || empty ($ tokens [$ closeTag ]['comment_opener ' ])) {
65+ if (( $ closeTag === false ) || ! isset ($ tokens [$ closeTag ]['comment_opener ' ])) {
6666 return [];
6767 }
6868
@@ -74,7 +74,7 @@ public static function allTags(
7474
7575 /** @var array<int, array{string, string}> $tags */
7676 $ tags = [];
77- $ start = (int )$ tokens [$ closeTag ]['comment_opener ' ] + 1 ;
77+ $ start = (int ) $ tokens [$ closeTag ]['comment_opener ' ] + 1 ;
7878 $ key = -1 ;
7979 $ inTag = false ;
8080
@@ -101,7 +101,7 @@ public static function allTags(
101101 static $ rand ;
102102 $ rand or $ rand = bin2hex (random_bytes (3 ));
103103 foreach ($ tags as [$ tagName , $ tagContent ]) {
104- empty ($ normalizedTags [$ tagName ]) and $ normalizedTags [$ tagName ] = [];
104+ isset ($ normalizedTags [$ tagName ]) or $ normalizedTags [$ tagName ] = [];
105105 if (!$ normalizeContent ) {
106106 $ normalizedTags [$ tagName ][] = $ tagContent ;
107107 continue ;
@@ -147,7 +147,7 @@ public static function allParamTypes(File $file, int $functionPosition): array
147147 $ types = [];
148148 foreach ($ params as $ param ) {
149149 preg_match ('~^([^$]+)\s*(\$\S+)~ ' , trim ($ param ), $ matches );
150- if (($ matches [1 ] ?? null ) && ($ matches [2 ] ?? null )) {
150+ if (isset ($ matches [1 ]) && isset ($ matches [2 ])) {
151151 $ types [$ matches [2 ]] = static ::normalizeTypesString ($ matches [1 ]);
152152 }
153153 }
@@ -170,10 +170,10 @@ public static function normalizeTypesString(string $typesString): array
170170 if (strpos ($ splitType , '& ' ) !== false ) {
171171 $ splitType = rtrim (ltrim ($ splitType , '( ' ), ') ' );
172172 } elseif (strpos ($ splitType , '? ' ) === 0 ) {
173- $ splitType = substr ($ splitType , 1 ) ?: '' ;
174- $ hasNull = $ hasNull || ($ splitType !== '' );
173+ $ splitType = substr ($ splitType , 1 );
174+ $ hasNull = $ hasNull || (( $ splitType !== '' ) && ( $ splitType !== false ) );
175175 }
176- if (! $ splitType ) {
176+ if (( $ splitType === false ) || ( $ splitType === '' ) ) {
177177 continue ;
178178 }
179179 if (strtolower ($ splitType ) === 'null ' ) {
0 commit comments