for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Shippinno\Notification\Application\Command;
use Shippinno\Notification\Domain\Model\GatewayRegistry;
use Shippinno\Notification\Domain\Model\NotificationRepository;
class SendUnsentNotificationsHandler
{
/**
* @var NotificationRepository
*/
private $notificationRepository;
* @var GatewayRegistry
private $gatewayRegistry;
* @param NotificationRepository $notificationRepository
* @param GatewayRegistry $gatewayRegistry
public function __construct(
NotificationRepository $notificationRepository,
GatewayRegistry $gatewayRegistry
) {
$this->notificationRepository = $notificationRepository;
$this->gatewayRegistry = $gatewayRegistry;
}
* @param SendUnsentNotifications $command
public function handle(SendUnsentNotifications $command): void
$command
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$notifications = $this->notificationRepository->unsentNotifications();
foreach ($notifications as $notification) {
$this->gatewayRegistry->get($notification->destination())->send($notification);
$notification->markSent();
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.