PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/Scope/StaticThisUsageStandard.xml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Download Installed Plugin
Download a WordPress plugin as a ZIP archive
Author: By
Last change:
Date: 12 days ago
Size: 644 bytes
 

Contents

Class file image Download
<documentation title="Static This Usage"> <standard> <![CDATA[ Static methods should not use $this. ]]> </standard> <code_comparison> <code title="Valid: Using self:: to access static variables."> <![CDATA[ class Foo { <em>static</em> function bar() { return <em>self</em>::$staticMember; } } ]]> </code> <code title="Invalid: Using $this-> to access static variables."> <![CDATA[ class Foo { <em>static</em> function bar() { return <em>$this</em>->$staticMember; } } ]]> </code> </code_comparison> </documentation>