It seems like $style defined by parameter $style on line 34 can be null; however, Box\Spout\Writer\Common\Entity\Row::setStyle() does not accept null, maybe add an additional type check?
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):
functionnotNullable(stdClass$x){}// UnsafefunctionwithoutCheck(stdClass$x=null){notNullable($x);}// Safe - Alternative 1: Adding Additional Type-CheckfunctionwithCheck(stdClass$x=null){if($xinstanceofstdClass){notNullable($x);}}// Safe - Alternative 2: Changing ParameterfunctionwithNonNullableParam(stdClass$x){notNullable($x);}
Loading history...
39
40
94
$this->rowManager = $rowManager;
41
94
}
42
43
/**
44
* @return Cell[] $cells
45
*/
46
82
public function getCells()
47
{
48
82
return $this->cells;
49
}
50
51
/**
52
* @param Cell[] $cells
53
* @return $this
54
*/
55
94
public function setCells(array $cells)
56
{
57
94
$this->cells = [];
58
94
foreach ($cells as $cell) {
59
89
$this->addCell($cell);
60
}
61
62
94
return $this;
63
}
64
65
/**
66
* @return Style
67
*/
68
62
public function getStyle()
69
{
70
62
return $this->style;
71
}
72
73
/**
74
* @param Style $style
75
* @return Row
76
*/
77
94
public function setStyle($style)
78
{
79
94
$this->style = $style ?: new Style();
80
81
94
return $this;
82
}
83
84
/**
85
* @param Style $style
86
* @return Row
87
*/
88
public function applyStyle($style)
89
{
90
$this->rowManager->applyStyle($this, $style);
91
92
return $this;
93
}
94
95
/**
96
* @param Cell $cell
97
* @return Row
98
*/
99
90
public function addCell(Cell $cell)
100
{
101
90
$this->cells[] = $cell;
102
103
90
return $this;
104
}
105
106
/**
107
* Returns whether a row has cells
108
*
109
* @return bool
110
*/
111
71
public function hasCells()
112
{
113
71
return $this->rowManager->hasCells($this);
114
}
115
116
/**
117
* Detect whether this row is considered empty.
118
* An empty row has either no cells at all - or only empty cells
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):