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

[TASK] Cleanup

parent d3e02841
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,9 @@ namespace SGalinski\SgNews\Controller;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\Exception;
use Psr\Http\Message\ResponseInterface;
use SGalinski\SgNews\Domain\Model\Category;
use SGalinski\SgNews\Domain\Model\News;
use SGalinski\SgNews\Domain\Repository\CategoryRepository;
......@@ -34,10 +37,14 @@ use SGalinski\SgNews\Domain\Repository\TagRepository;
use SGalinski\SgNews\Domain\Service\NewsService;
use SGalinski\SgNews\Service\ConfigurationService;
use SGalinski\SgNews\Service\HeaderMetaDataService;
use SGalinski\SgSeo\Service\HeadTagService;
use TYPO3\CMS\Core\Error\Http\PageNotFoundException;
use TYPO3\CMS\Core\Http\ImmediateResponseException;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException;
use TYPO3\CMS\Extbase\Http\ForwardResponse;
use TYPO3\CMS\Extbase\Mvc\Exception\StopActionException;
use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException;
use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Frontend\Controller\ErrorController;
......@@ -115,25 +122,23 @@ class OverviewController extends AbstractController {
* @param array $newsFilter
* @param int $currentPageBrowserPage
* @return void
* @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException
* @throws ImmediateResponseException
* @throws DBALException
* @throws Exception
* @throws PageNotFoundException
* @throws \TYPO3\CMS\Core\Package\Exception
* @throws InvalidConfigurationTypeException
* @throws StopActionException
* @throws InvalidQueryException
*/
public function overviewAction(array $newsFilter = [], int $currentPageBrowserPage = 0): ?\Psr\Http\Message\ResponseInterface {
$groupBy = $this->settings['groupBy'] ?? 0;
$enableFilter = $this->settings['enableFilter'] ?? FALSE;
if ((int) $groupBy === 0 && (bool) $enableFilter === FALSE) {
if (version_compare(
\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(),
'11.0.0',
'<'
)) {
public function overviewAction(array $newsFilter = [], int $currentPageBrowserPage = 0): ?ResponseInterface {
$groupBy = (int) ($this->settings['groupBy'] ?? 0);
$enableFilter = (bool) ($this->settings['enableFilter'] ?? FALSE);
if ($groupBy === 0 && $enableFilter === FALSE) {
if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) {
$this->forward('overviewWithoutCategories', NULL, NULL, $this->request->getArguments());
} else {
return (new \TYPO3\CMS\Extbase\Http\ForwardResponse(
'overviewWithoutCategories'
))
return (new ForwardResponse('overviewWithoutCategories'))
->withArguments($this->request->getArguments());
}
}
......@@ -337,7 +342,7 @@ class OverviewController extends AbstractController {
$this->view->assign('groupBy', 'none');
}
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) {
if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) {
return NULL;
} else {
return $this->htmlResponse();
......@@ -361,13 +366,13 @@ class OverviewController extends AbstractController {
switch ($columnAmount) {
case 4:
$columnClasses .= 'col-lg-3 ';
// no break
// no break
case 3:
$columnClasses .= 'col-md-4 ';
// no break
// no break
case 2:
$columnClasses .= 'col-sm-6 ';
// no break
// no break
default:
$columnClasses .= 'col-xs-12';
}
......
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