예제 #1
0
 private function makeJSONResponse() : array
 {
     if (!is_array($this->json)) {
         throw new \Exception(sprintf('Instance of ResponseBuilder has no JSON response'));
     }
     return $this->decorators->decorate($this, $this->json);
 }
예제 #2
0
 protected function initDecorators(ResponseDecoratorsManager $decoratorsManager)
 {
     $decoratorsManager->attach(new SuccessResponseDecorator())->attach(new TimeResponseDecorator())->attach(new ErrorResponseDecorator());
 }