Copied!

Type value object (immutable).

CloneableInstantiable
Constants
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_ARRAY = 'array'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_BOOL = 'bool'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_CALLABLE = 'callable'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_FALSE = 'false'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_FLOAT = 'float'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_INT = 'int'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_ITERABLE = 'iterable'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_NULL = 'null'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_OBJECT = 'object'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_RESOURCE = 'resource'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_STRING = 'string'
public Symfony\Component\PropertyInfo\Type::BUILTIN_TYPE_TRUE = 'true'
Properties
public static array $builtinCollectionTypes = ['array', 'iterable']
 

List of PHP builtin collection types.

  • var string[]
public static array $builtinTypes = ['int', 'float', 'string', 'bool', 'resource', 'object', 'array', 'callable', 'false', 'true', 'null', 'iterable']
 

List of PHP builtin types.

  • var string[]
Methods
public __construct(string $builtinType, bool $nullable = false, ?string $class = NULL, bool $collection = false, self|array|?null $collectionKeyType = NULL, self|array|?null $collectionValueType = NULL)
 
  • param \Type[]|\Type|null $collectionKeyType
  • param \Type[]|\Type|null $collectionValueType
  • throws \InvalidArgumentException
public getBuiltinType() : string
 

Gets built-in type.

Can be bool, int, float, string, array, object, resource, null, callback or iterable.

public getClassName() : ?string
 

Gets the class name.

Only applicable if the built-in type is object.

public getCollectionKeyTypes() : array
 

Gets collection key types.

Only applicable for a collection type.

  • return \Type[]
public getCollectionValueTypes() : array
 

Gets collection value types.

Only applicable for a collection type.

  • return \Type[]
public isCollection() : bool
public isNullable() : bool
Properties
private string $builtinType
private ?string $class
private bool $collection
private array $collectionKeyType
private array $collectionValueType
private bool $nullable
Methods
private validateCollectionArgument(self|array|?null $collectionArgument, int $argumentIndex, string $argumentName) : ?array
Properties
public static array $builtinCollectionTypes = ['array', 'iterable']
 

List of PHP builtin collection types.

  • var string[]
public static array $builtinTypes = ['int', 'float', 'string', 'bool', 'resource', 'object', 'array', 'callable', 'false', 'true', 'null', 'iterable']
 

List of PHP builtin types.

  • var string[]
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration