/** * Constructor. * Optionally merges custom cast handlers and field type definitions. * @param array<string,class-string>|null $castHandlers Optional custom cast handlers to merge. * @param array<string,string>|null $types Optional type definitions for fields. */ Defined in .../app/Core/Lib/DataCaster/DataCaster.php:63
/** * Adds or overrides cast handlers. * @param array<string,class-string> $handlers * @return $this */ Defined in .../app/Core/Lib/DataCaster/DataCaster.php:79
/** * Casts a value according to its configured type for a given field. * Supports nullable types prefixed with '?' and parameterized types like "json[array]". * @param mixed $value Value to be cast. * @param string $field Field name to determine type for. * @param 'get'|'set' $method Determines which handler method to call. * @return mixed * @throws DataCasterException If invalid cast method or nullability rules are violated. * @throws InvalidArgumentException If no handler exists for the given type. */ Defined in .../app/Core/Lib/DataCaster/DataCaster.php:108
/** * Returns the mapping of field names to their cast types. * @return array<string,string> */ Defined in .../app/Core/Lib/DataCaster/DataCaster.php:160
/** * Sets the mapping of field names to their cast types. * @param array<string,string> $types * @return $this */ Defined in .../app/Core/Lib/DataCaster/DataCaster.php:170