Completed
Push — checkout-optimisation ( 4a6bfb...756f29 )
by Kamil
18:24
created

UpdateHandlingException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 48
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getFlash() 0 4 1
A getApiResponseCode() 0 4 1
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
namespace Sylius\Component\Resource\Exception;
13
14
/**
15
 * @author Grzegorz Sadowski <[email protected]>
16
 */
17
class UpdateHandlingException extends \Exception
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $flash;
23
24
    /**
25
     * @var int
26
     */
27
    protected $apiResponseCode;
28
29
    /**
30
     * @param string $message
31
     * @param string $flash
32
     * @param int $apiResponseCode
33
     * @param int $code
34
     * @param \Exception $previous
0 ignored issues
show
Documentation introduced by
Should the type for parameter $previous not be null|\Exception?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
35
     */
36
    public function __construct(
37
        $message = 'Ups, something went wrong, please try again.',
38
        $flash = 'something_went_wrong_error',
39
        $apiResponseCode = 400,
40
        $code = 0,
41
        \Exception $previous = null
42
    ) {
43
        parent::__construct($message, $code, $previous);
44
45
        $this->flash = $flash;
46
        $this->apiResponseCode = $apiResponseCode;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getFlash()
53
    {
54
        return $this->flash;
55
    }
56
57
    /**
58
     * @return int
59
     */
60
    public function getApiResponseCode()
61
    {
62
        return $this->apiResponseCode;
63
    }
64
}
65