Total Complexity | 4 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | trait ReadOnlyRepositoryTrait |
||
9 | { |
||
10 | final public function create(array $options): ModelInterface |
||
11 | { |
||
12 | unset($options); |
||
13 | return $this->callUnsupportedMethod('create'); |
||
14 | } |
||
15 | |||
16 | final public function update($id, array $options): ModelInterface |
||
17 | { |
||
18 | unset($id, $options); |
||
19 | return $this->callUnsupportedMethod('update'); |
||
20 | } |
||
21 | |||
22 | final public function delete($id): bool |
||
23 | { |
||
24 | unset($id); |
||
25 | return $this->callUnsupportedMethod('delete'); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Throws an exception and uses the method name to generate the message. |
||
30 | * |
||
31 | * @param string $method The name of the unsupported method. |
||
32 | */ |
||
33 | protected function callUnsupportedMethod(string $method) |
||
37 | ); |
||
38 | } |
||
39 | } |
||
40 |