Find organize migrations modes for their names

@return string[]
164063
private function getOrganizeMigrationsModes() : array
    {
        $constPrefix = 'VERSIONS_ORGANIZATION_';
        $prefixLen   = strlen($constPrefix);
        $refClass    = new ReflectionClass('Doctrine\Migrations\Configuration\Configuration');
        $constsArray = $refClass->getConstants();
        $namesArray  = [];

        foreach ($constsArray as $key => $value) {
            if (strpos($key, $constPrefix) !== 0) {
                continue;
            }

            $namesArray[] = substr($key, $prefixLen);
        }

        return $namesArray;
    }
714015
public function getMigrationsNotApplied()
    {
        $migrationsNotApplied = [];
        $migrations = $this->getAllMigrations();

        foreach ($migrations as $migration) {
            if (!$migration->isApplied()) {
                $migrationsNotApplied[] = $migration;
            }
        }

        return $migrationsNotApplied;
    }
1200646
public function getMigrationsToRun()
    {
        $allMigrations = $this->getAllMigrations();

        $ranMigrations = $this->getRanMigrations();

        return array_diff($allMigrations, $ranMigrations);
    }
1191672
public function findRoutes(): array
    {
        /** @var array[] $routes */
        $routes = [];

        $modules = $this->packageRepository->findModules();
        foreach ($modules as $module) {
            $extra = $module->getExtra();
            $this->validateRoutesSectionInExtra($extra);
            if (empty($extra['phplist/core']['routes'])) {
                continue;
            }

            /** @var array $moduleRoutes */
            $moduleRoutes = $extra['phplist/core']['routes'];
            foreach ($moduleRoutes as $name => $route) {
                $prefixedRouteName = $module->getName() . '.' . $name;
                $routes[$prefixedRouteName] = $route;
            }
        }

        return $routes;
    }
1339728
protected function getChecked()
    {
        $return = [];

        $class = $this->compileEntity();
        $res = $class::getList([
            'select' => ['*'],
        ])->fetchAll();

        foreach ($res as $key => $value) {
            $return[$value['UF_MIGRATION_NAME']] = $value;
        }

        return $return;
    }
36552
public function getMigrations()
    {
        if (count($this->_migrations) <= 0 && $this->_config !== null) {
            $versions = [];
            $paths = $this->_config->getMigrationPaths();
            foreach ($paths as $path) {
                $files = glob($path . '/*.php');
                foreach ($files as $file) {
                    $fileName = basename($file);
                    if (Util::isValidMigrationFileName($fileName)) {
                        $version = Util::getVersionFromFileName($fileName);
                        if (Arr::key($version, $versions)) {
                            throw new \InvalidArgumentException(
                                __d(
                                    'extensions',
                                    'Duplicate migration - "%s" has the same version as "%s"',
                                    $file,
                                    $versions[$version]->getVersion()
                                )
                            );
                        }

                        //  Convert the filename to a class name.
                        $class = Util::mapFileNameToClassName($fileName);

                        /** @noinspection PhpIncludeInspection */
                        require_once $file;
                        if (!class_exists($class)) {
                            throw new \InvalidArgumentException(
                                __d('extensions', 'Could not find class "%s" in file "%s"', $class, $file)
                            );
                        }

                        //  Instantiate migration class.
                        $migration = new $class($version);
                        if (!($migration instanceof AbstractMigration)) {
                            throw new \InvalidArgumentException(
                                __d(
                                    'extensions',
                                    'The class "%s" in file "%s" must extend \Phinx\Migration\AbstractMigration',
                                    $class,
                                    $file
                                )
                            );
                        }

                        $versions[$version] = $migration;
                    }
                }
            }

            ksort($versions);
            $this->_migrations = $versions;
        }

        return $this->_migrations;
    }
1108307
protected function getMigrationPaths()
    {
        // If the package is in the list of migration paths we received we will put
        // the migrations in that path. Otherwise, we will assume the package is
        // is in the package directories and will place them in that location.
        if (! is_null($package = $this->option('package'))) {
            return $this->getPackageMigrationPaths($package);
        }

        return parent::getMigrationPaths();
    }
26914
public function getOptions()
    {
        return [
            ['force', 'f', InputOption::VALUE_NONE, 'Force override existing files'],
            ['domain', false, InputOption::VALUE_NONE, 'Install in a subdomain'],
            ['lucid', false, InputOption::VALUE_NONE, 'Lucid architecture'],
            ['model', null, InputOption::VALUE_NONE, 'Exclude model and migration'],
            ['views', null, InputOption::VALUE_NONE, 'Exclude views'],
            ['routes', null, InputOption::VALUE_NONE, 'Exclude routes'],
        ];
    }
