PHP Class PHPSA\Definition\ClassDefinition

Inheritance: extends ParentDefinition
Afficher le fichier Open project: ovr/phpsa Class Usage Examples

Protected Properties

Свойство Type Description
$constants PhpParser\Node\Stmt\Const_[] Class constants
$extendsClass string | null
$extendsClassDefinition ClassDefinition | null
$filepath string
$interfaces array
$methods ClassMethod[] Class methods
$properties PhpParser\Node\Stmt\PropertyProperty[] Class properties
$propertyStatements PhpParser\Node\Stmt\Property[] Property Statements
$statement PhpParser\Node\Stmt\Class_ | null
$type integer

Méthodes publiques

Méthode Description
__construct ( string $name, Class_ $statement = null, integer $type )
addConst ( ClassConst $const )
addInterface ( string $interface )
addMethod ( ClassMethod $classMethod, boolean $overwrite = true ) : boolean
addProperty ( Property $property )
compile ( Context $context )
getExtendsClass ( ) : null | string
getExtendsClassDefinition ( ) : null | ClassDefinition
getFilepath ( ) : string
getMethod ( $name, boolean | false $inherit = false ) : ClassMethod | null
getProperty ( string $name, boolean $inherit = false ) : PhpParser\Node\Stmt\PropertyProperty
getPropertyStatement ( string $name, boolean $inherit = false ) : Property
hasConst ( string $name, boolean $inherit = false ) : boolean
hasMethod ( string $name, boolean | false $inherit = false ) : boolean
hasProperty ( $name, boolean $inherit = false ) : boolean
isAbstract ( ) : boolean
isFinal ( ) : boolean
mergeTrait ( TraitDefinition $definition, array $adaptations )
setExtendsClass ( null | string $extendsClass )
setExtendsClassDefinition ( ClassDefinition $extendsClassDefinition )
setFilepath ( string $filepath )

Method Details

__construct() public méthode

public __construct ( string $name, Class_ $statement = null, integer $type )
$name string
$statement PhpParser\Node\Stmt\Class_
$type integer

addConst() public méthode

public addConst ( ClassConst $const )
$const PhpParser\Node\Stmt\ClassConst

addInterface() public méthode

public addInterface ( string $interface )
$interface string

addMethod() public méthode

public addMethod ( ClassMethod $classMethod, boolean $overwrite = true ) : boolean
$classMethod ClassMethod
$overwrite boolean Should we overwrite method if it already exists
Résultat boolean Did we overwrite method?

addProperty() public méthode

public addProperty ( Property $property )
$property PhpParser\Node\Stmt\Property

compile() public méthode

public compile ( Context $context )
$context PHPSA\Context

getExtendsClass() public méthode

public getExtendsClass ( ) : null | string
Résultat null | string

getExtendsClassDefinition() public méthode

public getExtendsClassDefinition ( ) : null | ClassDefinition
Résultat null | ClassDefinition

getFilepath() public méthode

public getFilepath ( ) : string
Résultat string

getMethod() public méthode

public getMethod ( $name, boolean | false $inherit = false ) : ClassMethod | null
$name
$inherit boolean | false
Résultat ClassMethod | null

getProperty() public méthode

public getProperty ( string $name, boolean $inherit = false ) : PhpParser\Node\Stmt\PropertyProperty
$name string
$inherit boolean
Résultat PhpParser\Node\Stmt\PropertyProperty

getPropertyStatement() public méthode

public getPropertyStatement ( string $name, boolean $inherit = false ) : Property
$name string
$inherit boolean
Résultat PhpParser\Node\Stmt\Property

hasConst() public méthode

public hasConst ( string $name, boolean $inherit = false ) : boolean
$name string
$inherit boolean
Résultat boolean

hasMethod() public méthode

public hasMethod ( string $name, boolean | false $inherit = false ) : boolean
$name string
$inherit boolean | false
Résultat boolean

hasProperty() public méthode

public hasProperty ( $name, boolean $inherit = false ) : boolean
$name
$inherit boolean
Résultat boolean

isAbstract() public méthode

public isAbstract ( ) : boolean
Résultat boolean

isFinal() public méthode

public isFinal ( ) : boolean
Résultat boolean

mergeTrait() public méthode

public mergeTrait ( TraitDefinition $definition, array $adaptations )
$definition TraitDefinition
$adaptations array

setExtendsClass() public méthode

public setExtendsClass ( null | string $extendsClass )
$extendsClass null | string

setExtendsClassDefinition() public méthode

public setExtendsClassDefinition ( ClassDefinition $extendsClassDefinition )
$extendsClassDefinition ClassDefinition

setFilepath() public méthode

public setFilepath ( string $filepath )
$filepath string

Property Details

$constants protected_oe property

Class constants
protected Const_[],PhpParser\Node\Stmt $constants
Résultat PhpParser\Node\Stmt\Const_[]

$extendsClass protected_oe property

protected string|null $extendsClass
Résultat string | null

$extendsClassDefinition protected_oe property

protected ClassDefinition,PHPSA\Definition|null $extendsClassDefinition
Résultat ClassDefinition | null

$filepath protected_oe property

protected string $filepath
Résultat string

$interfaces protected_oe property

protected array $interfaces
Résultat array

$methods protected_oe property

Class methods
protected ClassMethod[],PHPSA\Definition $methods
Résultat ClassMethod[]

$properties protected_oe property

Class properties
protected PropertyProperty[],PhpParser\Node\Stmt $properties
Résultat PhpParser\Node\Stmt\PropertyProperty[]

$propertyStatements protected_oe property

Property Statements
protected Property[],PhpParser\Node\Stmt $propertyStatements
Résultat PhpParser\Node\Stmt\Property[]

$statement protected_oe property

protected Class_,PhpParser\Node\Stmt|null $statement
Résultat PhpParser\Node\Stmt\Class_ | null

$type protected_oe property

protected int $type
Résultat integer