serializer = $serializer; $this->httpClient = $httpClient; $this->params = $params; } /** * @return bool|null */ public function __invoke(TraceView $story) { if ($this->params->get('story_enabled')) { $call = $this->httpClient->data('POST', $this->params->get('domain_story') . '/trace.json', ['json' => $this->serializer->normalize($story)]); } else { $call = null; } if (is_array($call) && isset($call['status'])) { $result = 201 === $call['status']; } else { $result = $call; } return $result; } }