From aa51a58da56e858042c66c70a92ef4675758264f Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 19 Mar 2022 11:03:43 +0200 Subject: [PATCH] type fixes --- application/Espo/Classes/Jobs/Cleanup.php | 14 ++++++++++---- .../Espo/Classes/TemplateHelpers/GoogleMaps.php | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/application/Espo/Classes/Jobs/Cleanup.php b/application/Espo/Classes/Jobs/Cleanup.php index acf19ae955..950a9b6aee 100644 --- a/application/Espo/Classes/Jobs/Cleanup.php +++ b/application/Espo/Classes/Jobs/Cleanup.php @@ -134,10 +134,12 @@ class Cleanup implements JobDataLess foreach ($items as $name => $item) { try { - /** @var class-string */ + /** @var class-string<\Espo\Core\Cleanup\Cleanup> */ $className = $item['className']; - $injectableFactory->create($className)->process(); + $obj = $injectableFactory->create($className); + + $obj->process(); } catch (Throwable $e) { $this->log->error("Cleanup: {$name}: " . $e->getMessage()); @@ -355,6 +357,7 @@ class Cleanup implements JobDataLess $datetimeFrom->modify($fromPeriod); + /** @var string[] */ $scopeList = array_keys($this->metadata->get(['scopes'])); foreach ($scopeList as $scope) { @@ -548,8 +551,10 @@ class Cleanup implements JobDataLess $datetime = new DateTime('-' . $this->cleanupBackupPeriod); - if (file_exists($path)) { - $fileManager = $this->fileManager; + $fileManager = $this->fileManager; + + if ($fileManager->exists($path)) { + /** @var string[] */ $fileList = $fileManager->getFileList($path, false, '', false); foreach ($fileList as $dirName) { @@ -708,6 +713,7 @@ class Cleanup implements JobDataLess $datetime = new DateTime($period); + /** @var string[] */ $scopeList = array_keys($this->metadata->get(['scopes'])); foreach ($scopeList as $scope) { diff --git a/application/Espo/Classes/TemplateHelpers/GoogleMaps.php b/application/Espo/Classes/TemplateHelpers/GoogleMaps.php index 9ac3f4d5d0..9881acfdf9 100644 --- a/application/Espo/Classes/TemplateHelpers/GoogleMaps.php +++ b/application/Espo/Classes/TemplateHelpers/GoogleMaps.php @@ -187,7 +187,7 @@ class GoogleMaps implements Helper list($width, $height) = explode('x', $size); - $src = '@' . base64_encode($image); + $src = '@' . base64_encode($image); /** @phpstan-ignore-line */ $tag = "";