@param Cacheable                   $annotation
@param InterceptionPrefixInterface $interception

@return ResultInterface
490437
public function interceptPrefix(
        CacheAnnotationInterface $annotation,
        InterceptionPrefixInterface $interception
    ) : ResultInterface {
        $key = $this->calculateKey($annotation, $interception);
        foreach ($annotation->pools as $poolName) {
            if (!$cacheItem = $this->locateCachedItem($poolName, $key)) {
                continue;
            }
            
            return new HitResult($interception, $key, [$poolName], $cacheItem->get());
        }
        
        return new EmptyResult();
    }
1293203
public function generateKey(InterceptionInterface $interception, CacheAnnotationInterface $annotation) : string
    {
        $format = property_exists($annotation, 'key') ? $annotation->key : '';
        $parameters = array_merge($interception->getParams(), ['interception' => $interception]);
        if ($format && $result = $this->language->evaluate($format, $parameters)) {
            return sha1(serialize($result));
        }

        return $this->keyGenerator->generateKey($interception, $annotation);
    }
419431
public function interceptSuffix(
        CacheAnnotationInterface $annotation,
        InterceptionSuffixInterface $interception
    ) : ResultInterface {
        if (!$interception->getReturnValue()) {
            return new EmptyResult();
        }

        $key = $this->calculateKey($annotation, $interception);

        $item = new CacheItem($key);
        $item->set($interception->getReturnValue());
        $item->setTags($annotation->tags);

        if ($annotation->ttl > 0) {
            $item->expiresAfter($annotation->ttl);
        }

        foreach ($annotation->pools as $poolName) {
            $pool = $this->poolManager->getPool($poolName);
            $pool->save($item);
        }
        
        return new MissResult($interception, $key, $annotation->pools);
    }
426895
public static function getPropertyAnnotation(\ReflectionProperty $property, $annotationClass, AnnotationReader $reader)
    {
        return $reader->getPropertyAnnotation($property, $annotationClass);
    }
1203691
private function checkDifferentAnnotations(Annotation $annotation, $linesCount)
    {
        if ($linesCount === 1) {
            return;
        }

        $this->phpcsFile->addError(
            \sprintf('Expected 1 lines between different annotations types, found %d.', $linesCount),
            $annotation->getStartPointer(),
            'LineBetweenDifferentTags'
        );
    }
295194
public function parse($annotation, \ReflectionClass $refClass, Endpoint $endpoint)
    {
        $query = new QueryDefinition();

        if ($annotation->name) {
            $query->setName($annotation->name);
        } else {
            $query->setName(lcfirst(ClassUtils::getDefaultName($refClass->getName())));
        }

        $endpoint->addQuery($query);

        if ($annotation->type) {
            $type = TypeUtil::normalize($annotation->type);
            if (class_exists($annotation->type)) {
                $type = $endpoint->getTypeForClass($annotation->type);
            }
            if ($endpoint->hasType($type)) {
                $query->setNode($type);
            }
            $query->setType($type);
        }

        $query->setList(TypeUtil::isTypeList($annotation->type));
        $query->setNonNull(TypeUtil::isTypeNonNull($annotation->type));
        $query->setNonNullList(TypeUtil::isTypeNonNullList($annotation->type));

        if (!$query->getType()) {
            $nodeType = ClassUtils::getNodeFromClass($refClass->getName());
            $objectDefinition = null;
            if ($nodeType && $endpoint->hasType($nodeType)) {
                $objectDefinition = $endpoint->getType($nodeType);
            }
            if ($objectDefinition) {
                $query->setType($objectDefinition->getName());
                $query->setNode($objectDefinition->getName());
            } else {
                //avoid throw Exception when the schema is empty
                //when the schema is empty the NodeInterface has not been loaded
                //then the node(id) and nodes(ids) queries fails
                if ('Node' === $nodeType) {
                    $endpoint->removeQuery($query->getName());

                    return;
                }

                $error = sprintf('Does not exist any valid type for class "%s"', $refClass->getName());
                throw new \RuntimeException($error);
            }
        }

        if ($annotation->arguments) {
            foreach ($annotation->arguments as $argAnnotation) {
                if ($argAnnotation instanceof Annotation\Argument) {
                    $this->resolveArgument($query, $argAnnotation);
                }
            }
        } else {
            $argAnnotations = $this->reader->getClassAnnotations($refClass);
            foreach ($argAnnotations as $argAnnotation) {
                if ($argAnnotation instanceof Annotation\Argument) {
                    $this->resolveArgument($query, $argAnnotation);
                }
            }
        }

        $query->setResolver($annotation->resolver ?? $refClass->getName());
        $query->setDeprecationReason($annotation->deprecationReason);
        $query->setDescription($annotation->description);

        foreach ($annotation->options as $option => $value) {
            $query->setMeta($option, $value);
        }
    }
