*/ protected array $patchData; /** * Captures all passed named arguments into an associative array. * * @param mixed ...$params */ public function __construct(...$params) { $this->patchData = $params; } /** * @return array * @throws \ReflectionException */ final public function toArray(): array { $result = []; foreach ($this->patchData as $key => $value) { $jsonKey = $this->toSnakeCase((string)$key); $result[$jsonKey] = $this->convertValue($value); } return $result; } }