Skip to content

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

Description

@Xerkus

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions