Completed
Push — master ( 21b783...e431c6 )
by Paweł
46:07 queued 35:24
created

DeleteHandlingException::getFlash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sylius\Component\Resource\Exception;
15
16
class DeleteHandlingException extends \Exception
17
{
18
    /**
19
     * @var string
20
     */
21
    protected $flash;
22
23
    /**
24
     * @var int
25
     */
26
    protected $apiResponseCode;
27
28
    /**
29
     * @param string $message
30
     * @param string $flash
31
     * @param int $apiResponseCode
32
     * @param int $code
33
     * @param \Exception|null $previous
34
     */
35
    public function __construct(
36
        string $message = 'Ups, something went wrong during deleting a resource, please try again.',
37
        string $flash = 'something_went_wrong_error',
38
        int $apiResponseCode = 500,
39
        int $code = 0,
40
        ?\Exception $previous = null
41
    ) {
42
        parent::__construct($message, $code, $previous);
43
44
        $this->flash = $flash;
45
        $this->apiResponseCode = $apiResponseCode;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getFlash(): string
52
    {
53
        return $this->flash;
54
    }
55
56
    /**
57
     * @return int
58
     */
59
    public function getApiResponseCode(): int
60
    {
61
        return $this->apiResponseCode;
62
    }
63
}
64