Builds service calls from arguments
array $arguments:
string &$calls By reference:
string &$behavior By reference:
private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior) {
foreach ($arguments as $argument) {
if (is_array($argument)) {
$this
->getServiceCallsFromArguments($argument, $calls, $behavior);
}
elseif ($argument instanceof Reference) {
$id = (string) $argument;
if (!isset($calls[$id])) {
$calls[$id] = 0;
}
if (!isset($behavior[$id])) {
$behavior[$id] = $argument
->getInvalidBehavior();
}
elseif (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $behavior[$id]) {
$behavior[$id] = $argument
->getInvalidBehavior();
}
$calls[$id] += 1;
}
}
}