Completed
Branch feature/pre-split (e801ec)
by Anton
03:11
created

TableOperation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDatabase() 0 4 1
A getTable() 0 4 1
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Anton Titov (Wolfy-J)
7
 */
8
namespace Spiral\Migrations\Operations;
9
10
use Spiral\Migrations\OperationInterface;
11
12
abstract class TableOperation implements OperationInterface
13
{
14
    /**
15
     * @var string|null
16
     */
17
    protected $database = null;
18
19
    /**
20
     * @var string
21
     */
22
    protected $table;
23
24
    /**
25
     * @param string|null $database
26
     * @param string      $table
27
     */
28
    public function __construct($database, string $table)
29
    {
30
        $this->database = $database;
31
        $this->table = $table;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getDatabase()
38
    {
39
        return $this->database;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getTable(): string
46
    {
47
        return $this->table;
48
    }
49
}