Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Migration/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public function migrate(?int $version = null, bool $fake = false, ?int $count =
if ($version === null) {
$version = max(array_merge($versions, array_keys($migrations)));
} else {
if ($version != 0 && !isset($migrations[$version])) {
if ($version !== 0 && !isset($migrations[$version])) {
$this->getIo()->out(sprintf(
'<comment>warning</comment> %s is not a valid version',
$version,
Expand Down Expand Up @@ -755,7 +755,7 @@ public function rollback(int|string|null $target = null, bool $force = false, bo

// Check we have at least 1 migration to revert
$executedVersionCreationTimes = array_keys($executedVersions);
if (!$executedVersionCreationTimes || $target == end($executedVersionCreationTimes)) {
if (!$executedVersionCreationTimes || $target === end($executedVersionCreationTimes)) {
$io->out('<error>No migrations to rollback</error>');

return;
Expand Down Expand Up @@ -795,7 +795,7 @@ public function rollback(int|string|null $target = null, bool $force = false, bo
}
}

if ($executedArray['breakpoint'] != 0 && !$force) {
if ((int)$executedArray['breakpoint'] !== 0 && !$force) {
$io->out('<error>Breakpoint reached. Further rollbacks inhibited.</error>');
break;
}
Expand Down Expand Up @@ -1290,7 +1290,7 @@ protected function markBreakpoint(?int $version, int $mark): void
}

$io = $this->getIo();
if ($version != 0 && (!isset($versions[$version]) || !isset($migrations[$version]))) {
if ($version !== 0 && (!isset($versions[$version]) || !isset($migrations[$version]))) {
$io->out(sprintf(
'<comment>warning</comment> %s is not a valid version',
$version,
Expand All @@ -1304,12 +1304,12 @@ protected function markBreakpoint(?int $version, int $mark): void
$env->getAdapter()->toggleBreakpoint($migrations[$version]);
break;
case self::BREAKPOINT_SET:
if ($versions[$version]['breakpoint'] == 0) {
if ((int)$versions[$version]['breakpoint'] === 0) {
$env->getAdapter()->setBreakpoint($migrations[$version]);
}
break;
case self::BREAKPOINT_UNSET:
if ($versions[$version]['breakpoint'] == 1) {
if ((int)$versions[$version]['breakpoint'] === 1) {
$env->getAdapter()->unsetBreakpoint($migrations[$version]);
}
break;
Expand Down
2 changes: 1 addition & 1 deletion src/Util/ColumnParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function parseFields(array $arguments): array
$type = str_contains($type, '?') ? 'integer?' : 'integer';
}

$nullable = (bool)strpos($type, '?');
$nullable = str_contains($type, '?');
$type = $nullable ? str_replace('?', '', $type) : $type;

[$type, $length] = $this->getTypeAndLength($field, $type);
Expand Down