Completed
Push — master ( b63991...931f33 )
by Tolan
23s queued 12s
created
lib/Template/TwigTemplate.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
         $templatePath = null,
58 58
         $templateString = null,
59 59
         ResourceRepository $repo = null
60
-    ){
61
-        parent::__construct( $component );
60
+    ) {
61
+        parent::__construct($component);
62 62
         $this->templatePath = $templatePath;
63 63
         $this->templateString = $templateString;
64 64
         // Optional Puli repo
65 65
         $this->repo = $repo;
66 66
 
67
-        $this->initTwig( $this->getLoader() );
67
+        $this->initTwig($this->getLoader());
68 68
     }
69 69
 
70 70
     /**
@@ -72,18 +72,18 @@  discard block
 block discarded – undo
72 72
      * @param array $props
73 73
      * @return Response
74 74
      */
75
-    protected function doRender( ViewState $state, array $props = [] ): Response
75
+    protected function doRender(ViewState $state, array $props = [ ]): Response
76 76
     {
77 77
         // If puli plugin is available then add it.
78
-        if (class_exists( "Puli\\TwigExtension\\PuliExtension" ) && null !== $this->repo) {
79
-            $this->twig->addExtension( new PuliExtension( $this->repo ) );
78
+        if (class_exists("Puli\\TwigExtension\\PuliExtension") && null !== $this->repo) {
79
+            $this->twig->addExtension(new PuliExtension($this->repo));
80 80
         }
81
-        if( $this->templateString ){
81
+        if ($this->templateString) {
82 82
             $template = $this->twig->createTemplate($this->templateString);
83 83
         }
84 84
         
85 85
         $rendered = $this->twig->render(
86
-            $template??$this->templatePath,
86
+            $template ?? $this->templatePath,
87 87
             [
88 88
                 'state' => $state,
89 89
                 'props' => $props,
@@ -91,17 +91,17 @@  discard block
 block discarded – undo
91 91
                 'parent' => $this->component->getParent(),
92 92
                 'exec' => $this->component->exec
93 93
             ] );
94
-        return new Response( "text/html", $rendered );
94
+        return new Response("text/html", $rendered);
95 95
     }
96 96
 
97 97
     /**
98 98
      * @return Twig_LoaderInterface
99 99
      */
100
-    protected function getLoader(): ChainLoader|ArrayLoader|LoaderInterface
100
+    protected function getLoader(): ChainLoader | ArrayLoader | LoaderInterface
101 101
     {
102 102
 
103
-        if (class_exists( "Puli\\TwigExtension\\PuliExtension" ) && null !== $this->repo) {
104
-            $loader = new ChainLoader( [ new PuliTemplateLoader( $this->repo ), new Twig_Loader_String() ] );
103
+        if (class_exists("Puli\\TwigExtension\\PuliExtension") && null !== $this->repo) {
104
+            $loader = new ChainLoader([ new PuliTemplateLoader($this->repo), new Twig_Loader_String() ]);
105 105
         }else {
106 106
             $loader = new ArrayLoader();
107 107
         }
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
     /**
112 112
      * @param $loader
113 113
      */
114
-    protected function initTwig( $loader )
114
+    protected function initTwig($loader)
115 115
     {
116 116
         $config = [ 'autoescape' => false ];
117
-        if (defined( "TWIG_CACHE_DIR" )) {
117
+        if (defined("TWIG_CACHE_DIR")) {
118 118
             $config[ 'cache' ] = TWIG_CACHE_DIR;
119 119
         }
120
-        $this->twig = new Environment( $loader, $config );
120
+        $this->twig = new Environment($loader, $config);
121 121
     }
122 122
 
123 123
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
 
103 103
         if (class_exists( "Puli\\TwigExtension\\PuliExtension" ) && null !== $this->repo) {
104 104
             $loader = new ChainLoader( [ new PuliTemplateLoader( $this->repo ), new Twig_Loader_String() ] );
105
-        }else {
105
+        } else {
106 106
             $loader = new ArrayLoader();
107 107
         }
108 108
         return $loader;
Please login to merge, or discard this patch.
lib/AbstractViewComponent.php 2 patches
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         AbstractViewComponent $parent = null,
75 75
         ExecHelper $execHelper = null,
76 76
         LoggerInterface $logger = null
77
-    ){
77
+    ) {
78 78
         // Null means we are root
79 79
         $this->parent = $parent;
80 80
 
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
         if (null === $execHelper) {
85 85
             $execHelper = new ExecHelper();
86 86
         }
87
-        $this->setExec( $execHelper );
87
+        $this->setExec($execHelper);
88 88
 
89 89
         $this->handleDependencyInjection();
90 90
         
91
-        $this->setLogger( $logger );
91
+        $this->setLogger($logger);
92 92
 
93 93
         // Set up the state container
94 94
         $this->initState();
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
      * @param string $level A constant from LogLevel
100 100
      * @param array|atring $context
101 101
      */
102
-    protected function log( string $message, string $level, array|string $context = [] ){
103
-        if( isset( $this->logger ) ){
104
-            $class = get_class( $this );
102
+    protected function log(string $message, string $level, array | string $context = [ ]) {
103
+        if (isset($this->logger)) {
104
+            $class = get_class($this);
105 105
             $message = "[{$class}] {$message}";
106
-            if( ! is_array($context) ){
107
-                $context = [$context];
106
+            if (!is_array($context)) {
107
+                $context = [ $context ];
108 108
             }
109
-            $this->logger->log( $level, $message, $context );
109
+            $this->logger->log($level, $message, $context);
110 110
         }
111 111
     }
112 112
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     {
119 119
         $ser = serialize($this);
120 120
         // We have to unserialise the serialised object here because it's stripped down to only the required properties by __sleep()
121
-        $this->log( "Dehydrating", LogLevel::DEBUG, [unserialize($ser)] );
121
+        $this->log("Dehydrating", LogLevel::DEBUG, [ unserialize($ser) ]);
122 122
         return $ser;
123 123
     }
124 124
 
@@ -126,16 +126,16 @@  discard block
 block discarded – undo
126 126
      * Use this to unserialise ViewComponents
127 127
      * Note that we have implemented __sleep() so not all members are serialised.
128 128
      */
129
-    public static function rehydrate( $serialised, ExecHelper $execHelper, LoggerInterface $logger = null ): AbstractViewComponent
129
+    public static function rehydrate($serialised, ExecHelper $execHelper, LoggerInterface $logger = null): AbstractViewComponent
130 130
     {
131 131
         /** @var AbstractViewComponent $view */
132
-        $view = unserialize( $serialised );
133
-        if( null !== $logger ){
134
-            $logger->log( LogLevel::DEBUG, "Rehydrating", [$view] );
132
+        $view = unserialize($serialised);
133
+        if (null !== $logger) {
134
+            $logger->log(LogLevel::DEBUG, "Rehydrating", [ $view ]);
135 135
         }
136
-        $view->setExec( $execHelper );
136
+        $view->setExec($execHelper);
137 137
         $view->handleDependencyInjection();
138
-        $view->setLogger( $logger );
138
+        $view->setLogger($logger);
139 139
         return $view;
140 140
     }
141 141
 
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
      * Implement JsonSerializable interface, for logging mainly
157 157
      * @return mixed
158 158
      */
159
-    #[Pure] public function jsonSerialize(): mixed
159
+    #[Pure ] public function jsonSerialize(): mixed
160 160
     {
161
-        $ret = [];
161
+        $ret = [ ];
162 162
         // Return the same fields as __sleep() specifies for serialize()
163
-        foreach ( $this->__sleep() as $member ){
163
+        foreach ($this->__sleep() as $member) {
164 164
             // Skip parent because recursion isn't supported
165
-            if( $member == 'parent'){
165
+            if ($member == 'parent') {
166 166
                 continue;
167 167
             }
168
-            $ret[$member] = $this->$member;
168
+            $ret[ $member ] = $this->$member;
169 169
         }
170 170
         return $ret;
171 171
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      * @throws Exception
178 178
      * @return Response
179 179
      */
180
-    public function render( $execMethodName = null, array $execArgs = null ): Response
180
+    public function render($execMethodName = null, array $execArgs = null): Response
181 181
     {
182 182
         $this->state->validate();
183 183
 
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
         // If we're called with an 'exec' then run it instead of rendering the whole tree.
193 193
         // It may still render the whole tree or it may just render a portion or just return JSON
194 194
         if ($execMethodName) { // Used to test for null but it could easily be an empty string
195
-            $this->log( "Rendering with exec: {$execMethodName}, args:".var_export($execArgs, true ), LogLevel::DEBUG );
196
-            $out = $this->execMethod( $execMethodName, $execArgs );
195
+            $this->log("Rendering with exec: {$execMethodName}, args:".var_export($execArgs, true), LogLevel::DEBUG);
196
+            $out = $this->execMethod($execMethodName, $execArgs);
197 197
         }else {
198
-            $this->log( "Rendering without exec", LogLevel::DEBUG );
199
-            $out = $this->template->render( $this->state, $this->props );
200
-            if (!( $out instanceof Response )) {
201
-                throw new Exception( get_class( $this->template ) . " returned invalid response. Should have been an instance of PatternSeek\ComponentView\Response" );
198
+            $this->log("Rendering without exec", LogLevel::DEBUG);
199
+            $out = $this->template->render($this->state, $this->props);
200
+            if (!($out instanceof Response)) {
201
+                throw new Exception(get_class($this->template)." returned invalid response. Should have been an instance of PatternSeek\ComponentView\Response");
202 202
             }
203 203
         }
204 204
         return $out;
@@ -212,34 +212,34 @@  discard block
 block discarded – undo
212 212
      * @throws Exception
213 213
      * @return Response
214 214
      */
215
-    protected function execMethod( $methodName, array $args = null ): Response
215
+    protected function execMethod($methodName, array $args = null): Response
216 216
     {
217
-        if (!is_array( $methodName )) {
218
-            $methodName = explode( '.', $methodName );
217
+        if (!is_array($methodName)) {
218
+            $methodName = explode('.', $methodName);
219 219
         }
220
-        if (count( $methodName ) == 1) {
221
-            $methodName = $methodName[ 0 ] . 'Handler';
222
-            $out = $this->$methodName( $args );
220
+        if (count($methodName) == 1) {
221
+            $methodName = $methodName[ 0 ].'Handler';
222
+            $out = $this->$methodName($args);
223 223
         }else {
224
-            $childName = array_shift( $methodName );
224
+            $childName = array_shift($methodName);
225 225
             $child = $this->childComponents[ $childName ];
226 226
             if ($child instanceof AbstractViewComponent) {
227
-                $out = $child->execMethod( $methodName, $args );
227
+                $out = $child->execMethod($methodName, $args);
228 228
             }else {
229
-                throw new Exception( implode( ".", $methodName ) . " is not a valid method." );
229
+                throw new Exception(implode(".", $methodName)." is not a valid method.");
230 230
             }
231 231
         }
232
-        if (!( $out instanceof Response )) {
233
-            $nameStr = is_array( $methodName )?implode( ".", $methodName ):$methodName;
234
-            throw new Exception( $nameStr . " returned invalid response. Should have been an instance of PatternSeek\ComponentView\Response" );
232
+        if (!($out instanceof Response)) {
233
+            $nameStr = is_array($methodName) ?implode(".", $methodName) : $methodName;
234
+            throw new Exception($nameStr." returned invalid response. Should have been an instance of PatternSeek\ComponentView\Response");
235 235
         }
236 236
         return $out;
237 237
     }
238 238
 
239
-    public function getExecPath( $execMethod ): string
239
+    public function getExecPath($execMethod): string
240 240
     {
241 241
         $path = $this->getPath();
242
-        return ( $path === null?$execMethod:$path . '.' . $execMethod );
242
+        return ($path === null ? $execMethod : $path.'.'.$execMethod);
243 243
     }
244 244
 
245 245
     public function getParent(): ?AbstractViewComponent
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
     }
249 249
 
250 250
 
251
-    protected function setFlashMessage( $string )
251
+    protected function setFlashMessage($string)
252 252
     {
253 253
         $this->flashMessage = $string;
254 254
     }
255 255
 
256
-    protected function setFlashError( string $string )
256
+    protected function setFlashError(string $string)
257 257
     {
258 258
         $this->flashError = $string;
259 259
     }
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         }
298 298
         $pPath = $this->parent->getPath();
299 299
         if (null !== $pPath) {
300
-            return $pPath . '.' . $this->handle;
300
+            return $pPath.'.'.$this->handle;
301 301
         }else {
302 302
             return $this->handle;
303 303
         }
@@ -311,20 +311,20 @@  discard block
 block discarded – undo
311 311
      * @param array $props
312 312
      * @throws Exception
313 313
      */
314
-    protected function addOrUpdateChild( $handle, $type, array $props = [ ] )
314
+    protected function addOrUpdateChild($handle, $type, array $props = [ ])
315 315
     {
316
-        $this->log( "Adding/updating child '{$handle}' of type {$type}", LogLevel::DEBUG );
317
-        if (!isset( $this->childComponents[ $handle ] )) {
318
-            if( ! class_exists( $type ) ){
319
-                throw new Exception( "Class '{$type}' for sub-component  does not exist." );
316
+        $this->log("Adding/updating child '{$handle}' of type {$type}", LogLevel::DEBUG);
317
+        if (!isset($this->childComponents[ $handle ])) {
318
+            if (!class_exists($type)) {
319
+                throw new Exception("Class '{$type}' for sub-component  does not exist.");
320 320
             }
321
-            $child = new $type( $handle, $this, $this->exec, $this->logger );
321
+            $child = new $type($handle, $this, $this->exec, $this->logger);
322 322
             $this->childComponents[ $handle ] = $child;
323 323
         }else {
324 324
             // exec, di and logger are set recursively in rehydrate()
325 325
             $child = $this->childComponents[ $handle ];
326 326
         }
327
-        $child->updateProps( $props );
327
+        $child->updateProps($props);
328 328
         $child->updateState();
329 329
     }
330 330
 
@@ -335,12 +335,12 @@  discard block
 block discarded – undo
335 335
      * @return string
336 336
      * @throws Exception
337 337
      */
338
-    public function renderChild( $handle ): string
338
+    public function renderChild($handle): string
339 339
     {
340 340
         if (!$this->childComponents[ $handle ]) {
341 341
             $message = "Attempted to render nonexistent child component with handle '{$handle}'";
342
-            $this->log( $message, LogLevel::CRITICAL );
343
-            throw new Exception( $message );
342
+            $this->log($message, LogLevel::CRITICAL);
343
+            throw new Exception($message);
344 344
         }
345 345
         return $this->childComponents[ $handle ]->render()->content;
346 346
     }
@@ -388,58 +388,58 @@  discard block
 block discarded – undo
388 388
      * @param array $inputs
389 389
      * @throws Exception
390 390
      */
391
-    protected function testInputs( array $inputSpec, array &$inputs )
391
+    protected function testInputs(array $inputSpec, array &$inputs)
392 392
     {
393 393
         
394 394
         foreach ($inputSpec as $fieldName => $fieldSpec) {
395 395
             // Required field
396
-            if (( count( $fieldSpec ) < 2 )) {
397
-                if (!isset( $inputs[ $fieldName ] )) {
398
-                    $calledFunc = debug_backtrace()[1]['function'];
399
-                    $callerFunc = debug_backtrace()[2]['function'];
400
-                    $callerClass = debug_backtrace()[2]['class'];
396
+            if ((count($fieldSpec) < 2)) {
397
+                if (!isset($inputs[ $fieldName ])) {
398
+                    $calledFunc = debug_backtrace()[ 1 ][ 'function' ];
399
+                    $callerFunc = debug_backtrace()[ 2 ][ 'function' ];
400
+                    $callerClass = debug_backtrace()[ 2 ][ 'class' ];
401 401
                     $parentText = '';
402
-                    if( $this->parent !== null ){
402
+                    if ($this->parent !== null) {
403 403
                         $parentText = " (parent component is ".get_class($this->parent).")";
404 404
                     }
405
-                    throw new Exception( $fieldName . " is a required field for " . get_class( $this )."::{$calledFunc}() called from {$callerClass}::{$callerFunc}(){$parentText}" );
405
+                    throw new Exception($fieldName." is a required field for ".get_class($this)."::{$calledFunc}() called from {$callerClass}::{$callerFunc}(){$parentText}");
406 406
                 }
407 407
             }
408 408
             // Set default is unset
409
-            if (!isset( $inputs[ $fieldName ] )) {
409
+            if (!isset($inputs[ $fieldName ])) {
410 410
                 $inputs[ $fieldName ] = $fieldSpec[ 1 ];
411 411
             }
412 412
             // Check type
413 413
             // Any type allowed, continue
414
-            if (!isset( $fieldSpec[ 0 ] ) || $fieldSpec[ 0 ] === null) {
414
+            if (!isset($fieldSpec[ 0 ]) || $fieldSpec[ 0 ] === null) {
415 415
                 continue;
416 416
             }
417 417
             $requiredType = $fieldSpec[ 0 ];
418 418
             $input = $inputs[ $fieldName ];
419 419
             // Specific type required
420 420
             // Null is allowed
421
-            if (!is_null( $input )) {
422
-                $failed = match ( $requiredType ) {
423
-                    "string" => !is_string( $input ),
424
-                    "array" => !is_array( $input ),
425
-                    "object" => !is_object( $input ),
426
-                    "resource" => !is_resource( $input ),
427
-                    "callable" => !is_callable( $input ),
428
-                    "boolean", "bool" => !is_bool( $input ),
429
-                    "integer", "int" => !is_int( $input ),
430
-                    "double" => !is_double( $input ),
431
-                    "float" => !is_float( $input ),
432
-                    default => !( $input instanceof $requiredType ),
421
+            if (!is_null($input)) {
422
+                $failed = match ($requiredType) {
423
+                    "string" => !is_string($input),
424
+                    "array" => !is_array($input),
425
+                    "object" => !is_object($input),
426
+                    "resource" => !is_resource($input),
427
+                    "callable" => !is_callable($input),
428
+                    "boolean", "bool" => !is_bool($input),
429
+                    "integer", "int" => !is_int($input),
430
+                    "double" => !is_double($input),
431
+                    "float" => !is_float($input),
432
+                    default => !($input instanceof $requiredType),
433 433
                 };
434 434
                 if ($failed) {
435
-                    $calledFunc = debug_backtrace()[1]['function'];
436
-                    $callerFunc = debug_backtrace()[2]['function'];
437
-                    $callerClass = debug_backtrace()[2]['class'];
435
+                    $calledFunc = debug_backtrace()[ 1 ][ 'function' ];
436
+                    $callerFunc = debug_backtrace()[ 2 ][ 'function' ];
437
+                    $callerClass = debug_backtrace()[ 2 ][ 'class' ];
438 438
                     $parentText = '';
439
-                    if( $this->parent !== null ){
439
+                    if ($this->parent !== null) {
440 440
                         $parentText = " (parent component is ".get_class($this->parent).")";
441 441
                     }
442
-                    throw new Exception( $fieldName . " should be of type " . $requiredType . "in " . get_class( $this )."::{$calledFunc}() called from {$callerClass}::{$callerFunc}(){$parentText}" );
442
+                    throw new Exception($fieldName." should be of type ".$requiredType."in ".get_class($this)."::{$calledFunc}() called from {$callerClass}::{$callerFunc}(){$parentText}");
443 443
                 }
444 444
             }
445 445
         }
@@ -448,9 +448,9 @@  discard block
 block discarded – undo
448 448
     /**
449 449
      * Update the full component view tree.
450 450
      */
451
-    public function updateView( array $props )
451
+    public function updateView(array $props)
452 452
     {
453
-        $this->updateProps( $props );
453
+        $this->updateProps($props);
454 454
         $this->updateState();
455 455
     }
456 456
 
@@ -459,13 +459,13 @@  discard block
 block discarded – undo
459 459
      *
460 460
      * @var array $props
461 461
      */
462
-    protected function updateProps( array $props )
462
+    protected function updateProps(array $props)
463 463
     {
464
-        $this->log( "Storing new props: ", LogLevel::DEBUG,  var_export( $props, true ) );
464
+        $this->log("Storing new props: ", LogLevel::DEBUG, var_export($props, true));
465 465
         $this->props = $props;   
466 466
     }
467 467
 
468
-    protected function forceResponse( Response $response )
468
+    protected function forceResponse(Response $response)
469 469
     {
470 470
         $this->forceResponse = $response;
471 471
     }
@@ -473,12 +473,12 @@  discard block
 block discarded – undo
473 473
     /**
474 474
      * @param ExecHelper $execHelper
475 475
      */
476
-    private function setExec( ExecHelper $execHelper )
476
+    private function setExec(ExecHelper $execHelper)
477 477
     {
478 478
         $this->exec = clone $execHelper;
479
-        $this->exec->setComponent( $this );
480
-        foreach( $this->childComponents as $child ){
481
-            $child->setExec( $execHelper );
479
+        $this->exec->setComponent($this);
480
+        foreach ($this->childComponents as $child) {
481
+            $child->setExec($execHelper);
482 482
         }
483 483
     }
484 484
 
@@ -492,9 +492,9 @@  discard block
 block discarded – undo
492 492
         // it manually and you still get the advantage that the deps
493 493
         // are specified in the optional injectDependencies() method's
494 494
         // signature
495
-        $this->log( "Dependency injection...", LogLevel::DEBUG );
496
-        DependencyInjector::instance()->injectIntoMethod( $this );
497
-        foreach( $this->childComponents as $child ){
495
+        $this->log("Dependency injection...", LogLevel::DEBUG);
496
+        DependencyInjector::instance()->injectIntoMethod($this);
497
+        foreach ($this->childComponents as $child) {
498 498
             $child->handleDependencyInjection();
499 499
         }
500 500
     }
@@ -502,13 +502,13 @@  discard block
 block discarded – undo
502 502
     /**
503 503
      * @param LoggerInterface $logger
504 504
      */
505
-    private function setLogger( LoggerInterface $logger = null )
505
+    private function setLogger(LoggerInterface $logger = null)
506 506
     {
507
-        if( null !== $logger ){
507
+        if (null !== $logger) {
508 508
             $this->logger = $logger;
509 509
             /** @var AbstractViewComponent $child */
510
-            foreach( $this->childComponents as $child ){
511
-                $child->setLogger( $logger );
510
+            foreach ($this->childComponents as $child) {
511
+                $child->setLogger($logger);
512 512
             }
513 513
         }
514 514
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         if ($execMethodName) { // Used to test for null but it could easily be an empty string
195 195
             $this->log( "Rendering with exec: {$execMethodName}, args:".var_export($execArgs, true ), LogLevel::DEBUG );
196 196
             $out = $this->execMethod( $execMethodName, $execArgs );
197
-        }else {
197
+        } else {
198 198
             $this->log( "Rendering without exec", LogLevel::DEBUG );
199 199
             $out = $this->template->render( $this->state, $this->props );
200 200
             if (!( $out instanceof Response )) {
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
         if (count( $methodName ) == 1) {
221 221
             $methodName = $methodName[ 0 ] . 'Handler';
222 222
             $out = $this->$methodName( $args );
223
-        }else {
223
+        } else {
224 224
             $childName = array_shift( $methodName );
225 225
             $child = $this->childComponents[ $childName ];
226 226
             if ($child instanceof AbstractViewComponent) {
227 227
                 $out = $child->execMethod( $methodName, $args );
228
-            }else {
228
+            } else {
229 229
                 throw new Exception( implode( ".", $methodName ) . " is not a valid method." );
230 230
             }
231 231
         }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         $pPath = $this->parent->getPath();
299 299
         if (null !== $pPath) {
300 300
             return $pPath . '.' . $this->handle;
301
-        }else {
301
+        } else {
302 302
             return $this->handle;
303 303
         }
304 304
     }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             }
321 321
             $child = new $type( $handle, $this, $this->exec, $this->logger );
322 322
             $this->childComponents[ $handle ] = $child;
323
-        }else {
323
+        } else {
324 324
             // exec, di and logger are set recursively in rehydrate()
325 325
             $child = $this->childComponents[ $handle ];
326 326
         }
Please login to merge, or discard this patch.