src/Vatsimphp/Sync/AbstractSync.php
public function loadData()
    {
        $this->filePath = "{$this->cacheDir}/{$this->cacheFile}";
        $this->validateConfig();
        $urls = $this->prepareUrls($this->filePath, $this->urls, $this->forceRefresh, $this->cacheOnly);

        // we need at least one location
        if (!count($urls)) {
            throw new SyncException(
                'No location(s) available to sync from',
                $this->errors
            );
        }

        // cycle urls until valid data is found
        while (count($urls) && empty($validData)) {
            $nextUrl = array_shift($urls);
            if ($this->getData($nextUrl)) {
                $validData = true;
            }
        }

        // we should have valid data at this point
        if (!$this->parser->isValid() || empty($validData)) {
            throw new SyncException(
                'Unable to download data or data invalid',
                $this->errors
            );
        }

        return $this->parser->getParsedData();
    }
public function loadData()
    {
        $this->filePath = "{$this->cacheDir}/{$this->cacheFile}";
        $this->validateConfig();
        $urls = $this->prepareUrls($this->filePath, $this->urls, $this->forceRefresh, $this->cacheOnly);

        // we need at least one location
        if (!count($urls)) {
            throw new SyncException(
                'No location(s) available to sync from',
                $this->errors
            );
        }

        // cycle urls until valid data is found
        while (count($urls) && empty($validData)) {
            $nextUrl = array_shift($urls);
            if ($this->getData($nextUrl)) {
                $validData = true;
            }
        }

        // we should have valid data at this point
        if (!$this->parser->isValid() || empty($validData)) {
            throw new SyncException(
                'Unable to download data or data invalid',
                $this->errors
            );
        }

        return $this->parser->getParsedData();
    }
public function loadData ( ) { $ this -> filePath = "{$this->cacheDir}/{$this->cacheFile}" ; $ this -> validateConfig ( ) ; $ urls = $ this -> prepareUrls ( $ this -> filePath , $ this -> urls , $ this -> forceRefresh , $ this -> cacheOnly ) ; // we need at least one location if ( ! count ( $ urls ) ) { throw new SyncException ( 'No location(s) available to sync from' , $ this -> errors ) ; } // cycle urls until valid data is found while ( count ( $ urls ) && empty ( $ validData ) ) { $ nextUrl = array_shift ( $ urls ) ; if ( $ this -> getData ( $ nextUrl ) ) { $ validData = true ; } } // we should have valid data at this point if ( ! $ this -> parser -> isValid ( ) || empty ( $ validData ) ) { throw new SyncException ( 'Unable to download data or data invalid' , $ this -> errors ) ; } return $ this -> parser -> getParsedData ( ) ; }
Return parsed data.

@throws SyncException

@return \Vatsimphp\Result\ResultContainer
Return parsed data .