-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
use Clyde\Core\Event_Dispatcher; | ||
use Clyde\Tasks\Task_Response; | ||
use Clyde\Tools\Printer; | ||
use Exception; | ||
|
||
abstract class Task_Base | ||
{ | ||
|
@@ -53,4 +54,20 @@ public function __construct(Application $Application) { | |
* @return Task_Response | ||
*/ | ||
abstract public function execute(): Task_Response; | ||
|
||
/** | ||
* Call a method on the Application | ||
* | ||
* @param string $name Method name | ||
* @param array $arguments Method arguments | ||
* @return mixed | ||
*/ | ||
public function __get(string $name) { | ||
Check failure on line 65 in src/App/Tasks/Task_Base.php GitHub Actions / build
|
||
$method = "get{$name}"; | ||
if (method_exists($this->Application, $method)) { | ||
return $this->Application->$method(); | ||
} | ||
|
||
throw new Exception("Method {$method} does not exist"); | ||
} | ||
} |