Skip to content
Merged
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
14 changes: 3 additions & 11 deletions src/Services/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function runUp(string $filename, int $batch, Options $options): void
$action = $this->resolveAction($path);
$name = $this->resolveActionName($path);

if ($this->allowAction($action, $name, $options)) {
if ($this->allowAction($action, $options)) {
$this->notification->task($name, function () use ($action, $name, $batch) {
$this->hasAction($action, '__invoke')
? $this->runAction($action, '__invoke')
Expand Down Expand Up @@ -118,21 +118,13 @@ protected function deleteLog(string $name): void
$this->repository->delete($name);
}

protected function allowAction(Action $action, string $name, Options $options): bool
protected function allowAction(Action $action, Options $options): bool
{
if (! $this->allowEnvironment($action)) {
$this->notification->info("Action: $name was skipped on this environment");

return false;
}

if ($this->disallowBefore($action, $options)) {
$this->notification->info("Action: $name was skipped by 'before' option");

return false;
}

return true;
return ! ($this->disallowBefore($action, $options));
}

protected function allowEnvironment(Action $action): bool
Expand Down