Completed
Pull Request — master (#42)
by Daniel
01:54
created

ClassMetadata   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 29
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
9
final class ClassMetadata extends MergeableClassMetadata
10
{
11
    private $grids;
12
    private $queries;
13
14
    public function __construct($name, array $grids, array $queries = [])
15
    {
16
        parent::__construct($name);
17
18
        array_map(function (GridMetadata $grid) {
19
            $grid->attachClassMetadata($this);
20
        }, $grids);
21
        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...
22
        }, $queries);
23
24
        $this->grids = $grids;
25
        $this->queries = $queries;
26
    }
27
28
    public function getGrids(): array
29
    {
30
        return $this->grids;
31
    }
32
33
    public function getQueries()
34
    {
35
        return $this->queries;
36
    }
37
}
38