Skip to content

Commit 10de71c

Browse files
authored
[FEATURE] Add RemoveDuplicateDoktypeRestrictionConfigurationFractor (#372)
Resolves: sabbelasichon/typo3-rector#4616
1 parent a5f43f7 commit 10de71c

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
@@ -6,6 +6,7 @@
66
use a9f\Typo3Fractor\TYPO3v14\Htaccess\RemoveUploadsFromDefaultHtaccessFractor;
77
use a9f\Typo3Fractor\TYPO3v14\TypoScript\MigrateTypoScriptConditionGetTSFEFractor;
88
use a9f\Typo3Fractor\TYPO3v14\TypoScript\MigrateTypoScriptGetDataPathFractor;
9+
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveDuplicateDoktypeRestrictionConfigurationFractor;
910
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveExposeNonexistentUserInForgotPasswordDialogSettingInFeLoginFractor;
1011
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveExternalOptionFromTypoScriptFractor;
1112
use a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveFrontendAssetConcatenationAndCompressionFractor;
@@ -28,4 +29,5 @@
2829
$services->set(MigrateTypoScriptGetDataPathFractor::class);
2930
$services->set(RemoveExternalOptionFromTypoScriptFractor::class);
3031
$services->set(RemoveUserTSConfigAuthBeRedirectToURLFractor::class);
32+
$services->set(RemoveDuplicateDoktypeRestrictionConfigurationFractor::class);
3133
};

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-
# 39 Rules Overview
1+
# 40 Rules Overview
22

33
## AbstractMessageGetSeverityFluidFractor
44

@@ -514,6 +514,19 @@ Remove config.spamProtectEmailAddresses with option ascii
514514

515515
<br>
516516

517+
## RemoveDuplicateDoktypeRestrictionConfigurationFractor
518+
519+
Remove mod.web_list.noViewWithDokTypes
520+
521+
- class: [`a9f\Typo3Fractor\TYPO3v14\TypoScript\RemoveDuplicateDoktypeRestrictionConfigurationFractor`](../rules/TYPO3v14/TypoScript/RemoveDuplicateDoktypeRestrictionConfigurationFractor.php)
522+
523+
```diff
524+
-mod.web_list.noViewWithDokTypes = 1
525+
+-
526+
```
527+
528+
<br>
529+
517530
## RemoveExposeNonexistentUserInForgotPasswordDialogSettingInFeLoginFractor
518531

519532
Remove plugin.tx_felogin_login.settings.exposeNonexistentUserInForgotPasswordDialog
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
mod {
2+
web_list.noViewWithDokTypes = 1
3+
foo = 1
4+
}
5+
-----
6+
mod {
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\RemoveDuplicateDoktypeRestrictionConfigurationFractor;
6+
7+
use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
8+
use PHPUnit\Framework\Attributes\DataProvider;
9+
10+
final class RemoveDuplicateDoktypeRestrictionConfigurationFractorTest 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+
}
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\RemoveDuplicateDoktypeRestrictionConfigurationFractor;
9+
10+
return FractorConfiguration::configure()
11+
->withOptions([
12+
XmlProcessorOption::INDENT_CHARACTER => Indent::STYLE_TAB,
13+
XmlProcessorOption::INDENT_SIZE => 1,
14+
])
15+
->withRules([RemoveDuplicateDoktypeRestrictionConfigurationFractor::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/Breaking-106949-DuplicateDoktypeRestrictionConfigurationRemoved.html
11+
* @see \a9f\Typo3Fractor\Tests\TYPO3v14\TypoScript\RemoveDuplicateDoktypeRestrictionConfigurationFractor\RemoveDuplicateDoktypeRestrictionConfigurationFractorTest
12+
*/
13+
final class RemoveDuplicateDoktypeRestrictionConfigurationFractor extends AbstractRemoveTypoScriptSettingFractor
14+
{
15+
protected function getFullOptionName(): string
16+
{
17+
return 'mod.web_list.noViewWithDokTypes';
18+
}
19+
}

0 commit comments

Comments
 (0)