public function getOrganizedStatements()
    {
        $organized_statements = array();
        if (empty($this->_statements)) {
            //           $this->load();
           try {
               $this->load();
           } catch (\Exception $e) {
               throw $e;
           }
        }
        $statements = $this->_statements;

        if (!empty($statements['require'])) {
            foreach ($statements['require'] as $statement) {
                $data = $statement->getData();
                foreach ($statement->getData() as $type=>$stack) {
                    if (!isset($statements[$type])) {
                        $statements[$type] = array();
                    }
                    $statements[$type] = array_merge($statements[$type], $stack);
                }
            }
            unset($statements['require']);
        }
        
        foreach ($statements as $type=>$statement_stack) {
            if (!isset($organized_statements[$type])) {
                $organized_statements[$type] = array();
            }
            foreach ($statement_stack as $statement) {
                $organized_statements[$type][] = $statement;
            }
        }

        foreach ($organized_statements as $type=>$stacks) {
            $organized_statements[$type] = $this->getOrderedStatements($stacks);
        }

        return $organized_statements;
    }
public function getOrganizedStatements()
    {
        $organized_statements = array();
        if (empty($this->_statements)) {
            //           $this->load();
           try {
               $this->load();
           } catch (\Exception $e) {
               throw $e;
           }
        }
        $statements = $this->_statements;

        if (!empty($statements['require'])) {
            foreach ($statements['require'] as $statement) {
                $data = $statement->getData();
                foreach ($statement->getData() as $type=>$stack) {
                    if (!isset($statements[$type])) {
                        $statements[$type] = array();
                    }
                    $statements[$type] = array_merge($statements[$type], $stack);
                }
            }
            unset($statements['require']);
        }
        
        foreach ($statements as $type=>$statement_stack) {
            if (!isset($organized_statements[$type])) {
                $organized_statements[$type] = array();
            }
            foreach ($statement_stack as $statement) {
                $organized_statements[$type][] = $statement;
            }
        }

        foreach ($organized_statements as $type=>$stacks) {
            $organized_statements[$type] = $this->getOrderedStatements($stacks);
        }

        return $organized_statements;
    }
public function getOrganizedStatements ( ) { $ organized_statements = array ( ) ; if ( empty ( $ this -> _statements ) ) { //           $this->load(); try { $ this -> load ( ) ; } catch ( \ Exception $ e ) { throw $ e ; } } $ statements = $ this -> _statements ; if ( ! empty ( $ statements [ 'require' ] ) ) { foreach ( $ statements [ 'require' ] as $ statement ) { $ data = $ statement -> getData ( ) ; foreach ( $ statement -> getData ( ) as $ type => $ stack ) { if ( ! isset ( $ statements [ $ type ] ) ) { $ statements [ $ type ] = array ( ) ; } $ statements [ $ type ] = array_merge ( $ statements [ $ type ] , $ stack ) ; } } unset ( $ statements [ 'require' ] ) ; } foreach ( $ statements as $ type => $ statement_stack ) { if ( ! isset ( $ organized_statements [ $ type ] ) ) { $ organized_statements [ $ type ] = array ( ) ; } foreach ( $ statement_stack as $ statement ) { $ organized_statements [ $ type ] [ ] = $ statement ; } } foreach ( $ organized_statements as $ type => $ stacks ) { $ organized_statements [ $ type ] = $ this -> getOrderedStatements ( $ stacks ) ; } return $ organized_statements ; }
Organize each statements item by position & requirements

@return  array
@throws  \Exception : any caught exception during `self::load()`
@see     self::load()
Organize each statements item by position & requirements