-
-
Notifications
You must be signed in to change notification settings - Fork 741
Closed
rectorphp/rector-src
#6019Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/eb744759-eea9-40c4-b502-93615d95761e
<?php
namespace Rector\Tests\CodeQuality\Rector\Foreach_\ForeachToInArrayRector\Fixture;
use Rector\Tests\CodeQuality\Rector\Foreach_\ForeachToInArrayRector\Source\Collection;
final class SkipMethodCalls
{
public function foreachToInArray($items): bool
{
foreach ($items as $item) {
if ($item == $this->strtoupper($item)) {
return true;
}
}
return false;
}
public function strtoupper($item): bool
{
return strtoupper((string) $item);
}
}
Expected Behaviour
Rector should not change the code as it cannot be changed to the in_array approach
Reactions are currently unavailable