1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Collection; |
4: | |
5: | use Salient\Contract\Collection\ListInterface; |
6: | use Salient\Contract\Core\Immutable; |
7: | use Salient\Core\Concern\HasMutator; |
8: | use Salient\Core\Concern\ImmutableArrayAccessTrait; |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | |
23: | |
24: | trait ImmutableListTrait |
25: | { |
26: | |
27: | use ListTrait; |
28: | |
29: | use ImmutableArrayAccessTrait { |
30: | ImmutableArrayAccessTrait::offsetSet insteadof ListTrait; |
31: | ImmutableArrayAccessTrait::offsetUnset insteadof ListTrait; |
32: | } |
33: | use HasMutator; |
34: | |
35: | |
36: | |
37: | |
38: | protected function maybeClone() |
39: | { |
40: | return clone $this; |
41: | } |
42: | } |
43: | |