-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d0de94
commit f5e2e32
Showing
7 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace TraitMixinMethods; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
/** | ||
* @template T | ||
*/ | ||
interface Foo | ||
{ | ||
|
||
/** @return T */ | ||
public function get(); | ||
|
||
} | ||
|
||
/** | ||
* @mixin Foo<static> | ||
*/ | ||
trait FooTrait | ||
{ | ||
|
||
} | ||
|
||
class Usages | ||
{ | ||
|
||
use FooTrait; | ||
|
||
} | ||
|
||
class ChildUsages extends Usages | ||
{ | ||
|
||
} | ||
|
||
function (Usages $u): void { | ||
assertType(Usages::class, $u->get()); | ||
}; | ||
|
||
function (ChildUsages $u): void { | ||
assertType(ChildUsages::class, $u->get()); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace TraitMixinProperties; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
/** | ||
* @template T | ||
*/ | ||
class Foo | ||
{ | ||
|
||
/** @var T */ | ||
public $a; | ||
|
||
} | ||
|
||
/** | ||
* @mixin Foo<static> | ||
*/ | ||
trait FooTrait | ||
{ | ||
|
||
} | ||
|
||
#[\AllowDynamicProperties] | ||
class Usages | ||
{ | ||
|
||
use FooTrait; | ||
|
||
} | ||
|
||
class ChildUsages extends Usages | ||
{ | ||
|
||
} | ||
|
||
function (Usages $u): void { | ||
assertType(Usages::class, $u->a); | ||
}; | ||
|
||
function (ChildUsages $u): void { | ||
assertType(ChildUsages::class, $u->a); | ||
}; |