241553
public function parse($annotation, \ReflectionClass $refClass, Endpoint $endpoint)
    {
        /** @var Annotation\Subscription $annotation */

        if (!preg_match('/\\Subscription\\\\/', $refClass->getName())) {
            $error = sprintf(
                'Annotation "@Subscription" in the class "%s" is not valid, 
            mutations can only be applied to classes inside "...Bundle\Subscription\..."',
                $refClass->getName()
            );
            throw new \RuntimeException($error);
        }

        if (!$annotation->resolver && !$refClass->hasMethod('__invoke')) {
            $error = sprintf(
                'The class "%s" should have a method "__invoke" to process the subscription.',
                $refClass->getName()
            );
            throw new \RuntimeException($error);
        }

        $subscription = new SubscriptionDefinition();
        $subscription->setType(TypeUtil::normalize($annotation->payload));

        if ($annotation->name) {
            $subscription->setName($annotation->name);
        } else {
            $subscription->setName(lcfirst(ClassUtils::getDefaultName($refClass->getName())));
        }

        if (!$subscription->getType()) {
            $nodeType = ClassUtils::getNodeFromClass($refClass->getName());
            $objectDefinition = null;
            if ($nodeType && $endpoint->hasType($nodeType)) {
                $objectDefinition = $endpoint->getType($nodeType);
            }
            if ($objectDefinition) {
                $subscription->setType($objectDefinition->getName());
                $subscription->setNode($objectDefinition->getName());
            } else {
                $error = sprintf('Does not exist any valid type for class "%s"', $refClass->getName());
                throw new \RuntimeException($error);
            }
        }

        $endpoint->addSubscription($subscription);

        if (!$annotation->payload) {
            if (class_exists($refClass->getName().'Payload')) {
                $annotation->payload = $refClass->getName().'Payload';
                if (!$endpoint->hasTypeForClass($annotation->payload)) {
                    $error = sprintf(
                        'The payload "%s" exist but does not exist a valid GraphQL type, is missing ObjectType annotation?',
                        $annotation->payload
                    );
                    throw new \RuntimeException($error);
                }
            }
        }

        // create subscription event
        $subscriptionEvent = new ObjectDefinition();
        $subscriptionEvent->setName(ucfirst($subscription->getName()).'Event');
        $field = new FieldDefinition();
        $field->setName($annotation->fieldName ?? 'data');
        $field->setDescription($annotation->fieldDescription ?? null);
        $field->setType($subscription->getType());
        $field->setNode($subscription->getNode());
        $field->setNonNull(TypeUtil::isTypeNonNull($annotation->payload));
        $field->setList(TypeUtil::isTypeList($annotation->payload));
        $field->setNonNullList(TypeUtil::isTypeNonNullList($annotation->payload));
        $subscriptionEvent->addField($field);
        $endpoint->addType($subscriptionEvent);

        // subscription response is a union between SubscriptionLink object and specific Subscription Event
        $subscriptionResponse = new UnionDefinition();
        $subscriptionResponse->setName(ucfirst($subscription->getName()).'Subscription');
        $subscriptionResponse->addType(new UnionTypeDefinition($subscriptionEvent->getName()));
        $subscriptionResponse->addType(new UnionTypeDefinition($endpoint->getTypeForClass(SubscriptionLink::class)));
        $endpoint->addType($subscriptionResponse);
        $subscription->setType(TypeUtil::normalize($subscriptionResponse->getName()));

        if (!$subscription->getType()) {
            $error = sprintf(
                'The subscription "%s" does not have a valid payload,
                 create a file called %sPayload or specify a payload.',
                $subscription->getName(),
                $refClass->getName()
            );
            throw new \RuntimeException($error);
        }

        $argAnnotations = $this->reader->getClassAnnotations($refClass);
        foreach ($argAnnotations as $argAnnotation) {
            if ($argAnnotation instanceof Annotation\Argument) {
                $this->resolveArgument($subscription, $argAnnotation);
            }
        }

        if ($annotation->node) {
            $subscription->setNode($annotation->node);
        } elseif (($node = ClassUtils::getNodeFromClass($refClass->getName())) && $endpoint->hasType($node)) {
            $subscription->setNode($node);
        }

        $subscription->setResolver($annotation->resolver ?? $refClass->getName());
        $subscription->setDeprecationReason($annotation->deprecationReason);
        $subscription->setDescription($annotation->description);

        foreach ($annotation->options as $option => $value) {
            $subscription->setMeta($option, $value);
        }
    }
