Completed
Push — master ( 02745e...0cb812 )
by Valentin
07:17
created

Declarations   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFromReflection() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Cycle\ORM\Promise\Declaration;
5
6
class Declarations
7
{
8
    /** @var DeclarationInterface */
9
    public $class;
10
11
    /** @var DeclarationInterface */
12
    public $parent;
13
14
    public static function createFromReflection(\ReflectionClass $parent, string $class): self
15
    {
16
        $self = new self();
17
        $self->parent = new Declaration\ReflectionDeclarationDeclaration($parent);
18
        $self->class = new Declaration\DeclarationDeclaration($class, $self->parent);
19
20
        return $self;
21
    }
22
}