src/EntityRepository.php
private function assertNotObject($data, string $methodName)
    {
        if (!is_object($data)) {
            return $data;
        }

        $type = get_class($data);

        throw new UnexpectedTypeException(
            "Return of method {$methodName} should be an array. {$type} given."
        );
    }
private function assertNotObject($data, string $methodName)
    {
        if (!is_object($data)) {
            return $data;
        }

        $type = get_class($data);

        throw new UnexpectedTypeException(
            "Return of method {$methodName} should be an array. {$type} given."
        );
    }
@var array|ResponseInterface|null

@return array|null