IterateEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 54
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getBackend() 0 4 1
A getIterator() 0 4 1
A getMessage() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\NotificationBundle\Event;
15
16
use Sonata\NotificationBundle\Backend\BackendInterface;
17
use Sonata\NotificationBundle\Iterator\MessageIteratorInterface;
18
use Sonata\NotificationBundle\Model\MessageInterface;
19
use Symfony\Contracts\EventDispatcher\Event;
20
21
/**
22
 * Event for ConsumerHandlerCommand iterations event.
23
 *
24
 * @author Kevin Nedelec <[email protected]>
25
 */
26
class IterateEvent extends Event
27
{
28
    public const EVENT_NAME = 'sonata.notification.event.message_iterate_event';
29
30
    /**
31
     * @var MessageIteratorInterface
32
     */
33
    protected $iterator;
34
35
    /**
36
     * @var BackendInterface
37
     */
38
    protected $backend;
39
40
    /**
41
     * @var MessageInterface
42
     */
43
    protected $message;
44
45
    /**
46
     * @param BackendInterface $backend
47
     * @param MessageInterface $message
48
     */
49
    public function __construct(MessageIteratorInterface $iterator, ?BackendInterface $backend = null, ?MessageInterface $message = null)
50
    {
51
        $this->iterator = $iterator;
52
        $this->backend = $backend;
53
        $this->message = $message;
54
    }
55
56
    /**
57
     * @return BackendInterface
58
     */
59
    public function getBackend()
60
    {
61
        return $this->backend;
62
    }
63
64
    /**
65
     * @return MessageIteratorInterface
66
     */
67
    public function getIterator()
68
    {
69
        return $this->iterator;
70
    }
71
72
    /**
73
     * @return MessageInterface
74
     */
75
    public function getMessage()
76
    {
77
        return $this->message;
78
    }
79
}
80