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

ProductUrlPathChecker::check()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Tkotosz\CatalogRouter\Model\Service\UrlPathUsedChecker;
4
5
use Tkotosz\CatalogRouter\Api\ProductResolverInterface;
6
use Tkotosz\CatalogRouter\Api\UrlPathUsedChecker;
7
use Tkotosz\CatalogRouter\Model\UrlPath;
8
use Tkotosz\CatalogRouter\Model\EntityData;
9
10
class ProductUrlPathChecker implements UrlPathUsedChecker
11
{
12
    /**
13
     * @var ProductResolverInterface
14
     */
15
    private $productResolver;
16
    
17
    /**
18
     * @param ProductResolverInterface $productResolver
19
     */
20
    public function __construct(ProductResolverInterface $productResolver)
21
    {
22
        $this->productResolver = $productResolver;
23
    }
24
    
25
    /**
26
     * @param UrlPath $urlPath
27
     * @param int     $storeId
28
     *
29
     * @return EntityData[]
30
     */
31
    public function check(UrlPath $urlPath, int $storeId) : array
32
    {
33
        return $this->productResolver->resolveAllByUrlKey($urlPath->getLastPart(), $storeId);
0 ignored issues
show
Bug introduced by
The method resolveAllByUrlKey() does not exist on Tkotosz\CatalogRouter\Api\ProductResolverInterface. Did you maybe mean resolveByUrlKey()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
34
    }
35
}
36