Passed
Push — master ( ed990b...cd5214 )
by Divine Niiquaye
07:33
created
src/Definitions/InterfaceDefinition.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;');
Please login to merge, or discard this patch.
src/Container.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         ));
Please login to merge, or discard this patch.
src/ContainerPanel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Exceptions/ParameterNotFoundException.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,10 +69,10 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Resolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
 		} elseif (
116 116
 			$method instanceof \ReflectionMethod
117 117
 			&& $type === 'array'
118
-			&& preg_match('#@param[ \t]+([\w\\\\]+)\[\][ \t]+\$' . $parameter->name . '#', (string) $method->getDocComment(), $m)
118
+			&& preg_match('#@param[ \t]+([\w\\\\]+)\[\][ \t]+\$'.$parameter->name.'#', (string) $method->getDocComment(), $m)
119 119
 			&& ($itemType = Reflection::expandClassName($m[1], $method->getDeclaringClass()))
120 120
 			&& (class_exists($itemType) || interface_exists($itemType))
121 121
 		) {
Please login to merge, or discard this patch.
src/PhpGenerator.php 1 patch
Spacing   -26 removed lines patch added patch discarded remove patch
@@ -57,29 +57,3 @@
 block discarded – undo
57 57
     public function toString(Nette\PhpGenerator\ClassType $class): string
58 58
     {
59 59
         $class->setComment(<<<'COMMENT'
60
-/**
61
- * Main DependencyInjection Container. This class has been auto-generated
62
- * by the Nette Dependency Injection Component.
63
- *
64
- * Automatically detects if "container" property are presented in class or uses
65
- * global container as fallback.
66
- *
67
- */
68
-COMMENT);
69
-
70
-        return parent::toString($class);
71
-    }
72
-
73
-    public function generateMethod(Definitions\Definition $def): Nette\PhpGenerator\Method
74
-    {
75
-        $method   = parent::generateMethod($def);
76
-        $name     = $def->getName();
77
-        $comment  = 'This service can be accessed by it\'s name in lower case,';
78
-        $comment2 = "thus `%s`, using container get or make methods.\n\n@return %s";
79
-
80
-        $method->setProtected();
81
-        $method->setComment(\sprintf($comment . "\n" . $comment2, $name, $def->getType()));
82
-
83
-        return $method;
84
-    }
85
-}
Please login to merge, or discard this patch.
src/Adapters/XmlAdapter.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function parse(string $content, $schemaOrCallable = null): DOMDocument
62 62
     {
63
-        $internalErrors  = \libxml_use_internal_errors(true);
63
+        $internalErrors = \libxml_use_internal_errors(true);
64 64
         \libxml_clear_errors();
65 65
 
66 66
         $dom                  = new DOMDocument();
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             $writer->startElement('container');
226 226
         }
227 227
 
228
-        $data = \array_map(function ($value) {
228
+        $data = \array_map(function($value) {
229 229
             $value = $this->resolveClassObject($value);
230 230
 
231 231
             if (\is_array($value)) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                         unset($value['value']);
288 288
 
289 289
                         $writer->startElement($key);
290
-                        \array_walk_recursive($value, function ($item, $id) use (&$writer): void {
290
+                        \array_walk_recursive($value, function($item, $id) use (&$writer): void {
291 291
                             $writer->writeAttribute($id, $item);
292 292
                         });
293 293
 
@@ -337,10 +337,10 @@  discard block
 block discarded – undo
337 337
                 return true;
338 338
             case 'false' === $lowercaseValue:
339 339
                 return false;
340
-            case isset($value[1]) && '0b' == $value[0] . $value[1] && \preg_match('/^0b[01]*$/', $value):
340
+            case isset($value[1]) && '0b' == $value[0].$value[1] && \preg_match('/^0b[01]*$/', $value):
341 341
                 return \bindec($value);
342 342
             case \is_numeric($value):
343
-                return '0x' === $value[0] . $value[1] ? \hexdec($value) : (float) $value;
343
+                return '0x' === $value[0].$value[1] ? \hexdec($value) : (float) $value;
344 344
             case \preg_match('/^0x[0-9a-f]++$/i', $value):
345 345
                 return \hexdec($value);
346 346
             case \preg_match('/^[+-]?[0-9]+(\.[0-9]+)?$/', $value):
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
                 return 'true';
372 372
             case false === $value:
373 373
                 return 'false';
374
-            case isset($value[1]) && '0b' == $value[0] . $value[1] && \preg_match('/^0b[01]*$/', (string) $value):
374
+            case isset($value[1]) && '0b' == $value[0].$value[1] && \preg_match('/^0b[01]*$/', (string) $value):
375 375
                 return (string) \bindec($value);
376 376
             case \preg_match('/^0x[0-9a-f]++$/i', (string) $value):
377 377
                 return \hexdec($value);
Please login to merge, or discard this patch.