From 21c593c93b3f3b3c9b5f008f2fc9eaa1c8886ec9 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Sun, 22 Dec 2024 11:02:21 -0300 Subject: [PATCH] Use abstract class --- app/src/Generator/Migration.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/src/Generator/Migration.php b/app/src/Generator/Migration.php index 6967a27..bc20f6c 100644 --- a/app/src/Generator/Migration.php +++ b/app/src/Generator/Migration.php @@ -7,16 +7,24 @@ use PDOException; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Style\StyleInterface; use ProVM\Concept; +use ProVM\Enforce; use ProVM\Repository; -class Migration +class Migration extends Enforce\Generator { public function __construct( - protected Concept\Database\Connection $connection, protected Concept\Database $database, + protected Concept\Database $database, + protected Concept\Database\Connection $connection, protected Concept\Database\Query\Builder $queryBuilder, - public Repository\Table $tableRepository, protected LoggerInterface $logger, - protected DateTimeInterface $startDate, protected string $databaseName, - protected string $migrationsPath, protected array $skips) {} + public Repository\Table $tableRepository, + LoggerInterface $logger, + protected DateTimeInterface $startDate, + protected string $databaseName, + protected string $migrationsPath, + protected array $skips) + { + parent::__construct($logger); + } public function generate(StyleInterface $io, bool $dryRun = false): void { @@ -121,11 +129,4 @@ use Phinx\Db\Adapter\MysqlAdapter; $time->format('Y-m-d H:i:s') ]); } - protected function log(string $message, bool $output = false, ?StyleInterface $io = null): void - { - $this->logger->info($message); - if ($output) { - $io->note($message); - } - } } \ No newline at end of file