Completed
Push — master ( b86059...b2e8e3 )
by Andrii
07:55 queued 13s
created

MultiCurrencyException::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace hipanel\modules\finance\cart;
4
5
use hiqdev\yii2\cart\NotPurchasableException;
6
use Yii;
7
8
final class MultiCurrencyException extends NotPurchasableException
9
{
10
    public function resolve(): bool
11
    {
12
        Yii::error('Cart position "' . $this->position->getName() . '" was removed from the cart because multi-currency cart is not available for now', 'hipanel.cart');
13
        $this->cart->remove($this->position);
14
15
        return true;
16
    }
17
}
18