Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer::isMaxDepthReached PHP Метод

isMaxDepthReached() приватный Метод

Is the max depth reached for the given attribute?
private isMaxDepthReached ( array $attributesMetadata, string $class, string $attribute, array &$context ) : boolean
$attributesMetadata array
$class string
$attribute string
$context array
Результат boolean
    private function isMaxDepthReached(array $attributesMetadata, $class, $attribute, array &$context)
    {
        if (!isset($context[static::ENABLE_MAX_DEPTH]) || !isset($attributesMetadata[$attribute]) || null === ($maxDepth = $attributesMetadata[$attribute]->getMaxDepth())) {
            return false;
        }
        $key = sprintf(static::DEPTH_KEY_PATTERN, $class, $attribute);
        if (!isset($context[$key])) {
            $context[$key] = 1;
            return false;
        }
        if ($context[$key] === $maxDepth) {
            return true;
        }
        ++$context[$key];
        return false;
    }