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.

FlashMessageSubscriber::sendPromotedFlashMassage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * This file is part of the AL labs package
6
 *
7
 * (c) Arnaud Langlade
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Al\ResourceManagement\Infrastructure\Framework;
14
15
use Al\ResourceManagement\Domain\Event\EmployeeFired;
16
use Al\ResourceManagement\Domain\Event\EmployeeHired;
17
use Al\ResourceManagement\Domain\Event\EmployeePromoted;
18
use Symfony\Component\HttpFoundation\Session\Session;
19
20
final class FlashMessageSubscriber
21
{
22
    /** @var Session */
23
    private $session;
24
25
    public function __construct(Session $session)
26
    {
27
        $this->session = $session;
28
    }
29
30
    /**
31
     * @param EmployeeHired $event
32
     */
33
    public function sendHiredFlashMassage(EmployeeHired $event)
34
    {
35
        $this->sendFlashMessage(
36
            sprintf('%s joins your company as %s!', $event->getEmployeeName(), $event->getEmployeePosition())
37
        );
38
    }
39
40
    /**
41
     * @param EmployeePromoted $event
42
     */
43
    public function sendPromotedFlashMassage(EmployeePromoted $event)
44
    {
45
        $this->sendFlashMessage(
46
            sprintf('%s has been successfully promoted to %s!', $event->getEmployeeName(), $event->getEmployeePosition())
47
        );
48
    }
49
50
    /**
51
     * @param EmployeeFired $event
52
     */
53
    public function sendFiredFlashMassage(EmployeeFired $event)
54
    {
55
        $this->sendFlashMessage(
56
            sprintf('%s (Dev) has been successfully fired!', $event->getEmployeeName(), $event->getEmployeePosition())
57
        );
58
    }
59
60
    /**
61
     * @param string $message
62
     */
63
    private function sendFlashMessage(string $message)
64
    {
65
        $this->session->getFlashBag()->add('success', $message);
66
    }
67
}
68