Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function saveConfig($key, $value) |
||
39 | { |
||
40 | $content = $this->readConfig(); |
||
41 | |||
42 | if (!$content) { |
||
43 | $content = []; |
||
44 | } |
||
45 | |||
46 | $content[$key] = $value; |
||
47 | |||
48 | $save = FileHelper::writeFile($this->configFile, Json::encode($content)); |
||
49 | |||
50 | if (!$save) { |
||
51 | return $this->outputError("Unable to find config file " . $this->configFile. ". Please create and provide Permissions."); |
||
52 | } |
||
53 | |||
54 | return $value; |
||
55 | } |
||
56 | } |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: