private function saveClassLikeAnnotation(InterfaceModelInterface $parent, AnnotationInterface $annotation): void
    {
        // If it is a mock, register in PhpFile
        if ($annotation->getType() === AnnotationInterface::TYPE_MOCK) {
            $parent = $parent->getParentNode();
            $annotation->setParentNode($parent);
            $parent->/** @scrutinizer ignore-call */
            addAnnotation($annotation);
            $annotation->compile();
        } else {
            // If it is a constructor, register in the current $parent
            if ($annotation->getType() === AnnotationInterface::TYPE_CONSTRUCT) {
                $annotation->setParentNode($parent);
                $parent->addAnnotation($annotation);
                $annotation->compile();
            }
        }
    }
private function saveClassLikeAnnotation(InterfaceModelInterface $parent, AnnotationInterface $annotation): void
    {
        // If it is a mock, register in PhpFile
        if ($annotation->getType() === AnnotationInterface::TYPE_MOCK) {
            $parent = $parent->getParentNode();
            $annotation->setParentNode($parent);
            $parent->/** @scrutinizer ignore-call */
            addAnnotation($annotation);
            $annotation->compile();
        } else {
            // If it is a constructor, register in the current $parent
            if ($annotation->getType() === AnnotationInterface::TYPE_CONSTRUCT) {
                $annotation->setParentNode($parent);
                $parent->addAnnotation($annotation);
                $annotation->compile();
            }
        }
    }
private function saveClassLikeAnnotation ( InterfaceModelInterface $ parent , AnnotationInterface $ annotation ) : void { // If it is a mock, register in PhpFile if ( $ annotation -> getType ( ) === AnnotationInterface :: TYPE_MOCK ) { $ parent = $ parent -> getParentNode ( ) ; $ annotation -> setParentNode ( $ parent ) ; $ parent -> /** @scrutinizer ignore-call */ addAnnotation ( $ annotation ) ; $ annotation -> compile ( ) ; } else { // If it is a constructor, register in the current $parent if ( $ annotation -> getType ( ) === AnnotationInterface :: TYPE_CONSTRUCT ) { $ annotation -> setParentNode ( $ parent ) ; $ parent -> addAnnotation ( $ annotation ) ; $ annotation -> compile ( ) ; } } }
Register an annotation for an interface, a trait or a class.

@param InterfaceModelInterface $parent     The interface, trait or class, to register annotation in.
@param AnnotationInterface     $annotation The annotation to register.

@throws AnnotationParseException If the annotation can not compile.
Register an annotation for an interface a trait or a class .