diff --git a/src/Providers/ModelStubProvider.php b/src/Providers/ModelStubProvider.php index 4a97053..19e1e79 100644 --- a/src/Providers/ModelStubProvider.php +++ b/src/Providers/ModelStubProvider.php @@ -50,7 +50,8 @@ final class ModelStubProvider implements GeneratesStubs $models_generator_command->run( new ArrayInput([ - '--nowrite' => true + '--nowrite' => true, + '--reset' => true, ]), new NullOutput() ); diff --git a/tests/Models/AbstractUuidModel.php b/tests/Models/AbstractUuidModel.php new file mode 100644 index 0000000..2b775e4 --- /dev/null +++ b/tests/Models/AbstractUuidModel.php @@ -0,0 +1,22 @@ +setAttribute('uuid', Str::uuid()); + }); + } +} diff --git a/tests/Models/Secret.php b/tests/Models/Secret.php new file mode 100644 index 0000000..8c2d9b5 --- /dev/null +++ b/tests/Models/Secret.php @@ -0,0 +1,6 @@ + + + + + + + + + + + """ + And I have the following code preamble + """ + id; + } + """ + When I run Psalm + Then I see no errors + + Scenario: Property annotation with imported type + Given I have the following code + """ + function test(User $user): ?\Carbon\CarbonInterface + { + return $user->email_verified_at; + } + """ + When I run Psalm + Then I see no errors + + + Scenario: Inherited property annotation + Given I have the following code + """ + function test(Secret $secret): \Ramsey\Uuid\UuidInterface + { + return $secret->uuid; + } + """ + When I run Psalm + Then I see no errors