zendframework / zend-coding-standard

Zend Framework Coding Standard
BSD 3-Clause "New" or "Revised" License
35 stars 8 forks source link

[v2] Intersection types not recognized in docblocks #16

Open Xerkus opened 5 years ago

Xerkus commented 5 years ago

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 commented 5 years ago

For reference, please see: https://github.com/squizlabs/PHP_CodeSniffer/issues/2410

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-coding-standard; a new issue has been opened at https://github.com/laminas/laminas-coding-standard/issues/6.