Skip to content

Releases: graze/standards

Fix AbstractClassNaming sniff error message

18 Aug 15:46
eac7737
Compare
Choose a tag to compare

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

06 Aug 14:22
fb6c746
Compare
Choose a tag to compare

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

04 Jul 13:26
a90e559
Compare
Choose a tag to compare

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

20 Sep 09:16
0770959
Compare
Choose a tag to compare

The following class definition no longer causes the abstract name checking sniff to crash:

<?php
class Foo
{
}

Minor php cs fix

06 Nov 11:47
0381502
Compare
Choose a tag to compare

Fix for checking for doc comments with child functions:

this should be valid:

function first()
{
    /**
     * @return string
     */
    function second()
    {
        return '2';
    }

    second();
}

phpcs -> v3

23 Aug 09:33
Compare
Choose a tag to compare

This updates phpcs to version 3.0.2. And requires a major version bump as a result.

Initial public release

16 Feb 12:08
Compare
Choose a tag to compare
v1.0.0

Add LICENSE file