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

RaceConditionException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
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 RaceConditionException extends UpdateHandlingException
18
{
19
    /**
20
     * @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...
21
     */
22
    public function __construct(\Exception $previous = null)
23
    {
24
        parent::__construct(
25
            'Operated entity was previously modified.',
26
            'race_condition_error',
27
            409,
28
            null !== $previous ? $previous->getCode() : 0,
29
            $previous
30
        );
31
    }
32
}
33