Skip to content

There needs to be a way to indicate the containing class in function docblocks without explicitly entering the name of the class #514

@Ibmurai

Description

@Ibmurai

For example when implementing a singleton:

class Singly {
    /**
     * Get the instance
     * @return Singly
     */
    public static function getInstance() {
        // Some code here...
    }
}

The @return Singly could instead be @return this, @return static or @return self or something like that.

This would be most useful for traits, which I know you are not focused on right now, but also useful in general:
What if you have a function which returns $this and extend the implementing class? Then the function really returns an instance of the extending class, and this would be really useful to be able to determine for IDE auto completion.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions