Failed Conditions
Push — master ( ae631c...a04781 )
by
unknown
52:50 queued 12:37
created

ProductReviewSearchToProductPageSearchFacadeAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A publishWithTimestamp() 0 7 2
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace Spryker\Zed\ProductReviewSearch\Dependency\Facade;
9
10
class ProductReviewSearchToProductPageSearchFacadeAdapter implements ProductReviewSearchToProductPageSearchFacadeInterface
11
{
12
    /**
13
     * @var \Spryker\Zed\ProductPageSearch\Business\ProductPageSearchFacadeInterface
14
     */
15
    protected $productPageSearchFacade;
16
17
    /**
18
     * @param \Spryker\Zed\ProductPageSearch\Business\ProductPageSearchFacadeInterface $productPageSearchFacade
19
     */
20
    public function __construct($productPageSearchFacade)
21
    {
22
        $this->productPageSearchFacade = $productPageSearchFacade;
23
    }
24
25
    /**
26
     * @param array<int, int> $productAbstractIdTimestampMap
27
     *
28
     * @return void
29
     */
30
    public function publishWithTimestamp(array $productAbstractIdTimestampMap): void
31
    {
32
        if (!method_exists($this->productPageSearchFacade, 'publishWithTimestamp') === false) {
33
            $this->productPageSearchFacade->refresh(array_keys($productAbstractIdTimestampMap));
34
        }
35
36
        $this->productPageSearchFacade->publishWithTimestamp($productAbstractIdTimestampMap);
37
    }
38
}
39