Skip to content

Return type $this&Iface must transfer the Iface to the invoked object #7385

@mvorisek

Description

@mvorisek

Feature request

$v->assertHasII() must have the same effect as $v = $v->assertHasII() when the return type is always instance of $this

https://phpstan.org/r/53ba9b04-685e-404c-ba77-a9616ca75ace

 Line 	Error
 22 	Dumped type: Cl
 24 	Dumped type: Cl&II
 30 	Dumped type: Cl
-32 	Dumped type: Cl
+32 	Dumped type: Cl&II
 37 	Dumped type: $this(Cl)
-40 	Dumped type: $this(Cl)
+40 	Dumped type: $this(Cl&II)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions