Test Failed
Pull Request — master (#1)
by Tibor
02:26
created

UrlPathUsedCheckerContainer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A check() 0 10 2
1
<?php
2
3
namespace Tkotosz\CatalogRouter\Model\Service;
4
5
use Tkotosz\CatalogRouter\Api\UrlPathUsedChecker;
6
use Tkotosz\CatalogRouter\Model\UrlPath;
7
use Tkotosz\CatalogRouter\Model\EntityData;
8
9
class UrlPathUsedCheckerContainer
10
{
11
    /**
12
     * @var UrlPathUsedChecker[]
13
     */
14
    private $checkers;
15
    
16
    /**
17
     * @param UrlPathUsedChecker[] $checkers
18
     */
19
    public function __construct(array $checkers)
20
    {
21
        $this->checkers = $checkers;
22
    }
23
24
    public function check(UrlPath $urlPath, int $storeId) : array
25
    {
26
        $result = [];
27
28
        foreach ($this->checkers as $checker) {
29
            $result = array_merge($result, $checker->check($urlPath, $storeId));
30
        }
31
32
        return $result;;
33
    }
34
}
35