391881
private function unknownParameterException(\ReflectionFunctionAbstract $controller, RequestParam $annotation) : HttpInternalServerErrorException
    {
        return new HttpInternalServerErrorException(sprintf(
            '%s() does not have a $%s parameter, please check your annotation.',
            $this->reflectionTools->getFunctionName($controller),
            $annotation->getBindTo()
        ));
    }
321494
private function getAnnotation(KernelEvent $event): ?Cache
    {
        $controller = $this->getController($event);
        $controllerClass = new ReflectionClass($controller[0]);

        if ($method = $controllerClass->getMethod($controller[1])) {
            return $this->reader->getMethodAnnotation($method, Cache::class);
        }

        return null;
    }
1186511
public function getInterceptors($interceptionPoint)
    {
        return isset($this->interceptors[$interceptionPoint]) ? $this->interceptors[$interceptionPoint] : new \SplObjectStorage();
    }
168604
public function parse($annotation, \ReflectionClass $refClass, Endpoint $endpoint)
    {
        if (!$endpoint->hasTypeForClass($refClass->getName())) {
            throw new \RuntimeException(sprintf('Can\'t apply Add/Update operation to "%s", CRUD operations can only be applied to valid GraphQL object types.', $refClass->getName()));
        }

        if (!$refClass->implementsInterface(NodeInterface::class)) {
            throw new \RuntimeException(sprintf('Can\'t apply Add/Update operation to "%s", CRUD operations can only be applied to nodes. You are implementing "%s" in this class?', $refClass->getName(), NodeInterface::class));
        }

        $definition = $endpoint->getType($endpoint->getTypeForClass($refClass->getName()));
        $bundleNamespace = ClassUtils::relatedBundleNamespace($refClass->getName());

        $actionPrefix = $annotation instanceof Annotation\MutationAdd ? 'add' : 'update';
        $annotation->name = $annotation->name ?? $actionPrefix.ucfirst($definition->getName());
        $annotation->payload = $annotation->payload ?? null;
        if (!$annotation->payload) {
            //deep cloning
            /** @var ObjectDefinitionInterface $payload */
            $payloadClass = $annotation instanceof Annotation\MutationAdd ? AddNodePayload::class : UpdateNodePayload::class;
            $payload = unserialize(serialize($endpoint->getType($payloadClass)), ['allowed_classes' => true]);
            $payload->setName(ucfirst($annotation->name.'Payload'));

            if (!$endpoint->hasType($payload->getName())) {
                $payload->getField('node')->setType($definition->getName());
                $endpoint->add($payload);
            }

            $annotation->payload = $payload->getName();
        }
        $annotation->node = $annotation->node ?? $definition->getName();

        if ($endpoint->hasTypeForClass($annotation->node)) {
            $annotation->node = $endpoint->getTypeForClass($annotation->node);
        }

        $formType = null;
        $options = [];
        $generalForm = ClassUtils::applyNamingConvention($bundleNamespace, 'Form\Input', $annotation->node, $annotation->node, 'Input');
        $specificForm = ClassUtils::applyNamingConvention($bundleNamespace, 'Form\Input', $annotation->node, $annotation->name, 'Input');
        if (class_exists($specificForm)) {
            $formType = $specificForm;
        } elseif (class_exists($generalForm)) {
            $formType = $generalForm;
            $options['operation'] = $annotation->name;

            //in case the form has activated namespace operation alias
            //the operation name will be the alias
            foreach ($annotation->options as $name => $option) {
                if ($option instanceof Annotation\Plugin\Namespaces && $option->alias) {
                    $options['operation'] = $option->alias;

                }

                //support for BC using array
                if (\is_array($option) && 'namespace' === $name && $option['alias'] ?? false) {
                    $options['operation'] = $option->alias;
                }
            }
        }

        $annotation->options = array_merge(['form' => ['type' => $formType, 'options' => $options]], $annotation->options);
        $resolver = $annotation instanceof Annotation\MutationAdd ? AddNode::class : UpdateNode::class;
        $resolverReflection = new \ReflectionClass($resolver);

        $resolver = ClassUtils::applyNamingConvention($bundleNamespace, 'Mutation', $definition->getName(), $annotation->name);
        if (class_exists($resolver)) {
            $annotation->resolver = $resolver;
        }

        parent::parse($annotation, $resolverReflection, $endpoint);
    }
