InterfaceGenerator
extends AbstractClassGenerator
in package
Interface generator class
Tags
Table of Contents
- $constants : array<string|int, mixed>
- Array of constant generator objects
- $docblock : DocblockGenerator
- Docblock generator object
- $indent : int
- Code indent spaces
- $methods : array<string|int, mixed>
- Array of method generator objects
- $name : string
- Name
- $namespace : NamespaceGenerator
- Namespace generator object
- $output : string
- Output string
- $parent : string
- Parent interfaces that are extended
- __construct() : mixed
- Constructor
- __toString() : string
- Print interface
- addConstant() : AbstractClassGenerator
- Add a constant
- addConstants() : AbstractClassGenerator
- Add constants
- addMethod() : AbstractClassGenerator
- Add a method
- addMethods() : AbstractClassGenerator
- Add methods
- getConstant() : ConstantGenerator
- Get a constant
- getConstants() : array<string|int, mixed>
- Get all constants
- getDesc() : string
- Get the docblock description
- getDocblock() : DocblockGenerator
- Access the docblock generator object
- getIndent() : int
- Get the indent
- getMethod() : MethodGenerator
- Get a method
- getMethods() : array<string|int, mixed>
- Get all methods
- getName() : string
- Get the name
- getNamespace() : NamespaceGenerator
- Access the namespace generator object
- getOutput() : string
- Get the output
- getParent() : string
- Get the interface parent
- hasConstant() : bool
- Has a constant
- hasConstants() : bool
- Has constants
- hasDesc() : bool
- Has a docblock description
- hasDocblock() : bool
- Has docblock generator object
- hasIndent() : bool
- Has indent
- hasMethod() : bool
- Has a method
- hasMethods() : bool
- Has methods
- hasName() : bool
- Get the name
- hasNamespace() : bool
- Has a namespace generator object
- hasOutput() : bool
- Has output
- hasParent() : bool
- Has parent
- isRendered() : bool
- Is rendered (alias to hasOutput())
- printIndent() : string
- Print the indent
- removeConstant() : AbstractClassGenerator
- Remove a constant
- removeMethod() : AbstractClassGenerator
- Remove a method
- render() : string
- Render interface
- setDesc() : DocblockTrait
- Set the docblock description
- setDocblock() : DocblockTrait
- Set the docblock generator object
- setIndent() : AbstractGenerator
- Set the indent
- setName() : NameTrait
- Set the name
- setNamespace() : NamespaceTrait
- Set the namespace generator object
- setParent() : InterfaceGenerator
- Set the interface parent
- formatConstants() : string
- Format the constants
- formatMethods() : string
- Format the methods
Properties
$constants
Array of constant generator objects
protected
array<string|int, mixed>
$constants
= []
$docblock
Docblock generator object
protected
DocblockGenerator
$docblock
= null
$indent
Code indent spaces
protected
int
$indent
= 4
$methods
Array of method generator objects
protected
array<string|int, mixed>
$methods
= []
$name
Name
protected
string
$name
= null
$namespace
Namespace generator object
protected
NamespaceGenerator
$namespace
= null
$output
Output string
protected
string
$output
= null
$parent
Parent interfaces that are extended
protected
string
$parent
= null
Methods
__construct()
Constructor
public
__construct(string $name[, string $parent = null ]) : mixed
Instantiate the interface generator object
Parameters
- $name : string
- $parent : string = null
Return values
mixed —__toString()
Print interface
public
__toString() : string
Return values
string —addConstant()
Add a constant
public
addConstant(ConstantGenerator $constant) : AbstractClassGenerator
Parameters
- $constant : ConstantGenerator
Return values
AbstractClassGenerator —addConstants()
Add constants
public
addConstants(array<string|int, mixed> $constants) : AbstractClassGenerator
Parameters
- $constants : array<string|int, mixed>
Return values
AbstractClassGenerator —addMethod()
Add a method
public
addMethod(MethodGenerator $method) : AbstractClassGenerator
Parameters
- $method : MethodGenerator
Return values
AbstractClassGenerator —addMethods()
Add methods
public
addMethods(array<string|int, mixed> $methods) : AbstractClassGenerator
Parameters
- $methods : array<string|int, mixed>
Return values
AbstractClassGenerator —getConstant()
Get a constant
public
getConstant(mixed $constant) : ConstantGenerator
Parameters
- $constant : mixed
Return values
ConstantGenerator —getConstants()
Get all constants
public
getConstants() : array<string|int, mixed>
Return values
array<string|int, mixed> —getDesc()
Get the docblock description
public
getDesc() : string
Return values
string —getDocblock()
Access the docblock generator object
public
getDocblock() : DocblockGenerator
Return values
DocblockGenerator —getIndent()
Get the indent
public
getIndent() : int
Return values
int —getMethod()
Get a method
public
getMethod(mixed $method) : MethodGenerator
Parameters
- $method : mixed
Return values
MethodGenerator —getMethods()
Get all methods
public
getMethods() : array<string|int, mixed>
Return values
array<string|int, mixed> —getName()
Get the name
public
getName() : string
Return values
string —getNamespace()
Access the namespace generator object
public
getNamespace() : NamespaceGenerator
Return values
NamespaceGenerator —getOutput()
Get the output
public
getOutput() : string
Return values
string —getParent()
Get the interface parent
public
getParent() : string
Return values
string —hasConstant()
Has a constant
public
hasConstant(mixed $constant) : bool
Parameters
- $constant : mixed
Return values
bool —hasConstants()
Has constants
public
hasConstants() : bool
Return values
bool —hasDesc()
Has a docblock description
public
hasDesc() : bool
Return values
bool —hasDocblock()
Has docblock generator object
public
hasDocblock() : bool
Return values
bool —hasIndent()
Has indent
public
hasIndent() : bool
Return values
bool —hasMethod()
Has a method
public
hasMethod(mixed $method) : bool
Parameters
- $method : mixed
Return values
bool —hasMethods()
Has methods
public
hasMethods() : bool
Return values
bool —hasName()
Get the name
public
hasName() : bool
Return values
bool —hasNamespace()
Has a namespace generator object
public
hasNamespace() : bool
Return values
bool —hasOutput()
Has output
public
hasOutput() : bool
Return values
bool —hasParent()
Has parent
public
hasParent() : bool
Return values
bool —isRendered()
Is rendered (alias to hasOutput())
public
isRendered() : bool
Return values
bool —printIndent()
Print the indent
public
printIndent() : string
Return values
string —removeConstant()
Remove a constant
public
removeConstant(mixed $constant) : AbstractClassGenerator
Parameters
- $constant : mixed
Return values
AbstractClassGenerator —removeMethod()
Remove a method
public
removeMethod(mixed $method) : AbstractClassGenerator
Parameters
- $method : mixed
Return values
AbstractClassGenerator —render()
Render interface
public
render() : string
Return values
string —setDesc()
Set the docblock description
public
setDesc([string $desc = null ]) : DocblockTrait
Parameters
- $desc : string = null
Return values
DocblockTrait —setDocblock()
Set the docblock generator object
public
setDocblock(DocblockGenerator $docblock) : DocblockTrait
Parameters
- $docblock : DocblockGenerator
Return values
DocblockTrait —setIndent()
Set the indent
public
setIndent(string $indent) : AbstractGenerator
Parameters
- $indent : string
Return values
AbstractGenerator —setName()
Set the name
public
setName(string $name) : NameTrait
Parameters
- $name : string
Return values
NameTrait —setNamespace()
Set the namespace generator object
public
setNamespace(NamespaceGenerator $namespace) : NamespaceTrait
Parameters
- $namespace : NamespaceGenerator
Return values
NamespaceTrait —setParent()
Set the interface parent
public
setParent([string $parent = null ]) : InterfaceGenerator
Parameters
- $parent : string = null
Return values
InterfaceGenerator —formatConstants()
Format the constants
protected
formatConstants() : string
Return values
string —formatMethods()
Format the methods
protected
formatMethods() : string