Test Setup Failed
Push — master ( 4d8696...980fb9 )
by Valentin
05:05
created

FetchMethods::getMethods()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * PHP Data Grid Source
5
 *
6
 * @license MIT
7
 * @author  Valentin V (vvval)
8
 */
9
declare(strict_types=1);
10
11
namespace Cycle\ORM\Promise\Visitor\Declaration;
12
13
use PhpParser\Node;
14
use PhpParser\NodeVisitorAbstract;
15
16
class FetchMethods extends NodeVisitorAbstract
17
{
18
    /** @var Node\Stmt\ClassMethod[] */
19
    private $methods = [];
20
21
    /**
22
     * {@inheritDoc}
23
     */
24
    public function leaveNode(Node $node)
25
    {
26
        if ($node instanceof Node\Stmt\ClassMethod) {
27
            $this->methods[(string)$node->name] = $node;
28
        }
29
30
        return null;
31
    }
32
33
    /**
34
     * @return Node\Stmt\ClassMethod[]
35
     */
36
    public function getMethods(): array
37
    {
38
        return $this->methods;
39
    }
40
}
41