1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Collection; |
4: | |
5: | use Salient\Contract\Collection\CollectionInterface; |
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: | |
25: | trait ImmutableCollectionTrait |
26: | { |
27: | |
28: | use CollectionTrait; |
29: | |
30: | use ImmutableArrayAccessTrait { |
31: | ImmutableArrayAccessTrait::offsetSet insteadof CollectionTrait; |
32: | ImmutableArrayAccessTrait::offsetUnset insteadof CollectionTrait; |
33: | } |
34: | use HasMutator; |
35: | |
36: | |
37: | |
38: | |
39: | protected function maybeClone() |
40: | { |
41: | return clone $this; |
42: | } |
43: | } |
44: | |