Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ final class UseDataProviderTestPhpdoc extends TestCase
];
}

/** @return list<array<string>> */
public static function dataProvider()
{
return [
Expand Down Expand Up @@ -51,6 +52,7 @@ final class UseDataProviderTestPhpdoc extends TestCase
yield ['<?php implode("", $foo, );', '<?php implode($foo, "", );'];
}

/** @return \Iterator<int<0, max>, array<string>> */
public static function dataProvider(): \Iterator
{
yield ['<?php implode(\'\', $foo, );', '<?php implode($foo, );'];
Expand Down
3 changes: 1 addition & 2 deletions rules/CodeQuality/Rector/Class_/YieldDataProviderRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Return_;
use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode;
use PHPStan\Type\ArrayType;
use PHPStan\Type\Generic\GenericObjectType;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
Expand Down Expand Up @@ -177,7 +176,7 @@ private function removeReturnTag(ClassMethod $classMethod): void
return;
}

if ($phpDocInfo->getReturnType() instanceof ArrayType) {
if ($phpDocInfo->getReturnType()->isArray()->yes()) {
$keyType = $phpDocInfo->getReturnType()
->getIterableKeyType();
$itemType = $phpDocInfo->getReturnType()
Expand Down
Loading