Documentation

PromotedParameterGenerator extends ParameterGenerator
in package

FinalYes

Table of Contents

Constants

LINE_FEED  = "\n"
Line feed to use in place of EOL
VISIBILITY_PRIVATE  = 'private'
VISIBILITY_PROTECTED  = 'protected'
VISIBILITY_PUBLIC  = 'public'

Properties

$defaultValue  : ValueGenerator|null
$indentation  : string
$isSourceDirty  : bool
$name  : string
$passedByReference  : bool
$position  : int
$sourceContent  : string|null
TODO: Type should be changed to "string" in the next major version. Nullable for BC
$type  : TypeGenerator|null
$omitDefaultValue  : bool
$variadic  : bool
$visibility  : string

Methods

__construct()  : mixed
fromArray()  : ParameterGenerator
Generate from array
fromParameterGeneratorWithVisibility()  : self
fromReflection()  : ParameterGenerator
generate()  : string
getDefaultValue()  : ValueGenerator|null
getIndentation()  : string
getName()  : string
getPassedByReference()  : bool
getPosition()  : int
getSourceContent()  : string|null
getType()  : string
getVariadic()  : bool
isSourceDirty()  : bool
omitDefaultValue()  : ParameterGenerator
setDefaultValue()  : ParameterGenerator
Set the default value of the parameter.
setIndentation()  : AbstractGenerator
setName()  : ParameterGenerator
setOptions()  : AbstractGenerator
setPassedByReference()  : ParameterGenerator
setPosition()  : ParameterGenerator
setSourceContent()  : AbstractGenerator
setSourceDirty()  : AbstractGenerator
setType()  : ParameterGenerator
setVariadic()  : ParameterGenerator
generateTypeHint()  : string

Constants

Properties

$sourceContent

TODO: Type should be changed to "string" in the next major version. Nullable for BC

protected string|null $sourceContent = null

Methods

__construct()

public __construct(string $name[, string|null $type = null ][, string $visibility = self::VISIBILITY_PUBLIC ][, int|null $position = null ][, bool $passByReference = false ]) : mixed
Parameters
$name : string
$type : string|null = null
$visibility : string = self::VISIBILITY_PUBLIC
$position : int|null = null
$passByReference : bool = false
Tags
psalm-param

non-empty-string $name

psalm-param

?non-empty-string $type

psalm-param

PromotedParameterGenerator::VISIBILITY_* $visibility

fromArray()

Generate from array

public static fromArray(array<string|int, mixed> $array) : ParameterGenerator
Parameters
$array : array<string|int, mixed>
Tags
configkey

name string [required] Class Name

configkey

type string

configkey

defaultvalue null|bool|string|int|float|array|ValueGenerator

configkey

passedbyreference bool

configkey

position int

configkey

sourcedirty bool

configkey

indentation string

configkey

sourcecontent string

configkey

omitdefaultvalue bool

throws
InvalidArgumentException
Return values
ParameterGenerator

fromParameterGeneratorWithVisibility()

public static fromParameterGeneratorWithVisibility(ParameterGenerator $generator, string $visibility) : self
Parameters
$generator : ParameterGenerator
$visibility : string
Tags
psalm-param

PromotedParameterGenerator::VISIBILITY_* $visibility

Return values
self

getSourceContent()

public getSourceContent() : string|null
Return values
string|null

        
On this page

Search results