Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
AbstractMigrator
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDb
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 db
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\Db\Sql\Migration;
15
16use Pop\Db\Adapter\AbstractAdapter;
17
18/**
19 * Db SQL migrator abstract class
20 *
21 * @category   Pop
22 * @package    Pop\Db
23 * @author     Nick Sagona, III <dev@nolainteractive.com>
24 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
25 * @license    http://www.popphp.org/license     New BSD License
26 * @version    6.5.0
27 */
28abstract class AbstractMigrator implements MigratorInterface
29{
30
31    /**
32     * Database adapter
33     * @var ?AbstractAdapter
34     */
35    protected ?AbstractAdapter $db = null;
36
37    /**
38     * Constructor
39     *
40     * Instantiate the migration object
41     *
42     * @param  AbstractAdapter $db
43     */
44    public function __construct(AbstractAdapter $db)
45    {
46        $this->db = $db;
47    }
48
49    /**
50     * Get the DB adapter
51     *
52     * @return AbstractAdapter
53     */
54    public function getDb(): AbstractAdapter
55    {
56        return $this->db;
57    }
58
59    /**
60     * Get the DB adapter (alias method)
61     *
62     * @return AbstractAdapter
63     */
64    public function db(): AbstractAdapter
65    {
66        return $this->db;
67    }
68
69}