Skip to content
On this page

BlockComment

Verifies that block comments are used appropriately.

Scope

Squiz.Commenting.BlockComment

Usage

xml
<rule ref="Squiz.Commenting.BlockComment"></rule>

Examples

Example 1

Valid: Lowercase self used.

php
self::foo();

Invalid: Uppercase self used.

php
SELF::foo();

Example 2

Valid: Correct spacing used.

php
self::foo();

Invalid: Incorrect spacing used.

php
self :: foo();

Example 3

Valid: Self used as reference.

php
class Foo
{
    public static function bar()
    {
    }

    public static function baz()
    {
        self::bar();
    }
}

Invalid: Local class name used as reference.

php
class Foo
{
    public static function bar()
    {
    }

    public static function baz()
    {
        Foo::bar();
    }
}

Released under the MIT License.