src/PhpToZephir/Converter/Printer/Stmt/SwitchPrinter.php
public function convert(Stmt\Switch_ $node)
    {
        $transformToIf = false;
        foreach ($node->cases as $case) {
            if (($case->cond instanceof Scalar\String_) === false && $case->cond !== null) {
                $transformToIf = true;
            }
        }

        if ($transformToIf === true) {
            return $this->convertSwitchToIfelse($node);
        } else {
            return 'switch ('.$this->dispatcher->p($node->cond).') {'
             .$this->dispatcher->pStmts($node->cases)."\n".'}';
        }
    }
public function convert(Stmt\Switch_ $node)
    {
        $transformToIf = false;
        foreach ($node->cases as $case) {
            if (($case->cond instanceof Scalar\String_) === false && $case->cond !== null) {
                $transformToIf = true;
            }
        }

        if ($transformToIf === true) {
            return $this->convertSwitchToIfelse($node);
        } else {
            return 'switch ('.$this->dispatcher->p($node->cond).') {'
             .$this->dispatcher->pStmts($node->cases)."\n".'}';
        }
    }
public function convert ( Stmt \ Switch_ $ node ) { $ transformToIf = false ; foreach ( $ node -> cases as $ case ) { if ( ( $ case -> cond instanceof Scalar \ String_ ) === false && $ case -> cond !== null ) { $ transformToIf = true ; } } if ( $ transformToIf === true ) { return $ this -> convertSwitchToIfelse ( $ node ) ; } else { return 'switch (' . $ this -> dispatcher -> p ( $ node -> cond ) . ') {' . $ this -> dispatcher -> pStmts ( $ node -> cases ) . "\n" . '}' ; } }
@param Stmt\Switch_ $node

@return string
@param Stmt \ Switch_ $node