ReflectionDocBlock icon indicating copy to clipboard operation
ReflectionDocBlock copied to clipboard

How to implement DocBlockFactoryInterface?

Open chornobils opened this issue 2 years ago • 1 comments

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

chornobils avatar Jun 11 '22 08:06 chornobils

Or I trying to do it wrongly?

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

WinterSilence avatar Aug 07 '22 18:08 WinterSilence

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

jaapio avatar Nov 14 '22 07:11 jaapio

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

jaapio avatar Nov 18 '22 09:11 jaapio