composer update
This commit is contained in:
@@ -127,10 +127,10 @@ class AddAnnotatedClassesToCachePass implements CompilerPassInterface
|
||||
|
||||
private function matchAnyRegexps(string $class, array $regexps): bool
|
||||
{
|
||||
$blacklisted = false !== strpos($class, 'Test');
|
||||
$isTest = false !== strpos($class, 'Test');
|
||||
|
||||
foreach ($regexps as $regex) {
|
||||
if ($blacklisted && false === strpos($regex, 'Test')) {
|
||||
if ($isTest && false === strpos($regex, 'Test')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,13 +93,13 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
}
|
||||
foreach (['action', 'argument', 'id'] as $k) {
|
||||
if (!isset($attributes[$k][0])) {
|
||||
throw new InvalidArgumentException(sprintf('Missing "%s" attribute on tag "%s" %s for service "%s".', $k, $this->controllerTag, json_encode($attributes, JSON_UNESCAPED_UNICODE), $id));
|
||||
throw new InvalidArgumentException(sprintf('Missing "%s" attribute on tag "%s" %s for service "%s".', $k, $this->controllerTag, json_encode($attributes, \JSON_UNESCAPED_UNICODE), $id));
|
||||
}
|
||||
}
|
||||
if (!isset($methods[$action = strtolower($attributes['action'])])) {
|
||||
throw new InvalidArgumentException(sprintf('Invalid "action" attribute on tag "%s" for service "%s": no public "%s()" method found on class "%s".', $this->controllerTag, $id, $attributes['action'], $class));
|
||||
}
|
||||
list($r, $parameters) = $methods[$action];
|
||||
[$r, $parameters] = $methods[$action];
|
||||
$found = false;
|
||||
|
||||
foreach ($parameters as $p) {
|
||||
@@ -117,7 +117,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($methods as list($r, $parameters)) {
|
||||
foreach ($methods as [$r, $parameters]) {
|
||||
/** @var \ReflectionMethod $r */
|
||||
|
||||
// create a per-method map of argument-names to service/type-references
|
||||
@@ -139,7 +139,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
} elseif (isset($bindings[$bindingName = $type.' $'.$p->name]) || isset($bindings[$bindingName = '$'.$p->name]) || isset($bindings[$bindingName = $type])) {
|
||||
$binding = $bindings[$bindingName];
|
||||
|
||||
list($bindingValue, $bindingId, , $bindingType, $bindingFile) = $binding->getValues();
|
||||
[$bindingValue, $bindingId, , $bindingType, $bindingFile] = $binding->getValues();
|
||||
$binding->setValues([$bindingValue, $bindingId, true, $bindingType, $bindingFile]);
|
||||
|
||||
if (!$bindingValue instanceof Reference) {
|
||||
|
||||
@@ -42,9 +42,9 @@ class RemoveEmptyControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
} else {
|
||||
// any methods listed for call-at-instantiation cannot be actions
|
||||
$reason = false;
|
||||
list($id, $action) = explode('::', $controller);
|
||||
[$id, $action] = explode('::', $controller);
|
||||
$controllerDef = $container->getDefinition($id);
|
||||
foreach ($controllerDef->getMethodCalls() as list($method)) {
|
||||
foreach ($controllerDef->getMethodCalls() as [$method]) {
|
||||
if (0 === strcasecmp($action, $method)) {
|
||||
$reason = sprintf('Removing method "%s" of service "%s" from controller candidates: the method is called at instantiation, thus cannot be an action.', $action, $id);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user