Lndj\Lcrawl::getAll PHP Method

getAll() public method

By Concurrent requests, to get all the data.
public getAll ( ) : Array
return Array
    public function getAll()
    {
        $requests = ['schedule' => $this->buildGetRequest(self::ZF_SCHEDULE_URI, [], $this->headers, true), 'cet' => $this->buildGetRequest(self::ZF_CET_URI, [], $this->headers, true), 'exam' => $this->buildGetRequest(self::ZF_EXAM_URI, [], $this->headers, true)];
        // Wait on all of the requests to complete. Throws a ConnectException
        // if any of the requests fail
        $results = Promise\unwrap($requests);
        // Wait for the requests to complete, even if some of them fail
        // $results = Promise\settle($requests)->wait();
        //Parser the data we need.
        $schedule = $this->parserSchedule($results['schedule']->getBody());
        $cet = $this->parserCommonTable($results['cet']->getBody());
        $exam = $this->parserCommonTable($results['exam']->getBody());
        return compact('schedule', 'cet', 'exam');
    }