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
파일 보기 프로젝트 열기: gossi/php-code-generator 1 사용 예제들

공개 메소드들

메소드 설명
__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