src/UseCase/Wage/Event/EventSubscriber.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\UseCase\Wage\Event;
  3. use App\System\Infrastructure\Implementation\DataAccess\PaymentPercent\PaymentPercentRepository;
  4. use App\UseCase\Wage\Write\Creation\CreationHandler;
  5. use App\UseCase\Wage\Write\Creation\CreationDto;
  6. use JetBrains\PhpStorm\Deprecated;
  7. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  8. #[Deprecated(reason"INS-4780")]
  9. class EventSubscriber implements EventSubscriberInterface
  10. {
  11.     public function __construct(
  12.         private readonly CreationHandler $wageCreation,
  13.         private readonly PaymentPercentRepository $paymentPercentRepository,
  14.     ) {}
  15.     public static function getSubscribedEvents(): array
  16.     {
  17.         return [
  18.             RecalculateWageEvent::NAME => 'onRecalculate',
  19.         ];
  20.     }
  21.     public function onRecalculate(RecalculateWageEvent $event): void
  22.     {
  23. //        $wage = $event->getWage();
  24. //        $percent = $this->paymentPercentRepository->findOneByPeriodDateAndUser(
  25. //            $wage->getReportingPeriod()->getStartDt(), $wage->getInsUserId()
  26. //        );
  27. //
  28. //        $this->wageCreation->handle(new CreationDto(
  29. //            $wage->getInsUserId(),
  30. //            $wage->getInsUserRole(),
  31. //            $percent ? ($percent->getCustomPaymentPercent() ?: $percent->getPaymentPercent()) : 0,
  32. //            $wage->getReportingPeriod(),
  33. //            $wage->getStatus(),
  34. //            wage: $wage
  35. //        ));
  36.     }
  37. }