protected function isSuccess(Response $response) { if ($response->getHttpStatusCode() === 200 || $response->getHttpStatusCode() === 202) { return true; } return false; }
protected function processExecute(Request $request, Response $response) { if (300 > $response->getHttpStatusCode()) { $decorator = $this->resolveDecorator($request); } else { $decorator = $this->getFullyQualifiedDecoratorName('ProblematicDecorator'); } $data = $response->getData()->toArray(); $instance = new $decorator($data); $instance->setCode($response->getHttpStatusCode()); return $instance; }