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

How to implement DocBlockFactoryInterface? #337

Closed
chornobils opened this issue Jun 11, 2022 · 3 comments
Closed

How to implement DocBlockFactoryInterface? #337

chornobils opened this issue Jun 11, 2022 · 3 comments
Assignees

Comments

@chornobils
Copy link

hi, I want to implement interface \phpDocumentor\Reflection\DocBlockFactoryInterface , but createInstace() return type does not allow me to do it:

/**
     * Factory method for easy instantiation.
     *
     * @param array<string, class-string<Tag>> $additionalTags
     */
    public static function createInstance(array $additionalTags = []) : DocBlockFactory;

I could set return type to DocBlockFactory, but this become meaningless, because I want to return my new DocBlockFactoryInterface instance. Or I trying to do it wrongly?

version 5.2.2

Thanks

@WinterSilence
Copy link
Contributor

Or I trying to do it wrongly?

nope, it's bug - master not fully tested by static analyzers.

@jaapio
Copy link
Member

jaapio commented Nov 14, 2022

I recently changed this, it will be part of the new release. Which I expect in a few weeks.

@jaapio jaapio self-assigned this Nov 14, 2022
@jaapio
Copy link
Member

jaapio commented Nov 18, 2022

fixed in #343

@jaapio jaapio closed this as completed Nov 18, 2022
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

3 participants