-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
RemoveWorkspacePlaceholderShadowColumnsConfigurationRector.php
46 lines (41 loc) · 1.6 KB
/
RemoveWorkspacePlaceholderShadowColumnsConfigurationRector.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
declare(strict_types=1);
namespace Ssch\TYPO3Rector\TYPO311\v0;
use PhpParser\Node\Expr\Array_;
use Ssch\TYPO3Rector\Rector\AbstractTcaRector;
use Symplify\RuleDocGenerator\Contract\DocumentedRuleInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @changelog https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Breaking-92791-NewPlaceholderRecordsRemovedInWorkspaces.html
* @changelog https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Breaking-92497-WorkspacesMovePlaceholdersRemoved.html
* @see \Ssch\TYPO3Rector\Tests\Rector\v11\v0\RemoveWorkspacePlaceholderShadowColumnsConfigurationRector\RemoveWorkspacePlaceholderShadowColumnsConfigurationRectorTest
*/
final class RemoveWorkspacePlaceholderShadowColumnsConfigurationRector extends AbstractTcaRector implements DocumentedRuleInterface
{
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition('removeWorkspacePlaceholderShadowColumnsConfiguration', [new CodeSample(
<<<'CODE_SAMPLE'
return [
'ctrl' => [
'shadowColumnsForNewPlaceholders' => '',
'shadowColumnsForMovePlaceholders' => '',
],
];
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
return [
'ctrl' => [
],
];
CODE_SAMPLE
)]);
}
protected function refactorCtrl(Array_ $ctrlArray): void
{
$this->removeArrayItemFromArrayByKey($ctrlArray, 'shadowColumnsForNewPlaceholders');
$this->removeArrayItemFromArrayByKey($ctrlArray, 'shadowColumnsForMovePlaceholders');
}
}