Completed
Push — master ( caa748...46d5e9 )
by David
01:05
created
symfony/dependency-injection/Loader/Configurator/AbstractConfigurator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@
 block discarded – undo
23 23
     protected $definition;
24 24
     public function __call($method, $args)
25 25
     {
26
-        if (\method_exists($this, 'set' . $method)) {
27
-            return \call_user_func_array([$this, 'set' . $method], $args);
26
+        if (\method_exists($this, 'set'.$method)) {
27
+            return \call_user_func_array([$this, 'set'.$method], $args);
28 28
         }
29 29
         throw new \BadMethodCallException(\sprintf('Call to undefined method "%s::%s()".', static::class, $method));
30 30
     }
Please login to merge, or discard this patch.
third-party/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function supports($resource, $type = null)
62 62
     {
63
-        if (!\is_string($resource)) {
63
+        if ( ! \is_string($resource)) {
64 64
             return \false;
65 65
         }
66 66
         if (null === $type && 'xml' === \pathinfo($resource, \PATHINFO_EXTENSION)) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         if (null === ($defaultsNode = $xpath->query('//container:services/container:defaults')->item(0))) {
140 140
             return [];
141 141
         }
142
-        $defaults = ['tags' => $this->getChildren($defaultsNode, 'tag'), 'bind' => \array_map(function ($v) {
142
+        $defaults = ['tags' => $this->getChildren($defaultsNode, 'tag'), 'bind' => \array_map(function($v) {
143 143
             return new BoundArgument($v);
144 144
         }, $this->getArgumentsAsPhp($defaultsNode, 'bind', $file))];
145 145
         foreach ($defaults['tags'] as $tag) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         if ($this->isLoadingInstanceof) {
181 181
             $definition = new ChildDefinition('');
182 182
         } elseif ($parent = $service->getAttribute('parent')) {
183
-            if (!empty($this->instanceof)) {
183
+            if ( ! empty($this->instanceof)) {
184 184
                 throw new InvalidArgumentException(\sprintf('The service "%s" cannot use the "parent" option in the same file where "instanceof" configuration is defined as using both is not supported. Move your child definitions to a separate file.', $service->getAttribute('id')));
185 185
             }
186 186
             foreach ($defaults as $k => $v) {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
                     }
196 196
                     continue;
197 197
                 }
198
-                if (!$service->hasAttribute($k)) {
198
+                if ( ! $service->hasAttribute($k)) {
199 199
                     throw new InvalidArgumentException(\sprintf('Attribute "%s" on service "%s" cannot be inherited from "defaults" when a "parent" is set. Move your child definitions to a separate file or define this attribute explicitly.', $k, $service->getAttribute('id')));
200 200
                 }
201 201
             }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         }
216 216
         foreach (['class', 'public', 'shared', 'synthetic', 'lazy', 'abstract'] as $key) {
217 217
             if ($value = $service->getAttribute($key)) {
218
-                $method = 'set' . $key;
218
+                $method = 'set'.$key;
219 219
                 $definition->{$method}(XmlUtils::phpize($value));
220 220
             }
221 221
         }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
             $definition->setAutowired(XmlUtils::phpize($value));
224 224
         }
225 225
         if ($value = $service->getAttribute('autoconfigure')) {
226
-            if (!$definition instanceof ChildDefinition) {
226
+            if ( ! $definition instanceof ChildDefinition) {
227 227
                 $definition->setAutoconfigured(XmlUtils::phpize($value));
228 228
             } elseif ($value = XmlUtils::phpize($value)) {
229 229
                 throw new InvalidArgumentException(\sprintf('The service "%s" cannot have a "parent" and also have "autoconfigure". Try setting autoconfigure="false" for the service.', $service->getAttribute('id')));
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             $definition->addMethodCall($call->getAttribute('method'), $this->getArgumentsAsPhp($call, 'argument', $file));
268 268
         }
269 269
         $tags = $this->getChildren($service, 'tag');
270
-        if (!empty($defaults['tags'])) {
270
+        if ( ! empty($defaults['tags'])) {
271 271
             $tags = \array_merge($tags, $defaults['tags']);
272 272
         }
273 273
         foreach ($tags as $tag) {
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                 if ('name' === $name) {
277 277
                     continue;
278 278
                 }
279
-                if (\false !== \strpos($name, '-') && \false === \strpos($name, '_') && !\array_key_exists($normalizedName = \str_replace('-', '_', $name), $parameters)) {
279
+                if (\false !== \strpos($name, '-') && \false === \strpos($name, '_') && ! \array_key_exists($normalizedName = \str_replace('-', '_', $name), $parameters)) {
280 280
                     $parameters[$normalizedName] = XmlUtils::phpize($node->nodeValue);
281 281
                 }
282 282
                 // keep not normalized key
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
         try {
320 320
             $dom = XmlUtils::loadFile($file, [$this, 'validateSchema']);
321 321
         } catch (\InvalidArgumentException $e) {
322
-            throw new InvalidArgumentException(\sprintf('Unable to parse file "%s": ', $file) . $e->getMessage(), $e->getCode(), $e);
322
+            throw new InvalidArgumentException(\sprintf('Unable to parse file "%s": ', $file).$e->getMessage(), $e->getCode(), $e);
323 323
         }
324 324
         $this->validateExtensions($dom, $file);
325 325
         return $dom;
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
     {
335 335
         $definitions = [];
336 336
         $count = 0;
337
-        $suffix = '~' . ContainerBuilder::hash($file);
337
+        $suffix = '~'.ContainerBuilder::hash($file);
338 338
         $xpath = new \DOMXPath($xml);
339 339
         $xpath->registerNamespace('container', self::NS);
340 340
         // anonymous services as arguments/properties
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
             foreach ($nodes as $node) {
343 343
                 if ($services = $this->getChildren($node, 'service')) {
344 344
                     // give it a unique name
345
-                    $id = \sprintf('%d_%s', ++$count, \preg_replace('/^.*\\\\/', '', $services[0]->getAttribute('class')) . $suffix);
345
+                    $id = \sprintf('%d_%s', ++$count, \preg_replace('/^.*\\\\/', '', $services[0]->getAttribute('class')).$suffix);
346 346
                     $node->setAttribute('id', $id);
347 347
                     $node->setAttribute('service', $id);
348 348
                     $definitions[$id] = [$services[0], $file, \false];
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
             foreach ($nodes as $node) {
359 359
                 @\trigger_error(\sprintf('Top-level anonymous services are deprecated since Symfony 3.4, the "id" attribute will be required in version 4.0 in %s at line %d.', $file, $node->getLineNo()), \E_USER_DEPRECATED);
360 360
                 // give it a unique name
361
-                $id = \sprintf('%d_%s', ++$count, \preg_replace('/^.*\\\\/', '', $node->getAttribute('class')) . $suffix);
361
+                $id = \sprintf('%d_%s', ++$count, \preg_replace('/^.*\\\\/', '', $node->getAttribute('class')).$suffix);
362 362
                 $node->setAttribute('id', $id);
363 363
                 $definitions[$id] = [$node, $file, \true];
364 364
             }
@@ -394,8 +394,8 @@  discard block
 block discarded – undo
394 394
             // this is used by ChildDefinition to overwrite a specific
395 395
             // argument of the parent definition
396 396
             if ($arg->hasAttribute('index')) {
397
-                $key = ($isChildDefinition ? 'index_' : '') . $arg->getAttribute('index');
398
-            } elseif (!$arg->hasAttribute('key')) {
397
+                $key = ($isChildDefinition ? 'index_' : '').$arg->getAttribute('index');
398
+            } elseif ( ! $arg->hasAttribute('key')) {
399 399
                 // Append an empty argument, then fetch its key to overwrite it later
400 400
                 $arguments[] = null;
401 401
                 $keys = \array_keys($arguments);
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
                     $arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior);
424 424
                     break;
425 425
                 case 'expression':
426
-                    if (!\class_exists(Expression::class)) {
426
+                    if ( ! \class_exists(Expression::class)) {
427 427
                         throw new \LogicException(\sprintf('The type="expression" attribute cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'));
428 428
                     }
429 429
                     $arguments[$key] = new Expression($arg->nodeValue);
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
                     }
441 441
                     break;
442 442
                 case 'tagged':
443
-                    if (!$arg->getAttribute('tag')) {
443
+                    if ( ! $arg->getAttribute('tag')) {
444 444
                         throw new InvalidArgumentException(\sprintf('Tag "<%s>" with type="tagged" has no or empty "tag" attribute in "%s".', $name, $file));
445 445
                     }
446 446
                     $arguments[$key] = new TaggedIteratorArgument($arg->getAttribute('tag'));
@@ -483,17 +483,17 @@  discard block
 block discarded – undo
483 483
      */
484 484
     public function validateSchema(\DOMDocument $dom)
485 485
     {
486
-        $schemaLocations = ['http://symfony.com/schema/dic/services' => \str_replace('\\', '/', __DIR__ . '/schema/dic/services/services-1.0.xsd')];
486
+        $schemaLocations = ['http://symfony.com/schema/dic/services' => \str_replace('\\', '/', __DIR__.'/schema/dic/services/services-1.0.xsd')];
487 487
         if ($element = $dom->documentElement->getAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation')) {
488 488
             $items = \preg_split('/\\s+/', $element);
489 489
             for ($i = 0, $nb = \count($items); $i < $nb; $i += 2) {
490
-                if (!$this->container->hasExtension($items[$i])) {
490
+                if ( ! $this->container->hasExtension($items[$i])) {
491 491
                     continue;
492 492
                 }
493 493
                 if (($extension = $this->container->getExtension($items[$i])) && \false !== $extension->getXsdValidationBasePath()) {
494 494
                     $ns = $extension->getNamespace();
495
-                    $path = \str_replace([$ns, \str_replace('http://', 'https://', $ns)], \str_replace('\\', '/', $extension->getXsdValidationBasePath()) . '/', $items[$i + 1]);
496
-                    if (!\is_file($path)) {
495
+                    $path = \str_replace([$ns, \str_replace('http://', 'https://', $ns)], \str_replace('\\', '/', $extension->getXsdValidationBasePath()).'/', $items[$i + 1]);
496
+                    if ( ! \is_file($path)) {
497 497
                         throw new RuntimeException(\sprintf('Extension "%s" references a non-existent XSD file "%s".', \get_class($extension), $path));
498 498
                     }
499 499
                     $schemaLocations[$items[$i]] = $path;
@@ -516,9 +516,9 @@  discard block
 block discarded – undo
516 516
                     $locationstart = 'phar:///';
517 517
                 }
518 518
             }
519
-            $drive = '\\' === \DIRECTORY_SEPARATOR ? \array_shift($parts) . '/' : '';
520
-            $location = $locationstart . $drive . \implode('/', \array_map('rawurlencode', $parts));
521
-            $imports .= \sprintf('  <xsd:import namespace="%s" schemaLocation="%s" />' . "\n", $namespace, $location);
519
+            $drive = '\\' === \DIRECTORY_SEPARATOR ? \array_shift($parts).'/' : '';
520
+            $location = $locationstart.$drive.\implode('/', \array_map('rawurlencode', $parts));
521
+            $imports .= \sprintf('  <xsd:import namespace="%s" schemaLocation="%s" />'."\n", $namespace, $location);
522 522
         }
523 523
         $source = <<<EOF
524 524
 <?xml version="1.0" encoding="utf-8" ?>
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
     private function validateAlias(\DOMElement $alias, $file)
552 552
     {
553 553
         foreach ($alias->attributes as $name => $node) {
554
-            if (!\in_array($name, ['alias', 'id', 'public'])) {
554
+            if ( ! \in_array($name, ['alias', 'id', 'public'])) {
555 555
                 @\trigger_error(\sprintf('Using the attribute "%s" is deprecated for the service "%s" which is defined as an alias in "%s". Allowed attributes for service aliases are "alias", "id" and "public". The XmlFileLoader will raise an exception in Symfony 4.0, instead of silently ignoring unsupported attributes.', $name, $alias->getAttribute('id'), $file), \E_USER_DEPRECATED);
556 556
             }
557 557
         }
@@ -571,12 +571,12 @@  discard block
 block discarded – undo
571 571
     private function validateExtensions(\DOMDocument $dom, $file)
572 572
     {
573 573
         foreach ($dom->documentElement->childNodes as $node) {
574
-            if (!$node instanceof \DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) {
574
+            if ( ! $node instanceof \DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) {
575 575
                 continue;
576 576
             }
577 577
             // can it be handled by an extension?
578
-            if (!$this->container->hasExtension($node->namespaceURI)) {
579
-                $extensionNamespaces = \array_filter(\array_map(function ($ext) {
578
+            if ( ! $this->container->hasExtension($node->namespaceURI)) {
579
+                $extensionNamespaces = \array_filter(\array_map(function($ext) {
580 580
                     return $ext->getNamespace();
581 581
                 }, $this->container->getExtensions()));
582 582
                 throw new InvalidArgumentException(\sprintf('There is no extension able to load the configuration for "%s" (in "%s"). Looked for namespace "%s", found "%s".', $node->tagName, $file, $node->namespaceURI, $extensionNamespaces ? \sprintf('"%s"', \implode('", "', $extensionNamespaces)) : 'none'));
@@ -589,11 +589,11 @@  discard block
 block discarded – undo
589 589
     private function loadFromExtensions(\DOMDocument $xml)
590 590
     {
591 591
         foreach ($xml->documentElement->childNodes as $node) {
592
-            if (!$node instanceof \DOMElement || self::NS === $node->namespaceURI) {
592
+            if ( ! $node instanceof \DOMElement || self::NS === $node->namespaceURI) {
593 593
                 continue;
594 594
             }
595 595
             $values = static::convertDomElementToArray($node);
596
-            if (!\is_array($values)) {
596
+            if ( ! \is_array($values)) {
597 597
                 $values = [];
598 598
             }
599 599
             $this->container->loadFromExtension($node->namespaceURI, $values);
Please login to merge, or discard this patch.
vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             return null;
86 86
         }
87 87
         if (\is_string($factory = $definition->getFactory())) {
88
-            if (!\function_exists($factory)) {
88
+            if ( ! \function_exists($factory)) {
89 89
                 throw new RuntimeException(\sprintf('Invalid service "%s": function "%s" does not exist.', $this->currentId, $factory));
90 90
             }
91 91
             $r = new \ReflectionFunction($factory);
@@ -108,18 +108,18 @@  discard block
 block discarded – undo
108 108
         }
109 109
         $class = $definition->getClass();
110 110
         try {
111
-            if (!($r = $this->container->getReflectionClass($class))) {
111
+            if ( ! ($r = $this->container->getReflectionClass($class))) {
112 112
                 throw new RuntimeException(\sprintf('Invalid service "%s": class "%s" does not exist.', $this->currentId, $class));
113 113
             }
114 114
         } catch (\ReflectionException $e) {
115
-            throw new RuntimeException(\sprintf('Invalid service "%s": ', $this->currentId) . \lcfirst($e->getMessage()));
115
+            throw new RuntimeException(\sprintf('Invalid service "%s": ', $this->currentId).\lcfirst($e->getMessage()));
116 116
         }
117
-        if (!($r = $r->getConstructor())) {
117
+        if ( ! ($r = $r->getConstructor())) {
118 118
             if ($required) {
119 119
                 throw new RuntimeException(\sprintf('Invalid service "%s": class%s has no constructor.', $this->currentId, \sprintf($class !== $this->currentId ? ' "%s"' : '', $class)));
120 120
             }
121
-        } elseif (!$r->isPublic()) {
122
-            throw new RuntimeException(\sprintf('Invalid service "%s": ', $this->currentId) . \sprintf($class !== $this->currentId ? 'constructor of class "%s"' : 'its constructor', $class) . ' must be public.');
121
+        } elseif ( ! $r->isPublic()) {
122
+            throw new RuntimeException(\sprintf('Invalid service "%s": ', $this->currentId).\sprintf($class !== $this->currentId ? 'constructor of class "%s"' : 'its constructor', $class).' must be public.');
123 123
         }
124 124
         return $r;
125 125
     }
@@ -135,18 +135,18 @@  discard block
 block discarded – undo
135 135
         if ('__construct' === $method) {
136 136
             return $this->getConstructor($definition, \true);
137 137
         }
138
-        if (!($class = $definition->getClass())) {
138
+        if ( ! ($class = $definition->getClass())) {
139 139
             throw new RuntimeException(\sprintf('Invalid service "%s": the class is not set.', $this->currentId));
140 140
         }
141
-        if (!($r = $this->container->getReflectionClass($class))) {
141
+        if ( ! ($r = $this->container->getReflectionClass($class))) {
142 142
             throw new RuntimeException(\sprintf('Invalid service "%s": class "%s" does not exist.', $this->currentId, $class));
143 143
         }
144
-        if (!$r->hasMethod($method)) {
145
-            throw new RuntimeException(\sprintf('Invalid service "%s": method "%s()" does not exist.', $this->currentId, $class !== $this->currentId ? $class . '::' . $method : $method));
144
+        if ( ! $r->hasMethod($method)) {
145
+            throw new RuntimeException(\sprintf('Invalid service "%s": method "%s()" does not exist.', $this->currentId, $class !== $this->currentId ? $class.'::'.$method : $method));
146 146
         }
147 147
         $r = $r->getMethod($method);
148
-        if (!$r->isPublic()) {
149
-            throw new RuntimeException(\sprintf('Invalid service "%s": method "%s()" must be public.', $this->currentId, $class !== $this->currentId ? $class . '::' . $method : $method));
148
+        if ( ! $r->isPublic()) {
149
+            throw new RuntimeException(\sprintf('Invalid service "%s": method "%s()" must be public.', $this->currentId, $class !== $this->currentId ? $class.'::'.$method : $method));
150 150
         }
151 151
         return $r;
152 152
     }
Please login to merge, or discard this patch.
vendor/symfony/dependency-injection/Compiler/DecoratorServicePass.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $definitions = new \SplPriorityQueue();
27 27
         $order = \PHP_INT_MAX;
28 28
         foreach ($container->getDefinitions() as $id => $definition) {
29
-            if (!($decorated = $definition->getDecoratedService())) {
29
+            if ( ! ($decorated = $definition->getDecoratedService())) {
30 30
                 continue;
31 31
             }
32 32
             $definitions->insert([$id, $definition], [$decorated[2], --$order]);
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
         foreach ($definitions as list($id, $definition)) {
36 36
             list($inner, $renamedId) = $definition->getDecoratedService();
37 37
             $definition->setDecoratedService(null);
38
-            if (!$renamedId) {
39
-                $renamedId = $id . '.inner';
38
+            if ( ! $renamedId) {
39
+                $renamedId = $id.'.inner';
40 40
             }
41 41
             // we create a new alias/service for the service we are replacing
42 42
             // to be able to reference it in the new one
Please login to merge, or discard this patch.
symfony/dependency-injection/Compiler/InlineServiceDefinitionsPass.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
             }
60 60
             $value = clone $value;
61 61
         }
62
-        if (!$value instanceof Reference || !$this->container->hasDefinition($id = $this->container->normalizeId($value))) {
62
+        if ( ! $value instanceof Reference || ! $this->container->hasDefinition($id = $this->container->normalizeId($value))) {
63 63
             return parent::processValue($value, $isRoot);
64 64
         }
65 65
         $definition = $this->container->getDefinition($id);
66
-        if (!$this->isInlineableDefinition($id, $definition, $this->container->getCompiler()->getServiceReferenceGraph())) {
66
+        if ( ! $this->isInlineableDefinition($id, $definition, $this->container->getCompiler()->getServiceReferenceGraph())) {
67 67
             return $value;
68 68
         }
69 69
         $this->container->log($this, \sprintf('Inlined service "%s" to "%s".', $id, $this->currentId));
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
         if ($definition->getErrors() || $definition->isDeprecated() || $definition->isLazy() || $definition->isSynthetic()) {
94 94
             return \false;
95 95
         }
96
-        if (!$definition->isShared()) {
96
+        if ( ! $definition->isShared()) {
97 97
             return \true;
98 98
         }
99 99
         if ($definition->isPublic() || $definition->isPrivate()) {
100 100
             return \false;
101 101
         }
102
-        if (!$graph->hasNode($id)) {
102
+        if ( ! $graph->hasNode($id)) {
103 103
             return \true;
104 104
         }
105 105
         if ($this->currentId == $id) {
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             }
115 115
             $ids[] = $edge->getSourceNode()->getId();
116 116
         }
117
-        if (!$ids) {
117
+        if ( ! $ids) {
118 118
             return \true;
119 119
         }
120 120
         if (\count(\array_unique($ids)) > 1) {
Please login to merge, or discard this patch.
symfony/dependency-injection/Compiler/ResolveChildDefinitionsPass.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     private $currentPath;
28 28
     protected function processValue($value, $isRoot = \false)
29 29
     {
30
-        if (!$value instanceof Definition) {
30
+        if ( ! $value instanceof Definition) {
31 31
             return parent::processValue($value, $isRoot);
32 32
         }
33 33
         if ($isRoot) {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     }
67 67
     private function doResolveDefinition(ChildDefinition $definition)
68 68
     {
69
-        if (!$this->container->has($parent = $definition->getParent())) {
69
+        if ( ! $this->container->has($parent = $definition->getParent())) {
70 70
             throw new RuntimeException(\sprintf('Parent definition "%s" does not exist.', $parent));
71 71
         }
72 72
         $searchKey = \array_search($parent, $this->currentPath);
Please login to merge, or discard this patch.
symfony/dependency-injection/Compiler/CheckDefinitionValidityPass.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
     {
37 37
         foreach ($container->getDefinitions() as $id => $definition) {
38 38
             // synthetic service is public
39
-            if ($definition->isSynthetic() && !($definition->isPublic() || $definition->isPrivate())) {
39
+            if ($definition->isSynthetic() && ! ($definition->isPublic() || $definition->isPrivate())) {
40 40
                 throw new RuntimeException(\sprintf('A synthetic service ("%s") must be public.', $id));
41 41
             }
42 42
             // non-synthetic, non-abstract service has class
43
-            if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass()) {
43
+            if ( ! $definition->isAbstract() && ! $definition->isSynthetic() && ! $definition->getClass()) {
44 44
                 if ($definition->getFactory()) {
45 45
                     throw new RuntimeException(\sprintf('Please add the class to service "%s" even if it is constructed by a factory since we might need to add method calls based on compile-time checks.', $id));
46 46
                 }
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
             foreach ($definition->getTags() as $name => $tags) {
57 57
                 foreach ($tags as $attributes) {
58 58
                     foreach ($attributes as $attribute => $value) {
59
-                        if (!\is_scalar($value) && null !== $value) {
59
+                        if ( ! \is_scalar($value) && null !== $value) {
60 60
                             throw new RuntimeException(\sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $id, $name, $attribute));
61 61
                         }
62 62
                     }
63 63
                 }
64 64
             }
65
-            if ($definition->isPublic() && !$definition->isPrivate()) {
65
+            if ($definition->isPublic() && ! $definition->isPrivate()) {
66 66
                 $resolvedId = $container->resolveEnvPlaceholders($id, null, $usedEnvs);
67 67
                 if (null !== $usedEnvs) {
68 68
                     throw new EnvParameterException([$resolvedId], null, 'A service name ("%s") cannot contain dynamic values.');
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             }
71 71
         }
72 72
         foreach ($container->getAliases() as $id => $alias) {
73
-            if ($alias->isPublic() && !$alias->isPrivate()) {
73
+            if ($alias->isPublic() && ! $alias->isPrivate()) {
74 74
                 $resolvedId = $container->resolveEnvPlaceholders($id, null, $usedEnvs);
75 75
                 if (null !== $usedEnvs) {
76 76
                     throw new EnvParameterException([$resolvedId], null, 'An alias name ("%s") cannot contain dynamic values.');
Please login to merge, or discard this patch.
vendor/symfony/dependency-injection/Compiler/ServiceLocatorTagPass.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
 {
27 27
     protected function processValue($value, $isRoot = \false)
28 28
     {
29
-        if (!$value instanceof Definition || !$value->hasTag('container.service_locator')) {
29
+        if ( ! $value instanceof Definition || ! $value->hasTag('container.service_locator')) {
30 30
             return parent::processValue($value, $isRoot);
31 31
         }
32
-        if (!$value->getClass()) {
32
+        if ( ! $value->getClass()) {
33 33
             $value->setClass(ServiceLocator::class);
34 34
         }
35 35
         $arguments = $value->getArguments();
36
-        if (!isset($arguments[0]) || !\is_array($arguments[0])) {
36
+        if ( ! isset($arguments[0]) || ! \is_array($arguments[0])) {
37 37
             throw new InvalidArgumentException(\sprintf('Invalid definition for service "%s": an array of references is expected as first argument when the "container.service_locator" tag is set.', $this->currentId));
38 38
         }
39 39
         $i = 0;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             if ($v instanceof ServiceClosureArgument) {
42 42
                 continue;
43 43
             }
44
-            if (!$v instanceof Reference) {
44
+            if ( ! $v instanceof Reference) {
45 45
                 throw new InvalidArgumentException(\sprintf('Invalid definition for service "%s": an array of references is expected as first argument when the "container.service_locator" tag is set, "%s" found for key "%s".', $this->currentId, \is_object($v) ? \get_class($v) : \gettype($v), $k));
46 46
             }
47 47
             if ($i === $k) {
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         }
56 56
         \ksort($arguments[0]);
57 57
         $value->setArguments($arguments);
58
-        $id = 'service_locator.' . ContainerBuilder::hash($value);
58
+        $id = 'service_locator.'.ContainerBuilder::hash($value);
59 59
         if ($isRoot) {
60 60
             if ($id !== $this->currentId) {
61 61
                 $this->container->setAlias($id, new Alias($this->currentId, \false));
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     public static function register(ContainerBuilder $container, array $refMap, $callerId = null)
75 75
     {
76 76
         foreach ($refMap as $id => $ref) {
77
-            if (!$ref instanceof Reference) {
77
+            if ( ! $ref instanceof Reference) {
78 78
                 throw new InvalidArgumentException(\sprintf('Invalid service locator definition: only services can be referenced, "%s" found for key "%s". Inject parameter values using constructors instead.', \is_object($ref) ? \get_class($ref) : \gettype($ref), $id));
79 79
             }
80 80
             $refMap[$id] = new ServiceClosureArgument($ref);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         if (null !== $callerId && $container->hasDefinition($callerId)) {
85 85
             $locator->setBindings($container->getDefinition($callerId)->getBindings());
86 86
         }
87
-        if (!$container->hasDefinition($id = 'service_locator.' . ContainerBuilder::hash($locator))) {
87
+        if ( ! $container->hasDefinition($id = 'service_locator.'.ContainerBuilder::hash($locator))) {
88 88
             $container->setDefinition($id, $locator);
89 89
         }
90 90
         if (null !== $callerId) {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             // Locators are shared when they hold the exact same list of factories;
93 93
             // to have them specialized per consumer service, we use a cloning factory
94 94
             // to derivate customized instances from the prototype one.
95
-            $container->register($id .= '.' . $callerId, ServiceLocator::class)->setPublic(\false)->setFactory([new Reference($locatorId), 'withContext'])->addArgument($callerId)->addArgument(new Reference('service_container'));
95
+            $container->register($id .= '.'.$callerId, ServiceLocator::class)->setPublic(\false)->setFactory([new Reference($locatorId), 'withContext'])->addArgument($callerId)->addArgument(new Reference('service_container'));
96 96
         }
97 97
         return new Reference($id);
98 98
     }
Please login to merge, or discard this patch.
vendor/symfony/dependency-injection/Compiler/AutoAliasServicePass.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     {
26 26
         foreach ($container->findTaggedServiceIds('auto_alias') as $serviceId => $tags) {
27 27
             foreach ($tags as $tag) {
28
-                if (!isset($tag['format'])) {
28
+                if ( ! isset($tag['format'])) {
29 29
                     throw new InvalidArgumentException(\sprintf('Missing tag information "format" on auto_alias service "%s".', $serviceId));
30 30
                 }
31 31
                 $aliasId = $container->getParameterBag()->resolveValue($tag['format']);
Please login to merge, or discard this patch.