Skip to content

Commit

Permalink
CountArrayToEmptyArrayComparisonRector: don't trust phpdoc (#5203)
Browse files Browse the repository at this point in the history
* CountArrayToEmptyArrayComparisonRector: don't trust phpdoc

* Update on_call_method_return_array.php.inc

* Update on_call_method_return_array.php.inc
  • Loading branch information
staabm committed Oct 26, 2023
1 parent 72cdbd0 commit be0cc77
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
@@ -0,0 +1,14 @@
<?php

namespace Rector\Tests\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector\Fixture;

/**
* @var Rechnung[] $Rechnung
*/

if ($Rechnung && count($Rechnung) > 0) {

}


?>
Expand Up @@ -117,7 +117,7 @@ private function refactorBooleanNot(BooleanNot $booleanNot): ?Identical

private function isArray(Expr $expr): bool
{
return $this->getType($expr)
return $this->nodeTypeResolver->getNativeType($expr)
->isArray()
->yes();
}
Expand Down
Expand Up @@ -15,7 +15,7 @@ final class OnCallMethodReturnArray
/**
* @return string[]
*/
private function get()
private function get(): array
{
return ['a', 'b'];
}
Expand All @@ -40,7 +40,7 @@ final class OnCallMethodReturnArray
/**
* @return string[]
*/
private function get()
private function get(): array
{
return ['a', 'b'];
}
Expand Down

0 comments on commit be0cc77

Please sign in to comment.