Skip to content

Commit 52af57e

Browse files
committed
some modify
1 parent eab28a8 commit 52af57e

File tree

6 files changed

+148
-0
lines changed

6 files changed

+148
-0
lines changed

src/Base/AbstractApplication.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ abstract class AbstractApplication implements ApplicationInterface
3737
'--debug' => 'Setting the application runtime debug level',
3838
'--profile' => 'Display timing and memory usage information',
3939
'--no-color' => 'Disable color/ANSI for message output',
40+
'--skip-invalid' => 'Whether ignore invalid arguments and options, when use input definition',
4041
'-h, --help' => 'Display this help message',
4142
'-V, --version' => 'Show application version information',
4243
];

src/IO/Input/InputArgument.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: inhere
5+
* Date: 2018-01-17
6+
* Time: 10:33
7+
*/
8+
9+
namespace Inhere\Console\IO\Input;
10+
11+
/**
12+
* Class InputArgument
13+
* - definition a input argument
14+
* @package Inhere\Console\IO\Input
15+
*/
16+
class InputArgument extends InputItem
17+
{
18+
19+
}

src/IO/Input/InputArguments.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: inhere
5+
* Date: 2018-01-17
6+
* Time: 10:11
7+
*/
8+
9+
namespace Inhere\Console\IO\Input;
10+
11+
/**
12+
* Class InputArguments
13+
* - input arguments builder
14+
* @package Inhere\Console\IO\Input
15+
*/
16+
class InputArguments
17+
{
18+
/**
19+
* @var array
20+
*/
21+
private $arguments = [];
22+
23+
/**
24+
* @param string $name
25+
* @param int|null $mode
26+
* @param string|null $type The argument data type. (eg: 'string', 'array', 'mixed')
27+
* @param string $description
28+
* @param null $default
29+
* @param null $alias
30+
*/
31+
public function add(string $name, int $mode = null, string $type = null, string $description = '', $default = null, $alias = null)
32+
{
33+
34+
}
35+
}

src/IO/Input/InputItem.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: inhere
5+
* Date: 2018-01-17
6+
* Time: 10:28
7+
*/
8+
9+
namespace Inhere\Console\IO\Input;
10+
11+
/**
12+
* Class InputItem
13+
* - definition a input item(option|argument)
14+
* @package Inhere\Console\IO\Input
15+
*/
16+
class InputItem
17+
{
18+
/**
19+
* @var string
20+
*/
21+
public $name;
22+
23+
/**
24+
* alias name
25+
* @var string
26+
*/
27+
public $alias;
28+
29+
/**
30+
* @var string
31+
*/
32+
public $description;
33+
34+
/**
35+
* @var int
36+
*/
37+
public $mode;
38+
39+
/**
40+
* The argument data type. (eg: 'string', 'array', 'mixed')
41+
* @var string
42+
*/
43+
public $type;
44+
45+
/**
46+
* default value
47+
* @var mixed
48+
*/
49+
public $default;
50+
51+
/**
52+
* allow multi value
53+
* @var bool
54+
*/
55+
public $multi;
56+
}

src/IO/Input/InputOption.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: inhere
5+
* Date: 2018-01-17
6+
* Time: 10:28
7+
*/
8+
9+
namespace Inhere\Console\IO\Input;
10+
11+
/**
12+
* Class InputOption
13+
* - definition a input option
14+
* @package Inhere\Console\IO\Input
15+
*/
16+
class InputOption extends InputItem
17+
{
18+
}

src/IO/Input/InputOptions.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: inhere
5+
* Date: 2018-01-17
6+
* Time: 10:10
7+
*/
8+
9+
namespace Inhere\Console\IO\Input;
10+
11+
/**
12+
* Class InputOptions
13+
* - input options builder
14+
* @package Inhere\Console\IO\Input
15+
*/
16+
class InputOptions
17+
{
18+
19+
}

0 commit comments

Comments
 (0)