public static function getOrderedStatements(array $statements)
    {
        $ordered = array();
        foreach ($statements as $index=>$statement) {
            $data = $statement->getData();
            $ordered[$index] = isset($data['position']) ? $data['position'] : count($ordered)+1;
        }
        array_multisort($ordered, SORT_DESC, SORT_NUMERIC, $statements);
        return $statements;
    }
public static function getOrderedStatements(array $statements)
    {
        $ordered = array();
        foreach ($statements as $index=>$statement) {
            $data = $statement->getData();
            $ordered[$index] = isset($data['position']) ? $data['position'] : count($ordered)+1;
        }
        array_multisort($ordered, SORT_DESC, SORT_NUMERIC, $statements);
        return $statements;
    }
public static function getOrderedStatements ( array $ statements ) { $ ordered = array ( ) ; foreach ( $ statements as $ index => $ statement ) { $ data = $ statement -> getData ( ) ; $ ordered [ $ index ] = isset ( $ data [ 'position' ] ) ? $ data [ 'position' ] : count ( $ ordered ) + 1 ; } array_multisort ( $ ordered , SORT_DESC , SORT_NUMERIC , $ statements ) ; return $ statements ; }
Internal function to order a statements stack

@param array $statements
@return array
Internal function to order a statements stack