private function transform(DefinitionCall $definitionCall, Transformation $transformation, $index, $value)
{
if (is_object($value) && !$value instanceof ArgumentInterface) {
return $value;
}
if ($transformation instanceof SimpleArgumentTransformation && $transformation->supportsDefinitionAndArgument($definitionCall, $index, $value)) {
return $transformation->transformArgument($this->callCenter, $definitionCall, $index, $value);
}
if ($transformation instanceof PatternTransformation && $transformation->supportsDefinitionAndArgument($this, $definitionCall, $value)) {
return $transformation->transformArgument($this, $this->callCenter, $definitionCall, $value);
}
return $value;
}