Loading coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +6 −1 Original line number Diff line number Diff line Loading @@ -762,7 +762,12 @@ class FunctionCommentSniff implements Sniff && isset($realParams[$checkPos]) === true ) { $typeHint = $realParams[$checkPos]['type_hint']; if ($typeHint !== '' && $typeHint !== 'stdClass' && $typeHint !== '\stdClass') { if ($typeHint !== '' && $typeHint !== 'stdClass' && $typeHint !== '\stdClass' // As of PHP 7.2, object is a valid type hint. && $typeHint !== 'object' ) { $error = 'Unknown type hint "%s" found for %s'; $data = [ $typeHint, Loading coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc +12 −0 Original line number Diff line number Diff line Loading @@ -453,3 +453,15 @@ function test34($a, $b) { function test35(\stdClass $name, \stdClass $param2) { } /** * Allow "object" as real type hint (PHP 7.2). * * @param \stdClass $arg * Something here. * @param object $blarg * Another thing. */ function test36(object $arg, object $blarg) { return $arg; } coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc.fixed +12 −0 Original line number Diff line number Diff line Loading @@ -479,3 +479,15 @@ function test34($a, $b) { function test35(\stdClass $name, \stdClass $param2) { } /** * Allow "object" as real type hint (PHP 7.2). * * @param object $arg * Something here. * @param object $blarg * Another thing. */ function test36(object $arg, object $blarg) { return $arg; } coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ class FunctionCommentUnitTest extends CoderSniffUnitTest 426 => 2, 427 => 2, 450 => 1, 460 => 1, ]; case 'FunctionCommentUnitTest.1.inc': return []; Loading Loading
coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +6 −1 Original line number Diff line number Diff line Loading @@ -762,7 +762,12 @@ class FunctionCommentSniff implements Sniff && isset($realParams[$checkPos]) === true ) { $typeHint = $realParams[$checkPos]['type_hint']; if ($typeHint !== '' && $typeHint !== 'stdClass' && $typeHint !== '\stdClass') { if ($typeHint !== '' && $typeHint !== 'stdClass' && $typeHint !== '\stdClass' // As of PHP 7.2, object is a valid type hint. && $typeHint !== 'object' ) { $error = 'Unknown type hint "%s" found for %s'; $data = [ $typeHint, Loading
coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc +12 −0 Original line number Diff line number Diff line Loading @@ -453,3 +453,15 @@ function test34($a, $b) { function test35(\stdClass $name, \stdClass $param2) { } /** * Allow "object" as real type hint (PHP 7.2). * * @param \stdClass $arg * Something here. * @param object $blarg * Another thing. */ function test36(object $arg, object $blarg) { return $arg; }
coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc.fixed +12 −0 Original line number Diff line number Diff line Loading @@ -479,3 +479,15 @@ function test34($a, $b) { function test35(\stdClass $name, \stdClass $param2) { } /** * Allow "object" as real type hint (PHP 7.2). * * @param object $arg * Something here. * @param object $blarg * Another thing. */ function test36(object $arg, object $blarg) { return $arg; }
coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.php +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ class FunctionCommentUnitTest extends CoderSniffUnitTest 426 => 2, 427 => 2, 450 => 1, 460 => 1, ]; case 'FunctionCommentUnitTest.1.inc': return []; Loading