src/PhpToZephir/Converter/Printer/Stmt/IfPrinter.php
private function implodeElseIfs(Stmt\If_ $node)
    {
        $elseCount = 0;
        $toReturn = '';
        foreach ($node->elseifs as $elseIf) {
            $collected = $this->assignManipulator->collectAssignInCondition($elseIf->cond);
            if ($collected->hasCollected()) {
                ++$elseCount;
                $toReturn .= ' else {'."\n".$this->dispatcher->p(new Stmt\If_($elseIf->cond, array('stmts' => $elseIf->stmts)))."\n";
            } else {
                $toReturn .= $this->dispatcher->pStmt_ElseIf($elseIf);
            }
        }
        $toReturn .= (null !== $node->else ? $this->dispatcher->p($node->else) : '');

        return $toReturn.str_repeat('}', $elseCount);
    }
private function implodeElseIfs(Stmt\If_ $node)
    {
        $elseCount = 0;
        $toReturn = '';
        foreach ($node->elseifs as $elseIf) {
            $collected = $this->assignManipulator->collectAssignInCondition($elseIf->cond);
            if ($collected->hasCollected()) {
                ++$elseCount;
                $toReturn .= ' else {'."\n".$this->dispatcher->p(new Stmt\If_($elseIf->cond, array('stmts' => $elseIf->stmts)))."\n";
            } else {
                $toReturn .= $this->dispatcher->pStmt_ElseIf($elseIf);
            }
        }
        $toReturn .= (null !== $node->else ? $this->dispatcher->p($node->else) : '');

        return $toReturn.str_repeat('}', $elseCount);
    }
private function implodeElseIfs ( Stmt \ If_ $ node ) { $ elseCount = 0 ; $ toReturn = '' ; foreach ( $ node -> elseifs as $ elseIf ) { $ collected = $ this -> assignManipulator -> collectAssignInCondition ( $ elseIf -> cond ) ; if ( $ collected -> hasCollected ( ) ) { ++ $ elseCount ; $ toReturn .= ' else {' . "\n" . $ this -> dispatcher -> p ( new Stmt \ If_ ( $ elseIf -> cond , array ( 'stmts' => $ elseIf -> stmts ) ) ) . "\n" ; } else { $ toReturn .= $ this -> dispatcher -> pStmt_ElseIf ( $ elseIf ) ; } } $ toReturn .= ( null !== $ node -> else ? $ this -> dispatcher -> p ( $ node -> else ) : '' ) ; return $ toReturn . str_repeat ( '}' , $ elseCount ) ; }
@param Stmt\If_ $node

@return string
@param Stmt \ If_ $node