It seems like $date defined by \DateTime::createFromFor...-d', $jsonObject->date) on line 60 can also be of type false; however, JPBernius\FMeat\Entities\Day::__construct() does only seem to accept object<DateTimeInterface>, did you maybe forget to handle an error condition?
This check looks for type mismatches where the missing type is false. This
is usually indicative of an error condtion.
This function either returns a new DateTime object or false, if there was an error.
This is a typical pattern in PHP programming to show that an error has occurred without
raising an exception. The calling code should check for this returned false
before passing on the value to another function or method that may not
be able to handle a false.
Loading history...
62
63
foreach ($jsonObject->dishes as $jsonDishObject) {
This check looks for type mismatches where the missing type is
false
. This is usually indicative of an error condtion.Consider the follow example
This function either returns a new
DateTime
object or false, if there was an error. This is a typical pattern in PHP programming to show that an error has occurred without raising an exception. The calling code should check for this returnedfalse
before passing on the value to another function or method that may not be able to handle afalse
.