AbstractMetadataCollector   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
collect() 0 1 ?
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by Vitaly Iegorov <[email protected]>.
4
 * on 20.08.16 at 12:39
5
 */
6
namespace samsonframework\container;
7
8
use samsonframework\container\metadata\ClassMetadata;
9
use samsonframework\container\resolver\ResolverInterface;
10
11
/**
12
 * Abstract class metadata collector.
13
 *
14
 * @author Vitaly Egorov <[email protected]>
15
 */
16
abstract class AbstractMetadataCollector
17
{
18
    /**
19
     * Metadata collector constructor.
20
     *
21
     * @param ResolverInterface $resolver
22
     */
23
    public function __construct(ResolverInterface $resolver)
24
    {
25
        $this->resolver = $resolver;
0 ignored issues
show
Bug introduced by
The property resolver does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
26
    }
27
28
    /**
29
     * Collect class metadata from source.
30
     *
31
     * @param mixed $source Input source for collecting class metadata
32
     *
33
     * @param array $classesMetadata
34
     *
35
     * @return array|metadata\ClassMetadata[] Collected class metadata collection
36
     */
37
    abstract public function collect($source, array $classesMetadata = []) : array;
38
}
39