src/Repository/Filesystem/Grouped.php
private function buildFromSubDirectory(\FilesystemIterator $directory)
    {
        /* @var $fileInfo \SplFileInfo */
        foreach ($directory as $fileInfo) {
            if ($fileInfo->isDir()) {
                $subDirectory = new \FilesystemIterator($fileInfo->getRealPath());
                $this->buildFromSubDirectory($subDirectory);
            } elseif ($fileInfo->isFile() && $fileInfo->getExtension() === $this->extension) {
                $migration = UnitOfWorkFactory::buildFromSplFileInfo($fileInfo);
                $this->add($migration);
            }
        }
    }
private function buildFromSubDirectory(\FilesystemIterator $directory)
    {
        /* @var $fileInfo \SplFileInfo */
        foreach ($directory as $fileInfo) {
            if ($fileInfo->isDir()) {
                $subDirectory = new \FilesystemIterator($fileInfo->getRealPath());
                $this->buildFromSubDirectory($subDirectory);
            } elseif ($fileInfo->isFile() && $fileInfo->getExtension() === $this->extension) {
                $migration = UnitOfWorkFactory::buildFromSplFileInfo($fileInfo);
                $this->add($migration);
            }
        }
    }
private function buildFromSubDirectory ( \ FilesystemIterator $ directory ) { /* @var $fileInfo \SplFileInfo */ foreach ( $ directory as $ fileInfo ) { if ( $ fileInfo -> isDir ( ) ) { $ subDirectory = new \ FilesystemIterator ( $ fileInfo -> getRealPath ( ) ) ; $ this -> buildFromSubDirectory ( $ subDirectory ) ; } elseif ( $ fileInfo -> isFile ( ) && $ fileInfo -> getExtension ( ) === $ this -> extension ) { $ migration = UnitOfWorkFactory :: buildFromSplFileInfo ( $ fileInfo ) ; $ this -> add ( $ migration ) ; } } }
Recursive build of the migrations

Recursion ends when files are located in the given filesystem iterator.
Otherwise the recursion steps into the directory.

@param \FilesystemIterator $directory The directory to build from

@throws \Bytepark\Component\Migration\Exception\UnitIsAlreadyPresentException
@throws \InvalidArgumentException
Recursive build of the migrations