Skip to content

Commit 56fad05

Browse files
fix: add PHPDoc block headers and author/license information
1 parent 72ec3c2 commit 56fad05

4 files changed

Lines changed: 104 additions & 8 deletions

File tree

Classes/Backend/ToolbarItems/NewsItem.php

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the TYPO3 CMS extension "xima_typo3_internal_news".
7+
*
8+
* Copyright (C) 2024-2025 Konrad Michalik <hej@konradmichalik.dev>
9+
*
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation, either version 2 of the License, or
13+
* (at your option) any later version.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
524
namespace Xima\XimaTypo3InternalNews\Backend\ToolbarItems;
625

726
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
@@ -10,13 +29,20 @@
1029
use Xima\XimaTypo3InternalNews\Configuration;
1130
use Xima\XimaTypo3InternalNews\Domain\Repository\NewsRepository;
1231

32+
33+
/**
34+
* NewsItem.
35+
*
36+
* @author Konrad Michalik <hej@konradmichalik.dev>
37+
* @license GPL-2.0
38+
*/
39+
1340
class NewsItem implements ToolbarItemInterface
1441
{
1542
protected array $configuration;
1643
public function __construct(
1744
private readonly NewsRepository $newsRepository
18-
) {
19-
}
45+
) {}
2046

2147
/**
2248
* Checks whether the user has access to this toolbar item
@@ -36,7 +62,7 @@ public function checkAccess(): bool
3662
public function getItem(): string
3763
{
3864
$items = $this->newsRepository->findAllByCurrentUser();
39-
$newItemsCount = count(array_filter($items, fn ($item) => $item->isNew()));
65+
$newItemsCount = count(array_filter($items, fn($item) => $item->isNew()));
4066
$view = GeneralUtility::makeInstance(StandaloneView::class);
4167
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:' . Configuration::EXT_KEY
4268
. '/Resources/Private/Templates/Backend/ToolbarItems/NewsItem.html'));

Classes/Hooks/DataHandler.php

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,40 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the TYPO3 CMS extension "xima_typo3_internal_news".
7+
*
8+
* Copyright (C) 2024-2025 Konrad Michalik <hej@konradmichalik.dev>
9+
*
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation, either version 2 of the License, or
13+
* (at your option) any later version.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
524
namespace Xima\XimaTypo3InternalNews\Hooks;
625

726
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
827

28+
29+
/**
30+
* DataHandler.
31+
*
32+
* @author Konrad Michalik <hej@konradmichalik.dev>
33+
* @license GPL-2.0
34+
*/
35+
936
class DataHandler
1037
{
11-
public function __construct(private FrontendInterface $cache)
12-
{
13-
}
38+
public function __construct(private FrontendInterface $cache) {}
1439

1540
public function clearCachePostProc(array $params): void
1641
{

Classes/Service/CacheService.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,43 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the TYPO3 CMS extension "xima_typo3_internal_news".
7+
*
8+
* Copyright (C) 2024-2025 Konrad Michalik <hej@konradmichalik.dev>
9+
*
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation, either version 2 of the License, or
13+
* (at your option) any later version.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
524
namespace Xima\XimaTypo3InternalNews\Service;
625

726
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
827
use Xima\XimaTypo3InternalNews\Configuration;
928

29+
30+
/**
31+
* CacheService.
32+
*
33+
* @author Konrad Michalik <hej@konradmichalik.dev>
34+
* @license GPL-2.0
35+
*/
36+
1037
class CacheService
1138
{
1239
public function __construct(
1340
private FrontendInterface $cache
14-
) {
15-
}
41+
) {}
1642

1743
public function has(string $identifier): bool
1844
{

ext_localconf.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
<?php
22

3+
/*
4+
* This file is part of the TYPO3 CMS extension "xima_typo3_internal_news".
5+
*
6+
* Copyright (C) 2024-2025 Konrad Michalik <hej@konradmichalik.dev>
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 2 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
322
use Xima\XimaTypo3InternalNews\Hooks\DataHandler;
423

524
$GLOBALS['TYPO3_CONF_VARS']['BE']['toolbarItems'][1726561044] = \Xima\XimaTypo3InternalNews\Backend\ToolbarItems\NewsItem::class;

0 commit comments

Comments
 (0)