protected function matchRepresentation($representation, array &$representationObjects)
{
if (!is_object($representation)) {
$className = $this->getRepresentationClassName($representation);
$representationObjects[] = $representation = new $className();
}
if (!$representation instanceof AbstractRepresentation) {
throw RepresentationException::representationMustBeInstanceOfDrestRepresentation();
}
if (($representation = $this->determineRepresentationByHttpMethod($representation, $this->config->getDetectContentOptions())) !== null) {
return $representation;
}
return null;
}