@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $writer->startElement('container-config'); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $data = \array_map(function ($value) { |
|
| 231 | + $data = \array_map(function($value) { |
|
| 232 | 232 | $value = $this->resolveClassObject($value); |
| 233 | 233 | |
| 234 | 234 | if (\is_array($value)) { |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | unset($value['value']); |
| 291 | 291 | |
| 292 | 292 | $writer->startElement($key); |
| 293 | - \array_walk_recursive($value, function ($item, $id) use (&$writer): void { |
|
| 293 | + \array_walk_recursive($value, function($item, $id) use (&$writer): void { |
|
| 294 | 294 | $writer->writeAttribute($id, $item); |
| 295 | 295 | }); |
| 296 | 296 | |
@@ -340,10 +340,10 @@ discard block |
||
| 340 | 340 | return true; |
| 341 | 341 | case 'false' === $lowercaseValue: |
| 342 | 342 | return false; |
| 343 | - case isset($value[1]) && '0b' == $value[0] . $value[1] && \preg_match('/^0b[01]*$/', $value): |
|
| 343 | + case isset($value[1]) && '0b' == $value[0].$value[1] && \preg_match('/^0b[01]*$/', $value): |
|
| 344 | 344 | return \bindec($value); |
| 345 | 345 | case \is_numeric($value): |
| 346 | - return '0x' === $value[0] . $value[1] ? \hexdec($value) : (float) $value; |
|
| 346 | + return '0x' === $value[0].$value[1] ? \hexdec($value) : (float) $value; |
|
| 347 | 347 | case \preg_match('/^0x[0-9a-f]++$/i', $value): |
| 348 | 348 | return \hexdec($value); |
| 349 | 349 | case \preg_match('/^[+-]?[0-9]+(\.[0-9]+)?$/', $value): |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | return 'true'; |
| 375 | 375 | case false === $value: |
| 376 | 376 | return 'false'; |
| 377 | - case isset($value[1]) && '0b' == $value[0] . $value[1] && \preg_match('/^0b[01]*$/', (string) $value): |
|
| 377 | + case isset($value[1]) && '0b' == $value[0].$value[1] && \preg_match('/^0b[01]*$/', (string) $value): |
|
| 378 | 378 | return (string) \bindec($value); |
| 379 | 379 | case \preg_match('/^0x[0-9a-f]++$/i', (string) $value): |
| 380 | 380 | return \hexdec($value); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | if ($resultDef instanceof Definitions\ServiceDefinition) { |
| 108 | 108 | if ($resultDef->getEntity() instanceof Definitions\Reference && !$resultDef->getFactory()->arguments) { |
| 109 | - $resultDef->setFactory([ // render as $container->createMethod() |
|
| 109 | + $resultDef->setFactory([// render as $container->createMethod() |
|
| 110 | 110 | new Definitions\Reference(Nette\DI\ContainerBuilder::THIS_CONTAINER), |
| 111 | 111 | Nette\DI\Container::getMethodName($resultDef->getEntity()->getValue()), |
| 112 | 112 | ]); |
@@ -130,16 +130,16 @@ discard block |
||
| 130 | 130 | $code = new Definitions\Statement('class', $this->resultDefinition->getFactory()->arguments); |
| 131 | 131 | $code = $generator->formatStatement($code); |
| 132 | 132 | |
| 133 | - $method->setBody('$service = ' . "{$code} " . $class->addExtend($entity) . ';'); |
|
| 133 | + $method->setBody('$service = '."{$code} ".$class->addExtend($entity).';'); |
|
| 134 | 134 | |
| 135 | 135 | if (!empty($this->resultDefinition->getSetup())) { |
| 136 | 136 | $setups = ''; |
| 137 | 137 | |
| 138 | 138 | foreach ($this->resultDefinition->getSetup() as $setup) { |
| 139 | - $setups .= $generator->formatStatement($setup) . ";\n"; |
|
| 139 | + $setups .= $generator->formatStatement($setup).";\n"; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $method->addBody("\n" . $setups); |
|
| 142 | + $method->addBody("\n".$setups); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $method->addBody('return $service;'); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function getClassName($key): string |
| 61 | 61 | { |
| 62 | - return 'Container_' . \substr(\md5(\serialize($key)), 0, 10); |
|
| 62 | + return 'Container_'.\substr(\md5(\serialize($key)), 0, 10); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | $handle = @\fopen("$file.lock", 'c+'); // @ is escalated to exception |
| 96 | 96 | |
| 97 | 97 | if (!$handle) { |
| 98 | - throw new Nette\IOException("Unable to create file '$file.lock'. " . Nette\Utils\Helpers::getLastError()); |
|
| 98 | + throw new Nette\IOException("Unable to create file '$file.lock'. ".Nette\Utils\Helpers::getLastError()); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | if (!@\flock($handle, \LOCK_EX)) { // @ is escalated to exception |
| 102 | - throw new Nette\IOException("Unable to acquire exclusive lock on '$file.lock'. " . Nette\Utils\Helpers::getLastError()); |
|
| 102 | + throw new Nette\IOException("Unable to acquire exclusive lock on '$file.lock'. ".Nette\Utils\Helpers::getLastError()); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | if (!\is_file($file) || $this->isExpired($file, $updatedMeta)) { |
@@ -250,8 +250,8 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | if (!\is_object($service)) { |
| 252 | 252 | throw new UnexpectedValueException( |
| 253 | - "Unable to create service '$name', value returned by " . |
|
| 254 | - ($cb instanceof Closure ? 'closure' : "method $method()") . ' is not object.' |
|
| 253 | + "Unable to create service '$name', value returned by ". |
|
| 254 | + ($cb instanceof Closure ? 'closure' : "method $method()").' is not object.' |
|
| 255 | 255 | ); |
| 256 | 256 | } |
| 257 | 257 | |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | \natsort($names); |
| 273 | 273 | |
| 274 | 274 | throw new MissingServiceException( |
| 275 | - "Multiple services of type $type found: " . \implode(', ', $names) . '.' |
|
| 275 | + "Multiple services of type $type found: ".\implode(', ', $names).'.' |
|
| 276 | 276 | ); |
| 277 | 277 | } |
| 278 | 278 | |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | if (($expectedType = $this->getServiceType($abstract)) && !\is_a($type, $expectedType, true)) { |
| 439 | 439 | throw new ContainerResolutionException( |
| 440 | - "Service '$abstract' must be instance of $expectedType, " . |
|
| 440 | + "Service '$abstract' must be instance of $expectedType, ". |
|
| 441 | 441 | ($type ? "$type given." : 'add typehint to closure.') |
| 442 | 442 | ); |
| 443 | 443 | } |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | |
| 479 | 479 | private function autowireArguments(ReflectionFunctionAbstract $function, array $args = []): array |
| 480 | 480 | { |
| 481 | - return Resolver::autowireArguments($function, $args, function (string $type, bool $single) { |
|
| 481 | + return Resolver::autowireArguments($function, $args, function(string $type, bool $single) { |
|
| 482 | 482 | return $single |
| 483 | 483 | ? $this->getByType($type) |
| 484 | 484 | : \array_map([$this, 'get'], $this->findAutowired($type)); |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | { |
| 511 | 511 | return \array_flip(\array_filter( |
| 512 | 512 | $methods, |
| 513 | - function ($s) { |
|
| 513 | + function($s) { |
|
| 514 | 514 | return \preg_match('#^createService.#', $s); |
| 515 | 515 | } |
| 516 | 516 | )); |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function getTab(): string |
| 55 | 55 | { |
| 56 | - return Nette\Utils\Helpers::capture(function (): void { |
|
| 56 | + return Nette\Utils\Helpers::capture(function(): void { |
|
| 57 | 57 | $elapsedTime = $this->elapsedTime; |
| 58 | 58 | |
| 59 | - require $this->diPath . '/templates/ContainerPanel.tab.phtml'; |
|
| 59 | + require $this->diPath.'/templates/ContainerPanel.tab.phtml'; |
|
| 60 | 60 | }); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -83,13 +83,13 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - return Nette\Utils\Helpers::capture(function () use ($tags, $types, $rc): void { |
|
| 86 | + return Nette\Utils\Helpers::capture(function() use ($tags, $types, $rc): void { |
|
| 87 | 87 | $container = $this->container; |
| 88 | 88 | $file = $rc->getFileName(); |
| 89 | 89 | $instances = $this->getContainerProperty('instances'); |
| 90 | 90 | $wiring = $this->getContainerProperty('wiring'); |
| 91 | 91 | |
| 92 | - require $this->diPath . '/templates/ContainerPanel.panel.phtml'; |
|
| 92 | + require $this->diPath.'/templates/ContainerPanel.panel.phtml'; |
|
| 93 | 93 | }); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -69,10 +69,10 @@ |
||
| 69 | 69 | } else { |
| 70 | 70 | $this->message .= ' Did you mean one of these: "'; |
| 71 | 71 | } |
| 72 | - $this->message .= \implode('", "', $this->alternatives) . '"?'; |
|
| 72 | + $this->message .= \implode('", "', $this->alternatives).'"?'; |
|
| 73 | 73 | } elseif (null !== $this->nonNestedAlternative) { |
| 74 | - $this->message .= ' You cannot access nested array items, do you want to inject "' . |
|
| 75 | - $this->nonNestedAlternative . '" instead?'; |
|
| 74 | + $this->message .= ' You cannot access nested array items, do you want to inject "'. |
|
| 75 | + $this->nonNestedAlternative.'" instead?'; |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | try { |
| 120 | 120 | $method = new Nette\PhpGenerator\Method(Container::getMethodName($name)); |
| 121 | 121 | $method->setProtected(); |
| 122 | - $method->setComment(\sprintf($comment . "\n" . $comment2, $name, $def->getType())); |
|
| 122 | + $method->setComment(\sprintf($comment."\n".$comment2, $name, $def->getType())); |
|
| 123 | 123 | $method->setReturnType($def->getType()); |
| 124 | 124 | $def->generateMethod($method, $this); |
| 125 | 125 | |
| 126 | 126 | return $method; |
| 127 | 127 | } catch (Exception $e) { |
| 128 | - throw new ServiceCreationException("Service '$name': " . $e->getMessage(), 0, $e); |
|
| 128 | + throw new ServiceCreationException("Service '$name': ".$e->getMessage(), 0, $e); |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function formatPhp(string $statement, array $args): string |
| 138 | 138 | { |
| 139 | - \array_walk_recursive($args, function (&$val): void { |
|
| 139 | + \array_walk_recursive($args, function(&$val): void { |
|
| 140 | 140 | if ($val instanceof Definitions\Statement) { |
| 141 | 141 | $val = new Php\Literal($this->formatStatement($val)); |
| 142 | 142 | } elseif ($val instanceof Definitions\Reference) { |