Completed
Push — master ( 480c88...01d8db )
by Valentin
08:43
created

Structure::methodNames()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Cycle\ORM\Promise\Declaration;
5
6
class Structure
7
{
8
    /** @var string[] */
9
    public $properties = [];
10
11
    /** @var string[] */
12
    public $constants = [];
13
14
    /** @var \PhpParser\Node\Stmt\ClassMethod[] */
15
    public $methods = [];
16
17
    /** @var bool */
18
    public $hasClone;
19
20
    public static function create(array $constants, array $properties, array $methods, bool $hasClone): Structure
21
    {
22
        $self = new self();
23
        $self->constants = $constants;
24
        $self->properties = $properties;
25
        $self->methods = $methods;
26
        $self->hasClone = $hasClone;
27
28
        return $self;
29
    }
30
31
    public function methodNames(): array
32
    {
33
        $names = [];
34
        foreach ($this->methods as $method) {
35
            $names[] = $method->name->name;
36
        }
37
38
        return $names;
39
    }
40
41
    protected function __construct()
42
    {
43
    }
44
}