@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | if (\is_int($index) && ($index < 0 || $index > \count($this->arguments) - 1)) { |
230 | 230 | throw new OutOfBoundsException(\sprintf('The index "%d" is not in the range [0, %d].', $index, \count($this->arguments) - 1)); |
231 | 231 | } |
232 | - if (!\array_key_exists($index, $this->arguments)) { |
|
232 | + if ( ! \array_key_exists($index, $this->arguments)) { |
|
233 | 233 | throw new OutOfBoundsException(\sprintf('The argument "%s" doesn\'t exist.', $index)); |
234 | 234 | } |
235 | 235 | $this->arguments[$index] = $argument; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function getArgument($index) |
270 | 270 | { |
271 | - if (!\array_key_exists($index, $this->arguments)) { |
|
271 | + if ( ! \array_key_exists($index, $this->arguments)) { |
|
272 | 272 | throw new OutOfBoundsException(\sprintf('The argument "%s" doesn\'t exist.', $index)); |
273 | 273 | } |
274 | 274 | return $this->arguments[$index]; |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | public function setBindings(array $bindings) |
816 | 816 | { |
817 | 817 | foreach ($bindings as $key => $binding) { |
818 | - if (!$binding instanceof BoundArgument) { |
|
818 | + if ( ! $binding instanceof BoundArgument) { |
|
819 | 819 | $bindings[$key] = new BoundArgument($binding); |
820 | 820 | } |
821 | 821 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function setValues(array $values) |
38 | 38 | { |
39 | - if ([0] !== \array_keys($values) || !($values[0] instanceof Reference || null === $values[0])) { |
|
39 | + if ([0] !== \array_keys($values) || ! ($values[0] instanceof Reference || null === $values[0])) { |
|
40 | 40 | throw new InvalidArgumentException('A ServiceClosureArgument must hold one and only one Reference.'); |
41 | 41 | } |
42 | 42 | $this->values = $values; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | public function setValues(array $values) |
41 | 41 | { |
42 | 42 | foreach ($values as $k => $v) { |
43 | - if (null !== $v && !$v instanceof Reference) { |
|
43 | + if (null !== $v && ! $v instanceof Reference) { |
|
44 | 44 | throw new InvalidArgumentException(\sprintf('An IteratorArgument must hold only Reference instances, "%s" given.', \is_object($v) ? \get_class($v) : \gettype($v))); |
45 | 45 | } |
46 | 46 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function getNamespace() |
38 | 38 | { |
39 | - return 'http://example.org/schema/dic/' . $this->getAlias(); |
|
39 | + return 'http://example.org/schema/dic/'.$this->getAlias(); |
|
40 | 40 | } |
41 | 41 | /** |
42 | 42 | * Returns the recommended alias to use in XML. |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $class = \substr_replace($class, '\\Configuration', \strrpos($class, '\\')); |
81 | 81 | $class = $container->getReflectionClass($class); |
82 | 82 | $constructor = $class ? $class->getConstructor() : null; |
83 | - return $class && (!$constructor || !$constructor->getNumberOfRequiredParameters()) ? $class->newInstance() : null; |
|
83 | + return $class && ( ! $constructor || ! $constructor->getNumberOfRequiredParameters()) ? $class->newInstance() : null; |
|
84 | 84 | } |
85 | 85 | /** |
86 | 86 | * @return array |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | protected function isConfigEnabled(ContainerBuilder $container, array $config) |
110 | 110 | { |
111 | - if (!\array_key_exists('enabled', $config)) { |
|
111 | + if ( ! \array_key_exists('enabled', $config)) { |
|
112 | 112 | throw new InvalidArgumentException("The config array has no 'enabled' key."); |
113 | 113 | } |
114 | 114 | return (bool) $container->getParameterBag()->resolveValue($config['enabled']); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function get($id) |
44 | 44 | { |
45 | - if (!isset($this->factories[$id])) { |
|
45 | + if ( ! isset($this->factories[$id])) { |
|
46 | 46 | throw new ServiceNotFoundException($id, \end($this->loading) ?: null, null, [], $this->createServiceNotFoundMessage($id)); |
47 | 47 | } |
48 | 48 | if (isset($this->loading[$id])) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $externalId = $this->externalId ?: $class; |
83 | 83 | $msg = []; |
84 | 84 | $msg[] = \sprintf('Service "%s" not found:', $id); |
85 | - if (!$this->container) { |
|
85 | + if ( ! $this->container) { |
|
86 | 86 | $class = null; |
87 | 87 | } elseif ($this->container->has($id) || isset($this->container->getRemovedIds()[$id])) { |
88 | 88 | $msg[] = 'even though it exists in the app\'s container,'; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } else { |
104 | 104 | $msg[] = \sprintf('the current service locator %s', $this->formatAlternatives()); |
105 | 105 | } |
106 | - if (!$class) { |
|
106 | + if ( ! $class) { |
|
107 | 107 | // no-op |
108 | 108 | } elseif (\is_subclass_of($class, ServiceSubscriberInterface::class)) { |
109 | 109 | $msg[] = \sprintf('Unless you need extra laziness, try using dependency injection instead. Otherwise, you need to declare it using "%s::getSubscribedServices()".', \preg_replace('/([^\\\\]++\\\\)++/', '', $class)); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | { |
117 | 117 | $format = '"%s"%s'; |
118 | 118 | if (null === $alternatives) { |
119 | - if (!($alternatives = \array_keys($this->factories))) { |
|
119 | + if ( ! ($alternatives = \array_keys($this->factories))) { |
|
120 | 120 | return 'is empty...'; |
121 | 121 | } |
122 | 122 | $format = \sprintf('only knows about the %s service%s.', $format, 1 < \count($alternatives) ? 's' : ''); |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function getArgument($index) |
66 | 66 | { |
67 | - if (\array_key_exists('index_' . $index, $this->arguments)) { |
|
68 | - return $this->arguments['index_' . $index]; |
|
67 | + if (\array_key_exists('index_'.$index, $this->arguments)) { |
|
68 | + return $this->arguments['index_'.$index]; |
|
69 | 69 | } |
70 | 70 | return parent::getArgument($index); |
71 | 71 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function replaceArgument($index, $value) |
88 | 88 | { |
89 | 89 | if (\is_int($index)) { |
90 | - $this->arguments['index_' . $index] = $value; |
|
90 | + $this->arguments['index_'.$index] = $value; |
|
91 | 91 | } elseif (0 === \strpos($index, '$')) { |
92 | 92 | $this->arguments[$index] = $value; |
93 | 93 | } else { |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function __toString() |
33 | 33 | { |
34 | - return 'container_parameters_' . \md5(\serialize($this->parameters)); |
|
34 | + return 'container_parameters_'.\md5(\serialize($this->parameters)); |
|
35 | 35 | } |
36 | 36 | /** |
37 | 37 | * @internal |
@@ -37,7 +37,7 @@ |
||
37 | 37 | public function isFresh(ResourceInterface $resource, $timestamp) |
38 | 38 | { |
39 | 39 | foreach ($resource->getParameters() as $key => $value) { |
40 | - if (!$this->container->hasParameter($key) || $this->container->getParameter($key) !== $value) { |
|
40 | + if ( ! $this->container->hasParameter($key) || $this->container->getParameter($key) !== $value) { |
|
41 | 41 | return \false; |
42 | 42 | } |
43 | 43 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | namespace Wordlift\Modules\Common\Symfony\Component\DependencyInjection\Config; |
12 | 12 | |
13 | -@\trigger_error('The ' . __NAMESPACE__ . '\\AutowireServiceResource class is deprecated since Symfony 3.3 and will be removed in 4.0. Use ContainerBuilder::getReflectionClass() instead.', \E_USER_DEPRECATED); |
|
13 | +@\trigger_error('The '.__NAMESPACE__.'\\AutowireServiceResource class is deprecated since Symfony 3.3 and will be removed in 4.0. Use ContainerBuilder::getReflectionClass() instead.', \E_USER_DEPRECATED); |
|
14 | 14 | use Wordlift\Modules\Common\Symfony\Component\Config\Resource\SelfCheckingResourceInterface; |
15 | 15 | use Wordlift\Modules\Common\Symfony\Component\DependencyInjection\Compiler\AutowirePass; |
16 | 16 | /** |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | public function isFresh($timestamp) |
31 | 31 | { |
32 | - if (!\file_exists($this->filePath)) { |
|
32 | + if ( ! \file_exists($this->filePath)) { |
|
33 | 33 | return \false; |
34 | 34 | } |
35 | 35 | // has the file *not* been modified? Definitely fresh |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | public function __toString() |
48 | 48 | { |
49 | - return 'service.autowire.' . $this->class; |
|
49 | + return 'service.autowire.'.$this->class; |
|
50 | 50 | } |
51 | 51 | /** |
52 | 52 | * @internal |