Psr2 Code Generator

ParameterBuilder extends AbstractBuilder Uses ValueBuilderPart, TypeBuilderPart

Table of Contents

$generator  : ModelGenerator
$noTypeHints  : array<string|int, string>
$php7typeHints  : array<string|int, string>
$typeHintMap  : array<string|int, mixed>
$config  : GeneratorConfig
$writer  : Writer
__construct()  : mixed
build()  : void
buildDocblock()  : void
ensureBlankLine()  : void
generate()  : void
getConfig()  : GeneratorConfig
getWriter()  : Writer
checkNullable()  : string
Manage nullable types.
exportVar()  : mixed|string
getType()  : string|null
removeThis()  : string
Remove `$this` key, from the list of the return types. I.e:.
writeValue()  : void

Properties

$noTypeHints

protected static array<string|int, string> $noTypeHints = ['string', 'int', 'integer', 'bool', 'boolean', 'float', 'double', 'object', 'mixed', 'resource', '$this']

$php7typeHints

protected static array<string|int, string> $php7typeHints = ['string', 'int', 'integer', 'bool', 'boolean', 'float', 'double']

$typeHintMap

protected static array<string|int, mixed> $typeHintMap = ['string' => 'string', 'int' => 'int', 'integer' => 'int', 'bool' => 'bool', 'boolean' => 'bool', 'float' => 'float', 'double' => 'float']

Methods

ensureBlankLine()

protected ensureBlankLine() : void
Return values
void

checkNullable()

Manage nullable types.

private checkNullable(string $type) : string
Parameters
$type : string
Return values
string

exportVar()

private exportVar(mixed $value) : mixed|string
Parameters
$value : mixed
Return values
mixed|string

getType()

private getType(AbstractModel $model) : string|null
Parameters
$model : AbstractModel
Tags
psalm-suppress

UndefinedMethod Concrete model classes using this trait always have getType() method.

Return values
string|null

removeThis()

Remove `$this` key, from the list of the return types. I.e:.

private removeThis(string $type) : string
Parameters
$type : string
Tags
see
MethodGeneratorTest

for examples

Return values
string

Search results