public function getStatuses()
    {
        $files = $this->getSqlFiles();
        $appliedFiles = $this->getAppliedFiles();

        /**
         * is file applied or not
         * @param $file
         * @return bool if applied, return true.
         */
        $isApplied = function($file) use ($appliedFiles){
            foreach ($appliedFiles as $appliedFile) {
                if ($appliedFile->getFileName() === $file->getFileName()){
                    return true;
                }
            }
            return false;
        };

        $statuses = [];

        foreach($files as $file){
            $appliedAt = $isApplied($file)? date('Y-m-d H:i:s', $file->getMTime()): "";
            $statuses[] = new Status($appliedAt, $file);
        }

        return $statuses;
    }
public function getStatuses()
    {
        $files = $this->getSqlFiles();
        $appliedFiles = $this->getAppliedFiles();

        /**
         * is file applied or not
         * @param $file
         * @return bool if applied, return true.
         */
        $isApplied = function($file) use ($appliedFiles){
            foreach ($appliedFiles as $appliedFile) {
                if ($appliedFile->getFileName() === $file->getFileName()){
                    return true;
                }
            }
            return false;
        };

        $statuses = [];

        foreach($files as $file){
            $appliedAt = $isApplied($file)? date('Y-m-d H:i:s', $file->getMTime()): "";
            $statuses[] = new Status($appliedAt, $file);
        }

        return $statuses;
    }
public function getStatuses ( ) { $ files = $ this -> getSqlFiles ( ) ; $ appliedFiles = $ this -> getAppliedFiles ( ) ; /**
         * is file applied or not
         * @param $file
         * @return bool if applied, return true.
         */ $ isApplied = function ( $ file ) use ( $ appliedFiles ) { foreach ( $ appliedFiles as $ appliedFile ) { if ( $ appliedFile -> getFileName ( ) === $ file -> getFileName ( ) ) { return true ; } } return false ; } ; $ statuses = [ ] ; foreach ( $ files as $ file ) { $ appliedAt = $ isApplied ( $ file ) ? date ( 'Y-m-d H:i:s' , $ file -> getMTime ( ) ) : "" ; $ statuses [ ] = new Status ( $ appliedAt , $ file ) ; } return $ statuses ; }
get migration status
@return array Statuses with applied datetime and file name
get migration status