GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 38-38 lines in 2 locations

lib/Core/Action/AutoResponderAction.php 1 location

@@ 14-51 (lines=38) @@
11
use Netgen\InformationCollection\API\Mailer\MailerInterface;
12
use Netgen\InformationCollection\API\Value\Event\InformationCollected;
13
14
class AutoResponderAction implements ActionInterface
15
{
16
    /**
17
     * @var \Netgen\InformationCollection\API\Mailer\MailerInterface
18
     */
19
    protected $mailer;
20
21
    /**
22
     * @var \Netgen\InformationCollection\Core\Factory\AutoResponderDataFactory
23
     */
24
    protected $factory;
25
26
    /**
27
     * AutoResponderAction constructor.
28
     *
29
     * @param \Netgen\InformationCollection\Core\Factory\AutoResponderDataFactory $factory
30
     * @param \Netgen\InformationCollection\API\Mailer\MailerInterface $mailer
31
     */
32
    public function __construct(AutoResponderDataFactory $factory, MailerInterface $mailer)
33
    {
34
        $this->mailer = $mailer;
35
        $this->factory = $factory;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function act(InformationCollected $event): void
42
    {
43
        $emailData = $this->factory->build($event);
44
45
        try {
46
            $this->mailer->createAndSendMessage($emailData);
47
        } catch (EmailNotSentException $e) {
48
            throw new ActionFailedException('auto_responder', $e->getMessage());
49
        }
50
    }
51
}
52

lib/Core/Action/EmailAction.php 1 location

@@ 14-51 (lines=38) @@
11
use Netgen\InformationCollection\Core\Factory\EmailDataFactory;
12
use Netgen\InformationCollection\API\Mailer\MailerInterface;
13
14
class EmailAction implements ActionInterface
15
{
16
    /**
17
     * @var \Netgen\InformationCollection\API\Mailer\MailerInterface
18
     */
19
    protected $mailer;
20
21
    /**
22
     * @var \Netgen\InformationCollection\Core\Factory\EmailDataFactory
23
     */
24
    protected $factory;
25
26
    /**
27
     * EmailAction constructor.
28
     *
29
     * @param \Netgen\InformationCollection\Core\Factory\EmailDataFactory $factory
30
     * @param \Netgen\InformationCollection\API\Mailer\MailerInterface $mailer
31
     */
32
    public function __construct(EmailDataFactory $factory, MailerInterface $mailer)
33
    {
34
        $this->mailer = $mailer;
35
        $this->factory = $factory;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function act(InformationCollected $event): void
42
    {
43
        $emailData = $this->factory->build($event);
44
45
        try {
46
            $this->mailer->createAndSendMessage($emailData);
47
        } catch (EmailNotSentException $e) {
48
            throw new ActionFailedException('email', $e->getMessage());
49
        }
50
    }
51
}
52