protected function statementsContainReturn(array $statements)
    {
        foreach ($statements as $statement) {
            if ($statement instanceof Stmt\Return_) {
                return true;
            }

            if (empty($statement->stmts)) {
                continue;
            }

            if ($this->statementsContainReturn($statement->stmts)) {
                return true;
            }
        }

        return false;
    }
protected function statementsContainReturn(array $statements)
    {
        foreach ($statements as $statement) {
            if ($statement instanceof Stmt\Return_) {
                return true;
            }

            if (empty($statement->stmts)) {
                continue;
            }

            if ($this->statementsContainReturn($statement->stmts)) {
                return true;
            }
        }

        return false;
    }
protected function statementsContainReturn ( array $ statements ) { foreach ( $ statements as $ statement ) { if ( $ statement instanceof Stmt \ Return_ ) { return true ; } if ( empty ( $ statement -> stmts ) ) { continue ; } if ( $ this -> statementsContainReturn ( $ statement -> stmts ) ) { return true ; } } return false ; }
Recursively search an array of statements for a return statement.
@param array $statements
@return bool
Recursively search an array of statements for a return statement .