diff --git a/src/contracts/Sets/ibexa-50.php b/src/contracts/Sets/ibexa-50.php index 563b912..037b9a6 100644 --- a/src/contracts/Sets/ibexa-50.php +++ b/src/contracts/Sets/ibexa-50.php @@ -228,4 +228,15 @@ 'isContainer' => 'isContainer', ], ]); + + $rectorConfig->ruleWithConfiguration( + RenameMethodRector::class, + [ + new MethodCallRename( + 'Ibexa\Core\Search\Common\FieldNameResolver', + 'getFieldNames', + 'getFieldTypes' + ), + ] + ); }; diff --git a/src/lib/Rule/ReplaceInterfaceRector.php b/src/lib/Rule/ReplaceInterfaceRector.php index 41e1481..b9218d5 100644 --- a/src/lib/Rule/ReplaceInterfaceRector.php +++ b/src/lib/Rule/ReplaceInterfaceRector.php @@ -55,7 +55,7 @@ public function getNodeTypes(): array /** * @param \PhpParser\Node\Stmt\Class_ $node */ - public function refactor(Node $node): ?Node + public function refactor(Node $node): Node { foreach ($node->implements as $key => $implement) { if ($this->isName($implement, $this->interfaceToBeReplaced)) { diff --git a/tests/lib/Sets/Ibexa50/Fixture/change_property_to_method_fieldnameresolver-getfieldnames_to_getfieldtypes.php.inc b/tests/lib/Sets/Ibexa50/Fixture/change_property_to_method_fieldnameresolver-getfieldnames_to_getfieldtypes.php.inc new file mode 100644 index 0000000..2f79759 --- /dev/null +++ b/tests/lib/Sets/Ibexa50/Fixture/change_property_to_method_fieldnameresolver-getfieldnames_to_getfieldtypes.php.inc @@ -0,0 +1,31 @@ +getFieldNames()]; + } +} + +?> +----- +getFieldTypes()]; + } +} + +?>