protected function extract(string $migration): array
    {
        if (strpos($migration, '\\') === false) {
            $file = Yii::getAlias($this->migrationPath . DIRECTORY_SEPARATOR . $migration . '.php');

            if (!file_exists($file)) {
                throw new ErrorException("File '{$file}' can not be found! Check migration history table.");
            }

            require_once $file;
        }

        $subject = new $migration;
        $subject->db = $this->db;
        $subject->up();

        return $subject->changes;
    }
protected function extract(string $migration): array
    {
        if (strpos($migration, '\\') === false) {
            $file = Yii::getAlias($this->migrationPath . DIRECTORY_SEPARATOR . $migration . '.php');

            if (!file_exists($file)) {
                throw new ErrorException("File '{$file}' can not be found! Check migration history table.");
            }

            require_once $file;
        }

        $subject = new $migration;
        $subject->db = $this->db;
        $subject->up();

        return $subject->changes;
    }
protected function extract ( string $ migration ) : array { if ( strpos ( $ migration , '\\' ) === false ) { $ file = Yii :: getAlias ( $ this -> migrationPath . DIRECTORY_SEPARATOR . $ migration . '.php' ) ; if ( ! file_exists ( $ file ) ) { throw new ErrorException ( "File '{$file}' can not be found! Check migration history table." ) ; } require_once $ file ; } $ subject = new $ migration ; $ subject -> db = $ this -> db ; $ subject -> up ( ) ; return $ subject -> changes ; }
Extracts migration data structures.
@param string $migration
@return array
@throws InvalidArgumentException
@throws ErrorException
Extracts migration data structures .