| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 31 | public function fromDocker(): HostMount |
||
| 32 | { |
||
| 33 | foreach ($this->mountsFactory->fromDocker()->toArray() as $mount) { |
||
| 34 | if ('bind' === $mount['Type'] && '/host' === $mount['Destination']) { |
||
| 35 | Assertion::true($mount['RW'], "Volume /host must be writable"); |
||
| 36 | Assertion::true( |
||
| 37 | $this->filesystem->isAbsolutePath($mount['Source']), |
||
| 38 | "Host mount source '{$mount['Source']}' is not an absolute path" |
||
| 39 | ); |
||
| 40 | |||
| 41 | return new HostMount($mount); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | throw HostException::noHostMount(); |
||
| 45 | } |
||
| 46 | } |