Completed
Push — legacy ( c3f933 )
by Simonas
95:41
created

AbstractElasticsearchEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 1 Features 1
Metric Value
wmc 2
c 1
b 1
f 1
lcom 0
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getConnection() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\ElasticsearchBundle\Event;
13
14
use ONGR\ElasticsearchBundle\Client\Connection;
15
use Symfony\Component\EventDispatcher\Event;
16
17
/**
18
 * Event to be dispatched in various Elasticsearch methods.
19
 */
20
abstract class AbstractElasticsearchEvent extends Event
21
{
22
    /**
23
     * @var Connection
24
     */
25
    protected $connection;
26
27
    /**
28
     * @param Connection $connection
29
     */
30
    public function __construct(Connection $connection)
31
    {
32
        $this->connection = $connection;
33
    }
34
35
    /**
36
     * Returns connection associated with the event.
37
     *
38
     * @return Connection
39
     */
40
    public function getConnection()
41
    {
42
        return $this->connection;
43
    }
44
}
45