From 6af9e8a2e27997476c5ce39219f8d7301df6908f Mon Sep 17 00:00:00 2001 From: Anton Vasiliev <1695147@gmail.com> Date: Thu, 31 Aug 2023 11:07:22 +0100 Subject: [PATCH] #2407 - Remove dead code --- Library/Statements/ForStatement.php | 10 ++++------ tests/fixtures/exit.php | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Library/Statements/ForStatement.php b/Library/Statements/ForStatement.php index ecd1ab2bf2..e2639a38eb 100644 --- a/Library/Statements/ForStatement.php +++ b/Library/Statements/ForStatement.php @@ -388,6 +388,8 @@ public function compileRange(array $exprRaw, CompilationContext $compilationCont $codePrinter->output('}'); $codePrinter->decreaseLevel(); $codePrinter->output('}'); + + return true; } /** @@ -396,11 +398,11 @@ public function compileRange(array $exprRaw, CompilationContext $compilationCont * @param array $exprRaw * @param CompilationContext $compilationContext * - * @return bool + * @return void * @throws Exception * @throws ReflectionException */ - public function compileIterator(array $exprRaw, CompilationContext $compilationContext): bool + public function compileIterator(array $exprRaw, CompilationContext $compilationContext): void { $iteratorVariable = $compilationContext->symbolTable->getTempVariableForWrite('zend_object_iterator', $compilationContext); $compilationContext->headersManager->add('kernel/iterator'); @@ -418,10 +420,6 @@ public function compileIterator(array $exprRaw, CompilationContext $compilationC } $exprVariable = $compilationContext->symbolTable->getVariableForRead($expression->getCode(), $compilationContext, $this->statement['expr']); - switch ($exprVariable->getType()) { - case 'variable': - break; - } /** * Initialize 'key' variable diff --git a/tests/fixtures/exit.php b/tests/fixtures/exit.php index 22bec8f9e5..58fd7d9493 100644 --- a/tests/fixtures/exit.php +++ b/tests/fixtures/exit.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + use Stub\ExitDie; if (!extension_loaded('stub')) {