We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class_alias
When using class_alias to replace an existing interface, psalm is not able to verify that the implementing class implements that interface.
https://psalm.dev/r/d0893a607e
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php namespace Psr\Container { interface ContainerInterface {} } namespace Interop\Container { class_alias(\Psr\Container\ContainerInterface::class, ContainerInterface::class); } namespace Foo { use Interop\Container\ContainerInterface; interface ClassInterface { public function __construct(ContainerInterface $container); } class ClassName implements ClassInterface { public function __construct(ContainerInterface $container) { } } class Container implements ContainerInterface { } } namespace Baz { use Foo\Container; use Foo\ClassName; class Foo { /** @var Container */ private $container; public function __construct(Container $container) { $this->container = $container; } public function initialize(): void { new ClassName($this->container); } } }
Psalm output (using commit 285fa13): ERROR: InvalidArgument - 55:27 - Argument 1 of Foo\ClassName::__construct expects Psr\Container\ContainerInterface, Foo\Container provided
Sorry, something went wrong.
ClassLikes
Successfully merging a pull request may close this issue.
When using
class_alias
to replace an existing interface, psalm is not able to verify that the implementing class implements that interface.https://psalm.dev/r/d0893a607e
The text was updated successfully, but these errors were encountered: