UrlPathUsedCheckerContainer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

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
    /**
25
     * @param UrlPath $urlPath
26
     * @param int     $storeId
27
     *
28
     * @return EntityData[]
29
     */
30
    public function check(UrlPath $urlPath, int $storeId) : array
31
    {
32
        $result = [];
33
34
        foreach ($this->checkers as $checker) {
35
            $result = array_merge($result, $checker->check($urlPath, $storeId));
36
        }
37
38
        return $result;;
39
    }
40
}
41