Skip to content

Return type brackets are not in the same line #305

@amoschristian

Description

@amoschristian

With PSR 12, if there is multiline params inside a function and return type are declared as per this explanation
https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md

When you have a return type declaration present, there MUST be one space after the colon followed by the type declaration. The colon and declaration MUST be on the same line as the argument list closing parenthesis with no spaces between the two characters.

image

but on my end it does look like this

<?php

namespace Vendor\Package;

class ReturnTypeVariations
{
    public function functionName(int $arg1, $arg2): string
    {
        return 'foo';
    }

    public function anotherFunction(
        string $foo,
        string $bar,
        int $baz
    ): string
    {
        return 'foo';
    }
}

But for a function with one line params, it has no issue

Is there any settings that i miss? or is this a bug?
Thank you

Metadata

Metadata

Assignees

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