src/AnnotationProcessor/PropertyInformation.php
public function processAnnotations(): void
    {
        $class    = $this->property->getClass();
        $imports  = $class ? array_change_key_case($class->getUseStatements()) : [];
        $filename = $class ? $class->getFilename() : 'memory';

        // Get all the namespaces in which annotations reside.
        $namespaces = [];
        foreach ($this->annotation_processors as $processor) {
            $namespaces[] = $processor->getProcessableAnnotationNamespace();
        }

        // Filter all imports that could lead to non loaded annotations,
        // this would let the DocParser explode with an Exception, while
        // the goal is to ignore other annotations besides the one explicitly
        // loaded.
        $without_foreign_annotations = array_filter(
            $imports,
            function ($import) use ($namespaces) {
                foreach ($namespaces as $namespace) {
                    if (stripos($namespace, $import) === 0) {
                        return true;
                    }
                }

                return false;
            }
        );

        $this->parser->setImports($without_foreign_annotations);
        $this->parser->setIgnoreNotImportedAnnotations(true);

        $annotations = $this->parser->parse($this->property->getDocComment(), $filename);

        // If the property is encrypted, column type MUST be string.
        $is_encrypted = false;
        $is_string    = true;
        foreach ($this->annotation_processors as $processor) {
            foreach ($annotations as $annotation) {
                $processor->processAnnotation($annotation, $this);

                if ($annotation instanceof Generate && isset($annotation->encryption_alias)) {
                    $is_encrypted = true;
                }

                if (!($annotation instanceof Column)
                    || !isset($annotation->type)
                    || \in_array($annotation->type, ['string', 'text'])
                ) {
                    continue;
                }

                $is_string = false;
            }
        }

        if ($is_encrypted && !$is_string) {
            throw new \RuntimeException(sprintf(
                'Property %s in class %s\%s has an encryption_alias set, but is not declared as column type \'string\'',
                $this->getName(),
                $this->getNamespace(),
                $this->getClass()
            ));
        }
    }
public function processAnnotations(): void
    {
        $class    = $this->property->getClass();
        $imports  = $class ? array_change_key_case($class->getUseStatements()) : [];
        $filename = $class ? $class->getFilename() : 'memory';

        // Get all the namespaces in which annotations reside.
        $namespaces = [];
        foreach ($this->annotation_processors as $processor) {
            $namespaces[] = $processor->getProcessableAnnotationNamespace();
        }

        // Filter all imports that could lead to non loaded annotations,
        // this would let the DocParser explode with an Exception, while
        // the goal is to ignore other annotations besides the one explicitly
        // loaded.
        $without_foreign_annotations = array_filter(
            $imports,
            function ($import) use ($namespaces) {
                foreach ($namespaces as $namespace) {
                    if (stripos($namespace, $import) === 0) {
                        return true;
                    }
                }

                return false;
            }
        );

        $this->parser->setImports($without_foreign_annotations);
        $this->parser->setIgnoreNotImportedAnnotations(true);

        $annotations = $this->parser->parse($this->property->getDocComment(), $filename);

        // If the property is encrypted, column type MUST be string.
        $is_encrypted = false;
        $is_string    = true;
        foreach ($this->annotation_processors as $processor) {
            foreach ($annotations as $annotation) {
                $processor->processAnnotation($annotation, $this);

                if ($annotation instanceof Generate && isset($annotation->encryption_alias)) {
                    $is_encrypted = true;
                }

                if (!($annotation instanceof Column)
                    || !isset($annotation->type)
                    || \in_array($annotation->type, ['string', 'text'])
                ) {
                    continue;
                }

                $is_string = false;
            }
        }

        if ($is_encrypted && !$is_string) {
            throw new \RuntimeException(sprintf(
                'Property %s in class %s\%s has an encryption_alias set, but is not declared as column type \'string\'',
                $this->getName(),
                $this->getNamespace(),
                $this->getClass()
            ));
        }
    }
public function processAnnotations ( ) : void { $ class = $ this -> property -> getClass ( ) ; $ imports = $ class ? array_change_key_case ( $ class -> getUseStatements ( ) ) : [ ] ; $ filename = $ class ? $ class -> getFilename ( ) : 'memory' ; // Get all the namespaces in which annotations reside. $ namespaces = [ ] ; foreach ( $ this -> annotation_processors as $ processor ) { $ namespaces [ ] = $ processor -> getProcessableAnnotationNamespace ( ) ; } // Filter all imports that could lead to non loaded annotations, // this would let the DocParser explode with an Exception, while // the goal is to ignore other annotations besides the one explicitly // loaded. $ without_foreign_annotations = array_filter ( $ imports , function ( $ import ) use ( $ namespaces ) { foreach ( $ namespaces as $ namespace ) { if ( stripos ( $ namespace , $ import ) === 0 ) { return true ; } } return false ; } ) ; $ this -> parser -> setImports ( $ without_foreign_annotations ) ; $ this -> parser -> setIgnoreNotImportedAnnotations ( true ) ; $ annotations = $ this -> parser -> parse ( $ this -> property -> getDocComment ( ) , $ filename ) ; // If the property is encrypted, column type MUST be string. $ is_encrypted = false ; $ is_string = true ; foreach ( $ this -> annotation_processors as $ processor ) { foreach ( $ annotations as $ annotation ) { $ processor -> processAnnotation ( $ annotation , $ this ) ; if ( $ annotation instanceof Generate && isset ( $ annotation -> encryption_alias ) ) { $ is_encrypted = true ; } if ( ! ( $ annotation instanceof Column ) || ! isset ( $ annotation -> type ) || \ in_array ( $ annotation -> type , [ 'string' , 'text' ] ) ) { continue ; } $ is_string = false ; } } if ( $ is_encrypted && ! $ is_string ) { throw new \ RuntimeException ( sprintf ( 'Property %s in class %s\%s has an encryption_alias set, but is not declared as column type \'string\'' , $ this -> getName ( ) , $ this -> getNamespace ( ) , $ this -> getClass ( ) ) ) ; } }
Start the processing of processAnnotations

@return void
@throws \OutOfBoundsException
@throws \Hostnet\Component\AccessorGenerator\Reflection\Exception\ClassDefinitionNotFoundException
@throws \RuntimeException
Start the processing of processAnnotations