public function parseMigrationDefinition(MigrationDefinition $migrationDefinition)
    {
        foreach ($this->DefinitionParsers as $definitionParser) {
            if ($definitionParser->supports($migrationDefinition->name)) {
                // parse the source file
                $migrationDefinition = $definitionParser->parseMigrationDefinition($migrationDefinition);

                // and make sure we know how to handle all steps
                foreach ($migrationDefinition->steps as $step) {
                    if (!isset($this->executors[$step->type])) {
                        return new MigrationDefinition(
                            $migrationDefinition->name,
                            $migrationDefinition->path,
                            $migrationDefinition->rawDefinition,
                            MigrationDefinition::STATUS_INVALID,
                            array(),
                            "Can not handle migration step of type '{$step->type}'"
                        );
                    }
                }

                return $migrationDefinition;
            }
        }

        throw new \Exception("No parser available to parse migration definition '{$migrationDefinition->name}'");
    }
public function parseMigrationDefinition(MigrationDefinition $migrationDefinition)
    {
        foreach ($this->DefinitionParsers as $definitionParser) {
            if ($definitionParser->supports($migrationDefinition->name)) {
                // parse the source file
                $migrationDefinition = $definitionParser->parseMigrationDefinition($migrationDefinition);

                // and make sure we know how to handle all steps
                foreach ($migrationDefinition->steps as $step) {
                    if (!isset($this->executors[$step->type])) {
                        return new MigrationDefinition(
                            $migrationDefinition->name,
                            $migrationDefinition->path,
                            $migrationDefinition->rawDefinition,
                            MigrationDefinition::STATUS_INVALID,
                            array(),
                            "Can not handle migration step of type '{$step->type}'"
                        );
                    }
                }

                return $migrationDefinition;
            }
        }

        throw new \Exception("No parser available to parse migration definition '{$migrationDefinition->name}'");
    }
public function parseMigrationDefinition ( MigrationDefinition $ migrationDefinition ) { foreach ( $ this -> DefinitionParsers as $ definitionParser ) { if ( $ definitionParser -> supports ( $ migrationDefinition -> name ) ) { // parse the source file $ migrationDefinition = $ definitionParser -> parseMigrationDefinition ( $ migrationDefinition ) ; // and make sure we know how to handle all steps foreach ( $ migrationDefinition -> steps as $ step ) { if ( ! isset ( $ this -> executors [ $ step -> type ] ) ) { return new MigrationDefinition ( $ migrationDefinition -> name , $ migrationDefinition -> path , $ migrationDefinition -> rawDefinition , MigrationDefinition :: STATUS_INVALID , array ( ) , "Can not handle migration step of type '{$step->type}'" ) ; } } return $ migrationDefinition ; } } throw new \ Exception ( "No parser available to parse migration definition '{$migrationDefinition->name}'" ) ; }
Parses a migration definition, return a parsed definition.
If there is a parsing error, the definition status will be updated accordingly

@param MigrationDefinition $migrationDefinition
@return MigrationDefinition
@throws \Exception if the migrationDefinition has no suitable parser for its source format
Parses a migration definition return a parsed definition . If there is a parsing error the definition status will be updated accordingly