Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| AbstractMigrator | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getDb | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| db | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Pop PHP Framework (https://www.popphp.org/) |
| 4 | * |
| 5 | * @link https://github.com/popphp/popphp-framework |
| 6 | * @author Nick Sagona, III <dev@noladev.com> |
| 7 | * @copyright Copyright (c) 2009-2026 NOLA Interactive, LLC. |
| 8 | * @license https://www.popphp.org/license New BSD License |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | * @namespace |
| 13 | */ |
| 14 | namespace Pop\Db\Sql\Migration; |
| 15 | |
| 16 | use 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@noladev.com> |
| 24 | * @copyright Copyright (c) 2009-2026 NOLA Interactive, LLC. |
| 25 | * @license https://www.popphp.org/license New BSD License |
| 26 | * @version 6.8.0 |
| 27 | */ |
| 28 | abstract 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 | } |