Skip to content
New issue

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

Add support for intersect typehints (&) in PEAR.Commenting.FunctionComment #2410

Open
Xerkus opened this issue Feb 7, 2019 · 0 comments
Open

Comments

@Xerkus
Copy link

Xerkus commented Feb 7, 2019

PEAR.Commenting.FunctionComment does not recognize intersect typehints

     /**
      * Inject a service into the container mock.
      *
      * Adjust `has('service')` and `get('service')` returns.
      *
-     * @param ContainerInterface&MockObject $container
+     * @param ContainerInterface &MockObject $container
      * @param mixed $service
      */
     protected function injectServiceInContainer(MockObject $container, string $serviceName, $service) : void
     {

Return type is unaffected so it looks like sniff considers & to be pass-by-reference symbol of parameter name.

Quite likely it happens in other places with variable names after type declaration too, like with inline @var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants