Embeddable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 29
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
equals() 0 1 ?
A __toString() 0 4 1
A __clone() 0 3 1
1
<?php
2
/**
3
 * Copyright 2016 Alexandru Guzinschi <[email protected]>
4
 *
5
 * This software may be modified and distributed under the terms
6
 * of the MIT license. See the LICENSE file for details.
7
 */
8
namespace Gentle\Embeddable;
9
10
/**
11
 * @author Alexandru Guzinschi <[email protected]>
12
 */
13
abstract class Embeddable
14
{
15
    /** @var string */
16
    protected $value;
17
18
    /**
19
     * Compare two embeddables.
20
     *
21
     * The comparison should be done by value.
22
     *
23
     * @access public
24
     * @param  Embeddable $object
25
     * @return bool
26
     */
27
    abstract public function equals(Embeddable $object);
28
29
    /**
30
     * @access public
31
     * @return string
32
     */
33 99
    public function __toString()
34
    {
35 99
        return $this->value;
36
    }
37
38
    protected function __clone()
39
    {
40
    }
41
}
42