| 1 | <?php |
||
| 9 | class RowManager |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var StyleMerger |
||
| 13 | */ |
||
| 14 | protected $styleMerger; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param StyleMerger $styleMerger |
||
| 18 | */ |
||
| 19 | 88 | public function __construct(StyleMerger $styleMerger) |
|
| 20 | { |
||
| 21 | 88 | $this->styleMerger = $styleMerger; |
|
| 22 | 88 | } |
|
| 23 | |||
| 24 | /** |
||
| 25 | * @param Row $row |
||
| 26 | * @param Style|null $style |
||
| 27 | * @return $this |
||
| 28 | */ |
||
| 29 | public function applyStyle(Row $row, Style $style) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Returns whether a row has cells |
||
| 37 | * |
||
| 38 | * @param Row $row |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | 75 | public function hasCells(Row $row) |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Detect whether a row is considered empty. |
||
| 48 | * An empty row has either no cells at all - or only one empty cell |
||
| 49 | * |
||
| 50 | * @param Row $row |
||
| 51 | * @return bool |
||
| 52 | */ |
||
| 53 | 35 | public function isEmpty(Row $row) |
|
| 59 | } |
||
| 60 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: