@@ -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 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | namespace Wordlift\Modules\Common\Symfony\Component\DependencyInjection; |
12 | 12 | |
13 | -@\trigger_error('The ' . __NAMESPACE__ . '\\DefinitionDecorator class is deprecated since Symfony 3.3 and will be removed in 4.0. Use the Symfony\\Component\\DependencyInjection\\ChildDefinition class instead.', \E_USER_DEPRECATED); |
|
13 | +@\trigger_error('The '.__NAMESPACE__.'\\DefinitionDecorator class is deprecated since Symfony 3.3 and will be removed in 4.0. Use the Symfony\\Component\\DependencyInjection\\ChildDefinition class instead.', \E_USER_DEPRECATED); |
|
14 | 14 | \class_exists(ChildDefinition::class); |
15 | 15 | if (\false) { |
16 | 16 | /** |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | foreach ($this->container->getDefinitions() as $id => $definition) { |
59 | 59 | $this->edges[$id] = \array_merge($this->findEdges($id, $definition->getArguments(), \true, ''), $this->findEdges($id, $definition->getProperties(), \false, '')); |
60 | 60 | foreach ($definition->getMethodCalls() as $call) { |
61 | - $this->edges[$id] = \array_merge($this->edges[$id], $this->findEdges($id, $call[1], \false, $call[0] . '()')); |
|
61 | + $this->edges[$id] = \array_merge($this->edges[$id], $this->findEdges($id, $call[1], \false, $call[0].'()')); |
|
62 | 62 | } |
63 | 63 | } |
64 | - return $this->container->resolveEnvPlaceholders($this->startDot() . $this->addNodes() . $this->addEdges() . $this->endDot(), '__ENV_%s__'); |
|
64 | + return $this->container->resolveEnvPlaceholders($this->startDot().$this->addNodes().$this->addEdges().$this->endDot(), '__ENV_%s__'); |
|
65 | 65 | } |
66 | 66 | /** |
67 | 67 | * Returns all nodes. |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $code = ''; |
74 | 74 | foreach ($this->nodes as $id => $node) { |
75 | 75 | $aliases = $this->getAliases($id); |
76 | - $code .= \sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id), $id . ($aliases ? ' (' . \implode(', ', $aliases) . ')' : ''), $node['class'], $this->options['node']['shape'], $this->addAttributes($node['attributes'])); |
|
76 | + $code .= \sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id), $id.($aliases ? ' ('.\implode(', ', $aliases).')' : ''), $node['class'], $this->options['node']['shape'], $this->addAttributes($node['attributes'])); |
|
77 | 77 | } |
78 | 78 | return $code; |
79 | 79 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | if ($argument instanceof Reference) { |
115 | 115 | $lazyEdge = $lazy; |
116 | - if (!$this->container->has((string) $argument)) { |
|
116 | + if ( ! $this->container->has((string) $argument)) { |
|
117 | 117 | $this->nodes[(string) $argument] = ['name' => $name, 'required' => $required, 'class' => '', 'attributes' => $this->options['node.missing']]; |
118 | 118 | } elseif ('service_container' !== (string) $argument) { |
119 | 119 | $lazyEdge = $lazy || $this->container->getDefinition((string) $argument)->isLazy(); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } elseif ($argument instanceof Definition) { |
125 | 125 | $edges = \array_merge($edges, $this->findEdges($id, $argument->getArguments(), $required, ''), $this->findEdges($id, $argument->getProperties(), \false, '')); |
126 | 126 | foreach ($argument->getMethodCalls() as $call) { |
127 | - $edges = \array_merge($edges, $this->findEdges($id, $call[1], \false, $call[0] . '()')); |
|
127 | + $edges = \array_merge($edges, $this->findEdges($id, $call[1], \false, $call[0].'()')); |
|
128 | 128 | } |
129 | 129 | } elseif (\is_array($argument)) { |
130 | 130 | $edges = \array_merge($edges, $this->findEdges($id, $argument, $required, $name, $lazy)); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | if (\array_key_exists($id, $container->getAliases())) { |
158 | 158 | continue; |
159 | 159 | } |
160 | - if (!$container->hasDefinition($id)) { |
|
160 | + if ( ! $container->hasDefinition($id)) { |
|
161 | 161 | $nodes[$id] = ['class' => \str_replace('\\', '\\\\', \get_class($container->get($id))), 'attributes' => $this->options['node.instance']]; |
162 | 162 | } |
163 | 163 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | foreach ($attributes as $k => $v) { |
207 | 207 | $code[] = \sprintf('%s="%s"', $k, $v); |
208 | 208 | } |
209 | - return $code ? ', ' . \implode(', ', $code) : ''; |
|
209 | + return $code ? ', '.\implode(', ', $code) : ''; |
|
210 | 210 | } |
211 | 211 | /** |
212 | 212 | * Adds options. |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function dump(array $options = []) |
42 | 42 | { |
43 | - if (!\class_exists('Wordlift\\Modules\\Common\\Symfony\\Component\\Yaml\\Dumper')) { |
|
43 | + if ( ! \class_exists('Wordlift\\Modules\\Common\\Symfony\\Component\\Yaml\\Dumper')) { |
|
44 | 44 | throw new RuntimeException('Unable to dump the container as the Symfony Yaml Component is not installed.'); |
45 | 45 | } |
46 | 46 | if (null === $this->dumper) { |
47 | 47 | $this->dumper = new YmlDumper(); |
48 | 48 | } |
49 | - return $this->container->resolveEnvPlaceholders($this->addParameters() . "\n" . $this->addServices()); |
|
49 | + return $this->container->resolveEnvPlaceholders($this->addParameters()."\n".$this->addServices()); |
|
50 | 50 | } |
51 | 51 | /** |
52 | 52 | * Adds a service. |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | $code .= \sprintf(" class: %s\n", $this->dumper->dump($class)); |
66 | 66 | } |
67 | - if (!$definition->isPrivate()) { |
|
67 | + if ( ! $definition->isPrivate()) { |
|
68 | 68 | $code .= \sprintf(" public: %s\n", $definition->isPublic() ? 'true' : 'false'); |
69 | 69 | } |
70 | 70 | $tagsCode = ''; |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | foreach ($attributes as $key => $value) { |
75 | 75 | $att[] = \sprintf('%s: %s', $this->dumper->dump($key), $this->dumper->dump($value)); |
76 | 76 | } |
77 | - $att = $att ? ', ' . \implode(', ', $att) : ''; |
|
77 | + $att = $att ? ', '.\implode(', ', $att) : ''; |
|
78 | 78 | $tagsCode .= \sprintf(" - { name: %s%s }\n", $this->dumper->dump($name), $att); |
79 | 79 | } |
80 | 80 | } |
81 | 81 | if ($tagsCode) { |
82 | - $code .= " tags:\n" . $tagsCode; |
|
82 | + $code .= " tags:\n".$tagsCode; |
|
83 | 83 | } |
84 | 84 | if ($definition->getFile()) { |
85 | 85 | $code .= \sprintf(" file: %s\n", $this->dumper->dump($definition->getFile())); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if ($definition->getMethodCalls()) { |
119 | 119 | $code .= \sprintf(" calls:\n%s\n", $this->dumper->dump($this->dumpValue($definition->getMethodCalls()), 1, 12)); |
120 | 120 | } |
121 | - if (!$definition->isShared()) { |
|
121 | + if ( ! $definition->isShared()) { |
|
122 | 122 | $code .= " shared: false\n"; |
123 | 123 | } |
124 | 124 | if (null !== ($decorated = $definition->getDecoratedService())) { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | private function addServices() |
162 | 162 | { |
163 | - if (!$this->container->getDefinitions()) { |
|
163 | + if ( ! $this->container->getDefinitions()) { |
|
164 | 164 | return ''; |
165 | 165 | } |
166 | 166 | $code = "services:\n"; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | */ |
184 | 184 | private function addParameters() |
185 | 185 | { |
186 | - if (!$this->container->getParameterBag()->all()) { |
|
186 | + if ( ! $this->container->getParameterBag()->all()) { |
|
187 | 187 | return ''; |
188 | 188 | } |
189 | 189 | $parameters = $this->prepareParameters($this->container->getParameterBag()->all(), $this->container->isCompiled()); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } elseif ($value instanceof Expression) { |
244 | 244 | return $this->getExpressionCall((string) $value); |
245 | 245 | } elseif ($value instanceof Definition) { |
246 | - return new TaggedValue('service', (new Parser())->parse("_:\n" . $this->addService('_', $value), Yaml::PARSE_CUSTOM_TAGS)['_']['_']); |
|
246 | + return new TaggedValue('service', (new Parser())->parse("_:\n".$this->addService('_', $value), Yaml::PARSE_CUSTOM_TAGS)['_']['_']); |
|
247 | 247 | } elseif (\is_object($value) || \is_resource($value)) { |
248 | 248 | throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); |
249 | 249 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | if (\is_array($value)) { |
301 | 301 | $value = $this->prepareParameters($value, $escape); |
302 | 302 | } elseif ($value instanceof Reference || \is_string($value) && 0 === \strpos($value, '@')) { |
303 | - $value = '@' . $value; |
|
303 | + $value = '@'.$value; |
|
304 | 304 | } |
305 | 305 | $filtered[$key] = $value; |
306 | 306 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | private function addParameters(\DOMElement $parent) |
55 | 55 | { |
56 | 56 | $data = $this->container->getParameterBag()->all(); |
57 | - if (!$data) { |
|
57 | + if ( ! $data) { |
|
58 | 58 | return; |
59 | 59 | } |
60 | 60 | if ($this->container->isCompiled()) { |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | } |
94 | 94 | $service->setAttribute('class', $class); |
95 | 95 | } |
96 | - if (!$definition->isShared()) { |
|
96 | + if ( ! $definition->isShared()) { |
|
97 | 97 | $service->setAttribute('shared', 'false'); |
98 | 98 | } |
99 | - if (!$definition->isPrivate()) { |
|
99 | + if ( ! $definition->isPrivate()) { |
|
100 | 100 | $service->setAttribute('public', $definition->isPublic() ? 'true' : 'false'); |
101 | 101 | } |
102 | 102 | if ($definition->isSynthetic()) { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $service = $this->document->createElement('service'); |
197 | 197 | $service->setAttribute('id', $alias); |
198 | 198 | $service->setAttribute('alias', $id); |
199 | - if (!$id->isPrivate()) { |
|
199 | + if ( ! $id->isPrivate()) { |
|
200 | 200 | $service->setAttribute('public', $id->isPublic() ? 'true' : 'false'); |
201 | 201 | } |
202 | 202 | $parent->appendChild($service); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | private function addServices(\DOMElement $parent) |
205 | 205 | { |
206 | 206 | $definitions = $this->container->getDefinitions(); |
207 | - if (!$definitions) { |
|
207 | + if ( ! $definitions) { |
|
208 | 208 | return; |
209 | 209 | } |
210 | 210 | $services = $this->document->createElement('services'); |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | case \false === $value: |
316 | 316 | return 'false'; |
317 | 317 | case $value instanceof Parameter: |
318 | - return '%' . $value . '%'; |
|
318 | + return '%'.$value.'%'; |
|
319 | 319 | case \is_object($value) || \is_resource($value): |
320 | 320 | throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); |
321 | 321 | default: |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function __construct(ContainerBuilder $container) |
77 | 77 | { |
78 | - if (!$container->isCompiled()) { |
|
78 | + if ( ! $container->isCompiled()) { |
|
79 | 79 | @\trigger_error('Dumping an uncompiled ContainerBuilder is deprecated since Symfony 3.3 and will not be supported anymore in 4.0. Compile the container beforehand.', \E_USER_DEPRECATED); |
80 | 80 | } |
81 | 81 | parent::__construct($container); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $this->hotPathTag = $options['hot_path_tag']; |
112 | 112 | $this->inlineRequires = $options['inline_class_loader_parameter'] && $this->container->hasParameter($options['inline_class_loader_parameter']) && $this->container->getParameter($options['inline_class_loader_parameter']); |
113 | 113 | if (0 !== \strpos($baseClass = $options['base_class'], '\\') && 'Container' !== $baseClass) { |
114 | - $baseClass = \sprintf('%s\\%s', $options['namespace'] ? '\\' . $options['namespace'] : '', $baseClass); |
|
114 | + $baseClass = \sprintf('%s\\%s', $options['namespace'] ? '\\'.$options['namespace'] : '', $baseClass); |
|
115 | 115 | $baseClassWithNamespace = $baseClass; |
116 | 116 | } elseif ('Container' === $baseClass) { |
117 | 117 | $baseClassWithNamespace = Container::class; |
@@ -130,21 +130,21 @@ discard block |
||
130 | 130 | throw new ServiceCircularReferenceException($e->getServiceId(), $path); |
131 | 131 | } |
132 | 132 | } |
133 | - (new AnalyzeServiceReferencesPass(\false, !$this->getProxyDumper() instanceof NullDumper))->process($this->container); |
|
133 | + (new AnalyzeServiceReferencesPass(\false, ! $this->getProxyDumper() instanceof NullDumper))->process($this->container); |
|
134 | 134 | $checkedNodes = []; |
135 | 135 | $this->circularReferences = []; |
136 | 136 | foreach ($this->container->getCompiler()->getServiceReferenceGraph()->getNodes() as $id => $node) { |
137 | - if (!$node->getValue() instanceof Definition) { |
|
137 | + if ( ! $node->getValue() instanceof Definition) { |
|
138 | 138 | continue; |
139 | 139 | } |
140 | - if (!isset($checkedNodes[$id])) { |
|
140 | + if ( ! isset($checkedNodes[$id])) { |
|
141 | 141 | $this->analyzeCircularReferences($id, $node->getOutEdges(), $checkedNodes); |
142 | 142 | } |
143 | 143 | } |
144 | 144 | $this->container->getCompiler()->getServiceReferenceGraph()->clear(); |
145 | 145 | $checkedNodes = []; |
146 | 146 | $this->docStar = $options['debug'] ? '*' : ''; |
147 | - if (!empty($options['file']) && \is_dir($dir = \dirname($options['file']))) { |
|
147 | + if ( ! empty($options['file']) && \is_dir($dir = \dirname($options['file']))) { |
|
148 | 148 | // Build a regexp where the first root dirs are mandatory, |
149 | 149 | // but every other sub-dir is optional up to the full path in $dir |
150 | 150 | // Mandate at least 1 root dir and not more than 5 optional dirs. |
@@ -155,15 +155,15 @@ discard block |
||
155 | 155 | $lastOptionalDir = $i > 8 ? $i - 5 : 2 + (int) ('\\' === \DIRECTORY_SEPARATOR); |
156 | 156 | $this->targetDirMaxMatches = $i - $lastOptionalDir; |
157 | 157 | while (--$i >= $lastOptionalDir) { |
158 | - $regex = \sprintf('(%s%s)?', \preg_quote(\DIRECTORY_SEPARATOR . $dir[$i], '#'), $regex); |
|
158 | + $regex = \sprintf('(%s%s)?', \preg_quote(\DIRECTORY_SEPARATOR.$dir[$i], '#'), $regex); |
|
159 | 159 | } |
160 | 160 | do { |
161 | - $regex = \preg_quote(\DIRECTORY_SEPARATOR . $dir[$i], '#') . $regex; |
|
161 | + $regex = \preg_quote(\DIRECTORY_SEPARATOR.$dir[$i], '#').$regex; |
|
162 | 162 | } while (0 < --$i); |
163 | - $this->targetDirRegex = '#(^|file://|[:;, \\|\\r\\n])' . \preg_quote($dir[0], '#') . $regex . '#'; |
|
163 | + $this->targetDirRegex = '#(^|file://|[:;, \\|\\r\\n])'.\preg_quote($dir[0], '#').$regex.'#'; |
|
164 | 164 | } |
165 | 165 | } |
166 | - $code = $this->startClass($options['class'], $baseClass, $baseClassWithNamespace) . $this->addServices() . $this->addDefaultParametersMethod() . $this->endClass(); |
|
166 | + $code = $this->startClass($options['class'], $baseClass, $baseClassWithNamespace).$this->addServices().$this->addDefaultParametersMethod().$this->endClass(); |
|
167 | 167 | if ($this->asFiles) { |
168 | 168 | $fileStart = <<<EOF |
169 | 169 | <?php |
@@ -178,28 +178,28 @@ discard block |
||
178 | 178 | \sort($ids); |
179 | 179 | $c = "<?php\n\nreturn [\n"; |
180 | 180 | foreach ($ids as $id) { |
181 | - $c .= ' ' . $this->doExport($id) . " => true,\n"; |
|
181 | + $c .= ' '.$this->doExport($id)." => true,\n"; |
|
182 | 182 | } |
183 | - $files['removed-ids.php'] = $c . "];\n"; |
|
183 | + $files['removed-ids.php'] = $c."];\n"; |
|
184 | 184 | } |
185 | 185 | foreach ($this->generateServiceFiles() as $file => $c) { |
186 | - $files[$file] = $fileStart . $c; |
|
186 | + $files[$file] = $fileStart.$c; |
|
187 | 187 | } |
188 | 188 | foreach ($this->generateProxyClasses() as $file => $c) { |
189 | - $files[$file] = "<?php\n" . $c; |
|
189 | + $files[$file] = "<?php\n".$c; |
|
190 | 190 | } |
191 | - $files[$options['class'] . '.php'] = $code; |
|
191 | + $files[$options['class'].'.php'] = $code; |
|
192 | 192 | $hash = \ucfirst(\strtr(ContainerBuilder::hash($files), '._', 'xx')); |
193 | 193 | $code = []; |
194 | 194 | foreach ($files as $file => $c) { |
195 | 195 | $code["Container{$hash}/{$file}"] = $c; |
196 | 196 | } |
197 | 197 | \array_pop($code); |
198 | - $code["Container{$hash}/{$options['class']}.php"] = \substr_replace($files[$options['class'] . '.php'], "<?php\n\nnamespace Container{$hash};\n", 0, 6); |
|
198 | + $code["Container{$hash}/{$options['class']}.php"] = \substr_replace($files[$options['class'].'.php'], "<?php\n\nnamespace Container{$hash};\n", 0, 6); |
|
199 | 199 | $namespaceLine = $this->namespace ? "\nnamespace {$this->namespace};\n" : ''; |
200 | 200 | $time = $options['build_time']; |
201 | - $id = \hash('crc32', $hash . $time); |
|
202 | - $code[$options['class'] . '.php'] = <<<EOF |
|
201 | + $id = \hash('crc32', $hash.$time); |
|
202 | + $code[$options['class'].'.php'] = <<<EOF |
|
203 | 203 | <?php |
204 | 204 | {$namespaceLine} |
205 | 205 | // This file has been auto-generated by the Symfony Dependency Injection Component for internal use. |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $this->circularReferences = []; |
234 | 234 | $unusedEnvs = []; |
235 | 235 | foreach ($this->container->getEnvCounters() as $env => $use) { |
236 | - if (!$use) { |
|
236 | + if ( ! $use) { |
|
237 | 237 | $unusedEnvs[] = $env; |
238 | 238 | } |
239 | 239 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | private function getProxyDumper() |
251 | 251 | { |
252 | - if (!$this->proxyDumper) { |
|
252 | + if ( ! $this->proxyDumper) { |
|
253 | 253 | $this->proxyDumper = new NullDumper(); |
254 | 254 | } |
255 | 255 | return $this->proxyDumper; |
@@ -261,11 +261,11 @@ discard block |
||
261 | 261 | foreach ($edges as $edge) { |
262 | 262 | $node = $edge->getDestNode(); |
263 | 263 | $id = $node->getId(); |
264 | - if (!$node->getValue() instanceof Definition || $sourceId === $id || $edge->isLazy() || $edge->isWeak()) { |
|
264 | + if ( ! $node->getValue() instanceof Definition || $sourceId === $id || $edge->isLazy() || $edge->isWeak()) { |
|
265 | 265 | // no-op |
266 | 266 | } elseif (isset($currentPath[$id])) { |
267 | 267 | $this->addCircularReferences($id, $currentPath, $edge->isReferencedByConstructor()); |
268 | - } elseif (!isset($checkedNodes[$id])) { |
|
268 | + } elseif ( ! isset($checkedNodes[$id])) { |
|
269 | 269 | $this->analyzeCircularReferences($id, $node->getOutEdges(), $checkedNodes, $currentPath, $edge->isReferencedByConstructor()); |
270 | 270 | } elseif (isset($this->circularReferences[$id])) { |
271 | 271 | $this->connectCircularReferences($id, $currentPath, $edge->isReferencedByConstructor()); |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | foreach ($this->circularReferences[$sourceId] as $id => $byConstructor) { |
280 | 280 | if (isset($currentPath[$id])) { |
281 | 281 | $this->addCircularReferences($id, $currentPath, $byConstructor); |
282 | - } elseif (!isset($subPath[$id]) && isset($this->circularReferences[$id])) { |
|
282 | + } elseif ( ! isset($subPath[$id]) && isset($this->circularReferences[$id])) { |
|
283 | 283 | $this->connectCircularReferences($id, $currentPath, $byConstructor, $subPath); |
284 | 284 | } |
285 | 285 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | if (isset($lineage[$class])) { |
310 | 310 | return; |
311 | 311 | } |
312 | - if (!($r = $this->container->getReflectionClass($class, \false))) { |
|
312 | + if ( ! ($r = $this->container->getReflectionClass($class, \false))) { |
|
313 | 313 | return; |
314 | 314 | } |
315 | 315 | if ($this->container instanceof $class) { |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | if (') : eval()\'d code' === \substr($file, -17)) { |
320 | 320 | $file = \substr($file, 0, \strrpos($file, '(', -17)); |
321 | 321 | } |
322 | - if (!$file || $this->doExport($file) === ($exportedFile = $this->export($file))) { |
|
322 | + if ( ! $file || $this->doExport($file) === ($exportedFile = $this->export($file))) { |
|
323 | 323 | return; |
324 | 324 | } |
325 | 325 | if ($parent = $r->getParentClass()) { |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $proxyDumper = $this->getProxyDumper(); |
342 | 342 | \ksort($definitions); |
343 | 343 | foreach ($definitions as $definition) { |
344 | - if (!$proxyDumper->isProxyCandidate($definition)) { |
|
344 | + if ( ! $proxyDumper->isProxyCandidate($definition)) { |
|
345 | 345 | continue; |
346 | 346 | } |
347 | 347 | if (isset($alreadyGenerated[$class = $definition->getClass()])) { |
@@ -350,11 +350,11 @@ discard block |
||
350 | 350 | $alreadyGenerated[$class] = \true; |
351 | 351 | // register class' reflector for resource tracking |
352 | 352 | $this->container->getReflectionClass($class); |
353 | - if ("\n" === ($proxyCode = "\n" . $proxyDumper->getProxyCode($definition))) { |
|
353 | + if ("\n" === ($proxyCode = "\n".$proxyDumper->getProxyCode($definition))) { |
|
354 | 354 | continue; |
355 | 355 | } |
356 | 356 | if ($strip) { |
357 | - $proxyCode = "<?php\n" . $proxyCode; |
|
357 | + $proxyCode = "<?php\n".$proxyCode; |
|
358 | 358 | $proxyCode = \substr(Kernel::stripComments($proxyCode), 5); |
359 | 359 | } |
360 | 360 | (yield \sprintf('%s.php', \explode(' ', $proxyCode, 3)[1]) => $proxyCode); |
@@ -368,10 +368,10 @@ discard block |
||
368 | 368 | private function addServiceInclude($cId, Definition $definition) |
369 | 369 | { |
370 | 370 | $code = ''; |
371 | - if ($this->inlineRequires && !$this->isHotPath($definition)) { |
|
371 | + if ($this->inlineRequires && ! $this->isHotPath($definition)) { |
|
372 | 372 | $lineage = []; |
373 | 373 | foreach ($this->inlinedDefinitions as $def) { |
374 | - if (!$def->isDeprecated() && \is_string($class = \is_array($factory = $def->getFactory()) && \is_string($factory[0]) ? $factory[0] : $def->getClass())) { |
|
374 | + if ( ! $def->isDeprecated() && \is_string($class = \is_array($factory = $def->getFactory()) && \is_string($factory[0]) ? $factory[0] : $def->getClass())) { |
|
375 | 375 | $this->collectLineage($class, $lineage); |
376 | 376 | } |
377 | 377 | } |
@@ -408,14 +408,14 @@ discard block |
||
408 | 408 | private function addServiceInstance($id, Definition $definition, $isSimpleInstance) |
409 | 409 | { |
410 | 410 | $class = $this->dumpValue($definition->getClass()); |
411 | - if (0 === \strpos($class, "'") && \false === \strpos($class, '$') && !\preg_match('/^\'(?:\\\\{2})?[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(?:\\\\{2}[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)*\'$/', $class)) { |
|
411 | + if (0 === \strpos($class, "'") && \false === \strpos($class, '$') && ! \preg_match('/^\'(?:\\\\{2})?[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(?:\\\\{2}[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)*\'$/', $class)) { |
|
412 | 412 | throw new InvalidArgumentException(\sprintf('"%s" is not a valid class name for the "%s" service.', $class, $id)); |
413 | 413 | } |
414 | 414 | $isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition); |
415 | 415 | $instantiation = ''; |
416 | - if (!$isProxyCandidate && $definition->isShared()) { |
|
416 | + if ( ! $isProxyCandidate && $definition->isShared()) { |
|
417 | 417 | $instantiation = \sprintf('$this->services[%s] = %s', $this->doExport($id), $isSimpleInstance ? '' : '$instance'); |
418 | - } elseif (!$isSimpleInstance) { |
|
418 | + } elseif ( ! $isSimpleInstance) { |
|
419 | 419 | $instantiation = '$instance'; |
420 | 420 | } |
421 | 421 | $return = ''; |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | return \false; |
441 | 441 | } |
442 | 442 | foreach ($definition->getArguments() as $arg) { |
443 | - if (!$arg || $arg instanceof Parameter) { |
|
443 | + if ( ! $arg || $arg instanceof Parameter) { |
|
444 | 444 | continue; |
445 | 445 | } |
446 | 446 | if (\is_array($arg) && 3 >= \count($arg)) { |
@@ -448,19 +448,19 @@ discard block |
||
448 | 448 | if ($this->dumpValue($k) !== $this->dumpValue($k, \false)) { |
449 | 449 | return \false; |
450 | 450 | } |
451 | - if (!$v || $v instanceof Parameter) { |
|
451 | + if ( ! $v || $v instanceof Parameter) { |
|
452 | 452 | continue; |
453 | 453 | } |
454 | 454 | if ($v instanceof Reference && $this->container->has($id = (string) $v) && $this->container->findDefinition($id)->isSynthetic()) { |
455 | 455 | continue; |
456 | 456 | } |
457 | - if (!\is_scalar($v) || $this->dumpValue($v) !== $this->dumpValue($v, \false)) { |
|
457 | + if ( ! \is_scalar($v) || $this->dumpValue($v) !== $this->dumpValue($v, \false)) { |
|
458 | 458 | return \false; |
459 | 459 | } |
460 | 460 | } |
461 | 461 | } elseif ($arg instanceof Reference && $this->container->has($id = (string) $arg) && $this->container->findDefinition($id)->isSynthetic()) { |
462 | 462 | continue; |
463 | - } elseif (!\is_scalar($arg) || $this->dumpValue($arg) !== $this->dumpValue($arg, \false)) { |
|
463 | + } elseif ( ! \is_scalar($arg) || $this->dumpValue($arg) !== $this->dumpValue($arg, \false)) { |
|
464 | 464 | return \false; |
465 | 465 | } |
466 | 466 | } |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | */ |
503 | 503 | private function addServiceConfigurator(Definition $definition, $variableName = 'instance') |
504 | 504 | { |
505 | - if (!($callable = $definition->getConfigurator())) { |
|
505 | + if ( ! ($callable = $definition->getConfigurator())) { |
|
506 | 506 | return ''; |
507 | 507 | } |
508 | 508 | if (\is_array($callable)) { |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | $this->referenceVariables[$id] = new Variable('instance'); |
538 | 538 | $return = []; |
539 | 539 | if ($class = $definition->getClass()) { |
540 | - $class = $class instanceof Parameter ? '%' . $class . '%' : $this->container->resolveEnvPlaceholders($class); |
|
540 | + $class = $class instanceof Parameter ? '%'.$class.'%' : $this->container->resolveEnvPlaceholders($class); |
|
541 | 541 | $return[] = \sprintf(0 === \strpos($class, '%') ? '@return object A %1$s instance' : '@return \\%s', \ltrim($class, '\\')); |
542 | 542 | } elseif ($definition->getFactory()) { |
543 | 543 | $factory = $definition->getFactory(); |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | $return[] = \sprintf('@return object An instance returned by %s()', $factory); |
546 | 546 | } elseif (\is_array($factory) && (\is_string($factory[0]) || $factory[0] instanceof Definition || $factory[0] instanceof Reference)) { |
547 | 547 | $class = $factory[0] instanceof Definition ? $factory[0]->getClass() : (string) $factory[0]; |
548 | - $class = $class instanceof Parameter ? '%' . $class . '%' : $this->container->resolveEnvPlaceholders($class); |
|
548 | + $class = $class instanceof Parameter ? '%'.$class.'%' : $this->container->resolveEnvPlaceholders($class); |
|
549 | 549 | $return[] = \sprintf('@return object An instance returned by %s::%s()', $class, $factory[1]); |
550 | 550 | } |
551 | 551 | } |
@@ -565,10 +565,10 @@ discard block |
||
565 | 565 | } else { |
566 | 566 | $lazyInitialization = ''; |
567 | 567 | } |
568 | - $asFile = $this->asFiles && $definition->isShared() && !$this->isHotPath($definition); |
|
568 | + $asFile = $this->asFiles && $definition->isShared() && ! $this->isHotPath($definition); |
|
569 | 569 | $methodName = $this->generateMethodName($id); |
570 | 570 | if ($asFile) { |
571 | - $file = $methodName . '.php'; |
|
571 | + $file = $methodName.'.php'; |
|
572 | 572 | $code = " // Returns the {$public} '{$id}'{$shared}{$autowired} service.\n\n"; |
573 | 573 | } else { |
574 | 574 | $code = <<<EOF |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | * |
579 | 579 | * {$return} |
580 | 580 | EOF; |
581 | - $code = \str_replace('*/', ' ', $code) . <<<EOF |
|
581 | + $code = \str_replace('*/', ' ', $code).<<<EOF |
|
582 | 582 | |
583 | 583 | */ |
584 | 584 | protected function {$methodName}({$lazyInitialization}) |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | } |
599 | 599 | $code .= $this->addInlineService($id, $definition); |
600 | 600 | if ($asFile) { |
601 | - $code = \implode("\n", \array_map(function ($line) { |
|
601 | + $code = \implode("\n", \array_map(function($line) { |
|
602 | 602 | return $line ? \substr($line, 8) : $line; |
603 | 603 | }, \explode("\n", $code))); |
604 | 604 | } else { |
@@ -634,20 +634,20 @@ discard block |
||
634 | 634 | if ('service_container' === $targetId || isset($this->referenceVariables[$targetId])) { |
635 | 635 | return ''; |
636 | 636 | } |
637 | - $hasSelfRef = isset($this->circularReferences[$id][$targetId]) && !isset($this->definitionVariables[$definition]); |
|
638 | - if ($hasSelfRef && !$forConstructor && !($forConstructor = !$this->circularReferences[$id][$targetId])) { |
|
637 | + $hasSelfRef = isset($this->circularReferences[$id][$targetId]) && ! isset($this->definitionVariables[$definition]); |
|
638 | + if ($hasSelfRef && ! $forConstructor && ! ($forConstructor = ! $this->circularReferences[$id][$targetId])) { |
|
639 | 639 | $code = $this->addInlineService($id, $definition, $definition); |
640 | 640 | } else { |
641 | 641 | $code = ''; |
642 | 642 | } |
643 | - if (isset($this->referenceVariables[$targetId]) || 2 > $callCount && (!$hasSelfRef || !$forConstructor)) { |
|
643 | + if (isset($this->referenceVariables[$targetId]) || 2 > $callCount && ( ! $hasSelfRef || ! $forConstructor)) { |
|
644 | 644 | return $code; |
645 | 645 | } |
646 | 646 | $name = $this->getNextVariableName(); |
647 | 647 | $this->referenceVariables[$targetId] = new Variable($name); |
648 | 648 | $reference = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE >= $behavior ? new Reference($targetId, $behavior) : null; |
649 | 649 | $code .= \sprintf(" \$%s = %s;\n", $name, $this->getServiceCall($targetId, $reference)); |
650 | - if (!$hasSelfRef || !$forConstructor) { |
|
650 | + if ( ! $hasSelfRef || ! $forConstructor) { |
|
651 | 651 | return $code; |
652 | 652 | } |
653 | 653 | $code .= \sprintf(<<<'EOTXT' |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | $code = ''; |
666 | 666 | if ($isSimpleInstance = $isRootInstance = null === $inlineDef) { |
667 | 667 | foreach ($this->serviceCalls as $targetId => list($callCount, $behavior, $byConstructor)) { |
668 | - if ($byConstructor && isset($this->circularReferences[$id][$targetId]) && !$this->circularReferences[$id][$targetId]) { |
|
668 | + if ($byConstructor && isset($this->circularReferences[$id][$targetId]) && ! $this->circularReferences[$id][$targetId]) { |
|
669 | 669 | $code .= $this->addInlineReference($id, $definition, $targetId, $forConstructor); |
670 | 670 | } |
671 | 671 | } |
@@ -689,10 +689,10 @@ discard block |
||
689 | 689 | if ('instance' === $name) { |
690 | 690 | $code .= $this->addServiceInstance($id, $definition, $isSimpleInstance); |
691 | 691 | } else { |
692 | - $code .= $this->addNewInstance($inlineDef, '$' . $name, ' = ', $id); |
|
692 | + $code .= $this->addNewInstance($inlineDef, '$'.$name, ' = ', $id); |
|
693 | 693 | } |
694 | 694 | if ('' !== ($inline = $this->addInlineVariables($id, $definition, $arguments, \false))) { |
695 | - $code .= "\n" . $inline . "\n"; |
|
695 | + $code .= "\n".$inline."\n"; |
|
696 | 696 | } elseif ($arguments && 'instance' === $name) { |
697 | 697 | $code .= "\n"; |
698 | 698 | } |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | $code .= $this->addServiceMethodCalls($inlineDef, $name); |
701 | 701 | $code .= $this->addServiceConfigurator($inlineDef, $name); |
702 | 702 | } |
703 | - if ($isRootInstance && !$isSimpleInstance) { |
|
703 | + if ($isRootInstance && ! $isSimpleInstance) { |
|
704 | 704 | $code .= "\n return \$instance;\n"; |
705 | 705 | } |
706 | 706 | return $code; |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | $definitions = $this->container->getDefinitions(); |
717 | 717 | \ksort($definitions); |
718 | 718 | foreach ($definitions as $id => $definition) { |
719 | - if ($definition->isSynthetic() || $this->asFiles && $definition->isShared() && !$this->isHotPath($definition)) { |
|
719 | + if ($definition->isSynthetic() || $this->asFiles && $definition->isShared() && ! $this->isHotPath($definition)) { |
|
720 | 720 | continue; |
721 | 721 | } |
722 | 722 | if ($definition->isPublic()) { |
@@ -725,14 +725,14 @@ discard block |
||
725 | 725 | $privateServices .= $this->addService($id, $definition); |
726 | 726 | } |
727 | 727 | } |
728 | - return $publicServices . $privateServices; |
|
728 | + return $publicServices.$privateServices; |
|
729 | 729 | } |
730 | 730 | private function generateServiceFiles() |
731 | 731 | { |
732 | 732 | $definitions = $this->container->getDefinitions(); |
733 | 733 | \ksort($definitions); |
734 | 734 | foreach ($definitions as $id => $definition) { |
735 | - if (!$definition->isSynthetic() && $definition->isShared() && !$this->isHotPath($definition)) { |
|
735 | + if ( ! $definition->isSynthetic() && $definition->isShared() && ! $this->isHotPath($definition)) { |
|
736 | 736 | $code = $this->addService($id, $definition, $file); |
737 | 737 | (yield $file => $code); |
738 | 738 | } |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | private function addNewInstance(Definition $definition, $return, $instantiation, $id) |
742 | 742 | { |
743 | 743 | $class = $this->dumpValue($definition->getClass()); |
744 | - $return = ' ' . $return . $instantiation; |
|
744 | + $return = ' '.$return.$instantiation; |
|
745 | 745 | $arguments = []; |
746 | 746 | foreach ($definition->getArguments() as $value) { |
747 | 747 | $arguments[] = $this->dumpValue($value); |
@@ -749,11 +749,11 @@ discard block |
||
749 | 749 | if (null !== $definition->getFactory()) { |
750 | 750 | $callable = $definition->getFactory(); |
751 | 751 | if (\is_array($callable)) { |
752 | - if (!\preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/', $callable[1])) { |
|
752 | + if ( ! \preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/', $callable[1])) { |
|
753 | 753 | throw new RuntimeException(\sprintf('Cannot dump definition because of invalid factory method (%s).', $callable[1] ?: 'n/a')); |
754 | 754 | } |
755 | 755 | if ($callable[0] instanceof Reference || $callable[0] instanceof Definition && $this->definitionVariables->contains($callable[0])) { |
756 | - return $return . \sprintf("%s->%s(%s);\n", $this->dumpValue($callable[0]), $callable[1], $arguments ? \implode(', ', $arguments) : ''); |
|
756 | + return $return.\sprintf("%s->%s(%s);\n", $this->dumpValue($callable[0]), $callable[1], $arguments ? \implode(', ', $arguments) : ''); |
|
757 | 757 | } |
758 | 758 | $class = $this->dumpValue($callable[0]); |
759 | 759 | // If the class is a string we can optimize call_user_func away |
@@ -761,19 +761,19 @@ discard block |
||
761 | 761 | if ("''" === $class) { |
762 | 762 | throw new RuntimeException(\sprintf('Cannot dump definition: The "%s" service is defined to be created by a factory but is missing the service reference, did you forget to define the factory service id or class?', $id)); |
763 | 763 | } |
764 | - return $return . \sprintf("%s::%s(%s);\n", $this->dumpLiteralClass($class), $callable[1], $arguments ? \implode(', ', $arguments) : ''); |
|
764 | + return $return.\sprintf("%s::%s(%s);\n", $this->dumpLiteralClass($class), $callable[1], $arguments ? \implode(', ', $arguments) : ''); |
|
765 | 765 | } |
766 | 766 | if (0 === \strpos($class, 'new ')) { |
767 | - return $return . \sprintf("(%s)->%s(%s);\n", $class, $callable[1], $arguments ? \implode(', ', $arguments) : ''); |
|
767 | + return $return.\sprintf("(%s)->%s(%s);\n", $class, $callable[1], $arguments ? \implode(', ', $arguments) : ''); |
|
768 | 768 | } |
769 | - return $return . \sprintf("\\call_user_func([%s, '%s']%s);\n", $class, $callable[1], $arguments ? ', ' . \implode(', ', $arguments) : ''); |
|
769 | + return $return.\sprintf("\\call_user_func([%s, '%s']%s);\n", $class, $callable[1], $arguments ? ', '.\implode(', ', $arguments) : ''); |
|
770 | 770 | } |
771 | - return $return . \sprintf("%s(%s);\n", $this->dumpLiteralClass($this->dumpValue($callable)), $arguments ? \implode(', ', $arguments) : ''); |
|
771 | + return $return.\sprintf("%s(%s);\n", $this->dumpLiteralClass($this->dumpValue($callable)), $arguments ? \implode(', ', $arguments) : ''); |
|
772 | 772 | } |
773 | 773 | if (\false !== \strpos($class, '$')) { |
774 | 774 | return \sprintf(" \$class = %s;\n\n%snew \$class(%s);\n", $class, $return, \implode(', ', $arguments)); |
775 | 775 | } |
776 | - return $return . \sprintf("new %s(%s);\n", $this->dumpLiteralClass($class), \implode(', ', $arguments)); |
|
776 | + return $return.\sprintf("new %s(%s);\n", $this->dumpLiteralClass($class), \implode(', ', $arguments)); |
|
777 | 777 | } |
778 | 778 | /** |
779 | 779 | * Adds the class headers. |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | private function startClass($class, $baseClass, $baseClassWithNamespace) |
788 | 788 | { |
789 | 789 | $bagClass = $this->container->isCompiled() ? 'use Wordlift\Modules\Common\\Symfony\\Component\\DependencyInjection\\ParameterBag\\FrozenParameterBag;' : 'use Wordlift\Modules\Common\\Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBag;'; |
790 | - $namespaceLine = !$this->asFiles && $this->namespace ? "\nnamespace {$this->namespace};\n" : ''; |
|
790 | + $namespaceLine = ! $this->asFiles && $this->namespace ? "\nnamespace {$this->namespace};\n" : ''; |
|
791 | 791 | $code = <<<EOF |
792 | 792 | <?php |
793 | 793 | {$namespaceLine} |
@@ -892,13 +892,13 @@ discard block |
||
892 | 892 | } |
893 | 893 | $proxyDumper = $this->getProxyDumper(); |
894 | 894 | foreach ($this->container->getDefinitions() as $definition) { |
895 | - if (!$proxyDumper->isProxyCandidate($definition)) { |
|
895 | + if ( ! $proxyDumper->isProxyCandidate($definition)) { |
|
896 | 896 | continue; |
897 | 897 | } |
898 | 898 | if ($this->asFiles) { |
899 | 899 | $proxyLoader = '$this->load("{$class}.php")'; |
900 | 900 | } elseif ($this->namespace) { |
901 | - $proxyLoader = 'class_alias("' . $this->namespace . '\\\\{$class}", $class, false)'; |
|
901 | + $proxyLoader = 'class_alias("'.$this->namespace.'\\\\{$class}", $class, false)'; |
|
902 | 902 | } else { |
903 | 903 | $proxyLoader = ''; |
904 | 904 | } |
@@ -929,10 +929,10 @@ discard block |
||
929 | 929 | \ksort($normalizedIds); |
930 | 930 | foreach ($normalizedIds as $id => $normalizedId) { |
931 | 931 | if ($this->container->has($normalizedId)) { |
932 | - $code .= ' ' . $this->doExport($id) . ' => ' . $this->doExport($normalizedId) . ",\n"; |
|
932 | + $code .= ' '.$this->doExport($id).' => '.$this->doExport($normalizedId).",\n"; |
|
933 | 933 | } |
934 | 934 | } |
935 | - return $code ? " \$this->normalizedIds = [\n" . $code . " ];\n" : ''; |
|
935 | + return $code ? " \$this->normalizedIds = [\n".$code." ];\n" : ''; |
|
936 | 936 | } |
937 | 937 | /** |
938 | 938 | * Adds the syntheticIds definition. |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | \ksort($definitions); |
947 | 947 | foreach ($definitions as $id => $definition) { |
948 | 948 | if ($definition->isSynthetic() && 'service_container' !== $id) { |
949 | - $code .= ' ' . $this->doExport($id) . " => true,\n"; |
|
949 | + $code .= ' '.$this->doExport($id)." => true,\n"; |
|
950 | 950 | } |
951 | 951 | } |
952 | 952 | return $code ? " \$this->syntheticIds = [\n{$code} ];\n" : ''; |
@@ -958,7 +958,7 @@ discard block |
||
958 | 958 | */ |
959 | 959 | private function addRemovedIds() |
960 | 960 | { |
961 | - if (!($ids = $this->container->getRemovedIds())) { |
|
961 | + if ( ! ($ids = $this->container->getRemovedIds())) { |
|
962 | 962 | return ''; |
963 | 963 | } |
964 | 964 | if ($this->asFiles) { |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | if (\preg_match('/^\\d+_[^~]++~[._a-zA-Z\\d]{7}$/', $id)) { |
972 | 972 | continue; |
973 | 973 | } |
974 | - $code .= ' ' . $this->doExport($id) . " => true,\n"; |
|
974 | + $code .= ' '.$this->doExport($id)." => true,\n"; |
|
975 | 975 | } |
976 | 976 | $code = "[\n{$code} ]"; |
977 | 977 | } |
@@ -995,8 +995,8 @@ discard block |
||
995 | 995 | $definitions = $this->container->getDefinitions(); |
996 | 996 | \ksort($definitions); |
997 | 997 | foreach ($definitions as $id => $definition) { |
998 | - if (!$definition->isSynthetic() && (!$this->asFiles || !$definition->isShared() || $this->isHotPath($definition))) { |
|
999 | - $code .= ' ' . $this->doExport($id) . ' => ' . $this->doExport($this->generateMethodName($id)) . ",\n"; |
|
998 | + if ( ! $definition->isSynthetic() && ( ! $this->asFiles || ! $definition->isShared() || $this->isHotPath($definition))) { |
|
999 | + $code .= ' '.$this->doExport($id).' => '.$this->doExport($this->generateMethodName($id)).",\n"; |
|
1000 | 1000 | } |
1001 | 1001 | } |
1002 | 1002 | return $code ? " \$this->methodMap = [\n{$code} ];\n" : ''; |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | $definitions = $this->container->getDefinitions(); |
1013 | 1013 | \ksort($definitions); |
1014 | 1014 | foreach ($definitions as $id => $definition) { |
1015 | - if (!$definition->isSynthetic() && $definition->isShared() && !$this->isHotPath($definition)) { |
|
1015 | + if ( ! $definition->isSynthetic() && $definition->isShared() && ! $this->isHotPath($definition)) { |
|
1016 | 1016 | $code .= \sprintf(" %s => '%s.php',\n", $this->doExport($id), $this->generateMethodName($id)); |
1017 | 1017 | } |
1018 | 1018 | } |
@@ -1030,14 +1030,14 @@ discard block |
||
1030 | 1030 | \ksort($aliases); |
1031 | 1031 | foreach ($aliases as $id => $alias) { |
1032 | 1032 | if ($alias->isPrivate()) { |
1033 | - $code .= ' ' . $this->doExport($id) . " => true,\n"; |
|
1033 | + $code .= ' '.$this->doExport($id)." => true,\n"; |
|
1034 | 1034 | } |
1035 | 1035 | } |
1036 | 1036 | $definitions = $this->container->getDefinitions(); |
1037 | 1037 | \ksort($definitions); |
1038 | 1038 | foreach ($definitions as $id => $definition) { |
1039 | - if (!$definition->isPublic()) { |
|
1040 | - $code .= ' ' . $this->doExport($id) . " => true,\n"; |
|
1039 | + if ( ! $definition->isPublic()) { |
|
1040 | + $code .= ' '.$this->doExport($id)." => true,\n"; |
|
1041 | 1041 | } |
1042 | 1042 | } |
1043 | 1043 | if (empty($code)) { |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | */ |
1056 | 1056 | private function addAliases() |
1057 | 1057 | { |
1058 | - if (!($aliases = $this->container->getAliases())) { |
|
1058 | + if ( ! ($aliases = $this->container->getAliases())) { |
|
1059 | 1059 | return $this->container->isCompiled() ? "\n \$this->aliases = [];\n" : ''; |
1060 | 1060 | } |
1061 | 1061 | $code = " \$this->aliases = [\n"; |
@@ -1065,13 +1065,13 @@ discard block |
||
1065 | 1065 | while (isset($aliases[$id])) { |
1066 | 1066 | $id = $this->container->normalizeId($aliases[$id]); |
1067 | 1067 | } |
1068 | - $code .= ' ' . $this->doExport($alias) . ' => ' . $this->doExport($id) . ",\n"; |
|
1068 | + $code .= ' '.$this->doExport($alias).' => '.$this->doExport($id).",\n"; |
|
1069 | 1069 | } |
1070 | - return $code . " ];\n"; |
|
1070 | + return $code." ];\n"; |
|
1071 | 1071 | } |
1072 | 1072 | private function addInlineRequires() |
1073 | 1073 | { |
1074 | - if (!$this->hotPathTag || !$this->inlineRequires) { |
|
1074 | + if ( ! $this->hotPathTag || ! $this->inlineRequires) { |
|
1075 | 1075 | return ''; |
1076 | 1076 | } |
1077 | 1077 | $lineage = []; |
@@ -1086,7 +1086,7 @@ discard block |
||
1086 | 1086 | } |
1087 | 1087 | $code = ''; |
1088 | 1088 | foreach ($lineage as $file) { |
1089 | - if (!isset($this->inlinedRequires[$file])) { |
|
1089 | + if ( ! isset($this->inlinedRequires[$file])) { |
|
1090 | 1090 | $this->inlinedRequires[$file] = \true; |
1091 | 1091 | $code .= \sprintf("\n include_once %s;", $file); |
1092 | 1092 | } |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | */ |
1101 | 1101 | private function addDefaultParametersMethod() |
1102 | 1102 | { |
1103 | - if (!$this->container->getParameterBag()->all()) { |
|
1103 | + if ( ! $this->container->getParameterBag()->all()) { |
|
1104 | 1104 | return ''; |
1105 | 1105 | } |
1106 | 1106 | $php = []; |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | } |
1180 | 1180 | |
1181 | 1181 | EOF; |
1182 | - if (!$this->asFiles) { |
|
1182 | + if ( ! $this->asFiles) { |
|
1183 | 1183 | $code = \preg_replace('/^.*buildParameters.*\\n.*\\n.*\\n/m', '', $code); |
1184 | 1184 | } |
1185 | 1185 | if ($dynamicPhp) { |
@@ -1196,7 +1196,7 @@ discard block |
||
1196 | 1196 | $getDynamicParameter = \sprintf($getDynamicParameter, \implode("\n", $dynamicPhp)); |
1197 | 1197 | } else { |
1198 | 1198 | $loadedDynamicParameters = '[]'; |
1199 | - $getDynamicParameter = \str_repeat(' ', 8) . 'throw new InvalidArgumentException(sprintf(\'The dynamic parameter "%s" must be defined.\', $name));'; |
|
1199 | + $getDynamicParameter = \str_repeat(' ', 8).'throw new InvalidArgumentException(sprintf(\'The dynamic parameter "%s" must be defined.\', $name));'; |
|
1200 | 1200 | } |
1201 | 1201 | $code .= <<<EOF |
1202 | 1202 | |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | |
1220 | 1220 | |
1221 | 1221 | EOF; |
1222 | - $code .= ' private $normalizedParameterNames = ' . ($normalizedParams ? \sprintf("[\n%s\n ];", \implode("\n", $normalizedParams)) : '[];') . "\n"; |
|
1222 | + $code .= ' private $normalizedParameterNames = '.($normalizedParams ? \sprintf("[\n%s\n ];", \implode("\n", $normalizedParams)) : '[];')."\n"; |
|
1223 | 1223 | $code .= <<<'EOF' |
1224 | 1224 | |
1225 | 1225 | private function normalizeParameterName($name) |
@@ -1270,17 +1270,17 @@ discard block |
||
1270 | 1270 | $php = []; |
1271 | 1271 | foreach ($parameters as $key => $value) { |
1272 | 1272 | if (\is_array($value)) { |
1273 | - $value = $this->exportParameters($value, $path . '/' . $key, $indent + 4); |
|
1273 | + $value = $this->exportParameters($value, $path.'/'.$key, $indent + 4); |
|
1274 | 1274 | } elseif ($value instanceof ArgumentInterface) { |
1275 | - throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain special arguments. "%s" found in "%s".', \get_class($value), $path . '/' . $key)); |
|
1275 | + throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain special arguments. "%s" found in "%s".', \get_class($value), $path.'/'.$key)); |
|
1276 | 1276 | } elseif ($value instanceof Variable) { |
1277 | - throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain variable references. Variable "%s" found in "%s".', $value, $path . '/' . $key)); |
|
1277 | + throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain variable references. Variable "%s" found in "%s".', $value, $path.'/'.$key)); |
|
1278 | 1278 | } elseif ($value instanceof Definition) { |
1279 | - throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain service definitions. Definition for "%s" found in "%s".', $value->getClass(), $path . '/' . $key)); |
|
1279 | + throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain service definitions. Definition for "%s" found in "%s".', $value->getClass(), $path.'/'.$key)); |
|
1280 | 1280 | } elseif ($value instanceof Reference) { |
1281 | - throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain references to other services (reference to service "%s" found in "%s").', $value, $path . '/' . $key)); |
|
1281 | + throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain references to other services (reference to service "%s" found in "%s").', $value, $path.'/'.$key)); |
|
1282 | 1282 | } elseif ($value instanceof Expression) { |
1283 | - throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path . '/' . $key)); |
|
1283 | + throw new InvalidArgumentException(\sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key)); |
|
1284 | 1284 | } else { |
1285 | 1285 | $value = $this->export($value); |
1286 | 1286 | } |
@@ -1310,12 +1310,12 @@ discard block |
||
1310 | 1310 | */ |
1311 | 1311 | private function wrapServiceConditionals($value, $code) |
1312 | 1312 | { |
1313 | - if (!($condition = $this->getServiceConditionals($value))) { |
|
1313 | + if ( ! ($condition = $this->getServiceConditionals($value))) { |
|
1314 | 1314 | return $code; |
1315 | 1315 | } |
1316 | 1316 | // re-indent the wrapped code |
1317 | - $code = \implode("\n", \array_map(function ($line) { |
|
1318 | - return $line ? ' ' . $line : $line; |
|
1317 | + $code = \implode("\n", \array_map(function($line) { |
|
1318 | + return $line ? ' '.$line : $line; |
|
1319 | 1319 | }, \explode("\n", $code))); |
1320 | 1320 | return \sprintf(" if (%s) {\n%s }\n", $condition, $code); |
1321 | 1321 | } |
@@ -1330,18 +1330,18 @@ discard block |
||
1330 | 1330 | { |
1331 | 1331 | $conditions = []; |
1332 | 1332 | foreach (ContainerBuilder::getInitializedConditionals($value) as $service) { |
1333 | - if (!$this->container->hasDefinition($service)) { |
|
1333 | + if ( ! $this->container->hasDefinition($service)) { |
|
1334 | 1334 | return 'false'; |
1335 | 1335 | } |
1336 | 1336 | $conditions[] = \sprintf('isset($this->services[%s])', $this->doExport($service)); |
1337 | 1337 | } |
1338 | 1338 | foreach (ContainerBuilder::getServiceConditionals($value) as $service) { |
1339 | - if ($this->container->hasDefinition($service) && !$this->container->getDefinition($service)->isPublic()) { |
|
1339 | + if ($this->container->hasDefinition($service) && ! $this->container->getDefinition($service)->isPublic()) { |
|
1340 | 1340 | continue; |
1341 | 1341 | } |
1342 | 1342 | $conditions[] = \sprintf('$this->has(%s)', $this->doExport($service)); |
1343 | 1343 | } |
1344 | - if (!$conditions) { |
|
1344 | + if ( ! $conditions) { |
|
1345 | 1345 | return ''; |
1346 | 1346 | } |
1347 | 1347 | return \implode(' && ', $conditions); |
@@ -1359,13 +1359,13 @@ discard block |
||
1359 | 1359 | while ($this->container->hasAlias($id)) { |
1360 | 1360 | $id = (string) $this->container->getAlias($id); |
1361 | 1361 | } |
1362 | - if (!isset($calls[$id])) { |
|
1362 | + if ( ! isset($calls[$id])) { |
|
1363 | 1363 | $calls[$id] = [0, $argument->getInvalidBehavior(), $byConstructor]; |
1364 | 1364 | } else { |
1365 | 1365 | $calls[$id][1] = \min($calls[$id][1], $argument->getInvalidBehavior()); |
1366 | 1366 | } |
1367 | 1367 | ++$calls[$id][0]; |
1368 | - } elseif (!$argument instanceof Definition) { |
|
1368 | + } elseif ( ! $argument instanceof Definition) { |
|
1369 | 1369 | // no-op |
1370 | 1370 | } elseif (isset($definitions[$argument])) { |
1371 | 1371 | $definitions[$argument] = 1 + $definitions[$argument]; |
@@ -1418,7 +1418,7 @@ discard block |
||
1418 | 1418 | $operands = [0]; |
1419 | 1419 | $code = []; |
1420 | 1420 | $code[] = 'new RewindableGenerator(function () {'; |
1421 | - if (!($values = $value->getValues())) { |
|
1421 | + if ( ! ($values = $value->getValues())) { |
|
1422 | 1422 | $code[] = ' return new \\EmptyIterator();'; |
1423 | 1423 | } else { |
1424 | 1424 | $countCode = []; |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | $v = $this->wrapServiceConditionals($v, \sprintf(" yield %s => %s;\n", $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate))); |
1429 | 1429 | foreach (\explode("\n", $v) as $v) { |
1430 | 1430 | if ($v) { |
1431 | - $code[] = ' ' . $v; |
|
1431 | + $code[] = ' '.$v; |
|
1432 | 1432 | } |
1433 | 1433 | } |
1434 | 1434 | } |
@@ -1464,7 +1464,7 @@ discard block |
||
1464 | 1464 | return \sprintf('%s(%s)', $this->dumpLiteralClass($this->dumpValue($factory)), \implode(', ', $arguments)); |
1465 | 1465 | } |
1466 | 1466 | if (\is_array($factory)) { |
1467 | - if (!\preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/', $factory[1])) { |
|
1467 | + if ( ! \preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/', $factory[1])) { |
|
1468 | 1468 | throw new RuntimeException(\sprintf('Cannot dump definition because of invalid factory method (%s).', $factory[1] ?: 'n/a')); |
1469 | 1469 | } |
1470 | 1470 | $class = $this->dumpValue($factory[0]); |
@@ -1475,7 +1475,7 @@ discard block |
||
1475 | 1475 | if (0 === \strpos($class, 'new ')) { |
1476 | 1476 | return \sprintf('(%s)->%s(%s)', $class, $factory[1], \implode(', ', $arguments)); |
1477 | 1477 | } |
1478 | - return \sprintf("\\call_user_func([%s, '%s']%s)", $class, $factory[1], \count($arguments) > 0 ? ', ' . \implode(', ', $arguments) : ''); |
|
1478 | + return \sprintf("\\call_user_func([%s, '%s']%s)", $class, $factory[1], \count($arguments) > 0 ? ', '.\implode(', ', $arguments) : ''); |
|
1479 | 1479 | } |
1480 | 1480 | if ($factory[0] instanceof Reference) { |
1481 | 1481 | return \sprintf('%s->%s(%s)', $class, $factory[1], \implode(', ', $arguments)); |
@@ -1489,7 +1489,7 @@ discard block |
||
1489 | 1489 | } |
1490 | 1490 | return \sprintf('new %s(%s)', $this->dumpLiteralClass($this->dumpValue($class)), \implode(', ', $arguments)); |
1491 | 1491 | } elseif ($value instanceof Variable) { |
1492 | - return '$' . $value; |
|
1492 | + return '$'.$value; |
|
1493 | 1493 | } elseif ($value instanceof Reference) { |
1494 | 1494 | $id = $this->container->normalizeId($value); |
1495 | 1495 | while ($this->container->hasAlias($id)) { |
@@ -1509,8 +1509,8 @@ discard block |
||
1509 | 1509 | // the preg_replace_callback converts them to strings |
1510 | 1510 | return $this->dumpParameter($match[1]); |
1511 | 1511 | } else { |
1512 | - $replaceParameters = function ($match) { |
|
1513 | - return "'." . $this->dumpParameter($match[2]) . ".'"; |
|
1512 | + $replaceParameters = function($match) { |
|
1513 | + return "'.".$this->dumpParameter($match[2]).".'"; |
|
1514 | 1514 | }; |
1515 | 1515 | $code = \str_replace('%%', '%', \preg_replace_callback('/(?<!%)(%)([^%]+)\\1/', $replaceParameters, $this->export($value))); |
1516 | 1516 | return $code; |
@@ -1534,11 +1534,11 @@ discard block |
||
1534 | 1534 | if (\false !== \strpos($class, '$')) { |
1535 | 1535 | return \sprintf('${($_ = %s) && false ?: "_"}', $class); |
1536 | 1536 | } |
1537 | - if (0 !== \strpos($class, "'") || !\preg_match('/^\'(?:\\\\{2})?[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(?:\\\\{2}[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)*\'$/', $class)) { |
|
1537 | + if (0 !== \strpos($class, "'") || ! \preg_match('/^\'(?:\\\\{2})?[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*(?:\\\\{2}[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)*\'$/', $class)) { |
|
1538 | 1538 | throw new RuntimeException(\sprintf('Cannot dump definition because of invalid class name (%s).', $class ?: 'n/a')); |
1539 | 1539 | } |
1540 | 1540 | $class = \substr(\str_replace('\\\\', '\\', $class), 1, -1); |
1541 | - return 0 === \strpos($class, '\\') ? $class : '\\' . $class; |
|
1541 | + return 0 === \strpos($class, '\\') ? $class : '\\'.$class; |
|
1542 | 1542 | } |
1543 | 1543 | /** |
1544 | 1544 | * Dumps a parameter. |
@@ -1553,10 +1553,10 @@ discard block |
||
1553 | 1553 | if ($this->container->isCompiled() && $this->container->hasParameter($name)) { |
1554 | 1554 | $value = $this->container->getParameter($name); |
1555 | 1555 | $dumpedValue = $this->dumpValue($value, \false); |
1556 | - if (!$value || !\is_array($value)) { |
|
1556 | + if ( ! $value || ! \is_array($value)) { |
|
1557 | 1557 | return $dumpedValue; |
1558 | 1558 | } |
1559 | - if (!\preg_match("/\\\$this->(?:getEnv\\('(?:\\w++:)*+\\w++'\\)|targetDirs\\[\\d++\\])/", $dumpedValue)) { |
|
1559 | + if ( ! \preg_match("/\\\$this->(?:getEnv\\('(?:\\w++:)*+\\w++'\\)|targetDirs\\[\\d++\\])/", $dumpedValue)) { |
|
1560 | 1560 | return \sprintf('$this->parameters[%s]', $this->doExport($name)); |
1561 | 1561 | } |
1562 | 1562 | } |
@@ -1581,10 +1581,10 @@ discard block |
||
1581 | 1581 | } |
1582 | 1582 | if ($this->container->hasDefinition($id) && ($definition = $this->container->getDefinition($id))) { |
1583 | 1583 | if ($definition->isSynthetic()) { |
1584 | - $code = \sprintf('$this->get(%s%s)', $this->doExport($id), null !== $reference ? ', ' . $reference->getInvalidBehavior() : ''); |
|
1584 | + $code = \sprintf('$this->get(%s%s)', $this->doExport($id), null !== $reference ? ', '.$reference->getInvalidBehavior() : ''); |
|
1585 | 1585 | } elseif (null !== $reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $reference->getInvalidBehavior()) { |
1586 | 1586 | $code = 'null'; |
1587 | - if (!$definition->isShared()) { |
|
1587 | + if ( ! $definition->isShared()) { |
|
1588 | 1588 | return $code; |
1589 | 1589 | } |
1590 | 1590 | } elseif ($this->isTrivialInstance($definition)) { |
@@ -1593,7 +1593,7 @@ discard block |
||
1593 | 1593 | $code = \sprintf('$this->services[%s] = %s', $this->doExport($id), $code); |
1594 | 1594 | } |
1595 | 1595 | $code = "({$code})"; |
1596 | - } elseif ($this->asFiles && $definition->isShared() && !$this->isHotPath($definition)) { |
|
1596 | + } elseif ($this->asFiles && $definition->isShared() && ! $this->isHotPath($definition)) { |
|
1597 | 1597 | $code = \sprintf("\$this->load('%s.php')", $this->generateMethodName($id)); |
1598 | 1598 | } else { |
1599 | 1599 | $code = \sprintf('$this->%s()', $this->generateMethodName($id)); |
@@ -1640,11 +1640,11 @@ discard block |
||
1640 | 1640 | $i = \strrpos($id, '\\'); |
1641 | 1641 | $name = Container::camelize(\false !== $i && isset($id[1 + $i]) ? \substr($id, 1 + $i) : $id); |
1642 | 1642 | $name = \preg_replace('/[^a-zA-Z0-9_\\x7f-\\xff]/', '', $name); |
1643 | - $methodName = 'get' . $name . 'Service'; |
|
1643 | + $methodName = 'get'.$name.'Service'; |
|
1644 | 1644 | $suffix = 1; |
1645 | 1645 | while (isset($this->usedMethodNames[\strtolower($methodName)])) { |
1646 | 1646 | ++$suffix; |
1647 | - $methodName = 'get' . $name . $suffix . 'Service'; |
|
1647 | + $methodName = 'get'.$name.$suffix.'Service'; |
|
1648 | 1648 | } |
1649 | 1649 | $this->serviceIdToMethodNameMap[$id] = $methodName; |
1650 | 1650 | $this->usedMethodNames[\strtolower($methodName)] = \true; |
@@ -1684,11 +1684,11 @@ discard block |
||
1684 | 1684 | private function getExpressionLanguage() |
1685 | 1685 | { |
1686 | 1686 | if (null === $this->expressionLanguage) { |
1687 | - if (!\class_exists('Wordlift\\Modules\\Common\\Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage')) { |
|
1687 | + if ( ! \class_exists('Wordlift\\Modules\\Common\\Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage')) { |
|
1688 | 1688 | throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); |
1689 | 1689 | } |
1690 | 1690 | $providers = $this->container->getExpressionLanguageProviders(); |
1691 | - $this->expressionLanguage = new ExpressionLanguage(null, $providers, function ($arg) { |
|
1691 | + $this->expressionLanguage = new ExpressionLanguage(null, $providers, function($arg) { |
|
1692 | 1692 | $id = '""' === \substr_replace($arg, '', 1, -1) ? \stripcslashes(\substr($arg, 1, -1)) : null; |
1693 | 1693 | if (null !== $id && ($this->container->hasAlias($id) || $this->container->hasDefinition($id))) { |
1694 | 1694 | return $this->getServiceCall($id); |
@@ -1705,15 +1705,15 @@ discard block |
||
1705 | 1705 | } |
1706 | 1706 | private function isHotPath(Definition $definition) |
1707 | 1707 | { |
1708 | - return $this->hotPathTag && $definition->hasTag($this->hotPathTag) && !$definition->isDeprecated(); |
|
1708 | + return $this->hotPathTag && $definition->hasTag($this->hotPathTag) && ! $definition->isDeprecated(); |
|
1709 | 1709 | } |
1710 | 1710 | private function export($value) |
1711 | 1711 | { |
1712 | 1712 | if (null !== $this->targetDirRegex && \is_string($value) && \preg_match($this->targetDirRegex, $value, $matches, \PREG_OFFSET_CAPTURE)) { |
1713 | 1713 | $suffix = $matches[0][1] + \strlen($matches[0][0]); |
1714 | 1714 | $matches[0][1] += \strlen($matches[1][0]); |
1715 | - $prefix = $matches[0][1] ? $this->doExport(\substr($value, 0, $matches[0][1]), \true) . '.' : ''; |
|
1716 | - $suffix = isset($value[$suffix]) ? '.' . $this->doExport(\substr($value, $suffix), \true) : ''; |
|
1715 | + $prefix = $matches[0][1] ? $this->doExport(\substr($value, 0, $matches[0][1]), \true).'.' : ''; |
|
1716 | + $suffix = isset($value[$suffix]) ? '.'.$this->doExport(\substr($value, $suffix), \true) : ''; |
|
1717 | 1717 | $dirname = $this->asFiles ? '$this->containerDir' : '__DIR__'; |
1718 | 1718 | $offset = 2 + $this->targetDirMaxMatches - \count($matches); |
1719 | 1719 | if ($this->asFiles || 0 < $offset) { |
@@ -1730,7 +1730,7 @@ discard block |
||
1730 | 1730 | { |
1731 | 1731 | if (\is_string($value) && \false !== \strpos($value, "\n")) { |
1732 | 1732 | $cleanParts = \explode("\n", $value); |
1733 | - $cleanParts = \array_map(function ($part) { |
|
1733 | + $cleanParts = \array_map(function($part) { |
|
1734 | 1734 | return \var_export($part, \true); |
1735 | 1735 | }, $cleanParts); |
1736 | 1736 | $export = \implode('."\\n".', $cleanParts); |