-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Describe the bug
Code sample
<?php declare(strict_types = 1);
namespace Bugs;
use Mockery;
class Bug {
public function bug(): mixed {
$a = static function (array $variables = []) {
return $variables;
};
$b = $a;
return $b;
}
}Custom ruleset
<?xml version="1.0"?>
<ruleset name="Bug"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd">
<file>./packages</file>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
</ruleset>To reproduce
Steps to reproduce the behavior:
- Create a file called
test.phpwith the code sample above... - Run
phpcs test.php ... - See error message displayed
---------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
12 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 37 spaces but found 1 space
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------
Expected behavior
No error.
Versions (please complete the following information):
OS: [e.g., Windows 10, MacOS 10.15]: Ubuntu Latest
PHP: [e.g., 7.2, 7.4]: 8.0
PHPCS: [e.g., 3.5.5, master]: master
Standard: [e.g., PSR2, PSR12, Squiz]: none