示例#1
0
 public function execute()
 {
     $response = parent::execute();
     if ($response instanceof Response) {
         return $this->processCdnResponse($response->getArrayData());
     }
     return $response;
 }
示例#2
0
 public function execute()
 {
     $rawResponse = parent::execute();
     if ($rawResponse instanceof ErrorResponse) {
         throw new \ErrorException("There was an error processing this method: " . $rawResponse->getDescription());
     }
     $content = $rawResponse->getArrayData();
     $response = new TrafficStatsResponse();
     $response->setLast24Hours($content['24h']);
     $response->setLast48Hours($content['48h']);
     $response->setLast30days($content['30d']);
     $response->setLastMonth($content['01m']);
     $response->setLast30days($content['02m']);
     $response->setCurrentMonth($content['00m']);
     return $response;
 }