From 90b7786dc92648150e8a63d76b96a968016646be Mon Sep 17 00:00:00 2001 From: Travis Tomka Date: Wed, 15 Mar 2017 13:44:17 -0600 Subject: [PATCH] Relocated the run() method to the task base class instead of having it reflected on each task object. --- src/Task/Base.php | 14 ++++++++++++++ src/Task/Down.php | 11 ----------- src/Task/Up.php | 11 ----------- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/Task/Base.php b/src/Task/Base.php index d2e1b17..2a5f223 100644 --- a/src/Task/Base.php +++ b/src/Task/Base.php @@ -49,6 +49,20 @@ abstract class Base extends BaseTask } } + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo( + 'Running Docker-Compose: {command}', + ['command' => $command] + ); + + return $this->executeCommand($command); + } + /** * Get docker-compose command. * diff --git a/src/Task/Down.php b/src/Task/Down.php index c670d39..6c50e47 100644 --- a/src/Task/Down.php +++ b/src/Task/Down.php @@ -60,15 +60,4 @@ class Down extends Base return $this; } - - /** - * {@inheritdoc} - */ - public function run() - { - $command = $this->getCommand(); - $this->printTaskInfo('Docker Down: {command}', ['command' => $command]); - - return $this->executeCommand($command); - } } diff --git a/src/Task/Up.php b/src/Task/Up.php index 7eb524c..9451bdb 100644 --- a/src/Task/Up.php +++ b/src/Task/Up.php @@ -147,17 +147,6 @@ class Up extends Base return $this; } - /** - * {@inheritdoc} - */ - public function run() - { - $command = $this->getCommand(); - $this->printTaskInfo('Docker Up: {command}', ['command' => $command]); - - return $this->executeCommand($command); - } - /** * {@inheritdoc} */