PHP Interface gossi\codegen\model\TraitsInterface

Author: Thomas Gossmann
Afficher le fichier Open project: gossi/php-code-generator Interface Usage Examples

Méthodes publiques

Méthode Description
addTrait ( PhpTrait | string $trait ) Adds a trait.
getTraits ( ) : string[] Returns a collection of traits
hasTrait ( PhpTrait | string $trait ) : boolean Checks whether a trait exists
removeTrait ( PhpTrait | string $trait ) Removes a trait.
setTraits ( array $traits ) Sets a collection of traits

Method Details

addTrait() public méthode

If the trait is passed as PhpTrait object, the trait is also added as use statement.
public addTrait ( PhpTrait | string $trait )
$trait PhpTrait | string trait or qualified name

getTraits() public méthode

Returns a collection of traits
public getTraits ( ) : string[]
Résultat string[]

hasTrait() public méthode

Checks whether a trait exists
public hasTrait ( PhpTrait | string $trait ) : boolean
$trait PhpTrait | string
Résultat boolean `true` if it exists and `false` if not

removeTrait() public méthode

If the trait is passed as PhpTrait object, the trait is also removed from use statements.
public removeTrait ( PhpTrait | string $trait )
$trait PhpTrait | string trait or qualified name

setTraits() public méthode

Sets a collection of traits
public setTraits ( array $traits )
$traits array