-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed missing return rule for native mixed type
- Loading branch information
1 parent
fc7bcff
commit 03d8312
Showing
4 changed files
with
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php // lint >= 8.0 | ||
|
||
namespace ModelMixin; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
/** @mixin Builder<static> */ | ||
class Model | ||
{ | ||
/** @param array<int, mixed> $args */ | ||
public static function __callStatic(string $method, array $args): mixed | ||
{ | ||
(new self)->$method(...$args); | ||
} | ||
} | ||
|
||
/** @template TModel as Model */ | ||
class Builder | ||
{ | ||
/** @return array<int, TModel> */ | ||
public function all() { return []; } | ||
} | ||
|
||
class User extends Model | ||
{ | ||
} | ||
|
||
function (): void { | ||
assertType('array<int, ModelMixin\User>', User::all()); | ||
}; |
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