PHP 클래스 PHPMD\Rule\UnusedPrivateField

저자: Manuel Pichler ([email protected])
상속: extends PHPMD\AbstractRule, implements ClassAware
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 메소드들

메소드 설명
apply ( PHPMD\AbstractNode $node ) : void This method checks that all private class properties are at least accessed by one method.

보호된 메소드들

메소드 설명
isInScopeOfClass ( PHPMD\Node\ClassNode $class, PHPMD\Node\ASTNode $postfix ) : boolean This method checks that the given property postfix is accessed on an instance or static reference to the given class.
isValidPropertyNode ( PHPMD\Node\ASTNode $node = null ) : boolean Checks if the given node is a valid property node.

비공개 메소드들

메소드 설명
collectPrivateField ( PHPMD\Node\ASTNode $declaration ) : void This method extracts all variable declarators from the given field declaration and stores them in the $_fields property.
collectPrivateFields ( PHPMD\Node\ClassNode $class ) : void This method collects all private fields in the given class and stores them in the $_fields property.
collectUnusedPrivateFields ( PHPMD\Node\ClassNode $class ) : PHPMD\AbstractNode[] This method collects all private fields that aren't used by any class method.
removeUsedField ( PHPMD\Node\ASTNode $postfix ) : void This method removes the field from the $_fields property that is accessed through the given property postfix node.
removeUsedFields ( PHPMD\Node\ClassNode $class ) : void This method extracts all property postfix nodes from the given class and removes all fields from the $_fields property that are accessed by one of the postfix nodes.

메소드 상세

apply() 공개 메소드

This method checks that all private class properties are at least accessed by one method.
public apply ( PHPMD\AbstractNode $node ) : void
$node PHPMD\AbstractNode
리턴 void

isInScopeOfClass() 보호된 메소드

This method checks that the given property postfix is accessed on an instance or static reference to the given class.
protected isInScopeOfClass ( PHPMD\Node\ClassNode $class, PHPMD\Node\ASTNode $postfix ) : boolean
$class PHPMD\Node\ClassNode
$postfix PHPMD\Node\ASTNode
리턴 boolean

isValidPropertyNode() 보호된 메소드

Checks if the given node is a valid property node.
부터: 0.2.6
protected isValidPropertyNode ( PHPMD\Node\ASTNode $node = null ) : boolean
$node PHPMD\Node\ASTNode
리턴 boolean