addTrait()
addTraitAlias()
addTraitOverride()
addTraits()
addUse()
getTraitAliases()
getTraitOverrides()
getTraits()
getUses()
hasTrait()
removeTrait()
removeTraitOverride()
addTrait(mixed $trait) : \Zend\Code\Generator\self
Array Format: key: traitName value: String
key: aliases value: array of arrays key: method value: @see addTraitAlias key: alias value: @see addTraitAlias key: visibility value: @see addTraitAlias
key: insteadof value: array of arrays key: method value: @see self::addTraitOverride key: traitToReplace value: @see self::addTraitOverride
mixedString | Array
\Zend\Code\Generator\selfaddTraitAlias(mixed $method, string $alias, $visibility)
This will be used to generate the AS portion of the use statement.
$method: This method provides 2 ways for defining the trait method. Option 1: String Option 2: Array key: traitName value: name of trait key: method value: trait method
$alias: Alias is a string representing the new method name.
$visibilty: ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PRIVATE| ReflectionMethod::IS_PROTECTED
mixedString or Array
string
addTraitOverride(mixed $method, $traitsToReplace)
This will be used to generate the INSTEADOF portion of the use statement.
$method:
This method provides 2 ways for defining the trait method.
Option 1: String Format:
$traitToReplace: The name of the trait that you wish to supersede.
This method provides 2 ways for defining the trait method. Option 1: String of trait to replace Option 2: Array of strings of traits to replace
mixed
addTraits(array $traits) : \Zend\Code\Generator\self
Trait can be an array of trait names or array of trait configurations
\Zend\Code\Generator\selfaddUse(string $use, string | null $useAlias) : \Zend\Code\Generator\self
string
stringnull
\Zend\Code\Generator\selfgetTraitAliases() : array
arraygetTraitOverrides() : array
arraygetTraits() : array
arraygetUses() : array
arrayhasTrait(\Zend\Code\Generator\strint $traitName) : bool
\Zend\Code\Generator\strint
boolremoveTrait($traitName)
removeTraitOverride($method, null $overridesToRemove) : \Zend\Code\Generator\$this
$method:
This method provides 2 ways for defining the trait method.
Option 1: String Format:
$overridesToRemove: The name of the trait that you wish to remove.
This method provides 2 ways for defining the trait method. Option 1: String of trait to replace Option 2: Array of strings of traits to replace
null
\Zend\Code\Generator\$this