Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Hubbitus opened this issue Jan 5, 2022 · 4 comments
Closed

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

Hubbitus opened this issue Jan 5, 2022 · 4 comments

Comments

@Hubbitus
Copy link
Contributor

Hubbitus commented Jan 5, 2022

        $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
Copy link
Member

nick-zh commented Jan 5, 2022

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
Copy link
Member

nick-zh commented Jan 5, 2022

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 😄

@Hubbitus
Copy link
Contributor Author

Hubbitus commented Jan 6, 2022

Sorry, I can't reproduce it now with changes by #38.
So, sorry for the noise.

@Hubbitus Hubbitus closed this as completed Jan 6, 2022
@nick-zh
Copy link
Member

nick-zh commented Jan 6, 2022

All good, no worries ✌️ 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 ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants