Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
21 | 12 | public function makeFromSheet(string $collection, string $name, ?string $page = null): Page |
|
22 | { |
||
23 | try { |
||
24 | 12 | $sheet = Sheets::collection($collection)->get($name); |
|
25 | 1 | } catch (RuntimeException $exception) { |
|
26 | 1 | throw SheetCollectionNotFoundException::make($collection, $exception); |
|
27 | } |
||
28 | |||
29 | 11 | if ($sheet === null) { |
|
30 | 1 | throw SheetNotFoundException::make($collection, $name); |
|
31 | } |
||
32 | |||
33 | 10 | return static::make($sheet->toArray(), $page); |
|
34 | } |
||
36 |