Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split method-signature-variance.php test stub into three different te…
…st cases
- Loading branch information
Showing
5 changed files
with
369 additions
and
242 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
75 changes: 75 additions & 0 deletions
75
tests/PHPStan/Rules/Generics/data/method-signature-variance-contravariant.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,75 @@ | ||
<?php | ||
|
||
namespace MethodSignatureVarianceContravariant; | ||
|
||
/** @template-contravariant T */ | ||
interface In { | ||
} | ||
|
||
/** @template-covariant T */ | ||
interface Out { | ||
} | ||
|
||
/** @template T */ | ||
interface Invariant { | ||
} | ||
|
||
/** | ||
* @template-contravariant K | ||
*/ | ||
class A { | ||
/** | ||
* @param K $a | ||
* @param In<K> $b | ||
* @param In<In<K>> $c | ||
* @param In<Out<K>> $d | ||
* @param In<Out<Invariant<K>>> $e | ||
* @param In<Invariant<In<K>>> $f | ||
* @param Out<K> $g | ||
* @param Out<Out<K>> $h | ||
* @param Out<In<K>> $i | ||
* @param Out<In<Invariant<K>>> $j | ||
* @param Out<Invariant<Out<K>>> $k | ||
* @param Invariant<K> $l | ||
* @param Invariant<Invariant<K>> $m | ||
* @param Invariant<Out<In<K>>> $n | ||
* @return K | ||
*/ | ||
function a($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m, $n) {} | ||
|
||
/** @return In<K> */ | ||
function b() {} | ||
|
||
/** @return In<In<K>> */ | ||
function c() {} | ||
|
||
/** @return In<Out<K>> */ | ||
function d() {} | ||
|
||
/** @return In<Out<Invariant<K>>> */ | ||
function e() {} | ||
|
||
/** @return Out<K> */ | ||
function f() {} | ||
|
||
/** @return Out<Out<K>> */ | ||
function g() {} | ||
|
||
/** @return Out<In<K>> */ | ||
function h() {} | ||
|
||
/** @return Out<In<Invariant<K>>> */ | ||
function i() {} | ||
|
||
/** @return Invariant<K> */ | ||
function j() {} | ||
|
||
/** @return Invariant<Invariant<K>> */ | ||
function k() {} | ||
|
||
/** @return Invariant<In<Out<K>>> */ | ||
function l() {} | ||
|
||
/** @return Invariant<Out<In<K>>> */ | ||
function m() {} | ||
} |
Oops, something went wrong.