Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
| IsResizable | |
100.00% |
6 / 6 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
| width | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getWidth | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| rows | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getRows | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray\Field\Capability; |
| 6 | |
| 7 | trait IsResizable |
| 8 | { |
| 9 | protected ?int $width = null; |
| 10 | protected ?int $rows = null; |
| 11 | |
| 12 | public function width(int $width): static |
| 13 | { |
| 14 | $this->width = $width; |
| 15 | |
| 16 | return $this; |
| 17 | } |
| 18 | |
| 19 | public function getWidth(): int |
| 20 | { |
| 21 | return $this->width; |
| 22 | } |
| 23 | |
| 24 | public function rows(int $rows): static |
| 25 | { |
| 26 | $this->rows = $rows; |
| 27 | |
| 28 | return $this; |
| 29 | } |
| 30 | |
| 31 | public function getRows(): int |
| 32 | { |
| 33 | return $this->rows; |
| 34 | } |
| 35 | } |