Copied!
CloneableInstantiable
Methods
public __construct(string $name)
 

Creates a property builder.

  • param string $name Name of the property
public addAttribute( $attribute)
 

Adds an attribute group.

  • param \Node\Attribute|\Node\AttributeGroup $attribute
  • return $this The builder instance (for fluid interface)
public getNode() : PhpParser\Node
 

Returns the built class node.

  • return \Stmt\Property The built property node
public makePrivate()
 

Makes the property private.

  • return $this The builder instance (for fluid interface)
public makeProtected()
 

Makes the property protected.

  • return $this The builder instance (for fluid interface)
public makePublic()
 

Makes the property public.

  • return $this The builder instance (for fluid interface)
public makeReadonly()
 

Makes the property readonly.

  • return $this The builder instance (for fluid interface)
public makeStatic()
 

Makes the property static.

  • return $this The builder instance (for fluid interface)
public setDefault( $value)
 

Sets default value for the property.

  • param mixed $value Default value to use
  • return $this The builder instance (for fluid interface)
public setDocComment( $docComment)
 

Sets doc comment for the property.

  • param \PhpParser\Comment\Doc|string $docComment Doc comment to set
  • return $this The builder instance (for fluid interface)
public setType( $type)
 

Sets the property type for PHP 7.4+.

  • param string|\Name|\Identifier|\ComplexType $type
  • return $this
Properties
protected array $attributeGroups = []
 
  • var list<\Node\AttributeGroup>
protected array $attributes = []
 
  • var array<string,mixed>
protected ?PhpParser\Node\Expr $default = NULL
protected int $flags = 0
protected string $name
protected ?PhpParser\Node $type = NULL
 
  • var null|\Identifier|\Name|\ComplexType
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration