private function resolvePriority($value, $targetMethodName)
{
if (count($value) == 1) {
return 0;
}
list($methodName, $priority) = $value;
if (is_string($methodName) && is_numeric($priority)) {
if ($methodName === $targetMethodName) {
return $priority;
}
return;
}
foreach ($value as $event) {
$resolved = $this->resolvePriority($event, $targetMethodName);
if (null !== $resolved) {
return $resolved;
}
}
}