Skip to content

FunctionComment.SpacingAfterParamType not working with intersection types #2887

Open
@icanhazstring

Description

@icanhazstring

Hi there,

the given sniff Squiz.Commenting.FunctionComment.SpacingAfterParamType does not work well with intersection type annotations.

Used Version: 3.5.4

It might be related to an older, already fixed issue:
#2530

Given the following code

/**
 * @param ContainerInterface&ServiceManager $container
 * @param array<string, string> $options
 */
public function __invoke(ContainerInterface $container, array $options = []) : Fubar

Expected:
no problem

Actual:

FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 XX | ERROR | [x] Expected 4 spaces after parameter type; 0 found
      (Squiz.Commenting.FunctionComment.SpacingAfterParamType)

Using phpcbf to fix the issue resulted in this line:

* @param ContainerInterface    &ServiceManager $container
* @param array<string, string> $options

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