Skip to content

Commit

Permalink
Merge branch refs/heads/1.12.x into 2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
phpstan-bot authored Feb 1, 2025
2 parents 2c0a5b0 + 4805533 commit 150b2e2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/PHPStan/Generics/data/variance-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@
},
{
"message": "Template type T is declared as covariant, but occurs in contravariant position in parameter t of method PHPStan\\Generics\\Variance\\ConstructorAndStatic::create().",
"line": 153,
"line": 154,
"ignorable": true
},
{
"message": "Template type T is declared as covariant, but occurs in contravariant position in parameter w of method PHPStan\\Generics\\Variance\\ConstructorAndStatic::create().",
"line": 153,
"line": 154,
"ignorable": true
},
{
"message": "Template type T is declared as covariant, but occurs in invariant position in parameter v of method PHPStan\\Generics\\Variance\\ConstructorAndStatic::create().",
"line": 153,
"line": 154,
"ignorable": true
}
]
]
2 changes: 1 addition & 1 deletion tests/PHPStan/Generics/data/variance-4.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"message": "Property PHPStan\\Generics\\Variance\\ConstructorAndStatic::$data is never read, only written.",
"line": 134,
"line": 135,
"ignorable": true
}
]
2 changes: 1 addition & 1 deletion tests/PHPStan/Generics/data/variance-5.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"message": "Parameter #1 $it of function PHPStan\\Generics\\Variance\\acceptInvariantIterOfDateTimeInterface expects PHPStan\\Generics\\Variance\\InvariantIter<DateTimeInterface>, PHPStan\\Generics\\Variance\\InvariantIter<DateTime> given.",
"line": 164,
"line": 165,
"ignorable": true
}
]
3 changes: 2 additions & 1 deletion tests/PHPStan/Generics/data/variance.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function set($v): void;
/**
* @template-covariant T
* @template U
* @phpstan-consistent-constructor
*/
class ConstructorAndStatic {

Expand All @@ -151,7 +152,7 @@ public function __construct($t, $u, $v, $w) {
* @return Static<T, U>
*/
public static function create($t, $u, $v, $w) {
return new self($t, $u, $v, $w);
return new static($t, $u, $v, $w);
}
}

Expand Down

0 comments on commit 150b2e2

Please sign in to comment.