Skip to content

Commit a5f43f7

Browse files
authored
[FEATURE] Add RemoveUserTSConfigAuthBeRedirectToURLFractor (#371)
Resolves: sabbelasichon/typo3-rector#4622
1 parent 47a60fd commit a5f43f7

File tree

6 files changed

+85
-1
lines changed

6 files changed

+85
-1
lines changed

packages/typo3-fractor/config/typo3-14.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveExternalOptionFromTypoScriptFractor;
1111
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveFrontendAssetConcatenationAndCompressionFractor;
1212
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveModWebLayoutDefLangBindingFractor;
13+
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveUserTSConfigAuthBeRedirectToURLFractor;
1314
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
1415

1516
return static function (ContainerConfigurator $containerConfigurator): void {
@@ -26,4 +27,5 @@
2627
$services->set(RemoveFrontendAssetConcatenationAndCompressionFractor::class);
2728
$services->set(MigrateTypoScriptGetDataPathFractor::class);
2829
$services->set(RemoveExternalOptionFromTypoScriptFractor::class);
30+
$services->set(RemoveUserTSConfigAuthBeRedirectToURLFractor::class);
2931
};

packages/typo3-fractor/docs/typo3-fractor-rules.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 38 Rules Overview
1+
# 39 Rules Overview
22

33
## AbstractMessageGetSeverityFluidFractor
44

@@ -721,6 +721,19 @@ Remove useCacheHash TypoScript setting
721721

722722
<br>
723723

724+
## RemoveUserTSConfigAuthBeRedirectToURLFractor
725+
726+
Remove auth.BE.redirectToURL
727+
728+
- class: [`a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveUserTSConfigAuthBeRedirectToURLFractor`](../rules/TYPO3v14/TypoScript/RemoveUserTSConfigAuthBeRedirectToURLFractor.php)
729+
730+
```diff
731+
-auth.BE.redirectToURL = 1
732+
+-
733+
```
734+
735+
<br>
736+
724737
## RemoveWorkspaceModeOptionsFractor
725738

726739
Remove TSConfig options.workspaces.swapMode and options.workspaces.changeStageMode
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
auth {
2+
BE.redirectToURL = https://example.com
3+
foo = 1
4+
}
5+
-----
6+
auth {
7+
foo = 1
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace a9f\Typo3Fractor\Tests\TYPO3v14\TypoScript\RemoveUserTSConfigAuthBeRedirectToURLFractor;
6+
7+
use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
8+
use PHPUnit\Framework\Attributes\DataProvider;
9+
10+
final class RemoveUserTSConfigAuthBeRedirectToURLFractorTest extends AbstractFractorTestCase
11+
{
12+
#[DataProvider('provideData')]
13+
public function test(string $filePath): void
14+
{
15+
$this->doTestFile($filePath);
16+
}
17+
18+
public static function provideData(): \Iterator
19+
{
20+
return self::yieldFilesFromDirectory(__DIR__ . '/Fixtures', '*.typoscript.fixture');
21+
}
22+
23+
public function provideConfigFilePath(): string
24+
{
25+
return __DIR__ . '/config/fractor.php';
26+
}
27+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use a9f\Fractor\Configuration\FractorConfiguration;
6+
use a9f\Fractor\ValueObject\Indent;
7+
use a9f\FractorXml\Configuration\XmlProcessorOption;
8+
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveUserTSConfigAuthBeRedirectToURLFractor;
9+
10+
return FractorConfiguration::configure()
11+
->withOptions([
12+
XmlProcessorOption::INDENT_CHARACTER => Indent::STYLE_TAB,
13+
XmlProcessorOption::INDENT_SIZE => 1,
14+
])
15+
->withRules([RemoveUserTSConfigAuthBeRedirectToURLFractor::class]);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace a9f\Typo3Fractor\TYPO3v14\TypoScript;
6+
7+
use a9f\Typo3Fractor\AbstractRemoveTypoScriptSettingFractor;
8+
9+
/**
10+
* @changelog https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/14.0/Deprecation-106969-DeprecateUserTSConfigAuthBEredirectToURL.html
11+
* @see \a9f\Typo3Fractor\Tests\TYPO3v14\TypoScript\RemoveUserTSConfigAuthBeRedirectToURLFractor\RemoveUserTSConfigAuthBeRedirectToURLFractorTest
12+
*/
13+
final class RemoveUserTSConfigAuthBeRedirectToURLFractor extends AbstractRemoveTypoScriptSettingFractor
14+
{
15+
protected function getFullOptionName(): string
16+
{
17+
return 'auth.BE.redirectToURL';
18+
}
19+
}

0 commit comments

Comments
 (0)