-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommand.php
More file actions
46 lines (39 loc) · 858 Bytes
/
Command.php
File metadata and controls
46 lines (39 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* DframeFramework
* Copyright (c) Sławomir Kaleta.
*
* @license https://github.com/dframe/dframe/blob/master/LICENCE (MIT)
*/
namespace Dframe\Console;
use Dframe\Console\Exceptions\ConsoleException;
use Dframe\Loader\Loader;
/**
* Class Command
*
* @package Dframe\Cli
*/
class Command extends Loader
{
/**
* @var OutputInterface
*/
protected $output;
/**
* @var InputInterface
*/
protected $input;
/**
* @param $args
*
* @return mixed
* @throws ConsoleException
*/
public function run($args)
{
$this->input = new ArrayArgs($args);
$class = '\\Command\\' . $this->input->getName() . 'Command';
$this->output = new OutputStyler();
return call_user_func_array([new $class(), 'execute'], [$this->input, $this->output]);
}
}