| 1 | <?php |
||
| 8 | class Row |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The cells in this row |
||
| 12 | * @var Cell[] |
||
| 13 | */ |
||
| 14 | protected $cells = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The row style |
||
| 18 | * @var Style|null |
||
| 19 | */ |
||
| 20 | protected $style; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Thw row manager |
||
| 24 | * @var RowManager |
||
| 25 | */ |
||
| 26 | protected $rowManager; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Row constructor. |
||
| 30 | * @param Cell[] $cells |
||
| 31 | * @param Style|null $style |
||
| 32 | * @param RowManager $rowManager |
||
| 33 | */ |
||
| 34 | 94 | public function __construct(array $cells = [], Style $style = null, RowManager $rowManager) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @return Cell[] $cells |
||
| 45 | */ |
||
| 46 | 82 | public function getCells() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @param Cell[] $cells |
||
| 53 | * @return $this |
||
| 54 | */ |
||
| 55 | 94 | public function setCells(array $cells) |
|
| 64 | |||
| 65 | /** |
||
| 66 | * @return Style |
||
| 67 | */ |
||
| 68 | 62 | public function getStyle() |
|
| 76 | |||
| 77 | /** |
||
| 78 | * @param Style $style |
||
| 79 | * @return Row |
||
| 80 | */ |
||
| 81 | 94 | public function setStyle($style) |
|
| 87 | |||
| 88 | /** |
||
| 89 | * @param Style|null $style |
||
| 90 | * @return Row |
||
| 91 | */ |
||
| 92 | public function applyStyle(Style $style = null) |
||
| 98 | |||
| 99 | /** |
||
| 100 | * @param Cell $cell |
||
| 101 | * @return Row |
||
| 102 | */ |
||
| 103 | 90 | public function addCell(Cell $cell) |
|
| 109 | |||
| 110 | /** |
||
| 111 | * Returns whether a row has cells |
||
| 112 | * |
||
| 113 | * @return bool |
||
| 114 | */ |
||
| 115 | 71 | public function hasCells() |
|
| 119 | |||
| 120 | /** |
||
| 121 | * Detect whether this row is considered empty. |
||
| 122 | * An empty row has either no cells at all - or only empty cells |
||
| 123 | * |
||
| 124 | * @return bool |
||
| 125 | */ |
||
| 126 | 32 | public function isEmpty() |
|
| 130 | } |
||
| 131 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):