From 59742cec100c73ca277eb02c86295fbdec8ca2f7 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 18 Sep 2021 22:59:05 +0100 Subject: [PATCH] #2276 - Remove deprecated method `isStringOperation()` --- Library/Expression.php | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/Library/Expression.php b/Library/Expression.php index b9fd3f0aa..3c80c9d1a 100644 --- a/Library/Expression.php +++ b/Library/Expression.php @@ -11,6 +11,7 @@ namespace Zephir; +use ReflectionException; use Zephir\Exception\CompilerException; use Zephir\Expression\Closure; use Zephir\Expression\ClosureArrow; @@ -200,19 +201,6 @@ public function setStringOperation($stringOperation) $this->stringOperation = $stringOperation; } - /** - * Checks if the result of the evaluated expression is intended to be used - * in a string operation like "concat". - * - * @deprecated - * - * @return bool - */ - public function isStringOperation() - { - return $this->stringOperation; - } - /** * Sets if the expression is being evaluated in an evaluation like the ones in 'if' and 'while' statements. * @@ -226,14 +214,14 @@ public function setEvalMode($evalMode) /** * Compiles foo = []. * - * @param array $expression + * @param array $expression * @param CompilationContext $compilationContext * * @return CompiledExpression */ - public function emptyArray($expression, CompilationContext $compilationContext) + public function emptyArray(array $expression, CompilationContext $compilationContext): CompiledExpression { - /* + /** * Resolves the symbol that expects the value */ if ($this->expecting) { @@ -254,7 +242,7 @@ public function emptyArray($expression, CompilationContext $compilationContext) throw new CompilerException('Cannot use variable: '.$symbolVariable->getName().'('.$symbolVariable->getType().') to create empty array', $expression); } - /* + /** * Mark the variable as an 'array' */ $symbolVariable->setDynamicTypes('array'); @@ -269,15 +257,14 @@ public function emptyArray($expression, CompilationContext $compilationContext) * * @param CompilationContext $compilationContext * - * @throws CompilerException|Exception - * * @return CompiledExpression + * @throws Exception + * @throws ReflectionException */ public function compile(CompilationContext $compilationContext): CompiledExpression { $expression = $this->expression; $type = $expression['type']; - $compilableExpression = null; switch ($type) { case 'null':