diff --git a/typo3/sysext/adminpanel/Classes/Log/InMemoryLogWriter.php b/typo3/sysext/adminpanel/Classes/Log/InMemoryLogWriter.php
index 19ef85008d8946b66c80a96d0b2a861f0405d90d..16ea9089120d3d3cc621b819412ef45a74fdc2a9 100644
--- a/typo3/sysext/adminpanel/Classes/Log/InMemoryLogWriter.php
+++ b/typo3/sysext/adminpanel/Classes/Log/InMemoryLogWriter.php
@@ -54,7 +54,7 @@ class InMemoryLogWriter extends AbstractWriter
         }
 
         // Guard: Memory Usage
-        if (!self::$memoryLock && MemoryUtility::isMemoryConsumptionTooHigh()) {
+        if (MemoryUtility::isMemoryConsumptionTooHigh()) {
             $this->lockWriter();
             return $this;
         }
diff --git a/typo3/sysext/adminpanel/Classes/Modules/Debug/Events.php b/typo3/sysext/adminpanel/Classes/Modules/Debug/Events.php
index 54c38227c8d6c639242d9a734606f137d5e5a732..21c41a0d8ec16b48179a5282e55249e063cd6253 100644
--- a/typo3/sysext/adminpanel/Classes/Modules/Debug/Events.php
+++ b/typo3/sysext/adminpanel/Classes/Modules/Debug/Events.php
@@ -47,6 +47,7 @@ class Events extends AbstractSubModule implements DataProviderInterface
 
     public function getDataToStore(ServerRequestInterface $request): ModuleData
     {
+        /** @var \TYPO3\CMS\Adminpanel\Service\EventDispatcher $eventDispatcher */
         $eventDispatcher = GeneralUtility::makeInstance(EventDispatcherInterface::class);
         $cloner = new VarCloner();
         $cloner->setMinDepth(2);
diff --git a/typo3/sysext/adminpanel/Classes/Modules/Debug/Log.php b/typo3/sysext/adminpanel/Classes/Modules/Debug/Log.php
index 3c320330deca2afc0e3e1f8c8ce61876bde6fa1c..94f500400e1f64ef608e159afa55e75e684b4cb0 100644
--- a/typo3/sysext/adminpanel/Classes/Modules/Debug/Log.php
+++ b/typo3/sysext/adminpanel/Classes/Modules/Debug/Log.php
@@ -143,7 +143,7 @@ class Log extends AbstractSubModule implements DataProviderInterface, ModuleSett
      */
     public function getContent(ModuleData $data): string
     {
-        $this->logLevel = $this->getConfigOption('startLevel');
+        $this->logLevel = (int)$this->getConfigOption('startLevel');
         $view = GeneralUtility::makeInstance(StandaloneView::class);
         $templateNameAndPath = 'EXT:adminpanel/Resources/Private/Templates/Modules/Debug/Log.html';
         $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
@@ -180,7 +180,7 @@ class Log extends AbstractSubModule implements DataProviderInterface, ModuleSett
      */
     public function enrich(ServerRequestInterface $request): ServerRequestInterface
     {
-        $this->logLevel = $this->getConfigOption('startLevel');
+        $this->logLevel = (int)$this->getConfigOption('startLevel');
 
         // set inMemoryLogWriter recursively for all configured namespaces/areas so we don't lose log entries
         $configWithInMemoryWriter = $this->setLoggingConfigRecursive($GLOBALS['TYPO3_CONF_VARS']['LOG'] ?? []);
diff --git a/typo3/sysext/adminpanel/Classes/Modules/Debug/QueryInformation.php b/typo3/sysext/adminpanel/Classes/Modules/Debug/QueryInformation.php
index 6b2119b51c4ea11ffbb9ab4e3572edd1e7e9e123..325802487ec12d0f96c68104053210ef314dcb12 100644
--- a/typo3/sysext/adminpanel/Classes/Modules/Debug/QueryInformation.php
+++ b/typo3/sysext/adminpanel/Classes/Modules/Debug/QueryInformation.php
@@ -98,7 +98,12 @@ class QueryInformation extends AbstractSubModule implements DataProviderInterfac
     {
         $groupedQueries = [];
         foreach ($queries as $query) {
-            $identifier = sha1($query['sql']) . sha1(json_encode($query['backtrace']));
+            $backtraceString = json_encode($query['backtrace']);
+            if ($backtraceString === false) {
+                // skip entry if it can't be encoded
+                continue;
+            }
+            $identifier = sha1($query['sql']) . sha1($backtraceString);
             if (is_array($query['params'])) {
                 foreach ($query['params'] as $k => $param) {
                     if (is_array($param)) {
@@ -123,7 +128,7 @@ class QueryInformation extends AbstractSubModule implements DataProviderInterfac
         }
         uasort(
             $groupedQueries,
-            function ($a, $b) {
+            static function ($a, $b) {
                 return $b['time'] <=> $a['time'];
             }
         );
diff --git a/typo3/sysext/adminpanel/Classes/Modules/Info/GeneralInformation.php b/typo3/sysext/adminpanel/Classes/Modules/Info/GeneralInformation.php
index 96021ca26afd614bc820cad7a44dafee8a2fe673..b9bba534eec3b2b93cfa289a7509ca6730e315a0 100644
--- a/typo3/sysext/adminpanel/Classes/Modules/Info/GeneralInformation.php
+++ b/typo3/sysext/adminpanel/Classes/Modules/Info/GeneralInformation.php
@@ -131,7 +131,7 @@ class GeneralInformation extends AbstractSubModule implements DataProviderInterf
         $count = 0;
         $totalImageSize = 0;
         foreach (GeneralUtility::makeInstance(AssetCollector::class)->getMedia() as $file => $information) {
-            $fileSize = @filesize($file);
+            $fileSize = (int)@filesize($file);
             $imagesOnPage['files'][] = [
                 'name' => $file,
                 'size' => $fileSize,
diff --git a/typo3/sysext/adminpanel/Classes/Utility/ResourceUtility.php b/typo3/sysext/adminpanel/Classes/Utility/ResourceUtility.php
index a21160b2699a15429016553520e0affe55fa77c4..6004e7316fa6494c74dad01a6e15b34b2f54ef30 100644
--- a/typo3/sysext/adminpanel/Classes/Utility/ResourceUtility.php
+++ b/typo3/sysext/adminpanel/Classes/Utility/ResourceUtility.php
@@ -28,7 +28,7 @@ class ResourceUtility
      * Get additional resources (css, js) from modules and merge it to
      * one array - returns an array of full html tags
      *
-     * @param \TYPO3\CMS\Adminpanel\ModuleApi\ResourceProviderInterface[] $modules
+     * @param \TYPO3\CMS\Adminpanel\ModuleApi\ModuleInterface[] $modules
      * @return array
      */
     public static function getAdditionalResourcesForModules(array $modules): array