|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Lenevor Framework |
|
5
|
|
|
* |
|
6
|
|
|
* LICENSE |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the new BSD license that is bundled |
|
9
|
|
|
* with this package in the file license.md. |
|
10
|
|
|
* It is also available through the world-wide-web at this URL: |
|
11
|
|
|
* https://lenevor.com/license |
|
12
|
|
|
* If you did not receive a copy of the license and are unable to |
|
13
|
|
|
* obtain it through the world-wide-web, please send an email |
|
14
|
|
|
* to [email protected] so we can send you a copy immediately. |
|
15
|
|
|
* |
|
16
|
|
|
* @package Lenevor |
|
17
|
|
|
* @subpackage Base |
|
18
|
|
|
* @link https://lenevor.com |
|
19
|
|
|
* @copyright Copyright (c) 2019 - 2023 Alexander Campo <[email protected]> |
|
20
|
|
|
* @license https://opensource.org/licenses/BSD-3-Clause New BSD license or see https://lenevor.com/license or see /license.md |
|
21
|
|
|
*/ |
|
22
|
|
|
|
|
23
|
|
|
namespace Syscodes\Components\Console\Description; |
|
24
|
|
|
|
|
25
|
|
|
use Syscodes\Components\Console\Application; |
|
26
|
|
|
use Syscodes\Components\Console\Command\Command; |
|
27
|
|
|
use Syscodes\Components\Console\Input\InputOption; |
|
28
|
|
|
use Syscodes\Components\Console\Input\InputArgument; |
|
29
|
|
|
use Syscodes\Components\Console\Input\InputDefinition; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* Xml descriptor. |
|
33
|
|
|
*/ |
|
34
|
|
|
class XmlDescriptor extends Descriptor |
|
35
|
|
|
{ |
|
36
|
|
|
/** |
|
37
|
|
|
* The output interface implementation. |
|
38
|
|
|
* |
|
39
|
|
|
* @var \Syscodes\Components\Contracts\Console\Output $output |
|
40
|
|
|
*/ |
|
41
|
|
|
protected $output; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Describes an InputArgument instance. |
|
45
|
|
|
* |
|
46
|
|
|
* @param \Syscodes\Components\Console\Input\InputArgument $argument The argument implemented |
|
47
|
|
|
* @param array $options The options of the console |
|
48
|
|
|
* |
|
49
|
|
|
* @return void |
|
50
|
|
|
*/ |
|
51
|
|
|
protected function describeArgument(InputArgument $argument, array $options = []) |
|
52
|
|
|
{ |
|
53
|
|
|
$this->writeText('hola mundo!!!'); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Describes an InputOption instance. |
|
58
|
|
|
* |
|
59
|
|
|
* @param \Syscodes\Components\Console\Input\InputOption $option The option implemented |
|
60
|
|
|
* @param array $options The options of the console |
|
61
|
|
|
* |
|
62
|
|
|
* @return void |
|
63
|
|
|
*/ |
|
64
|
|
|
protected function describeOption(InputOption $option, array $options = []) |
|
65
|
|
|
{ |
|
66
|
|
|
$this->writeText('hola mundo!!!'); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Describes an InputDefinition instance. |
|
71
|
|
|
* |
|
72
|
|
|
* @param \Syscodes\Components\Console\Input\InputDefinition $definition The definition implemented |
|
73
|
|
|
* @param array $options The options of the console |
|
74
|
|
|
* |
|
75
|
|
|
* @return void |
|
76
|
|
|
*/ |
|
77
|
|
|
protected function describeDefinition(InputDefinition $definition, array $options = []) |
|
78
|
|
|
{ |
|
79
|
|
|
$this->writeText('hola mundo!!!'); |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* Describes an Command instance. |
|
84
|
|
|
* |
|
85
|
|
|
* @param \Syscodes\Components\Console\Command\Command $command The command implemented |
|
86
|
|
|
* @param array $options The options of the console |
|
87
|
|
|
* |
|
88
|
|
|
* @return void |
|
89
|
|
|
*/ |
|
90
|
|
|
protected function describeCommand(Command $command, array $options = []) |
|
91
|
|
|
{ |
|
92
|
|
|
$this->writeText(' Hola command!!! '); |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* Describes an Application instance. |
|
97
|
|
|
* |
|
98
|
|
|
* @param \Syscodes\Components\Console\Application $application The application implemented |
|
99
|
|
|
* @param array $options The options of the console |
|
100
|
|
|
* |
|
101
|
|
|
* @return void |
|
102
|
|
|
*/ |
|
103
|
|
|
protected function describeApplication(Application $application, array $options = []) |
|
104
|
|
|
{ |
|
105
|
|
|
$this->writeText('<fg=bright-green;bg=green> Hola application!!! </>'); |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* Writes a message to the output. |
|
110
|
|
|
* |
|
111
|
|
|
* @param string $content The message to output |
|
112
|
|
|
* |
|
113
|
|
|
* @return string |
|
114
|
|
|
*/ |
|
115
|
|
|
private function writeText(string $content) |
|
116
|
|
|
{ |
|
117
|
|
|
$this->write($content); |
|
118
|
|
|
} |
|
119
|
|
|
} |