Psalm
Get started
Documentation
Paid support
Plugins
Blog
GitHub
<?php /** * @template T1 * @template T2 of array-key * @template TFlags of int-mask<1,2,4,8,16,256> */ class Foo { /** * @param T1 $a * @param T2 $b * @param TFlags $flags */ public function __construct($a, $b, $flags) {} /** @psalm-if-this-is self<mixed, mixed, 256> */ public function test(): void {} } $foo1 = new Foo(1, 2, 3); $foo1->test(); $foo2 = new Foo(3, 4, 256); $foo2->test();
Snippet created on July 18 2022 at 15:16 UTC
Settings
Get link