src/PhpToZephir/Converter/Printer/Stmt/IfPrinter.php
public function convert(Stmt\If_ $node)
    {
        $collected = $this->assignManipulator->collectAssignInCondition($node->cond);
        $node->cond = $this->assignManipulator->transformAssignInConditionTest($node->cond);

        if (empty($node->stmts)) {
            $node->stmts = array(new Stmt\Echo_(array(new Scalar\String_('not allowed'))));
            $this->logger->logIncompatibility(
                'Empty if',
                'Empty if not allowed, add "echo not allowed"',
                $node,
                $this->dispatcher->getMetadata()->getFullQualifiedNameClass()
            );
        }

        return $collected->getCollected() .
               'if '.$this->dispatcher->p($node->cond).' {'
             .$this->dispatcher->pStmts($node->stmts)."\n".'}'
             .$this->implodeElseIfs($node);
    }
public function convert(Stmt\If_ $node)
    {
        $collected = $this->assignManipulator->collectAssignInCondition($node->cond);
        $node->cond = $this->assignManipulator->transformAssignInConditionTest($node->cond);

        if (empty($node->stmts)) {
            $node->stmts = array(new Stmt\Echo_(array(new Scalar\String_('not allowed'))));
            $this->logger->logIncompatibility(
                'Empty if',
                'Empty if not allowed, add "echo not allowed"',
                $node,
                $this->dispatcher->getMetadata()->getFullQualifiedNameClass()
            );
        }

        return $collected->getCollected() .
               'if '.$this->dispatcher->p($node->cond).' {'
             .$this->dispatcher->pStmts($node->stmts)."\n".'}'
             .$this->implodeElseIfs($node);
    }
public function convert ( Stmt \ If_ $ node ) { $ collected = $ this -> assignManipulator -> collectAssignInCondition ( $ node -> cond ) ; $ node -> cond = $ this -> assignManipulator -> transformAssignInConditionTest ( $ node -> cond ) ; if ( empty ( $ node -> stmts ) ) { $ node -> stmts = array ( new Stmt \ Echo_ ( array ( new Scalar \ String_ ( 'not allowed' ) ) ) ) ; $ this -> logger -> logIncompatibility ( 'Empty if' , 'Empty if not allowed, add "echo not allowed"' , $ node , $ this -> dispatcher -> getMetadata ( ) -> getFullQualifiedNameClass ( ) ) ; } return $ collected -> getCollected ( ) . 'if ' . $ this -> dispatcher -> p ( $ node -> cond ) . ' {' . $ this -> dispatcher -> pStmts ( $ node -> stmts ) . "\n" . '}' . $ this -> implodeElseIfs ( $ node ) ; }
@param Stmt\If_ $node

@return string
@param Stmt \ If_ $node