-
-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
rectorphp/rector-src
#6001Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/fc2b72d3-8f36-4159-bc10-c3c3b4bd0614
<?php
declare(strict_types=1);
namespace App\MessageHandler\Cron;
use App\Model\Message\Job\DatabaseCleanupJob;
use App\Services\DatabaseCleanup;
use Symfony\Component\Lock\LockFactory;
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
final readonly class DatabaseCleanupJobHandler
{
private \Symfony\Component\Lock\LockInterface $lock;
public function __construct(private DatabaseCleanup $cleanup, private LockFactory $lockFactory)
{
$this->lock = $this->lockFactory->createLock('database-cleanup-cron');
}
public function __invoke(DatabaseCleanupJob $cleanupJob) : void
{
if (! $this->lock->acquire()) {
return;
}
$this->cleanup->execute();
$this->lock->release();
}
}Responsible rules
RemoveUnusedPublicMethodParameterRector
Expected Behavior
I think there's nothing wrong with an unused parameter when using __invoke isn't it?
Reactions are currently unavailable