-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix stale result cache with imported type aliases
- Loading branch information
Showing
28 changed files
with
494 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/vendor/ |
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,11 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Method App\\\\Example\\:\\:__invoke\\(\\) should return string but returns int\\.$#" | ||
count: 1 | ||
path: src/Example.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$s of method App\\\\Example\\:\\:needsString\\(\\) expects string, int given\\.$#" | ||
count: 1 | ||
path: src/Example.php |
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,16 @@ | ||
{ | ||
"name": "devnix/phpstan-reproducer-10449", | ||
"type": "project", | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"App\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Pablo Largo Mohedano", | ||
"email": "devnix.code@gmail.com" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,21 @@ | ||
diff --git a/e2e/bug10449/src/Query/ExampleQueryHandler.php b/e2e/bug10449/src/Query/ExampleQueryHandler.php | ||
index e9bc1d59f..f5d1c07bf 100644 | ||
--- a/e2e/bug10449/src/Query/ExampleQueryHandler.php | ||
+++ b/e2e/bug10449/src/Query/ExampleQueryHandler.php | ||
@@ -7,13 +7,13 @@ namespace App\Query; | ||
use App\Bus\QueryHandlerInterface; | ||
|
||
/** | ||
- * @phpstan-type Return string | ||
+ * @phpstan-type Return int | ||
*/ | ||
final class ExampleQueryHandler implements QueryHandlerInterface | ||
{ | ||
/** @return Return */ | ||
public function __invoke(ExampleQuery $exampleQuery) | ||
{ | ||
- return '1'; | ||
+ return 1; | ||
} | ||
} | ||
\ No newline at end of file |
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,2 @@ | ||
parameters: | ||
ignoreErrors: [] |
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,7 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
level: 9 | ||
paths: | ||
- src |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Bus; | ||
|
||
interface QueryBusInterface | ||
{ | ||
/** | ||
* @template T | ||
* | ||
* @param QueryInterface<T> $query | ||
* | ||
* @return T | ||
*/ | ||
public function handle(QueryInterface $query); | ||
} |
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,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Bus; | ||
|
||
interface QueryHandlerInterface | ||
{ | ||
} |
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Bus; | ||
|
||
/** @template T */ | ||
interface QueryInterface | ||
{ | ||
} |
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App; | ||
|
||
use App\Bus\QueryBusInterface; | ||
|
||
final class Example | ||
{ | ||
public function __construct(private QueryBusInterface $queryBus) | ||
{ | ||
} | ||
|
||
public function __invoke(): string | ||
{ | ||
$value = $this->queryBus->handle(new Query\ExampleQuery()); | ||
$this->needsString($value); | ||
return $value; | ||
} | ||
|
||
private function needsString(string $s):void {} | ||
} |
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,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Query; | ||
|
||
use App\Bus\QueryInterface; | ||
|
||
/** | ||
* @phpstan-import-type Return from ExampleQueryHandler | ||
* @implements QueryInterface<Return> | ||
*/ | ||
final class ExampleQuery implements QueryInterface | ||
{ | ||
} |
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Query; | ||
|
||
use App\Bus\QueryHandlerInterface; | ||
|
||
/** | ||
* @phpstan-type Return string | ||
*/ | ||
final class ExampleQueryHandler implements QueryHandlerInterface | ||
{ | ||
/** @return Return */ | ||
public function __invoke(ExampleQuery $exampleQuery) | ||
{ | ||
return '1'; | ||
} | ||
} |
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 @@ | ||
/vendor/ |
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,11 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Method App\\\\Example\\:\\:__invoke\\(\\) should return string but returns int\\.$#" | ||
count: 1 | ||
path: src/Example.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$s of method App\\\\Example\\:\\:needsString\\(\\) expects string, int given\\.$#" | ||
count: 1 | ||
path: src/Example.php |
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,16 @@ | ||
{ | ||
"name": "devnix/phpstan-reproducer-10449", | ||
"type": "project", | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"App\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Pablo Largo Mohedano", | ||
"email": "devnix.code@gmail.com" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.