Moving test into a separate file

This commit is contained in:
John Linhart 2020-02-16 19:47:26 +01:00
parent facca2a50b
commit 54302369f1
2 changed files with 45 additions and 28 deletions

View File

@ -27,19 +27,6 @@ class ForContinue
}
}
}
public function run3($list, $flag)
{
function ($list) use ($flag) {
foreach ($list as $key => $val) {
if ($flag && empty($key)) {
continue;
} elseif (empty($val)) {
$val = $key;
}
}
};
}
}
?>
@ -71,21 +58,6 @@ class ForContinue
echo '111';
}
}
public function run3($list, $flag)
{
function ($list) use ($flag) {
foreach ($list as $key => $val) {
if ($flag && empty($key)) {
continue;
}
if (empty($val)) {
$val = $key;
}
}
};
}
}
?>

View File

@ -0,0 +1,45 @@
<?php
namespace Rector\SOLID\Tests\Rector\If_\RemoveAlwaysElse\Fixture;
class FunctionForeachContinue
{
public function run($list, $flag)
{
function ($list) use ($flag) {
foreach ($list as $key => $val) {
if ($flag && empty($key)) {
continue;
} elseif (empty($val)) {
$val = $key;
}
}
};
}
}
?>
-----
<?php
namespace Rector\SOLID\Tests\Rector\If_\RemoveAlwaysElse\Fixture;
class FunctionForeachContinue
{
public function run($list, $flag)
{
function ($list) use ($flag) {
foreach ($list as $key => $val) {
if ($flag && empty($key)) {
continue;
}
if (empty($val)) {
$val = $key;
}
}
};
}
}
?>