| 1 |
<?php |
| 2 |
|
| 3 |
namespace Shellbox\Command; |
| 4 |
|
| 5 |
/** |
| 6 |
* A command without file handling. |
| 7 |
* |
| 8 |
* This is almost the same as Command, except with a type-hinted executor. |
| 9 |
*/ |
| 10 |
class UnboxedCommand extends Command { |
| 11 |
/** @var UnboxedExecutor */ |
| 12 |
protected $executor; |
| 13 |
|
| 14 |
/** |
| 15 |
* External callers should typically use UnboxedExecutor::createCommand() |
| 16 |
* |
| 17 |
* @param UnboxedExecutor $executor |
| 18 |
*/ |
| 19 |
public function __construct( UnboxedExecutor $executor ) { |
| 20 |
$this->executor = $executor; |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Execute the command with the current executor |
| 25 |
* |
| 26 |
* @return UnboxedResult |
| 27 |
*/ |
| 28 |
public function execute() { |
| 29 |
return $this->executor->execute( $this ); |
| 30 |
} |
| 31 |
} |