]> git.mxchange.org Git - friendica.git/commitdiff
Fix PHPStan errors
authorArt4 <art4@wlabs.de>
Fri, 9 May 2025 06:40:49 +0000 (06:40 +0000)
committerArt4 <art4@wlabs.de>
Fri, 9 May 2025 06:40:49 +0000 (06:40 +0000)
src/Core/Logger/Factory/SyslogLoggerFactory.php
src/Module/Photo.php

index 24a884a5f9cb88aada46f680b9bebd27418a3d83..e71eb219f9aa8aaa51a8228f001dbdc55d35634b 100644 (file)
@@ -48,8 +48,8 @@ final class SyslogLoggerFactory implements LoggerFactory
         */
        public function createLogger(string $logLevel, string $logChannel): LoggerInterface
        {
-               $logOpts     = (string) $this->config->get('system', 'syslog_flags')    ?? SyslogLogger::DEFAULT_FLAGS;
-               $logFacility = (string) $this->config->get('system', 'syslog_facility') ?? SyslogLogger::DEFAULT_FACILITY;
+               $logOpts     = (int) $this->config->get('system', 'syslog_flags')    ?? SyslogLogger::DEFAULT_FLAGS;
+               $logFacility = (int) $this->config->get('system', 'syslog_facility') ?? SyslogLogger::DEFAULT_FACILITY;
 
                if (!array_key_exists($logLevel, SyslogLogger::logLevels)) {
                        throw new LogLevelException(sprintf('The log level "%s" is not supported by "%s".', $logLevel, SyslogLogger::class));
@@ -58,7 +58,7 @@ final class SyslogLoggerFactory implements LoggerFactory
                return new SyslogLogger(
                        $logChannel,
                        $this->introspection,
-                       (string) SyslogLogger::logLevels[$logLevel],
+                       SyslogLogger::logLevels[$logLevel],
                        $logOpts,
                        $logFacility
                );
index 8faef5aa6d84a09cbe6754fd4b5f4c2b68e16ef7..ddd7b1994d797602d30dbc2929a5c4094da5fc80 100644 (file)
@@ -308,7 +308,9 @@ class Photo extends BaseApi
 
                                // For local users directly use the photo record that is marked as the profile
                                if (DI::baseUrl()->isLocalUrl($contact['url'])) {
-                                       $contact = Contact::selectFirst($fields, ['nurl' => $contact['nurl'], 'self' => true]);
+                                       $nurl    = $contact['nurl'];
+                                       $contact = Contact::selectFirst($fields, ['nurl' => $nurl, 'self' => true]);
+
                                        if (!empty($contact)) {
                                                if ($customsize <= Proxy::PIXEL_MICRO) {
                                                        $scale = 6;
@@ -324,7 +326,7 @@ class Photo extends BaseApi
                                                        $this->logger->notice('Profile photo was not loaded', ['scale' => $scale, 'uid' => $contact['uid']]);
                                                }
                                        } else {
-                                               $this->logger->notice('Local Contact was not found', ['url' => $contact['nurl']]);
+                                               $this->logger->notice('Local Contact was not found', ['url' => $nurl]);
                                        }
                                }