Releases: graze/standards
Fix AbstractClassNaming sniff error message
Previously the error message for the Graze.Naming.AbstractClassNaming
sniff showed a placeholder rather than the class name, like this:
Abstract class name "%s" must be prefixed with "Abstract"
It now correctly shows the class name, like this:
Abstract class name "Foo" must be prefixed with "Abstract"
Correct sniff names in output
This version ensures that when you run phpcs with the -s
flag, the custom sniffs included will produce a message that actually matches the sniff name.
Previously you would see this:
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
13 | ERROR | Space found after logical NOT operator
| | (graze.controlStructures.NegationNoSpaces)
------------------------------------------------------------------------------------------------
That's not the name of the sniff and so if you try to do anything with that (eg. adding it to a ruleset) phpcs will complain that the sniff does not exist.
Now you will correctly see this instead:
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
13 | ERROR | Space found after logical NOT operator
| | (Graze.ControlStructures.NegationNoSpaces)
------------------------------------------------------------------------------------------------
Negation and whitespace
Adds a new sniff (Graze\Sniffs\ControlStructures\NegationNoSpacesSniff
) to check for the following rule:
'Not' logical operators MUST NOT have whitespace between them and the subject being negated.
This means that the following will now produce an error:
$foo = ! $bar;
This can be fixed by removing the whitespace:
$foo = !$bar;
Fix for abstract name checking
The following class definition no longer causes the abstract name checking sniff to crash:
<?php
class Foo
{
}
Minor php cs fix
Fix for checking for doc comments with child functions:
this should be valid:
function first()
{
/**
* @return string
*/
function second()
{
return '2';
}
second();
}
phpcs -> v3
This updates phpcs to version 3.0.2. And requires a major version bump as a result.
Initial public release
v1.0.0 Add LICENSE file