public function findAll()
    {
        if ($this->fileManager->isDir(Installer::BASE_PATH . self::HISTORY_PATH) === false) {
            throw new EnvironnementResolverException(
                sprintf(
                    'Unable to locate "%d"',
                    Installer::BASE_PATH . self::HISTORY_PATH
                )
            );
        }

        $historyCollection = new HistoryCollection();
        $searchPath        = Installer::BASE_PATH . self::HISTORY_PATH . '*' . self::FILE_EXTENSION;

        foreach ($this->fileManager->glob($searchPath) as $file) {
            $content = $this->fileManager->fileGetContent($file);

            try {
                $historyCollection->append($this->historyHydrator->jsonToDTO($content));
            } catch (InvalidHistoryException $e) {
                continue;
            }
        }

        return $historyCollection;
    }
public function findAll()
    {
        if ($this->fileManager->isDir(Installer::BASE_PATH . self::HISTORY_PATH) === false) {
            throw new EnvironnementResolverException(
                sprintf(
                    'Unable to locate "%d"',
                    Installer::BASE_PATH . self::HISTORY_PATH
                )
            );
        }

        $historyCollection = new HistoryCollection();
        $searchPath        = Installer::BASE_PATH . self::HISTORY_PATH . '*' . self::FILE_EXTENSION;

        foreach ($this->fileManager->glob($searchPath) as $file) {
            $content = $this->fileManager->fileGetContent($file);

            try {
                $historyCollection->append($this->historyHydrator->jsonToDTO($content));
            } catch (InvalidHistoryException $e) {
                continue;
            }
        }

        return $historyCollection;
    }
public function findAll ( ) { if ( $ this -> fileManager -> isDir ( Installer :: BASE_PATH . self :: HISTORY_PATH ) === false ) { throw new EnvironnementResolverException ( sprintf ( 'Unable to locate "%d"' , Installer :: BASE_PATH . self :: HISTORY_PATH ) ) ; } $ historyCollection = new HistoryCollection ( ) ; $ searchPath = Installer :: BASE_PATH . self :: HISTORY_PATH . '*' . self :: FILE_EXTENSION ; foreach ( $ this -> fileManager -> glob ( $ searchPath ) as $ file ) { $ content = $ this -> fileManager -> fileGetContent ( $ file ) ; try { $ historyCollection -> append ( $ this -> historyHydrator -> jsonToDTO ( $ content ) ) ; } catch ( InvalidHistoryException $ e ) { continue ; } } return $ historyCollection ; }
Retrieve all history
@throws EnvironnementResolverException
@return HistoryCollection
Retrieve all history