コード例 #1
0
ファイル: ApiCallLogger.php プロジェクト: assimtech/dislog
 /**
  * @param ApiCallInterface $apiCall
  * @return void
  */
 protected function handleApiCall(ApiCallInterface $apiCall)
 {
     try {
         $this->handler->handle($apiCall);
     } catch (Exception $exception) {
         // Log handler failures to a Psr-3 Logger if we have one
         $this->logHandlerException($exception, $apiCall);
         if (!$this->options['suppressHandlerExceptions']) {
             throw $exception;
         }
     }
 }
コード例 #2
0
 function it_wont_process_null_response(ApiCallInterface $apiCall, HandlerInterface $handler, ProcessorInterface $processor)
 {
     $response = null;
     $requestTime = 1.2;
     $apiCall->getRequestTime()->willReturn($requestTime);
     $apiCall->setResponse($response)->willReturn($apiCall);
     $apiCall->setDuration(Argument::type('float'))->willReturn($apiCall);
     $handler->handle($apiCall)->shouldBeCalled();
     $processor->__invoke($response)->shouldNotBeCalled();
     $this->logResponse($apiCall, $response, $processor);
 }