Skip to content

Commit

Permalink
Fix #5672. TypeError when setting config value to '[]' (#5682)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman authored Jul 2, 2023
1 parent 301cd24 commit 02d96d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Commands/config/ConfigCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,16 @@ public function set($config_name, $key, $value, $options = ['input-format' => 's
$data = $this->stdin()->contents();
}

// Special handling for empty array.
if ($data == '[]') {
$data = [];
}

// Special handling for null.
if (strtolower($data) == 'null') {
$data = null;
}

// Special handling for empty array.
if ($data == '[]') {
$data = [];
}

if ($options['input-format'] === 'yaml') {
$parser = new Parser();
$data = $parser->parse($data);
Expand Down

0 comments on commit 02d96d6

Please sign in to comment.