Completed
Push — master ( 296743...12eab9 )
by Kirill
36:17
created

BaseDependent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getParent() 0 4 1
A __sleep() 0 6 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Base\Dependent;
11
12
use Railt\SDL\Base\Definitions\BaseTypeDefinition;
13
use Railt\SDL\Contracts\Definitions\TypeDefinition;
14
use Railt\SDL\Contracts\Dependent\DependentDefinition;
15
16
/**
17
 * Class BaseDependentType
18
 */
19
abstract class BaseDependent extends BaseTypeDefinition implements DependentDefinition
20
{
21
    /**
22
     * @var TypeDefinition|mixed
23
     */
24
    protected $parent;
25
26
    /**
27
     * @return TypeDefinition
28
     */
29 902
    public function getParent(): TypeDefinition
30
    {
31 902
        return $this->parent;
32
    }
33
34
    /**
35
     * @return array
36
     */
37 1163
    public function __sleep(): array
38
    {
39 1163
        return \array_merge(parent::__sleep(), [
40 1163
            'parent',
41
        ]);
42
    }
43
}
44