It seems like $createdAt defined by isset($data['created_at'...a['created_at']) : null on line 47 can be null; however, Mailgun\Model\Domain\Cre...onseItem::__construct() 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...
50
}
51
52
/**
53
* @param int $sizeBytes
54
* @param \DateTime $createdAt
55
* @param string $mailbox
56
* @param string $login
57
*/
58
private function __construct($sizeBytes, \DateTime $createdAt, $mailbox, $login)
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: