Use new column builder #1417
Annotations
11 warnings
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Run infection.:
src/Command/CreateCommand.php#L94
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
protected function execute(InputInterface $input, OutputInterface $output) : int
{
$io = new SymfonyStyle($input, $output);
- $this->migrator->setIo($io);
+
$this->migrationService->setIo($io);
$this->createService->setIo($io);
/** @var string|null $path */
|
Run infection.:
src/Command/CreateCommand.php#L144
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
$name = $this->generateName($command, $table, $and);
$className = $this->migrationService->generateClassName($name);
$nameLimit = $this->migrator->getMigrationNameLimit();
- if ($nameLimit !== 0 && strlen($className) > $nameLimit) {
+ if ($nameLimit !== 0 && strlen($className) >= $nameLimit) {
$io->error('The migration name is too long.');
return Command::INVALID;
}
|
Run infection.:
src/Command/CreateCommand.php#L187
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$file = $migrationPath . DIRECTORY_SEPARATOR . $className . '.php';
file_put_contents($file, $content, LOCK_EX);
$output->writeln("\n\t<info>{$className}</info>");
- $output->writeln("\n");
+
$io->success('New migration created successfully.');
}
$this->migrationService->databaseConnection();
|
Run infection.:
src/Command/CreateCommand.php#L200
Escaped Mutant for Mutator "MatchArmRemoval":
--- Original
+++ New
@@ @@
'addColumn' => 'Add_Column_' . $name,
'dropColumn' => 'Drop_Column_' . $name,
'junction' => 'Junction_Table_For_' . $name . '_And_' . (string) $and . '_Tables',
- default => $result,
};
}
}
|
Run infection.:
src/Command/NewCommand.php#L50
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
}
protected function configure() : void
{
- $this->addOption('limit', 'l', InputOption::VALUE_REQUIRED, 'Number of migrations to display.', 10)->addOption('all', 'a', InputOption::VALUE_NONE, 'All new migrations.')->addOption('path', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path to migrations to display.')->addOption('namespace', 'ns', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Namespace of migrations to display.');
+ $this->addOption('limit', 'l', InputOption::VALUE_REQUIRED, 'Number of migrations to display.', 11)->addOption('all', 'a', InputOption::VALUE_NONE, 'All new migrations.')->addOption('path', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path to migrations to display.')->addOption('namespace', 'ns', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Namespace of migrations to display.');
}
protected function execute(InputInterface $input, OutputInterface $output) : int
{
|
Run infection.:
src/Command/NewCommand.php#L107
Escaped Mutant for Mutator "Plus":
--- Original
+++ New
@@ @@
$io->section("Found {$n} new {$migrationWord}:");
}
foreach ($migrations as $i => $migration) {
- $output->writeln("<info>\t" . ($i + 1) . ". {$migration}</info>");
+ $output->writeln("<info>\t" . ($i - 1) . ". {$migration}</info>");
}
$this->migrationService->databaseConnection();
return Command::SUCCESS;
}
}
|
Run infection.:
src/Command/UpdateCommand.php#L107
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
}
$migrationsCount = count($migrations);
$migrationWord = $migrationsCount === 1 ? 'migration' : 'migrations';
- if ($limit !== null && $migrationsCount > $limit) {
+ if ($limit !== null && $migrationsCount >= $limit) {
$migrations = array_slice($migrations, 0, $limit);
$output->writeln("<fg=yellow>Total {$limit} out of {$migrationsCount} new {$migrationWord} to be applied:</>\n");
} else {
|
Run infection.:
src/Command/UpdateCommand.php#L118
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
}
foreach ($migrations as $i => $migration) {
$nameLimit = $this->migrator->getMigrationNameLimit();
- if (strlen($migration) > $nameLimit) {
+ if (strlen($migration) >= $nameLimit) {
$output->writeln("\n<fg=red>The migration name '{$migration}' is too long. Its not possible to apply " . 'this migration.</>');
return Command::INVALID;
}
|
Run infection.:
src/Service/MigrationService.php#L152
Escaped Mutant for Mutator "PregMatchRemoveCaret":
--- Original
+++ New
@@ @@
continue;
}
$path = $sourcePath . DIRECTORY_SEPARATOR . $file;
- if (is_file($path) && preg_match('/^(M(\\d{12}).*)\\.php$/s', $file, $matches)) {
+ if (is_file($path) && preg_match('/(M(\\d{12}).*)\\.php$/s', $file, $matches)) {
[, $class, $time] = $matches;
if (!empty($namespace)) {
$class = $namespace . '\\' . $class;
|
Run infection.:
src/Service/MigrationService.php#L152
Escaped Mutant for Mutator "PregMatchRemoveDollar":
--- Original
+++ New
@@ @@
continue;
}
$path = $sourcePath . DIRECTORY_SEPARATOR . $file;
- if (is_file($path) && preg_match('/^(M(\\d{12}).*)\\.php$/s', $file, $matches)) {
+ if (is_file($path) && preg_match('/^(M(\\d{12}).*)\\.php/s', $file, $matches)) {
[, $class, $time] = $matches;
if (!empty($namespace)) {
$class = $namespace . '\\' . $class;
|
Loading