Completed
Push — master ( 242356...67167b )
by Emily
02:33
created

GenericType   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 26
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A compatible() 0 4 1
A equals() 0 4 2
1
<?php
2
/**
3
 * This file is part of the Composite Utils package.
4
 *
5
 * (c) Emily Shepherd <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the
8
 * LICENSE.md file that was distributed with this source code.
9
 *
10
 * @package spaark/composite-utils
11
 * @author Emily Shepherd <[email protected]>
12
 * @license MIT
13
 */
14
15
namespace Spaark\CompositeUtils\Model\Reflection\Type;
16
17
/**
18
 * Represents a native integer type
19
 */
20
class GenericType extends AbstractType
21
{
22
    /**
23
     * @var string
24
     * @readable
25
     */
26
    protected $name;
27
28 1
    public function __construct(string $name)
29
    {
30 1
        $this->name = $name;
31 1
    }
32
33
    /**
34
     * {@inheritDoc}
35
     */
36
    public function compatible(AbstractType $type) : bool
37
    {
38
        return true;
39
    }
40
41
    public function equals($object) : bool
42
    {
43
        return parent::equals($object) && $object->name === $this->name;
44
    }
45
}
46