Skip to content

Commit 456cf65

Browse files
authored
[TASK] Remove unused function (#402)
Resolves: #401
1 parent f6e7724 commit 456cf65

File tree

3 files changed

+14
-74
lines changed

3 files changed

+14
-74
lines changed

Classes/Configuration/Configuration.php

-46
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22

33
declare(strict_types=1);
44

5-
/*
6-
* This file is part of the TYPO3 CMS project.
7-
*
8-
* It is free software; you can redistribute it and/or modify it under
9-
* the terms of the GNU General Public License, either version 2
10-
* of the License, or any later version.
11-
*
12-
* For the full copyright and license information, please read the
13-
* LICENSE.txt file that was distributed with this source code.
14-
*
15-
* The TYPO3 project - inspiring people to share!
16-
*/
17-
185
namespace Sypets\Brofix\Configuration;
196

207
use Symfony\Component\Mime\Address;
@@ -24,7 +11,6 @@
2411
use Sypets\Brofix\Linktype\AbstractLinktype;
2512
use Sypets\Brofix\Linktype\LinktypeInterface;
2613
use TYPO3\CMS\Backend\Utility\BackendUtility;
27-
use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
2814
use TYPO3\CMS\Core\Utility\ArrayUtility;
2915
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
3016
use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -226,38 +212,6 @@ public function loadPageTsConfig(int $page): void
226212
$this->setTsConfig(BackendUtility::getPagesTSconfig($page)['mod.']['brofix.'] ?? []);
227213
}
228214

229-
/**
230-
* Reads page TSconfig from string and overrides existing tsconfig in
231-
* $this->tsconfig with the values.
232-
*
233-
* @param string $tsConfigString
234-
* @throws \Exception
235-
*
236-
* @deprecated use overrideTsConfigByArray
237-
*/
238-
public function overrideTsConfigByString(string $tsConfigString): void
239-
{
240-
/**
241-
* @var TypoScriptParser $parseObj
242-
*/
243-
$parseObj = GeneralUtility::makeInstance(TypoScriptParser::class);
244-
$parseObj->parse($tsConfigString);
245-
if (!empty($parseObj->errors)) {
246-
$parseErrorMessage = 'Invalid TSconfig'
247-
. '<br />';
248-
foreach ($parseObj->errors as $errorInfo) {
249-
$parseErrorMessage .= $errorInfo[0] . '<br />';
250-
}
251-
throw new \Exception($parseErrorMessage);
252-
}
253-
$tsConfig = $parseObj->setup;
254-
$overrideTs = $tsConfig['mod.']['brofix.'];
255-
256-
if (is_array($overrideTs)) {
257-
ArrayUtility::mergeRecursiveWithOverrule($this->tsConfig, $overrideTs);
258-
}
259-
}
260-
261215
/**
262216
* @param array<mixed> $override
263217
*/

Tests/Functional/AbstractFunctional.php

+14-15
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@
44

55
namespace Sypets\Brofix\Tests\Functional;
66

7-
/*
8-
* This file is part of the TYPO3 CMS project.
9-
*
10-
* It is free software; you can redistribute it and/or modify it under
11-
* the terms of the GNU General Public License, either version 2
12-
* of the License, or any later version.
13-
*
14-
* For the full copyright and license information, please read the
15-
* LICENSE.txt file that was distributed with this source code.
16-
*
17-
* The TYPO3 project - inspiring people to share!
18-
*/
19-
207
use Psr\Http\Message\ServerRequestInterface;
218
use Sypets\Brofix\Command\CommandUtility;
229
use Sypets\Brofix\Configuration\Configuration;
@@ -73,14 +60,26 @@ protected function initializeConfiguration(): void
7360
'tt_content' => ['bodytext', 'header_link', 'records']
7461
];
7562
$linkTypes = ['db', 'file', 'external'];
63+
$tsconfig = [
64+
'mod' => [
65+
'brofix' => [
66+
'linktypesConfig' => [
67+
'external' => [
68+
'headers' => [
69+
'User-Agent' => 'Mozilla/5.0 (compatible; Broken Link Checker; +https://example.org/imprint.html)',
70+
]
71+
]
72+
]
73+
]
74+
]
75+
];
7676

7777
$tsConfigPath = GeneralUtility::getFileAbsFileName('EXT:brofix/Configuration/TsConfig/Page/pagetsconfig.tsconfig');
7878
$this->configuration = GeneralUtility::makeInstance(Configuration::class, self::EXTENSION_CONFIGURATION_ARRAY);
7979

8080
// load default values
8181
$this->configuration->setSearchFields($searchFields);
8282
$this->configuration->setLinkTypes($linkTypes);
83-
$this->configuration->overrideTsConfigByString(file_get_contents($tsConfigPath));
84-
$this->configuration->overrideTsConfigByString('mod.brofix.linktypesConfig.external.headers.User-Agent = Mozilla/5.0 (compatible; Broken Link Checker; +https://example.org/imprint.html)');
83+
$this->configuration->overrideTsConfigByArray($tsconfig);
8584
}
8685
}

Tests/Functional/CheckLinks/ExcludeLinkTargetTest.php

-13
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@
44

55
namespace Sypets\Brofix\Tests\Functional\CheckLinks;
66

7-
/*
8-
* This file is part of the TYPO3 CMS project.
9-
*
10-
* It is free software; you can redistribute it and/or modify it under
11-
* the terms of the GNU General Public License, either version 2
12-
* of the License, or any later version.
13-
*
14-
* For the full copyright and license information, please read the
15-
* LICENSE.txt file that was distributed with this source code.
16-
*
17-
* The TYPO3 project - inspiring people to share!
18-
*/
19-
207
use Sypets\Brofix\CheckLinks\ExcludeLinkTarget;
218
use Sypets\Brofix\Tests\Functional\AbstractFunctional;
229

0 commit comments

Comments
 (0)