PHP Класс gossi\codegen\model\AbstractPhpStruct

Автор: Johannes M. Schmitt ([email protected])
Наследование: extends AbstractModel, implements gossi\codegen\model\NamespaceInterface, implements gossi\codegen\model\DocblockInterface, use trait gossi\codegen\model\parts\QualifiedNameTrait, use trait gossi\codegen\model\parts\DocblockTrait, use trait gossi\codegen\model\parts\LongDescriptionTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $name = null ) Creates a new struct
addRequiredFile ( string $file ) Adds a new required file
addUseStatement ( string $qualifiedName, null | string $alias = null ) Adds a use statement with an optional alias
clearMethods ( ) Clears all methods
clearUseStatements ( ) Clears all use statements
create ( string $name = null ) : static Creates a new struct
declareUse ( string $qualifiedName, null | string $alias = null ) : string Declares a "use $fullClassName" with " as $alias" if $alias is available, and returns its alias (or not qualified classname) to be used in your actual php code.
declareUses ( ) Declares multiple use statements at once.
generateDocblock ( ) Generates a docblock from provided information
getMethod ( string $nameOrMethod ) : PhpMethod Returns a method
getMethodNames ( ) : phootwork\collection\Set Returns all method names
getMethods ( ) : phootwork\collection\Map Returns all methods
getRequiredFiles ( ) : phootwork\collection\Set Returns required files
getUseAlias ( string $qualifiedName ) : string Returns the usable alias for a qualified name
getUseStatements ( ) : phootwork\collection\Map Returns all use statements
hasMethod ( string | PhpMethod $nameOrMethod ) : boolean Checks whether a method exists or not
hasUseStatement ( string $qualifiedName ) : boolean Returns whether the given use statement is present
removeMethod ( string | PhpMethod $nameOrMethod ) Removes a method
removeUseStatement ( string $qualifiedName ) Removes a use statement
setMethod ( PhpMethod $method ) Adds a method
setMethods ( array $methods ) Sets a collection of methods
setRequiredFiles ( array $files ) Sets requried files
setUseStatements ( array $useStatements ) Sets use statements

Описание методов

__construct() публичный Метод

Creates a new struct
public __construct ( string $name = null )
$name string the fqcn

addRequiredFile() публичный Метод

Adds a new required file
public addRequiredFile ( string $file )
$file string

addUseStatement() публичный Метод

Adds a use statement with an optional alias
public addUseStatement ( string $qualifiedName, null | string $alias = null )
$qualifiedName string
$alias null | string

clearMethods() публичный Метод

Clears all methods
public clearMethods ( )

clearUseStatements() публичный Метод

Clears all use statements
public clearUseStatements ( )

create() публичный статический Метод

Creates a new struct
public static create ( string $name = null ) : static
$name string the fqcn
Результат static

declareUse() публичный Метод

If the class has already been declared you get only the set alias.
public declareUse ( string $qualifiedName, null | string $alias = null ) : string
$qualifiedName string
$alias null | string
Результат string the used alias

declareUses() публичный Метод

Declares multiple use statements at once.
public declareUses ( )

generateDocblock() публичный Метод

Generates a docblock from provided information
public generateDocblock ( )

getMethod() публичный Метод

Returns a method
public getMethod ( string $nameOrMethod ) : PhpMethod
$nameOrMethod string the methods name
Результат PhpMethod

getMethodNames() публичный Метод

Returns all method names
public getMethodNames ( ) : phootwork\collection\Set
Результат phootwork\collection\Set

getMethods() публичный Метод

Returns all methods
public getMethods ( ) : phootwork\collection\Map
Результат phootwork\collection\Map collection of methods

getRequiredFiles() публичный Метод

Returns required files
public getRequiredFiles ( ) : phootwork\collection\Set
Результат phootwork\collection\Set collection of filenames

getUseAlias() публичный Метод

Returns the usable alias for a qualified name
public getUseAlias ( string $qualifiedName ) : string
$qualifiedName string
Результат string the alias

getUseStatements() публичный Метод

Returns all use statements
public getUseStatements ( ) : phootwork\collection\Map
Результат phootwork\collection\Map collection of use statements

hasMethod() публичный Метод

Checks whether a method exists or not
public hasMethod ( string | PhpMethod $nameOrMethod ) : boolean
$nameOrMethod string | PhpMethod method name or Method instance
Результат boolean `true` if it exists and `false` if not

hasUseStatement() публичный Метод

Returns whether the given use statement is present
public hasUseStatement ( string $qualifiedName ) : boolean
$qualifiedName string
Результат boolean

removeMethod() публичный Метод

Removes a method
public removeMethod ( string | PhpMethod $nameOrMethod )
$nameOrMethod string | PhpMethod method name or Method instance

removeUseStatement() публичный Метод

Removes a use statement
public removeUseStatement ( string $qualifiedName )
$qualifiedName string

setMethod() публичный Метод

Adds a method
public setMethod ( PhpMethod $method )
$method PhpMethod

setMethods() публичный Метод

Sets a collection of methods
public setMethods ( array $methods )
$methods array

setRequiredFiles() публичный Метод

Sets requried files
public setRequiredFiles ( array $files )
$files array

setUseStatements() публичный Метод

Sets use statements
public setUseStatements ( array $useStatements )
$useStatements array