Completed
Push — master ( 3d89d6...b1b27b )
by Alexander
03:40
created

MigrationContext   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 60
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setContainer() 0 4 1
A getContainer() 0 4 1
A getDatabase() 0 4 1
1
<?php
2
/**
3
 * This file is part of the DB-Migration library.
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @copyright Alexander Obuhovich <[email protected]>
8
 * @link      https://github.com/console-helpers/db-migration
9
 */
10
11
namespace ConsoleHelpers\DatabaseMigration;
12
13
14
use Aura\Sql\ExtendedPdoInterface;
15
16
class MigrationContext
17
{
18
19
	/**
20
	 * Database.
21
	 *
22
	 * @var ExtendedPdoInterface
23
	 */
24
	private $_database;
25
26
	/**
27
	 * Container.
28
	 *
29
	 * @var \ArrayAccess
30
	 */
31
	private $_container;
32
33
	/**
34
	 * Creates migration manager context.
35
	 *
36
	 * @param ExtendedPdoInterface $database Database.
37
	 */
38 162
	public function __construct(ExtendedPdoInterface $database)
39
	{
40 162
		$this->_database = $database;
41 162
	}
42
43
	/**
44
	 * Sets container.
45
	 *
46
	 * @param \ArrayAccess $container Container.
47
	 *
48
	 * @return void
49
	 */
50 152
	public function setContainer(\ArrayAccess $container)
51
	{
52 152
		$this->_container = $container;
53 152
	}
54
55
	/**
56
	 * Returns container.
57
	 *
58
	 * @return \ArrayAccess
59
	 */
60 149
	public function getContainer()
61
	{
62 149
		return $this->_container;
63
	}
64
65
	/**
66
	 * Returns database.
67
	 *
68
	 * @return ExtendedPdoInterface
69
	 */
70 152
	public function getDatabase()
71
	{
72 152
		return $this->_database;
73
	}
74
75
}
76