@@ -194,15 +194,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
194194 }
195195
196196 if ($ error ['type ' ] == 'param-mismatch ' ) {
197- $ this ->output ->write ('<info> ' . $ error ['class ' ] . ':: ' . $ error ['method ' ] . '</info> - @param <fg=blue> ' .$ error ['param ' ] . '</> ( ' .$ error ['doc-type ' ].') does not match method signature ( ' .$ error ['param-type ' ].'). ' );
197+ $ this ->output ->write ('<info> ' . $ error ['class ' ] . ':: ' . $ error ['method ' ] . '</info> - @param <fg=blue> ' .$ error ['param ' ] . '</> ( ' .$ error ['doc-type ' ].') does not match method signature ( ' .$ error ['param-type ' ].'). ' );
198198 }
199199
200200 if ($ error ['type ' ] == 'return-missing ' ) {
201201 $ this ->output ->write ('<info> ' . $ error ['class ' ] . ':: ' . $ error ['method ' ] . '</info> - @return missing. ' );
202202 }
203203
204204 if ($ error ['type ' ] == 'return-mismatch ' ) {
205- $ this ->output ->write ('<info> ' . $ error ['class ' ] . ':: ' . $ error ['method ' ] . '</info> - @return <fg=blue> ' .$ error ['doc-type ' ] . '</> does not match method signature ( ' .$ error ['return-type ' ].'). ' );
205+ $ this ->output ->write ('<info> ' . $ error ['class ' ] . ':: ' . $ error ['method ' ] . '</info> - @return <fg=blue> ' .$ error ['doc-type ' ] . '</> does not match method signature ( ' .$ error ['return-type ' ].'). ' );
206206 }
207207
208208 $ this ->output ->writeln ('' );
@@ -323,7 +323,10 @@ protected function processFile($file)
323323 ];
324324 }
325325 } elseif (!empty ($ type ) && $ method ['docblock ' ]['params ' ][$ param ] !== $ type ) {
326- if ($ type === 'array ' && substr ($ method ['docblock ' ]['params ' ][$ param ], -2 ) === '[] ' ) {
326+ if (
327+ ($ type === 'array ' && substr ($ method ['docblock ' ]['params ' ][$ param ], -2 ) === '[] ' )
328+ || $ method ['docblock ' ]['params ' ][$ param ] === 'mixed '
329+ ) {
327330 // Do nothing because this is fine.
328331 } else {
329332 $ warnings = true ;
@@ -345,6 +348,10 @@ protected function processFile($file)
345348
346349 if (!empty ($ method ['return ' ])) {
347350 if (empty ($ method ['docblock ' ]['return ' ])) {
351+ // https://bugs.php.net/bug.php?id=75263
352+ if ($ method ['name ' ] === '__construct ' ) {
353+ continue ;
354+ }
348355 $ warnings = true ;
349356 $ this ->warnings [] = [
350357 'type ' => 'return-missing ' ,
@@ -368,7 +375,11 @@ protected function processFile($file)
368375 ];
369376 }
370377 } elseif ($ method ['docblock ' ]['return ' ] !== $ method ['return ' ]) {
371- if ($ method ['return ' ] === 'array ' && substr ($ method ['docblock ' ]['return ' ], -2 ) === '[] ' ) {
378+ if (
379+ ($ method ['return ' ] === 'array ' && substr ($ method ['docblock ' ]['return ' ], -2 ) === '[] ' )
380+ || $ method ['docblock ' ]['return ' ] === 'mixed '
381+ || (strpos ($ method ['docblock ' ]['return ' ], '| ' ) !== false && PHP_MAJOR_VERSION < 8 )
382+ ) {
372383 // Do nothing because this is fine.
373384 } else {
374385 $ warnings = true ;
0 commit comments