Completed
Pull Request — master (#12)
by Michael
01:18
created

ProductIsNotAProductBundleException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getProduct() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Created by solutionDrive GmbH.
6
 *
7
 * @copyright 2018 solutionDrive GmbH
8
 */
9
10
namespace SolutionDrive\SyliusProductBundlesPlugin\Exception;
11
12
use Sylius\Component\Core\Model\ProductInterface;
13
use Throwable;
14
15
class ProductIsNotAProductBundleException extends \RuntimeException
16
{
17
    /** @var ProductInterface */
18
    private $product;
19
20
    public function __construct(
21
        ProductInterface $product,
22
        string $message = '',
23
        int $code = 0,
24
        Throwable $previous = null
25
    ) {
26
        parent::__construct($message, $code, $previous);
27
        $this->product = $product;
28
    }
29
30
    public function getProduct(): ProductInterface
31
    {
32
        return $this->product;
33
    }
34
}
35