DowngradeObjectTypeDeclarationRector
Remove the "object" param and return type, add a @param and @return tags instead
class SomeClass
{
- public function someFunction(object $someObject): object
+ /**
+ * @param object $someObject
+ * @return object
+ */
+ public function someFunction($someObject)
{
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\DowngradePhp72\Rector\FunctionLike\DowngradeObjectTypeDeclarationRector;
return RectorConfig::configure()
->withRules([
DowngradeObjectTypeDeclarationRector::class,
]);