MagicMethodCasingFixer
extends AbstractFixer
in package
FinalYes
Table of Contents
Properties
- $magicNames : array<string, string>
Methods
- getDefinition() : FixerDefinitionInterface
- isCandidate() : bool
- applyFix() : void
- getMagicMethodNameInCorrectCasing() : string
- isFunctionSignature() : bool
- isMagicMethodName() : bool
- isMethodCall() : bool
- isStaticMethodCall() : bool
- setTokenToCorrectCasing() : void
Properties
$magicNames
private
static array<string, string>
$magicNames
= ['__call' => '__call', '__callstatic' => '__callStatic', '__clone' => '__clone', '__construct' => '__construct', '__debuginfo' => '__debugInfo', '__destruct' => '__destruct', '__get' => '__get', '__invoke' => '__invoke', '__isset' => '__isset', '__serialize' => '__serialize', '__set' => '__set', '__set_state' => '__set_state', '__sleep' => '__sleep', '__tostring' => '__toString', '__unserialize' => '__unserialize', '__unset' => '__unset', '__wakeup' => '__wakeup']
Methods
getDefinition()
public
getDefinition() : FixerDefinitionInterface
Return values
FixerDefinitionInterfaceisCandidate()
public
isCandidate(Tokens $tokens) : bool
Parameters
- $tokens : Tokens
Return values
boolapplyFix()
protected
applyFix(SplFileInfo $file, Tokens $tokens) : void
Parameters
- $file : SplFileInfo
- $tokens : Tokens
getMagicMethodNameInCorrectCasing()
private
getMagicMethodNameInCorrectCasing(string $name) : string
Parameters
- $name : string
-
name of a magic method
Return values
stringisFunctionSignature()
private
isFunctionSignature(Tokens $tokens, int $index) : bool
Parameters
- $tokens : Tokens
- $index : int
Return values
boolisMagicMethodName()
private
isMagicMethodName(string $name) : bool
Parameters
- $name : string
Return values
boolisMethodCall()
private
isMethodCall(Tokens $tokens, int $index) : bool
Parameters
- $tokens : Tokens
- $index : int
Return values
boolisStaticMethodCall()
private
isStaticMethodCall(Tokens $tokens, int $index) : bool
Parameters
- $tokens : Tokens
- $index : int
Return values
boolsetTokenToCorrectCasing()
private
setTokenToCorrectCasing(Tokens $tokens, int $index, string $nameInCorrectCasing) : void
Parameters
- $tokens : Tokens
- $index : int
- $nameInCorrectCasing : string