aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-04-05 22:28:34 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-05 22:28:34 +0200
commit4f078958b5603900592e14f9f3189bbebfc81bab (patch)
tree95cac533a26c018bf965c2c2a75f18670ff17959 /lib
parent3f1695db039101d44d611f0d1781d1ba034034dd (diff)
Fix phpstan level 9 error for f.php and lib/favicons.php (#5263)
* Fix phpstan level 9 error * Fix phpstan level 9 error * Remarque's from Alkarex --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/favicons.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/favicons.php b/lib/favicons.php
index abaa5e63a..960a72afc 100644
--- a/lib/favicons.php
+++ b/lib/favicons.php
@@ -12,8 +12,11 @@ function isImgMime(string $content): bool {
}
$isImage = true;
try {
+ /** @var finfo $fInfo */
$fInfo = finfo_open(FILEINFO_MIME_TYPE);
- $isImage = strpos(finfo_buffer($fInfo, $content), 'image') !== false;
+ /** @var string $content */
+ $content = finfo_buffer($fInfo, $content);
+ $isImage = strpos($content, 'image') !== false;
finfo_close($fInfo);
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
@@ -28,6 +31,7 @@ function downloadHttp(string &$url, array $curlOptions = []): string {
if (!$url) {
return '';
}
+ /** @var CurlHandle $ch */
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
@@ -38,6 +42,7 @@ function downloadHttp(string &$url, array $curlOptions = []): string {
CURLOPT_ENCODING => '', //Enable all encodings
]);
curl_setopt_array($ch, $curlOptions);
+ /** @var string $response */
$response = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);