Passed
Push — master ( fec1be...9c1a24 )
by Aleksey
10:36 queued 15s
created

CartBlockMiniCartViewExpanderPlugin::expand()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 6
c 1
b 1
f 0
dl 0
loc 13
rs 10
cc 2
nc 2
nop 2
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace Pyz\Yves\CartPage\Plugin\Cart;
9
10
use Generated\Shared\Transfer\MiniCartViewTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\MiniCartViewTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\QuoteTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Spryker\Yves\Kernel\AbstractPlugin;
13
use SprykerShop\Yves\CartPageExtension\Dependency\Plugin\MiniCartViewExpanderPluginInterface;
14
15
/**
16
 * @method \Pyz\Yves\CartPage\CartPageFactory getFactory()
17
 */
18
class CartBlockMiniCartViewExpanderPlugin extends AbstractPlugin implements MiniCartViewExpanderPluginInterface
19
{
20
    /**
21
     * @param \Generated\Shared\Transfer\MiniCartViewTransfer $miniCartViewTransfer
22
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
23
     *
24
     * @return \Generated\Shared\Transfer\MiniCartViewTransfer
25
     */
26
    public function expand(
27
        MiniCartViewTransfer $miniCartViewTransfer,
28
        QuoteTransfer $quoteTransfer,
29
    ): MiniCartViewTransfer {
30
        if (!$miniCartViewTransfer->getCounterOnly()) {
31
            $content = $this->getFactory()
32
                ->getTwigEnvironment()
33
                ->render('@ShopUi/components/organisms/navigation-top-async/navigation-top-async.twig');
34
35
            $miniCartViewTransfer->setContent($content);
36
        }
37
38
        return $miniCartViewTransfer;
39
    }
40
}
41