public function getQueryBuilderPartsForCachingHash(object
$queryBuilder): ?array
{ if (!
$queryBuilder instanceof QueryBuilder
) { throw new \
TypeError(sprintf('Expected an instance of "%s", but got "%s".', QueryBuilder::
class,
get_debug_type($queryBuilder)));
} return [ $queryBuilder->
getQuery()->
getSQL(),
array_map($this->
parameterToArray(...
),
$queryBuilder->
getParameters()->
toArray()),
];
} /**
* Converts a query parameter to an array.
*/
private function parameterToArray(Parameter
$parameter): array
{ return [$parameter->
getName(),
$parameter->
getType(),
$parameter->
getValue()];
}}