Skip to content

False positive using intersection types in type annotation #162

Closed
@icanhazstring

Description

@icanhazstring

Version: 7.0.2

There is a problem using intersection types for type declaration in annotations.
These are valid since PHPStorm 2018.3.

https://blog.jetbrains.com/phpstorm/2018/09/phpstorm-2018-3-eap-183-2635-12/#intersection-types

Given the following code

/**
 * @param ContainerInterface&ServiceManager $container
 */
 public function __invoke(ContainerInterface $container) : Fubar {}

Expected:
no problem

Actual:

FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 XX | ERROR | [x] Expected 4 spaces after parameter type; 0 found

Using phpcbf to fix the issue resulted in this line:

* @param ContainerInterface    &ServiceManager $container

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions