Skip to editor
Psalm
Docs
Playground
Plugins
Blog
Paid support
Share
Fix issues
Show original
PHP
Settings
<?php /** * @template T of Foo * @psalm-param class-string<T> $class * @return T */ function getFoo(string $class) { if ($class === FooChild::class) { return FooChild::create(); } throw new \Exception('err'); } interface Foo { } class FooChild implements Foo { private function __construct() { } public static function create(): self { return new self(); } } $r = getFoo(FooChild::class);
Issues
Types
idle
Saved Dec 24 2020 17:51 UTC
⌘/Ctrl+Enter
run
⌘/Ctrl+S
share
F8
/
⇧F8
next/prev issue