Find the best Rector rule to solve your problem
Replaces defined classes by new ones.
namespace App;
-use SomeOldClass;
+use SomeNewClass;
-function someFunction(SomeOldClass $someOldClass): SomeOldClass
+function someFunction(SomeNewClass $someOldClass): SomeNewClass
{
- if ($someOldClass instanceof SomeOldClass) {
- return new SomeOldClass;
+ if ($someOldClass instanceof SomeNewClass) {
+ return new SomeNewClass;
}
}
Rename attribute class names
-#[SimpleRoute()]
+#[BasicRoute()]
class SomeClass
{
}
Changes defined return typehint of method and class.
class SomeClass
{
- public function getData()
+ public function getData(): array
{
}
}