Completed
Pull Request — master (#329)
by Vojtěch
09:52
created

DuplicateEntryException::__sleep()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 12 and the first side effect is on line 45.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace Kdyby\Doctrine\Exception;
4
5
use Doctrine;
6
use Kdyby\Doctrine\Exception;
7
8
/**
9
 * @author Filip Procházka <[email protected]>
10
 * @deprecated
11
 */
12
class DuplicateEntryException extends DBALException
0 ignored issues
show
Deprecated Code introduced by
The class Kdyby\Doctrine\Exception\DBALException has been deprecated.

This class, trait or interface has been deprecated.

Loading history...
13
{
14
15
    /**
16
     * @var array
17
     */
18
    public $columns;
19
20
21
    /**
22
     * @param \Exception|\Throwable     $previous
23
     * @param array                     $columns
24
     * @param string                    $query
25
     * @param array                     $params
26
     * @param \Doctrine\DBAL\Connection $connection
27
     */
28
    public function __construct($previous, $columns = [], $query = NULL, $params = [], Doctrine\DBAL\Connection $connection = NULL)
29
    {
30
        parent::__construct($previous, $query, $params, $connection);
31
        $this->columns = $columns;
32
    }
33
34
35
    /**
36
     * @return array
37
     */
38
    public function __sleep()
39
    {
40
        return array_merge(parent::__sleep(), ['columns']);
41
    }
42
43
}
44
45
class_alias(DuplicateEntryException::class, 'Kdyby\Doctrine\DuplicateEntryException');
46