Browse Source

Fixed return statements in LoadTask and UnloadTask

Bob 11 years ago
parent
commit
757ed51142
2 changed files with 3 additions and 17 deletions
  1. 1 8
      src/Shell/Task/LoadTask.php
  2. 2 9
      src/Shell/Task/UnloadTask.php

+ 1 - 8
src/Shell/Task/LoadTask.php

@@ -46,14 +46,7 @@ class LoadTask extends Shell
             return false;
         }
 
-
-        $write = $this->_modifyBootstrap($plugin, $this->params['bootstrap'], $this->params['routes'], false);
-
-        if ($write) {
-            return true;
-        }
-
-        return false;
+        return (bool)$this->_modifyBootstrap($plugin, $this->params['bootstrap'], $this->params['routes'], false);
     }
 
     /**

+ 2 - 9
src/Shell/Task/UnloadTask.php

@@ -46,14 +46,7 @@ class UnloadTask extends Shell
             return false;
         }
 
-
-        $write = $this->_modifyBootstrap($plugin);
-
-        if ($write) {
-            return true;
-        }
-
-        return false;
+        return (bool)$this->_modifyBootstrap($plugin);
     }
 
     /**
@@ -65,7 +58,7 @@ class UnloadTask extends Shell
     protected function _modifyBootstrap($plugin)
     {
         $finder = "/\nPlugin::load\((.|.\n|\n\s\s|\n\t|)+'$plugin'(.|.\n|)+\);\n/";
-        
+
         $bootstrap = new File($this->bootstrap, false);
         $contents = $bootstrap->read();