separate fixture file (re rectorphp/rector#3026)

This commit is contained in:
Christian Rishøj 2020-03-16 16:17:58 +01:00
parent 6e63e3b0b7
commit db70bbf21f
No known key found for this signature in database
GPG Key ID: DE1C905267F33751
2 changed files with 35 additions and 12 deletions

View File

@ -19,12 +19,6 @@ class SomeClass
$value = $tokens[$i][0][1][4];
}
}
$other = array_reverse($tokens);
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
$value = $tokens[$i][0][1][4];
return $other[$i];
}
}
}
@ -51,12 +45,6 @@ class SomeClass
$value = $token[0][1][4];
}
}
$other = array_reverse($tokens);
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
$value = $tokens[$i][0][1][4];
return $other[$i];
}
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace Rector\CodeQuality\Tests\Rector\For_\ForToForeachRector\Fixture;
class SomeClass
{
public function run($tokens)
{
$other = array_reverse($tokens);
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
$value = $tokens[$i][0][1][4];
return $other[$i];
}
}
}
?>
-----
<?php
namespace Rector\CodeQuality\Tests\Rector\For_\ForToForeachRector\Fixture;
class SomeClass
{
public function run($tokens)
{
$other = array_reverse($tokens);
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
$value = $tokens[$i][0][1][4];
return $other[$i];
}
}
}
?>