Files
pterodactyl-panel/tools/phpstan/rules/tests/Rules/NoInstanceofOnMixedRuleTest.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

29 lines
791 B
PHP

<?php
declare(strict_types=1);
namespace Rules\Tests\Rules;
use Rules\Rules\NoInstanceofOnMixedRule;
use Rules\Support\TypeClassifier;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
/**
* @extends RuleTestCase<NoInstanceofOnMixedRule>
*/
final class NoInstanceofOnMixedRuleTest extends RuleTestCase
{
protected function getRule(): Rule
{
return new NoInstanceofOnMixedRule(new TypeClassifier, ['src/Boundary/**']);
}
public function testRule(): void
{
$this->analyse([__DIR__.'/data/no-instanceof-on-mixed.php'], [
['This `instanceof` narrows a `mixed` value without establishing its contract. Parse the value at its I/O boundary (cuyz/valinor, spatie/laravel-data), then branch on the domain type.', 9],
]);
}
}