Skip to content

Commit a38e5e9

Browse files
committed
ArrayHelper already has its own is_array() check
1 parent 329b88a commit a38e5e9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/controllers/DefaultController.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,12 @@ public function actionIndex(string $pattern): Response
101101
}
102102
}
103103

104-
// Does the config specify the serializer?
105-
$serializer = is_array($config) ? ArrayHelper::remove($config, 'serializer') : null;
106-
107104
// Extract config settings that aren't meant for createResource()
108-
$jsonOptions = (is_array($config) ? ArrayHelper::remove($config, 'jsonOptions') : null) ?? JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
109-
$pretty = (is_array($config) ? ArrayHelper::remove($config, 'pretty') : null) ?? false;
110-
$includes = (is_array($config) ? ArrayHelper::remove($config, 'includes') : null) ?? [];
111-
$excludes = (is_array($config) ? ArrayHelper::remove($config, 'excludes') : null) ?? [];
105+
$serializer = ArrayHelper::remove($config, 'serializer');
106+
$jsonOptions = ArrayHelper::remove($config, 'jsonOptions', JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
107+
$pretty = ArrayHelper::remove($config, 'pretty', false);
108+
$includes = ArrayHelper::remove($config, 'includes', []);
109+
$excludes = ArrayHelper::remove($config, 'excludes', []);
112110

113111
// Get the data resource
114112
try {

0 commit comments

Comments
 (0)