class CodeFileGeneratorConfig extends CodeGeneratorConfig

Configuration for code file generation

Methods

__construct(array $options = array())

Creates a new configuration for code generator

bool
getGenerateDocblock()

Returns whether docblocks should be generated

$this
setGenerateDocblock(bool $generate)

Sets whether docblocks should be generated

bool
getGenerateEmptyDocblock()

Returns whether empty docblocks are generated

$this
setGenerateEmptyDocblock(bool $generate)

Sets whether empty docblocks are generated

bool
getGenerateScalarTypeHints()

Returns whether scalar type hints will be generated for method parameters (PHP 7)

bool
isSortingEnabled()

Returns whether sorting is enabled

string|bool|Comparator|Closure
getUseStatementSorting()

Returns the use statement sorting

string|bool|Comparator|Closure
getConstantSorting()

Returns the constant sorting

string|bool|Comparator|Closure
getPropertySorting()

Returns the property sorting

string|bool|Comparator|Closure
getMethodSorting()

Returns the method sorting

$this
setGenerateScalarTypeHints(bool $generate)

Sets whether scalar type hints will be generated for method parameters (PHP 7)

bool
getGenerateReturnTypeHints()

Returns whether return type hints will be generated for method parameters (PHP 7)

$this
setGenerateReturnTypeHints(bool $generate)

Sets whether return type hints will be generated for method parameters (PHP 7)

$this
setSortingEnabled($enabled)

Returns whether sorting is enabled

$this
setUseStatementSorting($sorting)

Returns the use statement sorting

$this
setConstantSorting($sorting)

Returns the constant sorting

$this
setPropertySorting($sorting)

Returns the property sorting

$this
setMethodSorting($sorting)

Returns the method sorting

string
getHeaderComment()

Returns the file header comment

$this
setHeaderComment(string $comment)

Sets the file header comment

Docblock
getHeaderDocblock()

Returns the file header docblock

$this
setHeaderDocblock(Docblock $docblock)

Sets the file header docblock

bool
getBlankLineAtEnd()

Returns whether a blank line should be generated at the end of the file

$this
setBlankLineAtEnd(bool $show)

Sets whether a blank line should be generated at the end of the file

bool
getDeclareStrictTypes()

Returns whether a declare(strict_types=1); statement should be printed below the header comments (PHP 7)

$this
setDeclareStrictTypes(bool $strict)

Sets whether a declare(strict_types=1); statement should be printed below the header comments (PHP 7)

Details

in CodeGeneratorConfig at line line 24
__construct(array $options = array())

Creates a new configuration for code generator

Parameters

array $options

See also

https://php-code-generator.readthedocs.org/en/latest/generator.html

in CodeGeneratorConfig at line line 61
bool getGenerateDocblock()

Returns whether docblocks should be generated

Return Value

bool true if they will be generated and false if not

in CodeGeneratorConfig at line line 71
$this setGenerateDocblock(bool $generate)

Sets whether docblocks should be generated

Parameters

bool $generate true if they will be generated and false if not

Return Value

$this

in CodeGeneratorConfig at line line 84
bool getGenerateEmptyDocblock()

Returns whether empty docblocks are generated

Return Value

bool true if they will be generated and false if not

in CodeGeneratorConfig at line line 94
$this setGenerateEmptyDocblock(bool $generate)

Sets whether empty docblocks are generated

Parameters

bool $generate true if they will be generated and false if not

Return Value

$this

in CodeGeneratorConfig at line line 107
bool getGenerateScalarTypeHints()

Returns whether scalar type hints will be generated for method parameters (PHP 7)

Return Value

bool true if they will be generated and false if not

in CodeGeneratorConfig at line line 116
bool isSortingEnabled()

Returns whether sorting is enabled

Return Value

bool true if it is enabled and false if not

in CodeGeneratorConfig at line line 125
string|bool|Comparator|Closure getUseStatementSorting()

Returns the use statement sorting

Return Value

string|bool|Comparator|Closure

in CodeGeneratorConfig at line line 134
string|bool|Comparator|Closure getConstantSorting()

Returns the constant sorting

Return Value

string|bool|Comparator|Closure

in CodeGeneratorConfig at line line 143
string|bool|Comparator|Closure getPropertySorting()

Returns the property sorting

Return Value

string|bool|Comparator|Closure

in CodeGeneratorConfig at line line 152
string|bool|Comparator|Closure getMethodSorting()

Returns the method sorting

Return Value

string|bool|Comparator|Closure

in CodeGeneratorConfig at line line 162
$this setGenerateScalarTypeHints(bool $generate)

Sets whether scalar type hints will be generated for method parameters (PHP 7)

Parameters

bool $generate true if they will be generated and false if not

Return Value

$this

in CodeGeneratorConfig at line line 172
bool getGenerateReturnTypeHints()

Returns whether return type hints will be generated for method parameters (PHP 7)

Return Value

bool true if they will be generated and false if not

in CodeGeneratorConfig at line line 182
$this setGenerateReturnTypeHints(bool $generate)

Sets whether return type hints will be generated for method parameters (PHP 7)

Parameters

bool $generate true if they will be generated and false if not

Return Value

$this

in CodeGeneratorConfig at line line 193
$this setSortingEnabled($enabled)

Returns whether sorting is enabled

Parameters

$enabled bool true if it is enabled and false if not

Return Value

$this

in CodeGeneratorConfig at line line 204
$this setUseStatementSorting($sorting)

Returns the use statement sorting

Parameters

$sorting string|bool|Comparator|\Closure

Return Value

$this

in CodeGeneratorConfig at line line 215
$this setConstantSorting($sorting)

Returns the constant sorting

Parameters

$sorting string|bool|Comparator|\Closure

Return Value

$this

in CodeGeneratorConfig at line line 226
$this setPropertySorting($sorting)

Returns the property sorting

Parameters

$sorting string|bool|Comparator|\Closure

Return Value

$this

in CodeGeneratorConfig at line line 237
$this setMethodSorting($sorting)

Returns the method sorting

Parameters

$sorting string|bool|Comparator|\Closure

Return Value

$this

at line line 62
string getHeaderComment()

Returns the file header comment

Return Value

string the header comment

at line line 72
$this setHeaderComment(string $comment)

Sets the file header comment

Parameters

string $comment the header comment

Return Value

$this

at line line 82
Docblock getHeaderDocblock()

Returns the file header docblock

Return Value

Docblock the docblock

at line line 92
$this setHeaderDocblock(Docblock $docblock)

Sets the file header docblock

Parameters

Docblock $docblock the docblock

Return Value

$this

at line line 102
bool getBlankLineAtEnd()

Returns whether a blank line should be generated at the end of the file

Return Value

bool true if it will be generated and false if not

at line line 112
$this setBlankLineAtEnd(bool $show)

Sets whether a blank line should be generated at the end of the file

Parameters

bool $show true if it will be generated and false if not

Return Value

$this

at line line 123
bool getDeclareStrictTypes()

Returns whether a declare(strict_types=1); statement should be printed below the header comments (PHP 7)

Return Value

bool true if it will be printed and false if not

at line line 134
$this setDeclareStrictTypes(bool $strict)

Sets whether a declare(strict_types=1); statement should be printed below the header comments (PHP 7)

Parameters

bool $strict true if it will be printed and false if not

Return Value

$this