src/Common/Console/Command/Database/Migrate.php
private function mapDir($sDir): ?array
    {
        if (is_dir($sDir)) {

            $aOut = [];

            foreach (new \DirectoryIterator($sDir) as $oFileInfo) {

                if ($oFileInfo->isDot()) {
                    continue;
                }

                //  In the correct format?
                if (preg_match(static::VALID_MIGRATION_PATTERN, $oFileInfo->getFilename(), $aMatches)) {
                    $aOut[$aMatches[1]] = [
                        'path'  => $oFileInfo->getPathname(),
                        'index' => (int) $aMatches[1],
                    ];
                }
            }

            ksort($aOut);
            return $aOut;

        } else {
            return null;
        }
    }
private function mapDir($sDir): ?array
    {
        if (is_dir($sDir)) {

            $aOut = [];

            foreach (new \DirectoryIterator($sDir) as $oFileInfo) {

                if ($oFileInfo->isDot()) {
                    continue;
                }

                //  In the correct format?
                if (preg_match(static::VALID_MIGRATION_PATTERN, $oFileInfo->getFilename(), $aMatches)) {
                    $aOut[$aMatches[1]] = [
                        'path'  => $oFileInfo->getPathname(),
                        'index' => (int) $aMatches[1],
                    ];
                }
            }

            ksort($aOut);
            return $aOut;

        } else {
            return null;
        }
    }
private function mapDir ( $ sDir ) : ? array { if ( is_dir ( $ sDir ) ) { $ aOut = [ ] ; foreach ( new \ DirectoryIterator ( $ sDir ) as $ oFileInfo ) { if ( $ oFileInfo -> isDot ( ) ) { continue ; } //  In the correct format? if ( preg_match ( static :: VALID_MIGRATION_PATTERN , $ oFileInfo -> getFilename ( ) , $ aMatches ) ) { $ aOut [ $ aMatches [ 1 ] ] = [ 'path' => $ oFileInfo -> getPathname ( ) , 'index' => ( int ) $ aMatches [ 1 ] , ] ; } } ksort ( $ aOut ) ; return $ aOut ; } else { return null ; } }
Generates an array of files in a directory

@param  string $sDir The directory to analyse

@return array|null
Generates an array of files in a directory