phpDocumentor / ReflectionDocBlock

MIT License
9.35k stars 119 forks source link

How to implement DocBlockFactoryInterface? #337

Closed cornobils closed 1 year ago

cornobils commented 2 years ago

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 commented 2 years ago

Or I trying to do it wrongly?

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

jaapio commented 1 year ago

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

jaapio commented 1 year ago

fixed in https://github.com/phpDocumentor/ReflectionDocBlock/pull/343