Documentation

ClassGenerator extends AbstractClassGenerator
in package
Uses UseTrait, PropertiesTrait, AbstractFinalTrait

Class generator class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
4.1.0

Table of Contents

$abstract  : bool
Method abstract flag
$constants  : array<string|int, mixed>
Array of constant generator objects
$docblock  : DocblockGenerator
Docblock generator object
$final  : bool
Method final flag
$indent  : int
Code indent spaces
$interfaces  : array<string|int, mixed>
Interfaces that are implemented
$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 class that is extended
$properties  : array<string|int, mixed>
Array of property generator objects
$uses  : array<string|int, mixed>
Array of namespaces to use
__construct()  : mixed
Constructor
__toString()  : string
Print class
addConstant()  : AbstractClassGenerator
Add a constant
addConstants()  : AbstractClassGenerator
Add constants
addInterface()  : ClassGenerator
Add a class interface
addInterfaces()  : ClassGenerator
Add a class interface
addMethod()  : AbstractClassGenerator
Add a method
addMethods()  : AbstractClassGenerator
Add methods
addProperties()  : PropertiesTrait
Add class properties
addProperty()  : PropertiesTrait
Add a class property
addUse()  : UseTrait
Add a namespace to use
addUses()  : UseTrait
Add namespaces to use
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
getInterfaces()  : array<string|int, mixed>
Get the class interfaces
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 class parent
getProperties()  : array<string|int, mixed>
Get all properties
getProperty()  : PropertyGenerator
Get a class property
getUses()  : array<string|int, mixed>
Get uses
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
hasInterface()  : bool
Has class interface
hasInterfaces()  : bool
Has class interfaces
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
hasProperties()  : bool
Has properties
hasProperty()  : bool
Has a class property
hasUse()  : bool
Has use
hasUses()  : bool
Has uses
isAbstract()  : bool
Get the method abstract flag
isFinal()  : bool
Get the method final flag
isRendered()  : bool
Is rendered (alias to hasOutput())
printIndent()  : string
Print the indent
removeConstant()  : AbstractClassGenerator
Remove a constant
removeInterface()  : ClassGenerator
Remove class interface
removeMethod()  : AbstractClassGenerator
Remove a method
removeProperty()  : PropertiesTrait
Remove a class property
render()  : string
Render class
setAsAbstract()  : AbstractFinalTrait
Set the method abstract flag
setAsFinal()  : AbstractFinalTrait
Set the method final flag
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()  : ClassGenerator
Set the class parent
formatConstants()  : string
Format the constants
formatMethods()  : string
Format the methods
formatProperties()  : string
Format the properties

Properties

$constants

Array of constant generator objects

protected array<string|int, mixed> $constants = []

$interfaces

Interfaces that are implemented

protected array<string|int, mixed> $interfaces = []

$parent

Parent class that is extended

protected string $parent = null

$properties

Array of property generator objects

protected array<string|int, mixed> $properties = []

$uses

Array of namespaces to use

protected array<string|int, mixed> $uses = []

Methods

__construct()

Constructor

public __construct(string $name[, string $parent = null ][, mixed $interface = null ][, bool $abstract = false ]) : mixed

Instantiate the class generator object

Parameters
$name : string
$parent : string = null
$interface : mixed = null
$abstract : bool = false
Return values
mixed

__toString()

Print class

public __toString() : string
Return values
string

addUse()

Add a namespace to use

public addUse(string $use[, string $as = null ]) : UseTrait
Parameters
$use : string
$as : string = null
Return values
UseTrait

addUses()

Add namespaces to use

public addUses(array<string|int, mixed> $uses) : UseTrait
Parameters
$uses : array<string|int, mixed>
Return values
UseTrait

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

getInterfaces()

Get the class interfaces

public getInterfaces() : array<string|int, mixed>
Return values
array<string|int, mixed>

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

getOutput()

Get the output

public getOutput() : string
Return values
string

getParent()

Get the class parent

public getParent() : string
Return values
string

getProperties()

Get all properties

public getProperties() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUses()

Get uses

public getUses() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasConstant()

Has a constant

public hasConstant(mixed $constant) : bool
Parameters
$constant : mixed
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

hasInterface()

Has class interface

public hasInterface(string $interface) : bool
Parameters
$interface : string
Return values
bool

hasInterfaces()

Has class interfaces

public hasInterfaces() : bool
Return values
bool

hasMethod()

Has a method

public hasMethod(mixed $method) : bool
Parameters
$method : mixed
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

hasParent()

Has parent

public hasParent() : bool
Return values
bool

hasProperties()

Has properties

public hasProperties() : bool
Return values
bool

hasProperty()

Has a class property

public hasProperty(mixed $property) : bool
Parameters
$property : mixed
Return values
bool

hasUse()

Has use

public hasUse(string $use) : bool
Parameters
$use : string
Return values
bool

hasUses()

Has uses

public hasUses() : bool
Return values
bool

isAbstract()

Get the method abstract flag

public isAbstract() : bool
Return values
bool

isFinal()

Get the method final flag

public isFinal() : 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

render()

Render class

public render() : string
Return values
string

formatConstants()

Format the constants

protected formatConstants() : string
Return values
string

formatMethods()

Format the methods

protected formatMethods() : string
Return values
string

formatProperties()

Format the properties

protected formatProperties() : string
Return values
string

Search results