src/Manager.php
public function getAvailableRevisions($limit = null)
    {
        if ($limit !==null && !is_integer($limit)) {
            throw new \InvalidArgumentException('Limit must be integer');
        }

        $list = [];

        foreach (new \DirectoryIterator($this->getMigrationsDir()) as $file) {
            if (!$file->isFile()) {
                continue;
            }
            
            list($id, $className) = explode('_', $file->getBasename('.php'));
            
            $revision = new Revision();
            $revision
                ->setId($id)
                ->setName($className)
                ->setFilename($file->getFilename());
            
            $list[$id] = $revision;
            
            ksort($list);
        }

        if ($limit !== null) {
            $list = array_slice($list, -$limit);
        }

        return $list;
    }
public function getAvailableRevisions($limit = null)
    {
        if ($limit !==null && !is_integer($limit)) {
            throw new \InvalidArgumentException('Limit must be integer');
        }

        $list = [];

        foreach (new \DirectoryIterator($this->getMigrationsDir()) as $file) {
            if (!$file->isFile()) {
                continue;
            }
            
            list($id, $className) = explode('_', $file->getBasename('.php'));
            
            $revision = new Revision();
            $revision
                ->setId($id)
                ->setName($className)
                ->setFilename($file->getFilename());
            
            $list[$id] = $revision;
            
            ksort($list);
        }

        if ($limit !== null) {
            $list = array_slice($list, -$limit);
        }

        return $list;
    }
@param int|null $limit If specified, get only last revisions

@return Revision[]