protected function getMigrationFiles()
    {
        $directoryIterator = new \DirectoryIterator($this->directory);
        $migrationFiles = [];
        foreach ($directoryIterator as $fileInfo) {
            /** @var \SplFileInfo $fileInfo */
            if ($fileInfo->isFile()) {
                if (preg_match($this->filePattern, $fileInfo->getRealPath())) {
                    $migrationFiles[] = $fileInfo->getRealPath();
                } else {
                    $context = [
                        'path' => $fileInfo->getRealPath(),
                    ];

                    $this->getLogger()->notice(
                        self::MESSAGE__FOUND_UNSUPPORTED_FILE__PATH,
                        $context
                    );
                }
            }
        }
        sort($migrationFiles);

        if (empty($migrationFiles)) {
            $context = [
                'path' => $this->directory,
                'pattern' => $this->filePattern,
            ];

            $this->getLogger()->warning(
                self::MESSAGE__THERE_IS_NOTHING_MATCHING_PATTERN__PATH_PATTERN,
                $context
            );
        }

        $this->getLogger()->info(
            self::MESSAGE__FOUND_MIGRATION_FILES__COUNT_PATH_PATTERN,
            [
                'count' => count($migrationFiles),
                'path' => $this->directory,
                'pattern' => $this->filePattern,
            ]
        );

        return $migrationFiles;
    }
protected function getMigrationFiles()
    {
        $directoryIterator = new \DirectoryIterator($this->directory);
        $migrationFiles = [];
        foreach ($directoryIterator as $fileInfo) {
            /** @var \SplFileInfo $fileInfo */
            if ($fileInfo->isFile()) {
                if (preg_match($this->filePattern, $fileInfo->getRealPath())) {
                    $migrationFiles[] = $fileInfo->getRealPath();
                } else {
                    $context = [
                        'path' => $fileInfo->getRealPath(),
                    ];

                    $this->getLogger()->notice(
                        self::MESSAGE__FOUND_UNSUPPORTED_FILE__PATH,
                        $context
                    );
                }
            }
        }
        sort($migrationFiles);

        if (empty($migrationFiles)) {
            $context = [
                'path' => $this->directory,
                'pattern' => $this->filePattern,
            ];

            $this->getLogger()->warning(
                self::MESSAGE__THERE_IS_NOTHING_MATCHING_PATTERN__PATH_PATTERN,
                $context
            );
        }

        $this->getLogger()->info(
            self::MESSAGE__FOUND_MIGRATION_FILES__COUNT_PATH_PATTERN,
            [
                'count' => count($migrationFiles),
                'path' => $this->directory,
                'pattern' => $this->filePattern,
            ]
        );

        return $migrationFiles;
    }
protected function getMigrationFiles ( ) { $ directoryIterator = new \ DirectoryIterator ( $ this -> directory ) ; $ migrationFiles = [ ] ; foreach ( $ directoryIterator as $ fileInfo ) { /** @var \SplFileInfo $fileInfo */ if ( $ fileInfo -> isFile ( ) ) { if ( preg_match ( $ this -> filePattern , $ fileInfo -> getRealPath ( ) ) ) { $ migrationFiles [ ] = $ fileInfo -> getRealPath ( ) ; } else { $ context = [ 'path' => $ fileInfo -> getRealPath ( ) , ] ; $ this -> getLogger ( ) -> notice ( self :: MESSAGE__FOUND_UNSUPPORTED_FILE__PATH , $ context ) ; } } } sort ( $ migrationFiles ) ; if ( empty ( $ migrationFiles ) ) { $ context = [ 'path' => $ this -> directory , 'pattern' => $ this -> filePattern , ] ; $ this -> getLogger ( ) -> warning ( self :: MESSAGE__THERE_IS_NOTHING_MATCHING_PATTERN__PATH_PATTERN , $ context ) ; } $ this -> getLogger ( ) -> info ( self :: MESSAGE__FOUND_MIGRATION_FILES__COUNT_PATH_PATTERN , [ 'count' => count ( $ migrationFiles ) , 'path' => $ this -> directory , 'pattern' => $ this -> filePattern , ] ) ; return $ migrationFiles ; }
Returns list of paths to migration files

@return string[]
Returns list of paths to migration files