CartDependencyProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 12
dl 0
loc 48
c 0
b 0
f 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRemoveItemsRequestExpanderPlugins() 0 4 1
A getQuoteStorageStrategyPlugins() 0 6 1
A getQuoteItemFinderPlugin() 0 3 1
A getAddItemsRequestExpanderPlugins() 0 6 1
A getItemCountPlugin() 0 3 1
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
declare(strict_types = 1);
9
10
namespace Pyz\Client\Cart;
11
12
use Spryker\Client\Cart\CartDependencyProvider as SprykerCartDependencyProvider;
13
use Spryker\Client\Cart\Dependency\Plugin\ItemCountPluginInterface;
14
use Spryker\Client\Cart\Plugin\ProductSeparateCartChangeExpanderPlugin;
15
use Spryker\Client\CartExtension\Dependency\Plugin\QuoteItemFinderPluginInterface;
16
use Spryker\Client\DiscountPromotion\Plugin\AddDiscountPromotionCartRequestExpandPlugin;
17
use Spryker\Client\PersistentCart\Plugin\DatabaseQuoteStorageStrategy;
18
use Spryker\Client\ProductBundle\Plugin\Cart\BundleProductQuoteItemFinderPlugin;
19
use Spryker\Client\ProductBundle\Plugin\Cart\ProductBundleItemCountQuantityPlugin;
20
use Spryker\Client\ProductBundle\Plugin\Cart\RemoveBundleChangeRequestExpanderPlugin;
21
use Spryker\Client\ProductConfigurationCart\Plugin\Cart\ProductConfigurationCartChangeRequestExpanderPlugin;
22
23
class CartDependencyProvider extends SprykerCartDependencyProvider
24
{
25
    /**
26
     * @return \Spryker\Client\Cart\Dependency\Plugin\ItemCountPluginInterface
27
     */
28
    protected function getItemCountPlugin(): ItemCountPluginInterface
29
    {
30
        return new ProductBundleItemCountQuantityPlugin();
31
    }
32
33
    /**
34
     * @return array<\Spryker\Client\CartExtension\Dependency\Plugin\QuoteStorageStrategyPluginInterface>
35
     */
36
    protected function getQuoteStorageStrategyPlugins(): array
37
    {
38
        $quoteStorageStrategyPlugins = parent::getQuoteStorageStrategyPlugins();
39
        $quoteStorageStrategyPlugins[] = new DatabaseQuoteStorageStrategy(); #PersistentCartFeature
40
41
        return $quoteStorageStrategyPlugins;
42
    }
43
44
    /**
45
     * @return \Spryker\Client\CartExtension\Dependency\Plugin\QuoteItemFinderPluginInterface
46
     */
47
    protected function getQuoteItemFinderPlugin(): QuoteItemFinderPluginInterface
48
    {
49
        return new BundleProductQuoteItemFinderPlugin();
50
    }
51
52
    /**
53
     * @return array<\Spryker\Client\CartExtension\Dependency\Plugin\CartChangeRequestExpanderPluginInterface>
54
     */
55
    protected function getAddItemsRequestExpanderPlugins(): array
56
    {
57
        return [
58
            new AddDiscountPromotionCartRequestExpandPlugin(),
59
            new ProductSeparateCartChangeExpanderPlugin(),
60
            new ProductConfigurationCartChangeRequestExpanderPlugin(),
61
        ];
62
    }
63
64
    /**
65
     * @return array<\Spryker\Client\CartExtension\Dependency\Plugin\CartChangeRequestExpanderPluginInterface>
66
     */
67
    protected function getRemoveItemsRequestExpanderPlugins(): array
68
    {
69
        return [
70
            new RemoveBundleChangeRequestExpanderPlugin(),
71
        ];
72
    }
73
}
74