Skip to content

Commit

Permalink
[TASK] Fixes for phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
hojalatheef committed Dec 6, 2024
1 parent fddbfc6 commit 8962e74
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Classes/Backend/Preview/Weather2PluginPreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class Weather2PluginPreview extends StandardContentPreviewRenderer
public function __construct(
protected FlexFormService $flexFormService,
protected ViewFactoryInterface $viewFactory,
) {}
) {
}

public function renderPageModulePreviewContent(GridColumnItem $item): string
{
Expand All @@ -43,9 +44,11 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
return '';
}

$view = $this->viewFactory->create(new ViewFactoryData(
templatePathAndFilename: self::PREVIEW_TEMPLATE,
));
$view = $this->viewFactory->create(
new ViewFactoryData(
templatePathAndFilename: self::PREVIEW_TEMPLATE,
)
);
$view->assignMultiple($ttContentRecord);

$this->addPluginName($view, $ttContentRecord);
Expand All @@ -59,6 +62,9 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
return $view->render();
}

/**
* @param array<string, mixed> $ttContentRecord
*/
protected function isValidPlugin(array $ttContentRecord): bool
{
if (!isset($ttContentRecord['CType'])) {
Expand All @@ -72,6 +78,9 @@ protected function isValidPlugin(array $ttContentRecord): bool
return true;
}

/**
* @param array<string, mixed> $ttContentRecord
*/
protected function addPluginName(ViewInterface $view, array $ttContentRecord): void
{
$langKey = sprintf(
Expand All @@ -85,6 +94,10 @@ protected function addPluginName(ViewInterface $view, array $ttContentRecord): v
);
}

/**
* @param array<string, mixed> $ttContentRecord
* @return array<string, mixed>
*/
protected function getPiFlexformData(array $ttContentRecord): array
{
$data = [];
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"require": {
"typo3/cms-core": "^13.4",
"typo3/cms-dashboard": "^13.4",
"typo3/cms-install": "^13.4",
"typo3/cms-scheduler": "^13.4"
},
"require-dev": {
Expand Down

0 comments on commit 8962e74

Please sign in to comment.