updated packages
This commit is contained in:
@@ -34,7 +34,7 @@ final class ArgumentResolver implements ArgumentResolverInterface
|
||||
*/
|
||||
private $argumentValueResolvers;
|
||||
|
||||
public function __construct(ArgumentMetadataFactoryInterface $argumentMetadataFactory = null, iterable $argumentValueResolvers = array())
|
||||
public function __construct(ArgumentMetadataFactoryInterface $argumentMetadataFactory = null, iterable $argumentValueResolvers = [])
|
||||
{
|
||||
$this->argumentMetadataFactory = $argumentMetadataFactory ?: new ArgumentMetadataFactory();
|
||||
$this->argumentValueResolvers = $argumentValueResolvers ?: self::getDefaultArgumentValueResolvers();
|
||||
@@ -45,7 +45,7 @@ final class ArgumentResolver implements ArgumentResolverInterface
|
||||
*/
|
||||
public function getArguments(Request $request, $controller)
|
||||
{
|
||||
$arguments = array();
|
||||
$arguments = [];
|
||||
|
||||
foreach ($this->argumentMetadataFactory->createArgumentMetadata($controller) as $metadata) {
|
||||
foreach ($this->argumentValueResolvers as $resolver) {
|
||||
@@ -83,12 +83,12 @@ final class ArgumentResolver implements ArgumentResolverInterface
|
||||
|
||||
public static function getDefaultArgumentValueResolvers(): iterable
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
new RequestAttributeValueResolver(),
|
||||
new RequestValueResolver(),
|
||||
new SessionValueResolver(),
|
||||
new DefaultValueResolver(),
|
||||
new VariadicValueResolver(),
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,15 +27,15 @@ use Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface;
|
||||
class ControllerReference
|
||||
{
|
||||
public $controller;
|
||||
public $attributes = array();
|
||||
public $query = array();
|
||||
public $attributes = [];
|
||||
public $query = [];
|
||||
|
||||
/**
|
||||
* @param string $controller The controller name
|
||||
* @param array $attributes An array of parameters to add to the Request attributes
|
||||
* @param array $query An array of parameters to add to the Request query string
|
||||
*/
|
||||
public function __construct(string $controller, array $attributes = array(), array $query = array())
|
||||
public function __construct(string $controller, array $attributes = [], array $query = [])
|
||||
{
|
||||
$this->controller = $controller;
|
||||
$this->attributes = $attributes;
|
||||
|
||||
@@ -107,7 +107,7 @@ class ControllerResolver implements ControllerResolverInterface
|
||||
list($class, $method) = explode('::', $controller, 2);
|
||||
|
||||
try {
|
||||
return array($this->instantiateController($class), $method);
|
||||
return [$this->instantiateController($class), $method];
|
||||
} catch (\Error | \LogicException $e) {
|
||||
try {
|
||||
if ((new \ReflectionMethod($class, $method))->isStatic()) {
|
||||
@@ -155,7 +155,7 @@ class ControllerResolver implements ControllerResolverInterface
|
||||
}
|
||||
|
||||
if (!isset($callable[0]) || !isset($callable[1]) || 2 !== \count($callable)) {
|
||||
return 'Invalid array callable, expected array(controller, method).';
|
||||
return 'Invalid array callable, expected [controller, method].';
|
||||
}
|
||||
|
||||
list($controller, $method) = $callable;
|
||||
@@ -172,7 +172,7 @@ class ControllerResolver implements ControllerResolverInterface
|
||||
|
||||
$collection = $this->getClassMethodsWithoutMagicMethods($controller);
|
||||
|
||||
$alternatives = array();
|
||||
$alternatives = [];
|
||||
|
||||
foreach ($collection as $item) {
|
||||
$lev = levenshtein($method, $item);
|
||||
|
||||
Reference in New Issue
Block a user