PHP Класс Pop\Code\Generator

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$allowed array Array of allowed file types.
$body string Code body
$close boolean Flag to close the code file with ?>
$code Pop\Code\Generator\ClassGenerator | Pop\Code\Generator\InterfaceGenerator Code object
$docblock Pop\Code\Generator\DocblockGenerator Docblock generator object
$indent string Code indent
$namespace Pop\Code\Generator\NamespaceGenerator Namespace generator object

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

Метод Описание
__construct ( string $file, integer $type = Generator::CREATE_NONE ) : Generator Constructor
appendToBody ( string $body, boolean $newline = true ) : Generator Append to the code body
code ( ) : ClassGenerator | InterfaceGenerator Access the code generator object
createClass ( ) : Generator Create a class generator object
createInterface ( ) : Generator Create a class generator object
getBody ( ) : string Get the method body
getDocblock ( ) : DocblockGenerator Access the docblock generator object
getIndent ( ) : string Get the code indent
getNamespace ( ) : NamespaceGenerator Access the namespace generator object
output ( boolean $download = false ) : Generator Output the code object directly.
render ( boolean $ret = false ) : mixed Render method
save ( string $to = null, boolean $append = false ) : void Save the code object to disk.
setBody ( string $body, boolean $newline = true ) : Generator Set the code body
setClose ( boolean $close = false ) : Generator Set the code close flag
setDocblock ( DocblockGenerator $docblock ) : Generator Set the docblock generator object
setIndent ( string $indent = null ) : Generator Set the code indent
setNamespace ( NamespaceGenerator $namespace ) : Generator Set the namespace generator object

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

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

Instantiate the code generator object
public __construct ( string $file, integer $type = Generator::CREATE_NONE ) : Generator
$file string
$type integer
Результат Generator

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

Append to the code body
public appendToBody ( string $body, boolean $newline = true ) : Generator
$body string
$newline boolean
Результат Generator

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

Access the code generator object
public code ( ) : ClassGenerator | InterfaceGenerator
Результат Pop\Code\Generator\ClassGenerator | Pop\Code\Generator\InterfaceGenerator

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

Create a class generator object
public createClass ( ) : Generator
Результат Generator

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

Create a class generator object
public createInterface ( ) : Generator
Результат Generator

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

Get the method body
public getBody ( ) : string
Результат string

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

Access the docblock generator object
public getDocblock ( ) : DocblockGenerator
Результат Pop\Code\Generator\DocblockGenerator

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

Get the code indent
public getIndent ( ) : string
Результат string

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

Access the namespace generator object
public getNamespace ( ) : NamespaceGenerator
Результат Pop\Code\Generator\NamespaceGenerator

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

Output the code object directly.
public output ( boolean $download = false ) : Generator
$download boolean
Результат Generator

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

Render method
public render ( boolean $ret = false ) : mixed
$ret boolean
Результат mixed

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

Save the code object to disk.
public save ( string $to = null, boolean $append = false ) : void
$to string
$append boolean
Результат void

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

Set the code body
public setBody ( string $body, boolean $newline = true ) : Generator
$body string
$newline boolean
Результат Generator

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

Set the code close flag
public setClose ( boolean $close = false ) : Generator
$close boolean
Результат Generator

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

Set the docblock generator object
public setDocblock ( DocblockGenerator $docblock ) : Generator
$docblock Pop\Code\Generator\DocblockGenerator
Результат Generator

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

Set the code indent
public setIndent ( string $indent = null ) : Generator
$indent string
Результат Generator

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

Set the namespace generator object
public setNamespace ( NamespaceGenerator $namespace ) : Generator
$namespace Pop\Code\Generator\NamespaceGenerator
Результат Generator

Описание свойств

$allowed защищенное свойство

Array of allowed file types.
protected array $allowed
Результат array

$body защищенное свойство

Code body
protected string $body
Результат string

$close защищенное свойство

Flag to close the code file with ?>
protected bool $close
Результат boolean

$code защищенное свойство

Code object
protected ClassGenerator,Pop\Code\Generator|InterfaceGenerator,Pop\Code\Generator $code
Результат Pop\Code\Generator\ClassGenerator | Pop\Code\Generator\InterfaceGenerator

$docblock защищенное свойство

Docblock generator object
protected DocblockGenerator,Pop\Code\Generator $docblock
Результат Pop\Code\Generator\DocblockGenerator

$indent защищенное свойство

Code indent
protected string $indent
Результат string

$namespace защищенное свойство

Namespace generator object
protected NamespaceGenerator,Pop\Code\Generator $namespace
Результат Pop\Code\Generator\NamespaceGenerator