\Pvra\AnalysersPhp53Features

Class Php53Features

Used for the detection of the following elements:

  • goto and Jump constructs
  • Namespace related features
  • NowDoc definitions
  • Definitions of PHP 5.3+ magic methods and their explicit usage
  • DIR constant
  • Short ternary
  • Closure definition using function() {} syntax
  • Late state binding

Summary

Methods
Properties
Constants
__construct()
setOwningAnalyser()
getOwningAnalyser()
enterNode()
leaveNode()
No public properties found
No constants found
getResult()
No protected properties found
N/A
detectGotoKeywordAndJumpLabel()
detectNamespaces()
detectNowDoc()
detectNewMagicDefinitions()
detectDocFormatConstantInitializationAndConstOutsideClass()
detectShortHandTernary()
detectClosures()
detectDynamicAccessToStatic()
detectLateStateBinding()
$requirementAnalyser
$inClass
$importedNames
N/A

Properties

$requirementAnalyser

$requirementAnalyser : \Pvra\Analyser

The `Analyser` representing the currently running operation.

Type

\Pvra\Analyser

$inClass

$inClass : boolean

Stores the current in class state of this NodeVisitor.

This is required to detect the usage of doc-syntax usaged within class constant definitions.

Type

boolean

$importedNames

$importedNames : 

Type

Methods

__construct()

__construct(\Pvra\Analyser  $requirementAnalyser = null) 

Create an instance of the child Analyser

It is optional to set the related analyser during instance creation. When using this class in the context of an Analyser it will always be ensured that this Analyser will be known to the instance before any node is traversed.

Parameters

\Pvra\Analyser $requirementAnalyser

setOwningAnalyser()

setOwningAnalyser(\Pvra\Analyser  $requirementAnalyser) 

Parameters

\Pvra\Analyser $requirementAnalyser

getOwningAnalyser()

getOwningAnalyser() 

enterNode()

enterNode(\PhpParser\Node  $node) : null|\PhpParser\Node

Called when entering a source node

This method is called when a source node is entered. Contained logic determines the presence of specific syntactical features.

Parameters

\PhpParser\Node $node

Returns

null|\PhpParser\Node —

The nodes should not be modified as other walkers might depend on it.

leaveNode()

leaveNode(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

getResult()

getResult() : \Pvra\AnalysisResult

Get the instance of the currently used `Pvra\AnalysisResult`.

Returns

\Pvra\AnalysisResult

detectGotoKeywordAndJumpLabel()

detectGotoKeywordAndJumpLabel(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

detectNamespaces()

detectNamespaces(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

detectNowDoc()

detectNowDoc(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

detectNewMagicDefinitions()

detectNewMagicDefinitions(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

detectDocFormatConstantInitializationAndConstOutsideClass()

detectDocFormatConstantInitializationAndConstOutsideClass(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

detectShortHandTernary()

detectShortHandTernary(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

detectClosures()

detectClosures(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

detectDynamicAccessToStatic()

detectDynamicAccessToStatic(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

detectLateStateBinding()

detectLateStateBinding(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node