forked from sabbelasichon/typo3-rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntroduceCapabilitiesBitSetRector.php
51 lines (43 loc) · 1.5 KB
/
IntroduceCapabilitiesBitSetRector.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
47
48
49
50
51
<?php
declare(strict_types=1);
namespace Ssch\TYPO3Rector\TYPO313\v0;
use PhpParser\Node;
use Rector\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @changelog https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-101291-IntroduceCapabilitiesBitSet.html
* @see \Ssch\TYPO3Rector\Tests\Rector\v13\v0\IntroduceCapabilitiesBitSetRector\IntroduceCapabilitiesBitSetRectorTest
*/
final class IntroduceCapabilitiesBitSetRector extends AbstractRector
{
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition('Introduce capabilities bit set', [new CodeSample(
<<<'CODE_SAMPLE'
use TYPO3\CMS\Core\Resource\ResourceStorageInterface;
echo ResourceStorageInterface::CAPABILITY_BROWSABLE;
echo ResourceStorageInterface::CAPABILITY_PUBLIC;
echo ResourceStorageInterface::CAPABILITY_WRITABLE;
echo ResourceStorageInterface::CAPABILITY_HIERARCHICAL_IDENTIFIERS;
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
use TYPO3\CMS\Core\Resource\Capabilities;
use TYPO3\CMS\Core\Resource\ResourceStorageInterface;
echo Capabilities::CAPABILITY_BROWSABLE;
echo Capabilities::CAPABILITY_PUBLIC;
echo Capabilities::CAPABILITY_WRITABLE;
echo Capabilities::CAPABILITY_HIERARCHICAL_IDENTIFIERS;
CODE_SAMPLE
)]);
}
public function getNodeTypes(): array
{
return [];
}
public function refactor(Node $node)
{
return null;
}
}