Completed
Push — master ( 5dd66e...5b5c2c )
by Marco
114:19 queued 111:15
created

SchemaDropTableEventArgs   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Test Coverage

Coverage 30.76%

Importance

Changes 0
Metric Value
wmc 5
eloc 11
dl 0
loc 56
ccs 4
cts 13
cp 0.3076
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setSql() 0 5 1
A getTable() 0 3 1
A __construct() 0 4 1
A getPlatform() 0 3 1
A getSql() 0 3 1
1
<?php
2
3
namespace Doctrine\DBAL\Event;
4
5
use Doctrine\DBAL\Platforms\AbstractPlatform;
6
use Doctrine\DBAL\Schema\Table;
7
use InvalidArgumentException;
8
9
/**
10
 * Event Arguments used when the SQL query for dropping tables are generated inside Doctrine\DBAL\Platform\AbstractPlatform.
11
 */
12
class SchemaDropTableEventArgs extends SchemaEventArgs
13
{
14
    /** @var string|Table */
15
    private $table;
16
17
    /** @var AbstractPlatform */
18
    private $platform;
19
20
    /** @var string|null */
21
    private $sql = null;
22
23
    /**
24
     * @param string|Table $table
25
     *
26
     * @throws InvalidArgumentException
27
     */
28 486
    public function __construct($table, AbstractPlatform $platform)
29
    {
30 486
        $this->table    = $table;
31 486
        $this->platform = $platform;
32 486
    }
33
34
    /**
35
     * @return string|Table
36
     */
37
    public function getTable()
38
    {
39
        return $this->table;
40
    }
41
42
    /**
43
     * @return AbstractPlatform
44
     */
45
    public function getPlatform()
46
    {
47
        return $this->platform;
48
    }
49
50
    /**
51
     * @param string $sql
52
     *
53
     * @return \Doctrine\DBAL\Event\SchemaDropTableEventArgs
54
     */
55
    public function setSql($sql)
56
    {
57
        $this->sql = $sql;
58
59
        return $this;
60
    }
61
62
    /**
63
     * @return string|null
64
     */
65
    public function getSql()
66
    {
67
        return $this->sql;
68
    }
69
}
70