updated packages
This commit is contained in:
@@ -59,7 +59,7 @@ class AddAnnotatedClassesToCachePass implements CompilerPassInterface
|
||||
*/
|
||||
private function expandClasses(array $patterns, array $classes)
|
||||
{
|
||||
$expanded = array();
|
||||
$expanded = [];
|
||||
|
||||
// Explicit classes declared in the patterns are returned directly
|
||||
foreach ($patterns as $key => $pattern) {
|
||||
@@ -85,7 +85,7 @@ class AddAnnotatedClassesToCachePass implements CompilerPassInterface
|
||||
|
||||
private function getClassesInComposerClassMaps()
|
||||
{
|
||||
$classes = array();
|
||||
$classes = [];
|
||||
|
||||
foreach (spl_autoload_functions() as $function) {
|
||||
if (!\is_array($function)) {
|
||||
@@ -106,14 +106,14 @@ class AddAnnotatedClassesToCachePass implements CompilerPassInterface
|
||||
|
||||
private function patternsToRegexps($patterns)
|
||||
{
|
||||
$regexps = array();
|
||||
$regexps = [];
|
||||
|
||||
foreach ($patterns as $pattern) {
|
||||
// Escape user input
|
||||
$regex = preg_quote(ltrim($pattern, '\\'));
|
||||
|
||||
// Wildcards * and **
|
||||
$regex = strtr($regex, array('\\*\\*' => '.*?', '\\*' => '[^\\\\]*?'));
|
||||
$regex = strtr($regex, ['\\*\\*' => '.*?', '\\*' => '[^\\\\]*?']);
|
||||
|
||||
// If this class does not end by a slash, anchor the end
|
||||
if ('\\' !== substr($regex, -1)) {
|
||||
|
||||
@@ -52,7 +52,7 @@ class ControllerArgumentValueResolverPass implements CompilerPassInterface
|
||||
$id = (string) $resolverReference;
|
||||
$container->register("debug.$id", TraceableValueResolver::class)
|
||||
->setDecoratedService($id)
|
||||
->setArguments(array(new Reference("debug.$id.inner"), new Reference($this->traceableResolverStopwatch)));
|
||||
->setArguments([new Reference("debug.$id.inner"), new Reference($this->traceableResolverStopwatch)]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\DependencyInjection\Extension\Extension as BaseExtension;
|
||||
*/
|
||||
abstract class Extension extends BaseExtension
|
||||
{
|
||||
private $annotatedClasses = array();
|
||||
private $annotatedClasses = [];
|
||||
|
||||
/**
|
||||
* Gets the annotated classes to cache.
|
||||
|
||||
@@ -41,7 +41,7 @@ class FragmentRendererPass implements CompilerPassInterface
|
||||
}
|
||||
|
||||
$definition = $container->getDefinition($this->handlerService);
|
||||
$renderers = array();
|
||||
$renderers = [];
|
||||
foreach ($container->findTaggedServiceIds($this->rendererTag, true) as $id => $tags) {
|
||||
$def = $container->getDefinition($id);
|
||||
$class = $container->getParameterBag()->resolveValue($def->getClass());
|
||||
|
||||
@@ -23,19 +23,19 @@ use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
|
||||
class LazyLoadingFragmentHandler extends FragmentHandler
|
||||
{
|
||||
private $container;
|
||||
private $initialized = array();
|
||||
private $initialized = [];
|
||||
|
||||
public function __construct(ContainerInterface $container, RequestStack $requestStack, bool $debug = false)
|
||||
{
|
||||
$this->container = $container;
|
||||
|
||||
parent::__construct($requestStack, array(), $debug);
|
||||
parent::__construct($requestStack, [], $debug);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render($uri, $renderer = 'inline', array $options = array())
|
||||
public function render($uri, $renderer = 'inline', array $options = [])
|
||||
{
|
||||
if (!isset($this->initialized[$renderer]) && $this->container->has($renderer)) {
|
||||
$this->addRenderer($this->container->get($renderer));
|
||||
|
||||
@@ -32,7 +32,7 @@ class MergeExtensionConfigurationPass extends BaseMergeExtensionConfigurationPas
|
||||
{
|
||||
foreach ($this->extensions as $extension) {
|
||||
if (!\count($container->getExtensionConfig($extension))) {
|
||||
$container->loadFromExtension($extension, array());
|
||||
$container->loadFromExtension($extension, []);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
}
|
||||
|
||||
$parameterBag = $container->getParameterBag();
|
||||
$controllers = array();
|
||||
$controllers = [];
|
||||
|
||||
foreach ($container->findTaggedServiceIds($this->controllerTag, true) as $id => $tags) {
|
||||
$def = $container->getDefinition($id);
|
||||
@@ -72,14 +72,14 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
$isContainerAware = $r->implementsInterface(ContainerAwareInterface::class) || is_subclass_of($class, AbstractController::class);
|
||||
|
||||
// get regular public methods
|
||||
$methods = array();
|
||||
$arguments = array();
|
||||
$methods = [];
|
||||
$arguments = [];
|
||||
foreach ($r->getMethods(\ReflectionMethod::IS_PUBLIC) as $r) {
|
||||
if ('setContainer' === $r->name && $isContainerAware) {
|
||||
continue;
|
||||
}
|
||||
if (!$r->isConstructor() && !$r->isDestructor() && !$r->isAbstract()) {
|
||||
$methods[strtolower($r->name)] = array($r, $r->getParameters());
|
||||
$methods[strtolower($r->name)] = [$r, $r->getParameters()];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
$autowire = true;
|
||||
continue;
|
||||
}
|
||||
foreach (array('action', 'argument', 'id') as $k) {
|
||||
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));
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
/** @var \ReflectionMethod $r */
|
||||
|
||||
// create a per-method map of argument-names to service/type-references
|
||||
$args = array();
|
||||
$args = [];
|
||||
foreach ($parameters as $p) {
|
||||
/** @var \ReflectionParameter $p */
|
||||
$type = ltrim($target = ProxyHelper::getTypeHint($r, $p), '\\');
|
||||
@@ -138,13 +138,13 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
$binding = $bindings[$bindingName];
|
||||
|
||||
list($bindingValue, $bindingId) = $binding->getValues();
|
||||
$binding->setValues(array($bindingValue, $bindingId, true));
|
||||
$binding->setValues([$bindingValue, $bindingId, true]);
|
||||
|
||||
if (!$bindingValue instanceof Reference) {
|
||||
$args[$p->name] = new Reference('.value.'.$container->hash($bindingValue));
|
||||
$container->register((string) $args[$p->name], 'mixed')
|
||||
->setFactory('current')
|
||||
->addArgument(array($bindingValue));
|
||||
->addArgument([$bindingValue]);
|
||||
} else {
|
||||
$args[$p->name] = $bindingValue;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class ResettableServicePass implements CompilerPassInterface
|
||||
return;
|
||||
}
|
||||
|
||||
$services = $methods = array();
|
||||
$services = $methods = [];
|
||||
|
||||
foreach ($container->findTaggedServiceIds($this->tagName, true) as $id => $tags) {
|
||||
$services[$id] = new Reference($id, ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE);
|
||||
|
||||
Reference in New Issue
Block a user