public function all(): array {
return $this->data;
}
This code will generate this notification: WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement
When I remove empty line before return, I get this notification: WPForms.Formatting.EmptyLineAfterFunctionDeclaration.AddEmptyLineAfterFunctionDeclaration
The problem is in the return type added to the function declaration: : array.
If I remove it - everything works just fine.
It looks like WPForms PHPCS is not aware of the function's return type and does not treat them properly.
Expected behavior: ignore them OR make sure the declared return type is the same as the actual return value of the function.
Here is what I found today:
This code will generate this notification:
WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement
When I remove empty line before return, I get this notification:
WPForms.Formatting.EmptyLineAfterFunctionDeclaration.AddEmptyLineAfterFunctionDeclaration
The problem is in the return type added to the function declaration:
: array
. If I remove it - everything works just fine.It looks like WPForms PHPCS is not aware of the function's return type and does not treat them properly.
Expected behavior: ignore them OR make sure the declared return type is the same as the actual return value of the function.
I'm using wpforms-phpcs@1.1.0