| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 14 |
| Ratio | 100 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | 11 | View Code Duplication | public function add(SheetInterface $sheet): SpreadsheetInterface |
| 40 | { |
||
| 41 | 11 | if ($this->has($sheet->name())) { |
|
| 42 | 1 | throw new SheetAlreadyExistsException; |
|
| 43 | } |
||
| 44 | |||
| 45 | 11 | $self = new self($this->name); |
|
| 46 | 11 | $self->sheets = $this->sheets->put( |
|
| 47 | 11 | $sheet->name(), |
|
| 48 | $sheet |
||
| 49 | ); |
||
| 50 | |||
| 51 | 11 | return $self; |
|
| 52 | } |
||
| 53 | |||
| 79 |