src/Extractor.php
/**
     * Extracts migration data structures.
     * @param string $migration
     * @param array<string> $migrationPaths
     * @throws ErrorException
     */
Extracts migration data structures.
@param string $migration
@param array $migrationPaths
@throws ErrorException
Extracts migration data structures . @param string $migration @param array $migrationPaths @throws ErrorException
public function extract(string $migration, array $migrationPaths): void
    {
        $this->setDummyMigrationClass();
        if (strpos($migration, '\\') === false) { 
            $fileFound = false;
            $file = null;
            foreach ($migrationPaths as $path) {
                $file = Yii::getAlias($path . DIRECTORY_SEPARATOR . $migration . '.php');
                if (file_exists($file)) {
                    $fileFound = true;
                    break;
                }
            }
            if (!$fileFound) {
                throw new ErrorException("File '{$migration}.php' can not be found! Check migration history table.");
            }
            require_once $file;
        }
        $this->subject = new $migration(['db' => $this->db, 'experimental' => $this->experimental]);
        if ($this->subject instanceof MigrationChangesInterface === false) {
            throw new ErrorException(
                "Class '{$migration}' must implement bizley\migration\dummy\MigrationChangesInterface."
            );
        }
        $this->subject->up();
    }
public function extract ( string $ migration , array $ migrationPaths ) : void { $ this -> setDummyMigrationClass ( ) ; if ( strpos ( $ migration , '\\' ) === false ) { $ fileFound = false ; $ file = null ; foreach ( $ migrationPaths as $ path ) { $ file = Yii :: getAlias ( $ path . DIRECTORY_SEPARATOR . $ migration . '.php' ) ; if ( file_exists ( $ file ) ) { $ fileFound = true ; break ; } } if ( ! $ fileFound ) { throw new ErrorException ( " File ' { $ migration } .php' can not be found! Check migration history table. " ) ; } require_once $ file ; } $ this -> subject = new $ migration ( [ 'db' => $ this -> db , 'experimental' => $ this -> experimental ] ) ; if ( $ this -> subject instanceof MigrationChangesInterface === false ) { throw new ErrorException ( " Class ' { $ migration } ' must implement bizley\migration\dummy\MigrationChangesInterface. " ) ; } $ this -> subject -> up ( ) ; }
Extracts migration data structures.
Extracts migration data structures .
// not namespaced /** @var string $file */