Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(code): use better comparison ===
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinsivy committed Oct 24, 2019
1 parent 738f2b9 commit 7683087
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions www/class/centreonGraph.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ public function __construct($user_id, $index = null, $debug = 0, $compress = nul
AND cbi.config_key IN ('rrd_cached_option', 'rrd_cached')"
);
while ($row = $result->fetch()) {
if ($row['config_key'] == 'rrd_cached_option') {
if ($row['config_key'] === 'rrd_cached_option') {
$this->rrdCachedOptions['rrd_cached_option'] = $row['config_value'];
} elseif ($row['config_key'] == 'rrd_cached') {
} elseif ($row['config_key'] === 'rrd_cached') {
$this->rrdCachedOptions['rrd_cached'] = $row['config_value'];
}
}
Expand Down Expand Up @@ -1808,9 +1808,9 @@ protected function flushRrdcached($metricsId)
*/
$errno = 0;
$errstr = '';
if ($this->rrdCachedOptions['rrd_cached_option'] == 'tcp') {
if ($this->rrdCachedOptions['rrd_cached_option'] === 'tcp') {
$sock = fsockopen('127.0.0.1', trim($this->rrdCachedOptions['rrd_cached']), $errno, $errstr);
} elseif ($this->rrdCachedOptions['rrd_cached_option'] == 'unix') {
} elseif ($this->rrdCachedOptions['rrd_cached_option'] === 'unix') {
$sock = fsockopen('unix://' . trim($this->rrdCachedOptions['rrd_cached']), $errno, $errstr);
} else {
return false;
Expand Down
8 changes: 4 additions & 4 deletions www/class/centreonGraphNg.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ public function __construct($userId)
);

while ($row = $stmt->fetch()) {
if ($row['config_key'] == 'rrd_cached_option') {
if ($row['config_key'] === 'rrd_cached_option') {
$this->rrdCachedOptions['rrd_cached_option'] = $row['config_value'];
} elseif ($row['config_key'] == 'rrd_cached') {
} elseif ($row['config_key'] === 'rrd_cached') {
$this->rrdCachedOptions['rrd_cached'] = $row['config_value'];
}
}
Expand Down Expand Up @@ -1257,9 +1257,9 @@ protected function flushRrdcached($metricsId)

$errno = 0;
$errstr = '';
if ($this->rrdCachedOptions['rrd_cached_option'] == 'tcp') {
if ($this->rrdCachedOptions['rrd_cached_option'] === 'tcp') {
$sock = fsockopen('127.0.0.1', trim($this->rrdCachedOptions['rrd_cached']), $errno, $errstr);
} elseif ($this->rrdCachedOptions['rrd_cached_option'] == 'unix') {
} elseif ($this->rrdCachedOptions['rrd_cached_option'] === 'unix') {
$sock = fsockopen('unix://' . trim($this->rrdCachedOptions['rrd_cached']), $errno, $errstr);
} else {
return false;
Expand Down
8 changes: 4 additions & 4 deletions www/class/centreonGraphStatus.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ public function flushRrdCached($indexData)

$errno = 0;
$errstr = '';
if ($this->rrdCachedOptions['rrd_cached_option'] == 'tcp') {
if ($this->rrdCachedOptions['rrd_cached_option'] === 'tcp') {
$sock = fsockopen('127.0.0.1', trim($this->rrdCachedOptions['rrd_cached']), $errno, $errstr);
} elseif ($this->rrdCachedOptions['rrd_cached_option'] == 'unix') {
} elseif ($this->rrdCachedOptions['rrd_cached_option'] === 'unix') {
$sock = fsockopen('unix://' . trim($this->rrdCachedOptions['rrd_cached']), $errno, $errstr);
} else {
return false;
Expand Down Expand Up @@ -222,9 +222,9 @@ protected function getRrdCachedOptions()

$rrdCachedOptions = [];
while ($row = $result->fetch()) {
if ($row['config_key'] == 'rrd_cached_option') {
if ($row['config_key'] === 'rrd_cached_option') {
$rrdCachedOptions['rrd_cached_option'] = $row['config_value'];
} elseif ($row['config_key'] == 'rrd_cached') {
} elseif ($row['config_key'] === 'rrd_cached') {
$rrdCachedOptions['rrd_cached'] = $row['config_value'];
}
}
Expand Down

0 comments on commit 7683087

Please sign in to comment.