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 5, 2025
2 parents bdf41ae + d5312c0 commit da5754c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPStan\Rules\MissingTypehintCheck;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use const PHP_VERSION_ID;

/**
* @extends RuleTestCase<MissingMethodReturnTypehintRule>
Expand Down Expand Up @@ -111,4 +112,13 @@ public function testGenericStatic(): void
]);
}

public function testBug9657(): void
{
if (PHP_VERSION_ID < 80000) {
$this->markTestSkipped('Test requires PHP 8.0');
}

$this->analyse([__DIR__ . '/data/bug-9657.php'], []);
}

}
25 changes: 25 additions & 0 deletions tests/PHPStan/Rules/Methods/data/bug-9657.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php // lint >= 8.0

namespace Bug9657;

/**
* @template T
*/
trait Convertable
{
/**
* @return T
*/
abstract public function toOther(): mixed;
}

final class Thing
{
/** @use Convertable<list<never>> */
use Convertable;

public function toOther(): array
{
return [];
}
}

0 comments on commit da5754c

Please sign in to comment.