400145
protected function getAllMigrations()
	{
		$migrations = array();
		$file_extensions = $this->getMigrationFileExtensions();

		// Use "DirectoryIterator" instead of "glob", because it works within PHAR files as well.
		$directory_iterator = new \DirectoryIterator($this->_migrationsDirectory);

		foreach ( $directory_iterator as $file ) {
			if ( $file->isFile() && in_array($file->getExtension(), $file_extensions) ) {
				$migrations[] = $file->getBasename();
			}
		}

		sort($migrations);

		return $migrations;
	}
954982
public function getMigrationsClasses()
    {
        $appFiles = $this->getMigrationsFiles();
        $classes = [];

        /* @var $component AppInterface */
        foreach ($appFiles as $appName => $migrationFiles) {
            $component = $this->orm->getComponent($appName);
            foreach ($migrationFiles as $migrationFile) {
                $className = ClassHelper::getClassFromFile($migrationFile);
                $foundClass = ClassHelper::classExists(
                    $className,
                    $component->getNamespace()
                );
                if (!$foundClass) {
                    throw new ClassNotFoundException(
                        sprintf(
                            'The class [ %2$s\\%1$s or \\%1$s ] '.
                            'could not be located',
                            $className,
                            $component->getNamespace()
                        )
                    );
                }
                $classes[$appName][] = $foundClass;
            }
        }

        return $classes;
    }
260266
public function getTravelModes()
    {
        $travelModes = [];
        for ($i = 0; $i <= 4; $i++) {
            $travelModes[$i] = LocalizationUtility::translate(
                'tx_gomapsext_domain_model_map.travel_mode.' . $i,
                'go_maps_ext'
            );
        }

        return $travelModes;
    }
660565
public function getRanMigrations()
    {
        $query = $this->resolveConnection($this->connection)->table($this->table);

        return $query->orderBy('batch', 'desc')->orderBy('migration', 'desc')->get();
    }
1248460
protected function getMissingEntities()
    {
        $modes = $this->getAllModes();
        $entrySubtypes = $this->getEntrySubtypes();
        
        $classes = array();
        foreach ($entrySubtypes as $service => $subtypes) {
            foreach ($modes as $mode) {
                foreach ($subtypes as $subtype) {
                    $classes[] = sprintf(
                        self::MODE_PATTERN,
                        $service,
                        $mode,
                        $service . $subtype . $mode
                    );
                }
            }
        }
        
        return $this->getMissingClasses($classes);
    }
1210496
protected function getSeedFiles()
    {
        $config = $this->getConfig();
        $paths = $config->getSeedPaths();
        $files = [];

        foreach ($paths as $path) {
            $files = array_merge(
                $files,
                Util::glob($path . DIRECTORY_SEPARATOR . '*.php')
            );
        }
        // glob() can return the same file multiple times
        // This will cause the migration to fail with a
        // false assumption of duplicate migrations
        // http://php.net/manual/en/function.glob.php#110340
        $files = array_unique($files);

        return $files;
    }
452266
public function getExportModes()
    {
        return array(
            'listHandle' =>         ExportableField::LIST_OF
                                    + ExportableField::HANDLE,
            'listValue' =>          ExportableField::LIST_OF
                                    + ExportableField::VALUE,
            'listHandleToValue' =>  ExportableField::LIST_OF
                                    + ExportableField::HANDLE
                                    + ExportableField::VALUE,
            'getPostdata' =>        ExportableField::POSTDATA
        );
    }
152302
private function getPathsOfAvailableModules()
    {
        $config = Registry::getConfig();
        $modulesRootPath = $config->getModulesDir();
        $modulePaths = $config->getConfigParam('aModulePaths');

        if (!is_dir($modulesRootPath))
            return [];

        if (!is_array($modulePaths))
            return [];

        $fullModulePaths = array_map(function ($modulePath) use ($modulesRootPath) {
            return $modulesRootPath . $modulePath;
        }, array_values($modulePaths));

        return array_filter($fullModulePaths, function ($fullModulePath) {
            return is_dir($fullModulePath);
        });
    }
953902
public static function get_all() {
		$packages = [];
		$packages[] = 'project';
		foreach (\Skeleton\Core\Skeleton::get_all() as $package) {
			$packages[] = $package->name;
		}
		$migrations = [];
		foreach ($packages as $package) {
			$migrations[$package] = \Skeleton\Database\Migration::get_between_versions($package);
		}

		return $migrations;
	}