Skip to content

Commit 2f0d1d6

Browse files
authored
Merge pull request #244 from andreaswolf/issue-49
[FEATURE] Add RemoveOptionAlternateBgColorsFractor
2 parents 78bedd9 + 60c3388 commit 2f0d1d6

File tree

7 files changed

+210
-111
lines changed

7 files changed

+210
-111
lines changed

packages/fractor-rule-generator/tests/Functional/Console/Command/GenerateRuleCommandTest.php

+118-110
Large diffs are not rendered by default.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use a9f\Typo3Fractor\TYPO3v7\TypoScript\RemoveOptionAlternateBgColorsFractor;
6+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
7+
8+
return static function (ContainerConfigurator $containerConfigurator): void {
9+
$services = $containerConfigurator->services();
10+
$services->defaults()
11+
->autoconfigure()
12+
->autowire();
13+
14+
$services->set(RemoveOptionAlternateBgColorsFractor::class);
15+
};

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

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 25 Rules Overview
1+
# 26 Rules Overview
22

33
## AbstractMessageGetSeverityFluidFractor
44

@@ -452,6 +452,19 @@ Remove noCacheHash="1" and useCacheHash="1" attribute
452452

453453
<br>
454454

455+
## RemoveOptionAlternateBgColorsFractor
456+
457+
Remove mod.web_list.alternateBgColors
458+
459+
- class: [`a9f\Typo3Fractor\TYPO3v7\TypoScript\RemoveOptionAlternateBgColorsFractor`](../rules/TYPO3v7/TypoScript/RemoveOptionAlternateBgColorsFractor.php)
460+
461+
```diff
462+
-mod.web_list.alternateBgColors = 1
463+
+-
464+
```
465+
466+
<br>
467+
455468
## RemoveTceFormsDomElementFlexFormFractor
456469

457470
Remove TCEForms key from all elements in data structure
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
mod.web_list {
2+
dummy = 1
3+
alternateBgColors = 1
4+
}
5+
-----
6+
mod.web_list {
7+
dummy = 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\TYPO3v7\TypoScript\RemoveOptionAlternateBgColorsFractor;
6+
7+
use a9f\Fractor\Testing\PHPUnit\AbstractFractorTestCase;
8+
use PHPUnit\Framework\Attributes\DataProvider;
9+
10+
final class RemoveOptionAlternateBgColorsFractorTest 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');
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,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use a9f\Fractor\Configuration\FractorConfiguration;
6+
use a9f\Typo3Fractor\TYPO3v7\TypoScript\RemoveOptionAlternateBgColorsFractor;
7+
8+
return FractorConfiguration::configure()
9+
->withRules([RemoveOptionAlternateBgColorsFractor::class]);
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\TYPO3v7\TypoScript;
6+
7+
use a9f\Typo3Fractor\AbstractRemoveTypoScriptSettingFractor;
8+
9+
/**
10+
* @changelog https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/7.0/Breaking-53658-RemoveAlternateBgColorsOption.html
11+
* @see \a9f\Typo3Fractor\Tests\TYPO3v7\TypoScript\RemoveOptionAlternateBgColorsFractor\RemoveOptionAlternateBgColorsFractorTest
12+
*/
13+
final class RemoveOptionAlternateBgColorsFractor extends AbstractRemoveTypoScriptSettingFractor
14+
{
15+
protected function getFullOptionName(): string
16+
{
17+
return 'mod.web_list.alternateBgColors';
18+
}
19+
}

0 commit comments

Comments
 (0)