-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAdditionalQueryParams.php
79 lines (70 loc) · 1.92 KB
/
AdditionalQueryParams.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
declare(strict_types=1);
namespace Core\Request\Parameters;
class AdditionalQueryParams extends MultipleParams
{
/**
* Initializes a new AdditionalQueryParams object.
*/
public static function init(?array $values): self
{
return new self($values ?? []);
}
private function __construct(array $values)
{
parent::__construct('additional query');
$this->parameters = array_map(function ($key, $val) {
return QueryParam::init($key, $val);
}, array_keys($values), $values);
}
/**
* Turns all parameters of the object to unIndexed.
*/
public function unIndexed(): self
{
$this->parameters = array_map(function ($param) {
return $param->unIndexed();
}, $this->parameters);
return $this;
}
/**
* Turns all parameters of the object to plain.
*/
public function plain(): self
{
$this->parameters = array_map(function ($param) {
return $param->plain();
}, $this->parameters);
return $this;
}
/**
* Turns all parameters of the object to comma separated.
*/
public function commaSeparated(): self
{
$this->parameters = array_map(function ($param) {
return $param->commaSeparated();
}, $this->parameters);
return $this;
}
/**
* Turns all parameters of the object to tab separated.
*/
public function tabSeparated(): self
{
$this->parameters = array_map(function ($param) {
return $param->tabSeparated();
}, $this->parameters);
return $this;
}
/**
* Turns all parameters of the object to pipe separated.
*/
public function pipeSeparated(): self
{
$this->parameters = array_map(function ($param) {
return $param->pipeSeparated();
}, $this->parameters);
return $this;
}
}