1 | <?php |
||
10 | class Attributes implements AttributesContract |
||
11 | { |
||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $attributes; |
||
16 | |||
17 | /** |
||
18 | * @inheritDoc |
||
19 | */ |
||
20 | 44 | public function __construct(array $attributes) |
|
21 | { |
||
22 | 44 | $this->attributes = $attributes; |
|
23 | 44 | } |
|
24 | |||
25 | /** |
||
26 | * @inheritDoc |
||
27 | */ |
||
28 | 6 | public function get($name, $default = null) |
|
35 | |||
36 | /** |
||
37 | * @inheritDoc |
||
38 | */ |
||
39 | 2 | public function set(array $attributes) |
|
45 | |||
46 | /** |
||
47 | * @inheritDoc |
||
48 | */ |
||
49 | 18 | public function all() |
|
53 | |||
54 | /** |
||
55 | * @inheritDoc |
||
56 | */ |
||
57 | 3 | public function has($name) |
|
61 | |||
62 | /** |
||
63 | * @inheritDoc |
||
64 | */ |
||
65 | 1 | public function forget($name) |
|
66 | { |
||
67 | 1 | if ($this->has($name)) { |
|
68 | 1 | unset($this->attributes[$name]); |
|
69 | } |
||
70 | 1 | } |
|
71 | |||
72 | /** |
||
73 | * @inheritDoc |
||
74 | */ |
||
75 | 4 | public function push(array $attributes) |
|
81 | |||
82 | /** |
||
83 | * @inheritDoc |
||
84 | */ |
||
85 | 6 | public function put($name, $value) |
|
91 | |||
92 | /** |
||
93 | * @inheritDoc |
||
94 | */ |
||
95 | 1 | public function merge(array $attributes) |
|
101 | |||
102 | /** |
||
103 | * @inheritDoc |
||
104 | */ |
||
105 | 13 | public function build($attributes = []) |
|
118 | |||
119 | /** |
||
120 | * @inheritDoc |
||
121 | */ |
||
122 | 1 | public function __toString() |
|
126 | |||
127 | /** |
||
128 | * @inheritDoc |
||
129 | */ |
||
130 | 4 | public function toArray() |
|
137 | |||
138 | /** |
||
139 | * @inheritDoc |
||
140 | */ |
||
141 | 1 | public function offsetExists($offset) |
|
145 | |||
146 | /** |
||
147 | * @inheritDoc |
||
148 | */ |
||
149 | 1 | public function offsetGet($offset) |
|
153 | |||
154 | /** |
||
155 | * @inheritDoc |
||
156 | */ |
||
157 | 1 | public function offsetSet($offset, $value) |
|
161 | |||
162 | /** |
||
163 | * @inheritDoc |
||
164 | */ |
||
165 | 1 | public function offsetUnset($offset) |
|
169 | } |