Commit 0fee8243 authored by Susanne Moog's avatar Susanne Moog Committed by Andreas Fernandez
Browse files

[TASK] Clean up admin panel types

Resolves: #91457
Releases: master
Change-Id: I29009a9498b050942e34a27815acdf996e6f0539
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64558


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent e3ad2bd0
......@@ -54,7 +54,7 @@ class InMemoryLogWriter extends AbstractWriter
}
// Guard: Memory Usage
if (!self::$memoryLock && MemoryUtility::isMemoryConsumptionTooHigh()) {
if (MemoryUtility::isMemoryConsumptionTooHigh()) {
$this->lockWriter();
return $this;
}
......
......@@ -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);
......
......@@ -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'] ?? []);
......
......@@ -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'];
}
);
......
......@@ -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,
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment