Completed
Push — master ( 36630e...8a890e )
by Jonathan
08:38 queued 04:30
created

Event   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 26
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getEntity() 0 4 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Caridea
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7
 * use this file except in compliance with the License. You may obtain a copy of
8
 * the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
 * License for the specific language governing permissions and limitations under
16
 * the License.
17
 *
18
 * @copyright 2015-2016 LibreWorks contributors
19
 * @license   http://opensource.org/licenses/Apache-2.0 Apache 2.0 License
20
 */
21
namespace Caridea\Dao;
22
23
/**
24
 * An abstract peristence event.
25
 *
26
 * @copyright 2015-2016 LibreWorks contributors
27
 * @license   http://opensource.org/licenses/Apache-2.0 Apache 2.0 License
28
 */
29
abstract class Event extends \Caridea\Event\Event
30
{
31
    private $entity;
32
33
    /**
34
     * Creates a new Dao Event.
35
     *
36
     * @param object $source
37
     * @param object|array $entity
38
     */
39 5
    public function __construct($source, $entity)
40
    {
41 5
        parent::__construct($source);
42 5
        $this->entity = $entity;
43 5
    }
44
45
    /**
46
     * Gets the entity associated with the event.
47
     *
48
     * @return object|array The event entity
49
     */
50 5
    public function getEntity()
51
    {
52 5
        return $this->entity;
53
    }
54
}
55