Skip to content

Commit e23e807

Browse files
committed
move some classes, change some namespace. begin dev 3.x
1 parent d4b73b5 commit e23e807

12 files changed

+45
-26
lines changed

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: php
2+
3+
php:
4+
- 7.1
5+
- 7.2
6+
- 7.3
7+
8+
#matrix:
9+
# include:
10+
# - php: 7.2
11+
# env: ANALYSIS='true'
12+
13+
before_script:
14+
- composer require php-coveralls/php-coveralls:^2.1.0
15+
16+
script:
17+
- phpunit --coverage-clover clover.xml
18+
19+
after_success:
20+
- vendor/bin/php-coveralls --coverage_clover=clover.xml --json_path=coveralls-upload.json -v

src/Base/AbstractApplication.php renamed to src/AbstractApplication.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
* Time: 18:37
77
*/
88

9-
namespace Inhere\Console\Base;
9+
namespace Inhere\Console;
1010

1111
use Inhere\Console\BuiltIn\ErrorHandler;
12+
use Inhere\Console\Face\ApplicationInterface;
1213
use Inhere\Console\Face\CommandInterface;
1314
use Inhere\Console\Face\ErrorHandlerInterface;
1415
use Inhere\Console\IO\Input;
@@ -20,7 +21,6 @@
2021
use Inhere\Console\Components\Style\Style;
2122
use Inhere\Console\Utils\FormatUtil;
2223
use Inhere\Console\Utils\Helper;
23-
use Toolkit\Cli\Highlighter;
2424

2525
/**
2626
* Class AbstractApplication

src/Base/AbstractCommand.php renamed to src/AbstractCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* Time: 11:40
77
*/
88

9-
namespace Inhere\Console\Base;
9+
namespace Inhere\Console;
1010

11-
use Inhere\Console\Application;
11+
use Inhere\Console\Face\BaseCommandInterface;
1212
use Inhere\Console\Face\CommandInterface;
1313
use Inhere\Console\IO\Input;
1414
use Inhere\Console\IO\InputDefinition;

src/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Inhere\Console;
1010

11-
use Inhere\Console\Base\AbstractApplication;
11+
use Inhere\Console\AbstractApplication;
1212
use Inhere\Console\Utils\Helper;
1313

1414
/**

src/BuiltIn/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Inhere\Console\BuiltIn;
1010

11-
use Inhere\Console\Base\AbstractApplication;
11+
use Inhere\Console\AbstractApplication;
1212
use Inhere\Console\Face\ErrorHandlerInterface;
1313
use Toolkit\Cli\Highlighter;
1414

src/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Inhere\Console;
1010

11-
use Inhere\Console\Base\AbstractCommand;
11+
use Inhere\Console\AbstractCommand;
1212
use Inhere\Console\Face\CommandInterface;
1313

1414
/**

src/Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
namespace Inhere\Console;
1010

11-
use Inhere\Console\Base\AbstractCommand;
12-
use Inhere\Console\Base\ControllerInterface;
11+
use Inhere\Console\AbstractCommand;
12+
use Inhere\Console\Face\ControllerInterface;
1313
use Inhere\Console\IO\Input;
1414
use Inhere\Console\IO\Output;
1515
use Inhere\Console\Utils\FormatUtil;

src/Base/ApplicationInterface.php renamed to src/Face/ApplicationInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Time: 16:51
77
*/
88

9-
namespace Inhere\Console\Base;
9+
namespace Inhere\Console\Face;
1010

1111
/**
1212
* Interface ApplicationInterface
@@ -15,11 +15,11 @@
1515
interface ApplicationInterface
1616
{
1717
// event name list
18-
const ON_BEFORE_RUN = 'beforeRun';
19-
const ON_AFTER_RUN = 'afterRun';
20-
const ON_RUN_ERROR = 'runError';
21-
const ON_STOP_RUN = 'stopRun';
22-
const ON_NOT_FOUND = 'notFound';
18+
public const ON_BEFORE_RUN = 'app.beforeRun';
19+
public const ON_AFTER_RUN = 'app.afterRun';
20+
public const ON_RUN_ERROR = 'app.runError';
21+
public const ON_STOP_RUN = 'app.stopRun';
22+
public const ON_NOT_FOUND = 'app.notFound';
2323

2424
/**
2525
* @param bool $exit

src/Base/BaseCommandInterface.php renamed to src/Face/BaseCommandInterface.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@
66
* Time: 18:57
77
*/
88

9-
namespace Inhere\Console\Base;
9+
namespace Inhere\Console\Face;
1010

11+
use Inhere\Console\AbstractApplication;
1112
use Inhere\Console\IO\InputDefinition;
1213

1314
/**
1415
* Interface BaseCommandInterface
15-
* @package Inhere\Console\Base
16+
* @package Inhere\Console\Face
1617
*/
1718
interface BaseCommandInterface
1819
{
19-
const OK = 0;
20-
const ERR = 2;
20+
public const OK = 0;
21+
public const ERR = 2;
2122

2223
// name -> {name}
23-
const ANNOTATION_VAR = '{%s}'; // '{$%s}';
24+
public const ANNOTATION_VAR = '{%s}'; // '{$%s}';
2425

2526
/**
2627
* run command
@@ -35,7 +36,7 @@ public function run(string $command = ''): int;
3536
public function getDefinition();
3637

3738
/**
38-
* @return AbstractApplication
39+
* @return AbstractApplication|ApplicationInterface
3940
*/
4041
public function getApp(): AbstractApplication;
4142

src/Face/CommandInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
namespace Inhere\Console\Face;
1010

11-
use Inhere\Console\Base\BaseCommandInterface;
12-
1311
/**
1412
* Interface CommandInterface
1513
* @package Inhere\Console\Face

0 commit comments

Comments
 (0)