The expression $this->data of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an
empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using empty(..) or !empty(...) instead.
The expression $this->options of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an
empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using empty(..) or !empty(...) instead.
Loading history...
35
$body['Options'] = encodeJson($this->options);
36
}
37
38
return $body;
39
}
40
41
public function getResponseClass(): string
42
{
43
return Response::class;
44
}
45
46
/**
47
* @return array
48
*/
49
public function getData(): array
50
{
51
return (array)$this->data;
52
}
53
54
/**
55
* @param array $data
56
* @return Request
57
*/
58
public function setData(array $data)
59
{
60
$this->data = $data;
61
return $this;
62
}
63
64
public function getOption(string $option)
65
{
66
if (!$this->options || !array_key_exists($option, $this->options)) {
The expression $this->options of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using empty($expr) instead to make it clear that you intend to check for an array without elements.
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an
empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using empty(..) or !empty(...) instead.
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.