| Conditions | 2 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 27 | public function fromString(string $puzzle): Puzzle |
||
| 28 | { |
||
| 29 | if (substr_count($puzzle, $this->separator) !== 1) { |
||
| 30 | throw InvalidFormat::couldNotLoad('sliding crates', $puzzle, "Missing `$this->separator` in input."); |
||
| 31 | } |
||
| 32 | [$level, $target] = explode($this->separator, $puzzle); |
||
| 33 | return SlidingCratesPuzzle::fromString($level, trim($target)[0]); |
||
| 34 | } |
||
| 36 |