/** * Get value at the given path in JSON. * * @param string $path * * @return mixed */ private function getValueAtPath($path) { $content = $this->restContext->getMink()->getSession()->getDriver()->getContent(); if (null === ($decoded = json_decode($content, true))) { throw new \RuntimeException('JSON response seems to be invalid'); } $accessor = PropertyAccess::createPropertyAccessor(); return $accessor->getValue($decoded, $path); }