Loading coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +19 −18 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ class FunctionCommentSniff implements Sniff 'integer' => 'int', 'str' => 'string', 'stdClass' => 'object', '\stdClass' => 'object', 'number' => 'int', 'String' => 'string', 'type' => 'mixed', Loading Loading @@ -734,7 +735,7 @@ class FunctionCommentSniff implements Sniff && isset($realParams[$checkPos]) === true ) { $typeHint = $realParams[$checkPos]['type_hint']; if ($typeHint !== '' && $typeHint !== 'stdClass') { if ($typeHint !== '' && $typeHint !== 'stdClass' && $typeHint !== '\stdClass') { $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 @@ -441,3 +441,15 @@ function test34($a, $b) { yield $i; } } /** * Using \stdClass as type hint is ok, but not in the documentation. * * @param object $name * Some description. * @param \stdClass $param2 * Some description. */ function test35(\stdClass $name, \stdClass $param2) { } coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc.fixed +13 −1 Original line number Diff line number Diff line Loading @@ -383,7 +383,7 @@ class Test2 extends AbstractTest { /** * Run method with missing described variable. * * @param \stdClass $start * @param object $start * Start point. * * @return bool Loading Loading @@ -467,3 +467,15 @@ function test34($a, $b) { yield $i; } } /** * Using \stdClass as type hint is ok, but not in the documentation. * * @param object $name * Some description. * @param object $param2 * Some description. */ function test35(\stdClass $name, \stdClass $param2) { } coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ class FunctionCommentUnitTest extends CoderSniffUnitTest 357 => 1, 360 => 1, 371 => 1, 374 => 1, 389 => 2, 390 => 2, 401 => 1, Loading @@ -71,6 +72,7 @@ class FunctionCommentUnitTest extends CoderSniffUnitTest 416 => 1, 426 => 2, 427 => 2, 450 => 1, ]; case 'FunctionCommentUnitTest.1.inc': return []; Loading Loading
coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +19 −18 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ class FunctionCommentSniff implements Sniff 'integer' => 'int', 'str' => 'string', 'stdClass' => 'object', '\stdClass' => 'object', 'number' => 'int', 'String' => 'string', 'type' => 'mixed', Loading Loading @@ -734,7 +735,7 @@ class FunctionCommentSniff implements Sniff && isset($realParams[$checkPos]) === true ) { $typeHint = $realParams[$checkPos]['type_hint']; if ($typeHint !== '' && $typeHint !== 'stdClass') { if ($typeHint !== '' && $typeHint !== 'stdClass' && $typeHint !== '\stdClass') { $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 @@ -441,3 +441,15 @@ function test34($a, $b) { yield $i; } } /** * Using \stdClass as type hint is ok, but not in the documentation. * * @param object $name * Some description. * @param \stdClass $param2 * Some description. */ function test35(\stdClass $name, \stdClass $param2) { }
coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc.fixed +13 −1 Original line number Diff line number Diff line Loading @@ -383,7 +383,7 @@ class Test2 extends AbstractTest { /** * Run method with missing described variable. * * @param \stdClass $start * @param object $start * Start point. * * @return bool Loading Loading @@ -467,3 +467,15 @@ function test34($a, $b) { yield $i; } } /** * Using \stdClass as type hint is ok, but not in the documentation. * * @param object $name * Some description. * @param object $param2 * Some description. */ function test35(\stdClass $name, \stdClass $param2) { }
coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ class FunctionCommentUnitTest extends CoderSniffUnitTest 357 => 1, 360 => 1, 371 => 1, 374 => 1, 389 => 2, 390 => 2, 401 => 1, Loading @@ -71,6 +72,7 @@ class FunctionCommentUnitTest extends CoderSniffUnitTest 416 => 1, 426 => 2, 427 => 2, 450 => 1, ]; case 'FunctionCommentUnitTest.1.inc': return []; Loading