Browse Source

Use `+` instead of isset checks.

Mark Story 10 years ago
parent
commit
d610c92c7a
1 changed files with 6 additions and 8 deletions
  1. 6 8
      src/Controller/Component/RequestHandlerComponent.php

+ 6 - 8
src/Controller/Component/RequestHandlerComponent.php

@@ -96,19 +96,17 @@ class RequestHandlerComponent extends Component
      */
      */
     public function __construct(ComponentRegistry $registry, array $config = [])
     public function __construct(ComponentRegistry $registry, array $config = [])
     {
     {
-        if (!isset($config['viewClassMap'])) {
-            $config['viewClassMap'] = [
+        $config += [
+            'viewClassMap' => [
                 'json' => 'Json',
                 'json' => 'Json',
                 'xml' => 'Xml',
                 'xml' => 'Xml',
                 'ajax' => 'Ajax'
                 'ajax' => 'Ajax'
-            ];
-        }
-        if (!isset($config['inputTypeMap'])) {
-            $config['inputTypeMap'] = [
+            ],
+            'inputTypeMap' => [
                 'json' => ['json_decode', true],
                 'json' => ['json_decode', true],
                 'xml' => [[$this, 'convertXml']],
                 'xml' => [[$this, 'convertXml']],
-            ];
-        }
+            ]
+        ];
         parent::__construct($registry, $config);
         parent::__construct($registry, $config);
     }
     }