Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commitfd24165

Browse files
committed
Removed redundant count array items checks
1 parent37e39bc commitfd24165

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎src/ConfigResource.php‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,8 @@ public function replaceKey($keys, $value, array $config)
189189

190190
$key =array_shift($keys);
191191

192-
$haveKeys = (count($keys) >0) ?true :false;
193-
194192
// If no more keys, overwrite and return
195-
if (!$haveKeys) {
193+
if (!$keys) {
196194
$config[$key] =$value;
197195
return$config;
198196
}
@@ -303,7 +301,7 @@ public function createNestedKeyValuePair(&$patchValues, $key, $value)
303301
protectedfunctionextractAndSet(array$keys,$value, &$array)
304302
{
305303
$key =array_shift($keys);
306-
if (count($keys)) {
304+
if ($keys) {
307305
if (!isset($array[$key]) || !is_array($array[$key])) {
308306
$array[$key] = [];
309307
}
@@ -327,7 +325,7 @@ protected function deleteByKey(&$array, array $keys)
327325
return;
328326
}
329327

330-
if (1 >count($keys)) {
328+
if (!$keys) {
331329
unset($array[$key]);
332330
return;
333331
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp