Completed
Pull Request — master (#42)
by Daniel
10:35 queued 08:29
created

ClassMetadata   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 30
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getGrids() 0 4 1
A getQueries() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Grid\Metadata;
6
7
use Metadata\MergeableClassMetadata;
8
use Psi\Component\Grid\Metadata\QueryMetadata;
9
use Psi\Component\Grid\Metadata\GridMetadata;
10
11
final class ClassMetadata extends MergeableClassMetadata
12
{
13
    private $grids;
14
    private $queries;
15
16
    public function __construct($name, array $grids, array $queries = [])
17
    {
18
        parent::__construct($name);
19
20
        array_map(function (GridMetadata $grid) {
21
            $grid->attachClassMetadata($this);
22
        }, $grids);
23
        array_map(function (QueryMetadata $query) {
0 ignored issues
show
Unused Code introduced by
The parameter $query is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
        }, $queries);
25
26
        $this->grids = $grids;
27
        $this->queries = $queries;
28
    }
29
30
    public function getGrids(): array
31
    {
32
        return $this->grids;
33
    }
34
35
    public function getQueries() 
36
    {
37
        return $this->queries;
38
    }
39
    
40
}
41