php-kafka / php-avro-schema-generator

PHP avro subschema merger and experimental PHP Class avro schema generator
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

The @var annotation contains a non existent class "self" #37

Closed Hubbitus closed 2 years ago

Hubbitus commented 2 years ago
        $registry = (new ClassRegistry())
            ->addClassDirectory($this->projectDir . '/var/classes/DataObject')
            ->load();

The directory contains files from PIMcore, and among others scanned class Pimcore\Model\DataObject\AbstractObject with property with annotation:

    /**
     * @internal
     *
     * @var self|null
     */
    protected $o_parent;

Should be there self keyword resolved automatically into Pimcore\Model\DataObject\AbstractObject class?

nick-zh commented 2 years ago

Do i understand correctly, that you have a class that extends Pimcore\Model\DataObject\AbstractObject and AbstractObject has this $o_parent prop that is not resolved properly?

nick-zh commented 2 years ago

It would help if i would know about the structure (can be a dummy example), but probably properties with self should be ignored, since this can lead to endless schema recursion :smile:

Hubbitus commented 2 years ago

Sorry, I can't reproduce it now with changes by https://github.com/php-kafka/php-avro-schema-generator/issues/38. So, sorry for the noise.

nick-zh commented 2 years ago

All good, no worries :v: this error is only present in 2.x since in 3.x parsing is done differently, probably that's why. You still gave very good input and new use cases, which i appreciate a lot :v: