Total Complexity | 4 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | class AtomicOperationsDocument extends Document { |
||
14 | /** @var AtomicOperationsExtension */ |
||
15 | private $extension; |
||
16 | /** @var ResourceInterface[] */ |
||
17 | private $results = []; |
||
18 | |||
19 | /** |
||
20 | * start the document, auto applies the extension |
||
21 | */ |
||
22 | 2 | public function __construct() { |
|
23 | 2 | parent::__construct(); |
|
24 | |||
25 | 2 | $this->extension = new AtomicOperationsExtension(); |
|
26 | 2 | $this->applyExtension($this->extension); |
|
27 | 2 | } |
|
28 | |||
29 | /** |
||
30 | * add resources as results of the operations |
||
31 | * |
||
32 | * @param ResourceInterface[] ...$resources |
||
33 | */ |
||
34 | 1 | public function addResults(ResourceInterface ...$resources) { |
|
35 | 1 | $this->results = array_merge($this->results, $resources); |
|
36 | 1 | } |
|
37 | |||
38 | /** |
||
39 | * DocumentInterface |
||
40 | */ |
||
41 | |||
42 | /** |
||
43 | * @inheritDoc |
||
44 | */ |
||
45 | 2 | public function toArray() { |
|
56 | } |
||
57 | } |
||
58 |