Completed
Push — master ( d82b6a...0d953e )
by Marco
45:18 queued 42:00
created

getPlatform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Doctrine\DBAL\Event;
4
5
use Doctrine\DBAL\Platforms\AbstractPlatform;
6
use Doctrine\DBAL\Schema\Column;
7
use Doctrine\DBAL\Schema\TableDiff;
8
use function array_merge;
9
use function func_get_args;
10
use function is_array;
11
12
/**
13
 * Event Arguments used when SQL queries for removing table columns are generated inside Doctrine\DBAL\Platform\*Platform.
14
 */
15
class SchemaAlterTableRemoveColumnEventArgs extends SchemaEventArgs
16
{
17
    /** @var Column */
18
    private $column;
19
20
    /** @var TableDiff */
21
    private $tableDiff;
22
23
    /** @var AbstractPlatform */
24
    private $platform;
25
26
    /** @var string[] */
27
    private $sql = [];
28
29 486
    public function __construct(Column $column, TableDiff $tableDiff, AbstractPlatform $platform)
30
    {
31 486
        $this->column    = $column;
32 486
        $this->tableDiff = $tableDiff;
33 486
        $this->platform  = $platform;
34 486
    }
35
36
    /**
37
     * @return Column
38
     */
39
    public function getColumn()
40
    {
41
        return $this->column;
42
    }
43
44
    /**
45
     * @return TableDiff
46
     */
47
    public function getTableDiff()
48
    {
49
        return $this->tableDiff;
50
    }
51
52
    /**
53
     * @return AbstractPlatform
54
     */
55
    public function getPlatform()
56
    {
57
        return $this->platform;
58
    }
59
60
    /**
61
     * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead.
62
     *
63
     * @param string|string[] $sql
64
     *
65
     * @return \Doctrine\DBAL\Event\SchemaAlterTableRemoveColumnEventArgs
66
     */
67
    public function addSql($sql)
68
    {
69
        $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args());
70
71
        return $this;
72
    }
73
74
    /**
75
     * @return string[]
76
     */
77 486
    public function getSql()
78
    {
79 486
        return $this->sql;
80
    }
81
}
82