Completed
Push — master ( 499778...79f24a )
by Emily
9s
created

GenericType::compatible()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 0
cp 0
rs 10
nc 1
cc 1
eloc 2
nop 1
crap 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 8
    public function __construct(string $name)
29
    {
30 8
        $this->name = $name;
31 8
    }
32
33
    public function equals($object) : bool
34
    {
35
        return parent::equals($object) && $object->name === $this->name;
36
    }
37
38
    public function __toString() : string
39
    {
40
        return $this->name;
41
    }
42
}
43