Skip to content

Commit 4805533

Browse files
committed
Fix tests
1 parent 703ec31 commit 4805533

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

tests/PHPStan/Generics/data/variance-2.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@
6161
},
6262
{
6363
"message": "Template type T is declared as covariant, but occurs in contravariant position in parameter t of method PHPStan\\Generics\\Variance\\ConstructorAndStatic::create().",
64-
"line": 153,
64+
"line": 154,
6565
"ignorable": true
6666
},
6767
{
6868
"message": "Template type T is declared as covariant, but occurs in contravariant position in parameter w of method PHPStan\\Generics\\Variance\\ConstructorAndStatic::create().",
69-
"line": 153,
69+
"line": 154,
7070
"ignorable": true
7171
},
7272
{
7373
"message": "Template type T is declared as covariant, but occurs in invariant position in parameter v of method PHPStan\\Generics\\Variance\\ConstructorAndStatic::create().",
74-
"line": 153,
74+
"line": 154,
7575
"ignorable": true
7676
}
77-
]
77+
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"message": "Property PHPStan\\Generics\\Variance\\ConstructorAndStatic::$data is never read, only written.",
4-
"line": 134,
4+
"line": 135,
55
"ignorable": true
66
}
77
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"message": "Parameter #1 $it of function PHPStan\\Generics\\Variance\\acceptInvariantIterOfDateTimeInterface expects PHPStan\\Generics\\Variance\\InvariantIter<DateTimeInterface>, PHPStan\\Generics\\Variance\\InvariantIter<DateTime> given.",
4-
"line": 164,
4+
"line": 165,
55
"ignorable": true
66
}
77
]

tests/PHPStan/Generics/data/variance.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ function set($v): void;
127127
/**
128128
* @template-covariant T
129129
* @template U
130+
* @phpstan-consistent-constructor
130131
*/
131132
class ConstructorAndStatic {
132133

@@ -151,7 +152,7 @@ public function __construct($t, $u, $v, $w) {
151152
* @return Static<T, U>
152153
*/
153154
public static function create($t, $u, $v, $w) {
154-
return new self($t, $u, $v, $w);
155+
return new static($t, $u, $v, $w);
155156
}
156157
}
157158

0 commit comments

Comments
 (0)