Skip to content
On this page

ClosingDeclarationComment

Checks the //end ... comments on classes, interfaces and functions.

Scope

Squiz.Commenting.ClosingDeclarationComment

Usage

xml
<rule ref="Squiz.Commenting.ClosingDeclarationComment"></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.