190660
private function nested($annotation, $nestedContext)
    {
        if (property_exists($annotation, '_context') && $annotation->_context === $this->_context) {
            $annotation->_context = $nestedContext;
        }
        return $annotation;
    }
825118
private function readSourceMethod(Request $request, Annotation $annotation): string
    {
        $method = 'read' . $this->source($annotation);
        if (!method_exists($request, $method)) {
            throw new \RuntimeException(
                    'Unknown source ' . $annotation->getSource() . ' for '
                    . $annotation . ' on ' . get_class($request)
            );
        }

        return $method;
    }
817124
public function invoke(MethodInvocation $invocation)
    {
        /** @var Cacheable $annotation */
        $annotation = $invocation->getMethod()->getAnnotation($this->annotation);
        $keys = $this->generateCacheName($annotation->cacheName, $invocation);
        if (!is_array($annotation->key)) {
            $annotation->key = [$annotation->key];
        }
        $keys = $this->detectCacheKeys($invocation, $annotation, $keys);
        // detect use cache driver
        $cache = $this->detectCacheRepository($annotation);
        $key = $this->recursiveImplode($this->join, $keys);
        if ($cache->has($key)) {
            return $cache->get($key);
        }
        $result = $invocation->proceed();
        if (!$annotation->negative) {
            if ($result) {
                $cache->add($key, $result, $annotation->lifetime);
            }

            return $result;
        }
        if (is_null($result)) {
            $cache->add($key, $result, $annotation->lifetime);
        }

        return $result;
    }
1289026
private function parseDate(Annotation $annotation, string $field)
    {
        if ($annotation->hasValueByName($field)) {
            return new Date($annotation->getValueByName($field));
        }

        return null;
    }
13013
private function invalidScalarParameterException(\ReflectionFunctionAbstract $controller, RequestParam $annotation, string $type) : HttpBadRequestException
    {
        return new HttpBadRequestException(sprintf(
            '%s() received an invalid %s value for %s parameter "%s" (bound to $%s).',
            $this->reflectionTools->getFunctionName($controller),
            $type,
            $annotation->getParameterType(),
            $annotation->getName(),
            $annotation->getBindTo()
        ));
    }
511175
@Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        if (method.getName().equals("annotationType")) {
            return annotationType;
        } else if (method.getName().equals("toString")) { 
            return toString();
        } else if (method.getName().equals("equals")) {
           return annotationEquals(args[0]);
        } else if (method.getName().equals("hashCode")) { 
            return proxy.hashCode();
        } else {
            return attributeData.get(method.getName());
        }
       
    }