mediatekformation

FileGenerator extends AbstractGenerator
in package

Table of Contents

LINE_FEED  = "\n"
Line feed to use in place of EOL
$body  : string
$classes  : array<string|int, mixed>
$declares  : array<string|int, DeclareStatement>
$docBlock  : DocBlockGenerator
$filename  : string
$indentation  : int|string
$isSourceDirty  : bool
$namespace  : string
$requiredFiles  : array<string|int, mixed>
$sourceContent  : string
$uses  : array<string|int, mixed>
__construct()  : mixed
Passes $options to {@link setOptions()}.
fromArray()  : FileGenerator
fromReflectedFileName()  : FileGenerator
Use this if you intend on generating code generation objects based on the same file.
fromReflection()  : FileGenerator
generate()  : string
getBody()  : string
getClass()  : ClassGenerator
getClasses()  : array<string|int, ClassGenerator>
getDocBlock()  : DocBlockGenerator
getFilename()  : string
getIndentation()  : string
getNamespace()  : string
getRequiredFiles()  : array<string|int, mixed>
getSourceContent()  : string
getUses()  : array<string|int, mixed>
Returns an array with the first element the use statement, second is the as part.
isSourceDirty()  : bool
setBody()  : FileGenerator
setClass()  : FileGenerator
setClasses()  : FileGenerator
setDeclares()  : mixed
setDocBlock()  : FileGenerator
setFilename()  : FileGenerator
setIndentation()  : AbstractGenerator
setNamespace()  : FileGenerator
setOptions()  : AbstractGenerator
setRequiredFiles()  : FileGenerator
setSourceContent()  : AbstractGenerator
setSourceDirty()  : AbstractGenerator
setUse()  : FileGenerator
setUses()  : FileGenerator
write()  : FileGenerator

Constants

Properties

$requiredFiles

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

Methods

__construct()

Passes $options to {@link setOptions()}.

public __construct([array<string|int, mixed>|Traversable $options = null ]) : mixed
Parameters
$options : array<string|int, mixed>|Traversable = null
Return values
mixed

fromReflectedFileName()

Use this if you intend on generating code generation objects based on the same file.

public static fromReflectedFileName(string $filePath[, bool $includeIfNotAlreadyIncluded = true ]) : FileGenerator

This will keep previous changes to the file in tact during the same PHP process

Parameters
$filePath : string
$includeIfNotAlreadyIncluded : bool = true
Tags
throws
InvalidArgumentException

If file does not exists

throws
RuntimeException

If file exists but is not included or required

Return values
FileGenerator

generate()

public generate() : string
Return values
string

getBody()

public getBody() : string
Return values
string

getFilename()

public getFilename() : string
Return values
string

getNamespace()

public getNamespace() : string
Return values
string

getRequiredFiles()

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

getSourceContent()

public getSourceContent() : string
Return values
string

getUses()

Returns an array with the first element the use statement, second is the as part.

public getUses([bool $withResolvedAs = false ]) : array<string|int, mixed>

If $withResolvedAs is set to true, there will be a third element that is the "resolved" as statement, as the second part is not required in use statements

Parameters
$withResolvedAs : bool = false
Return values
array<string|int, mixed>

isSourceDirty()

public isSourceDirty() : bool
Return values
bool

setDeclares()

public setDeclares(array<string|int, mixed> $declares) : mixed
Parameters
$declares : array<string|int, mixed>
Return values
mixed

Search results