Skip to content

Commit

Permalink
Fix errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 13, 2024
1 parent 43cbd5f commit db45e7e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@
<code>$executedVersion</code>
</ReferenceReusedFromConfusingScope>
</file>
<file src="src/Migration/PhinxBackend.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
</DeprecatedTrait>
</file>
<file src="src/Migrations.php">
<DeprecatedTrait>
<code>ConfigurationTrait</code>
Expand Down
8 changes: 4 additions & 4 deletions src/Migration/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,8 @@ function ($phpFile) {

$config = $this->getConfig();
$input = new ArrayInput([
'--plugin' => $config['plugin'],
'--source' => $config['source'],
'--plugin' => $config['plugin'] ?? null,
'--source' => $config['source'] ?? null,
'--connection' => $config->getConnection(),
]);
$output = new OutputAdapter($io);
Expand Down Expand Up @@ -971,9 +971,9 @@ public function getSeeds(): array
new InputOption('source', mode: InputOption::VALUE_OPTIONAL, default: ''),
]);
$input = new ArrayInput([
'--plugin' => $config['plugin'],
'--plugin' => $config['plugin'] ?? null,
'--source' => $config['source'] ?? null,
'--connection' => $config->getConnection(),
'--source' => $config['source'],
], $optionDef);
$output = new OutputAdapter($this->io);

Expand Down
8 changes: 8 additions & 0 deletions tests/TestCase/Command/Phinx/StatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public function testExecuteWithInconsistency()
$migrations = $this->getMigrations();
$migrations->migrate();

$migrations = $this->getMigrations();
$migrationPaths = $migrations->getConfig()->getMigrationPaths();
$migrationPath = array_pop($migrationPaths);
$origin = $migrationPath . DS . '20150724233100_update_numbers_table.php';
Expand Down Expand Up @@ -248,7 +249,14 @@ protected function getMigrations()
'connection' => 'test',
'source' => 'TestsMigrations',
];
$args = [
'--connection' => $params['connection'],
'--source' => $params['source'],
];
$input = new ArrayInput($args, $this->command->getDefinition());
$migrations = new Migrations($params);
$migrations->setInput($input);
$this->command->setInput($input);

$adapter = $migrations
->getManager($this->command->getConfig())
Expand Down

0 comments on commit db45e7e

Please sign in to comment.