Completed
Push — master ( 09a563...bb361a )
by Stanislav
47s queued 13s
created

CheckoutAddressFormDataProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
dl 0
loc 12
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A canDeliverToMultipleShippingAddresses() 0 10 3
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\Yves\CustomerPage\Form\DataProvider;
11
12
use Generated\Shared\Transfer\QuoteTransfer;
13
use SprykerShop\Yves\CustomerPage\Form\DataProvider\CheckoutAddressFormDataProvider as SprykerCheckoutAddressFormDataProvider;
14
15
class CheckoutAddressFormDataProvider extends SprykerCheckoutAddressFormDataProvider
16
{
17
    protected function canDeliverToMultipleShippingAddresses(QuoteTransfer $quoteTransfer): bool
18
    {
19
        $items = $this->productBundleClient->getGroupedBundleItems(
20
            $quoteTransfer->getItems(),
21
            $quoteTransfer->getBundleItems(),
22
        );
23
24
        return count($items) >= 1
25
            && $this->shipmentClient->isMultiShipmentSelectionEnabled()
26
            && !$this->hasQuoteGiftCardItems($quoteTransfer);
27
    }
28
}
29