| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 48 | 19 | public function buildStack(ResourceRepository $repository, $path) |
|
| 49 | { |
||
| 50 | 19 | if (!isset($this->stack[$path])) { |
|
| 51 | 8 | throw new InvalidArgumentException(sprintf('No version of path %s were found in the ChangeStream', $path)); |
|
| 52 | } |
||
| 53 | |||
| 54 | 11 | $resources = array(); |
|
| 55 | |||
| 56 | 11 | foreach ($this->stack[$path] as $resource) { |
|
| 57 | 11 | $resource->attachTo($repository, $path); |
|
| 58 | 11 | $resources[] = $resource; |
|
| 59 | 11 | } |
|
| 60 | |||
| 61 | 11 | return new ResourceStack($resources); |
|
| 62 | } |
||
| 63 | } |
||
| 64 |