Skip to content
Snippets Groups Projects
Commit 17a8fb89 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Cleanup and PHP 8 errors

parent 0e3bdc22
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,14 @@ class NewsFeedController extends AbstractController {
/**
* @var NewsRepository
*/
protected $newsRepository;
protected NewsRepository $newsRepository;
/**
* @param NewsRepository $newsRepository
*/
public function injectNewsRepository(NewsRepository $newsRepository) {
$this->newsRepository = $newsRepository;
}
/**
* Renders the news feed
......@@ -49,8 +56,8 @@ class NewsFeedController extends AbstractController {
public function indexAction(): ?\Psr\Http\Message\ResponseInterface {
$categories = GeneralUtility::intExplode(',', $this->settings['showCategories'], TRUE);
$tags = GeneralUtility::intExplode(',', $this->settings['showTags'], TRUE);
$startTime = (int) $this->settings['starttime'];
$endTime = (int) $this->settings['endtime'];
$startTime = (int) ($this->settings['starttime'] ?? 0);
$endTime = (int) ($this->settings['endtime'] ?? 0);
$news = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategories(
10,
FALSE,
......@@ -85,15 +92,8 @@ class NewsFeedController extends AbstractController {
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) {
return NULL;
} else {
return $this->htmlResponse();
}
}
/**
* @param NewsRepository $newsRepository
*/
public function injectNewsRepository(NewsRepository $newsRepository) {
$this->newsRepository = $newsRepository;
return $this->htmlResponse();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment