diff options
| author | 2024-09-11 17:14:53 +0200 | |
|---|---|---|
| committer | 2024-09-11 17:14:53 +0200 | |
| commit | dfac9f5813df7d4c7c812c381364c8898333f559 (patch) | |
| tree | 978496d0a8d8b0d6b5dbe836c6829296133b337c /lib | |
| parent | 31c8846791d4b5316fbc790202f79545c012f9c2 (diff) | |
PHPStan booleansInConditions (#6793)
* PHPStan booleansInConditions
* Uniformisation
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Minz/ModelPdo.php | 2 | ||||
| -rw-r--r-- | lib/lib_rss.php | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index 7804b3302..26b5269a5 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -224,7 +224,7 @@ class Minz_ModelPdo { $calling .= '|' . $backtrace[$i]['function']; } $calling = trim($calling, '|'); - $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); + $info = $stm === false ? $this->pdo->errorInfo() : $stm->errorInfo(); Minz_Log::error('SQL error ' . $calling . ' ' . json_encode($info)); return null; } diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 61055153c..d8602963e 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -285,9 +285,9 @@ function customSimplePie(array $attributes = [], array $curl_options = []): Simp $curl_options = array_replace(FreshRSS_Context::systemConf()->curl_options, $curl_options); if (isset($attributes['ssl_verify'])) { - $curl_options[CURLOPT_SSL_VERIFYHOST] = $attributes['ssl_verify'] ? 2 : 0; + $curl_options[CURLOPT_SSL_VERIFYHOST] = empty($attributes['ssl_verify']) ? 0 : 2; $curl_options[CURLOPT_SSL_VERIFYPEER] = (bool)$attributes['ssl_verify']; - if (!$attributes['ssl_verify']) { + if (empty($attributes['ssl_verify'])) { $curl_options[CURLOPT_SSL_CIPHER_LIST] = 'DEFAULT@SECLEVEL=1'; } } @@ -518,9 +518,9 @@ function httpGet(string $url, string $cachePath, string $type = 'html', array $a } if (isset($attributes['ssl_verify'])) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $attributes['ssl_verify'] ? 2 : 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, empty($attributes['ssl_verify']) ? 0 : 2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (bool)$attributes['ssl_verify']); - if (!$attributes['ssl_verify']) { + if (empty($attributes['ssl_verify'])) { curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'DEFAULT@SECLEVEL=1'); } } |
