It seems like $style defined by parameter $style on line 32 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);}
It seems like $this->getStyle() can be null; however, merge() does not accept null, maybe add an additional type check?
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:
/** @return stdClass|null */functionmayReturnNull(){}functiondoesNotAcceptNull(stdClass$x){}// With potential error.functionwithoutCheck(){$x=mayReturnNull();doesNotAcceptNull($x);// Potential error here.}// Safe - Alternative 1functionwithCheck1(){$x=mayReturnNull();if(!$xinstanceofstdClass){thrownew\LogicException('$x must be defined.');}doesNotAcceptNull($x);}// Safe - Alternative 2functionwithCheck2(){$x=mayReturnNull();if($xinstanceofstdClass){doesNotAcceptNull($x);}}
Loading history...
93
$this->setStyle($merged);
94
return $this;
95
}
96
97
/**
98
* @param Cell $cell
99
* @return Row
100
*/
101
88
public function addCell(Cell $cell)
102
{
103
88
$this->cells[] = $cell;
104
88
return $this;
105
}
106
107
/**
108
* Detect whether this row is considered empty.
109
* 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):