Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

[v2] Intersection types not recognized in docblocks #16

Open
Xerkus opened this issue Feb 4, 2019 · 2 comments
Open

[v2] Intersection types not recognized in docblocks #16

Xerkus opened this issue Feb 4, 2019 · 2 comments
Milestone

Comments

@Xerkus
Copy link
Member

Xerkus commented Feb 4, 2019

2.0.0-alpha.3 standard does not recognize and improperly reformats intersect types(&) in phpdoc:

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

Intersections types are supported by PhpStorm, phpstan and present in the draft for phpdoc PSR
https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md#details

@michalbundyra
Copy link
Member

For reference, please see: squizlabs/PHP_CodeSniffer#2410

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-coding-standard; a new issue has been opened at laminas/laminas-coding-standard#6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants