Skip to content

Commit 18e101b

Browse files
committed
Apply CGL
1 parent 90c7b2d commit 18e101b

File tree

7 files changed

+34
-17
lines changed

7 files changed

+34
-17
lines changed

Classes/Configuration/Exception/ApiKeyNotAvailableException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@
1616
/**
1717
* This Exception will be thrown, if API key was not set in extension settings
1818
*/
19-
class ApiKeyNotAvailableException extends Exception
20-
{
21-
}
19+
class ApiKeyNotAvailableException extends Exception {}

Classes/Domain/Repository/StackRepository.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
public function __construct(
2424
protected QueryBuilder $queryBuilder
25-
) {
26-
}
25+
) {}
2726

2827
public function findAll(): iterable
2928
{
@@ -58,7 +57,7 @@ public function insert(string $url): void
5857
[
5958
'tstamp' => time(),
6059
'crdate' => time(),
61-
'url' => $url
60+
'url' => $url,
6261
]
6362
);
6463
}

Classes/Hook/DataHandlerHook.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
namespace JWeiland\IndexNow\Hook;
1313

14-
use TYPO3\CMS\Backend\Routing\PreviewUriBuilder;
1514
use JWeiland\IndexNow\Configuration\Exception\ApiKeyNotAvailableException;
1615
use JWeiland\IndexNow\Configuration\ExtConf;
1716
use JWeiland\IndexNow\Domain\Repository\StackRepository;
1817
use JWeiland\IndexNow\Event\ModifyPageUidEvent;
18+
use TYPO3\CMS\Backend\Routing\PreviewUriBuilder;
1919
use TYPO3\CMS\Backend\Utility\BackendUtility;
2020
use TYPO3\CMS\Core\DataHandling\DataHandler;
2121
use TYPO3\CMS\Core\EventDispatcher\EventDispatcher;
@@ -41,8 +41,7 @@ public function __construct(
4141
protected PageRenderer $pageRenderer,
4242
protected FlashMessageService $flashMessageService,
4343
protected EventDispatcher $eventDispatcher
44-
) {
45-
}
44+
) {}
4645

4746
public function processDatamap_beforeStart(DataHandler $dataHandler): void
4847
{
@@ -125,7 +124,7 @@ protected function getPreviewUrl(int $pageUid): ?string
125124

126125
try {
127126
return htmlspecialchars(
128-
(string) PreviewUriBuilder::create($pageUid)->withRootLine(null)->withSection($anchorSection)->withAdditionalQueryParameters($additionalParams)->buildUri()
127+
(string)PreviewUriBuilder::create($pageUid)->withRootLine(null)->withSection($anchorSection)->withAdditionalQueryParameters($additionalParams)->buildUri()
129128
);
130129
} catch (UnableToLinkToPageException $e) {
131130
return null;
@@ -137,11 +136,11 @@ protected function getUrlForSearchEngineEndpoint(string $url): string
137136
$urlForSearchEngine = str_replace(
138137
[
139138
'###URL###',
140-
'###APIKEY###'
139+
'###APIKEY###',
141140
],
142141
[
143142
$url,
144-
$this->extConf->getApiKey()
143+
$this->extConf->getApiKey(),
145144
],
146145
$this->extConf->getSearchEngineEndpoint()
147146
);

Classes/Notifier/SearchEngineNotifier.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
public function __construct(
2525
protected RequestFactory $requestFactory,
2626
protected LoggerInterface $logger
27-
) {
28-
}
27+
) {}
2928

3029
public function notify(string $url): bool
3130
{

Configuration/TCA/tx_indexnow_stack.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<?php
2+
3+
/*
4+
* This file is part of the package jweiland/indexnow.
5+
*
6+
* For the full copyright and license information, please read the
7+
* LICENSE file that was distributed with this source code.
8+
*/
9+
210
return [
311
'ctrl' => [
412
'title' => 'IndexNow URL Stack',
@@ -16,19 +24,19 @@
1624
'label' => 'crdate',
1725
'config' => [
1826
'type' => 'passthrough',
19-
]
27+
],
2028
],
2129
'tstamp' => [
2230
'label' => 'tstamp',
2331
'config' => [
2432
'type' => 'passthrough',
25-
]
33+
],
2634
],
2735
'url' => [
2836
'label' => 'URL',
2937
'config' => [
3038
'type' => 'passthrough',
3139
],
3240
],
33-
]
41+
],
3442
];

ext_emconf.php

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

3+
/*
4+
* This file is part of the package jweiland/indexnow.
5+
*
6+
* For the full copyright and license information, please read the
7+
* LICENSE file that was distributed with this source code.
8+
*/
9+
310
$EM_CONF[$_EXTKEY] = [
411
'title' => 'Index now',
512
'description' => 'TYPO3 extension to inform various search engines over IndexNow endpoint about content updates',

ext_localconf.php

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

3+
/*
4+
* This file is part of the package jweiland/indexnow.
5+
*
6+
* For the full copyright and license information, please read the
7+
* LICENSE file that was distributed with this source code.
8+
*/
9+
310
if (!defined('TYPO3')) {
411
die('Access denied.');
512
}

0 commit comments

Comments
 (0)