It seems like $rawData can also be of type null; however, Chubbyphp\Deserializatio...sformer::cleanRawData() does only seem to accept array, maybe add an additional type check?
If a method or function can return multiple different values and unless you are
sure that you only can receive a single value in this context, we recommend
to add an additional type check:
/** * @return array|string */functionreturnsDifferentValues($x){if($x){return'foo';}returnarray();}$x=returnsDifferentValues($y);if(is_array($x)){// $x is an array.}
If this a common case that PHP Analyzer should handle natively, please let us
know by opening an issue.
Loading history...
40
}
41
42
/**
43
* @param array $rawData
44
* @param int $numericPrefixLength
45
*
46
* @return array
47
*/
48
2
private function cleanRawData(array $rawData, int $numericPrefixLength): array
49
{
50
2
$data = [];
51
2
foreach ($rawData as $rawKey => $value) {
52
2
if (0 !== $numericPrefixLength && 0 === strpos($rawKey, $this->numericPrefix)) {
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.