Issues (4)

src/Mailer/RewardEmailManager.php (1 issue)

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusReferralsPlugin\Mailer;
6
7
use Sylius\Component\Core\Model\ChannelInterface;
8
use Sylius\Component\Core\Model\CustomerInterface;
9
use Sylius\Component\Core\Model\PromotionCouponInterface;
10
use Sylius\Component\Mailer\Sender\SenderInterface;
11
12
final class RewardEmailManager implements RewardEmailManagerInterface
13
{
14
    public function __construct(
15
        private SenderInterface $emailSender,
16
    ) {
17
    }
18
19
    public function sendPromotionEmail(
20
        CustomerInterface $customer,
21
        PromotionCouponInterface $coupon,
22
        ChannelInterface $channel,
23
        string $localeCode,
24
    ): void {
25
        /**
26
         * @psalm-suppress DeprecatedMethod
27
         */
28
        $this->emailSender->send(
0 ignored issues
show
Deprecated Code introduced by
The function Sylius\Component\Mailer\...SenderInterface::send() has been deprecated: using this method without 2 last arguments ($ccRecipients and $bccRecipients) is deprecated since 1.8 and won't be possible since 2.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

28
        /** @scrutinizer ignore-deprecated */ $this->emailSender->send(

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
29
            Emails::PROMOTION_REWARD,
30
            [$customer->getEmail()],
31
            [
32
                'coupon' => $coupon,
33
                'channel' => $channel,
34
                'localeCode' => $localeCode,
35
            ],
36
        );
37
    }
38
}
39