Skip to content

PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket bug #3477

@dereuromark

Description

@dereuromark

Describe the bug
The rule breaks with an fail to fix.

Code sample

		$this->belongsTo('Users', [
				'className' => $userClass, 'foreignKey' => 'user_id',
			],
		);

shows

FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
 53 | ERROR | [x] Expected 0 spaces before closing parenthesis; newline found
    |       |     (PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket)
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY

Trying to fix it (phpcbf):

FILE                                                                                                        FIXED  REMAINING
----------------------------------------------------------------------------------------------------------------------------
/.../cakephp-ratings/src/Model/Table/RatingsTable.php     FAILED TO FIX
----------------------------------------------------------------------------------------------------------------------------
A TOTAL OF -1 ERRORS WERE FIXED IN 1 FILE

It breaks here hard.

Note: The code uses tabs and is configured as such (<arg name="tab-width" value="4"/>).

Expected behavior
Auto fixing this , or not reporting it to be fixable.

I need to manually fix it to this for sniffer to work again and also fix the other things in this file:

		$this->belongsTo('Users', [
				'className' => $userClass, 'foreignKey' => 'user_id',
		]);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions