PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml

Recommend this page to a friend!
  Classes of milenmk   Simple PHP Password Manager   vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Simple PHP Password Manager
Application to store and retrieve user password
Author: By
Last change:
Date: 1 year ago
Size: 1,338 bytes
 

Contents

Class file image Download
<documentation title="Self Member Reference"> <standard> <![CDATA[ The self keyword should be used instead of the current class name, should be lowercase, and should not have spaces before or after it. ]]> </standard> <code_comparison> <code title="Valid: Lowercase self used."> <![CDATA[ <em>self</em>::foo(); ]]> </code> <code title="Invalid: Uppercase self used."> <![CDATA[ <em>SELF</em>::foo(); ]]> </code> </code_comparison> <code_comparison> <code title="Valid: Correct spacing used."> <![CDATA[ self<em></em>::<em></em>foo(); ]]> </code> <code title="Invalid: Incorrect spacing used."> <![CDATA[ self<em> </em>::<em> </em>foo(); ]]> </code> </code_comparison> <code_comparison> <code title="Valid: Self used as reference."> <![CDATA[ class Foo { public static function bar() { } public static function baz() { <em>self</em>::bar(); } } ]]> </code> <code title="Invalid: Local class name used as reference."> <![CDATA[ class <em>Foo</em> { public static function bar() { } public static function baz() { <em>Foo</em>::bar(); } } ]]> </code> </code_comparison> </documentation>