Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
28 | 16 | public function makeFromSheetName(string $collection, string $name, ?string $page = null): PageContract |
|
29 | { |
||
30 | try { |
||
31 | 16 | $sheet = Sheets::collection($collection)->get($name); |
|
32 | 1 | } catch (RuntimeException $exception) { |
|
33 | 1 | throw SheetCollectionNotFoundException::make($collection, $exception); |
|
34 | } |
||
35 | |||
36 | 15 | if ($sheet === null) { |
|
37 | 1 | throw SheetNotFoundException::make($collection, $name); |
|
38 | } |
||
39 | |||
40 | 14 | return static::makeFromSheet($sheet, $page); |
|
41 | } |
||
43 |