Make example of ReplaceStringWithClassConstantRector more correct (#5269)

* Make example of ReplaceStringWithClassConstantRector more correct

- `argument position` and `class with constants` are swapped
- `argument position` starts with zero (0), so `1` is the second argument

* also fix example in `Rector`ing class
This commit is contained in:
vladyslavstartsev 2021-01-23 14:51:23 +02:00 committed by GitHub
parent 8cd6dbea3b
commit 10b96a0b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -14133,7 +14133,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$services->set(ReplaceStringWithClassConstantRector::class)
->call('configure', [[
ReplaceStringWithClassConstantRector::REPLACE_STRING_WITH_CLASS_CONSTANT => ValueObjectInliner::inline([
new ReplaceStringWithClassConstant('SomeClass', 'call', 'Placeholder', 1),
new ReplaceStringWithClassConstant('SomeClass', 'call', 0, 'Placeholder'),
]),
]]);
};

View File

@ -66,7 +66,7 @@ CODE_SAMPLE
,
[
self::REPLACE_STRING_WITH_CLASS_CONSTANT => [
new ReplaceStringWithClassConstant('SomeClass', 'call', 1, 'Placeholder'),
new ReplaceStringWithClassConstant('SomeClass', 'call', 0, 'Placeholder'),
],
]
),