Skip to content

Commit

Permalink
refactor: move some abstract class to Concern dir
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Dec 25, 2021
1 parent bc61390 commit 7259524
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/AbstractApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use Inhere\Console\Component\ErrorHandler;
use Inhere\Console\Component\Router;
use Inhere\Console\Component\Formatter\Title;
use Inhere\Console\Concern\InputOutputAwareTrait;
use Inhere\Console\Concern\SimpleEventAwareTrait;
use Inhere\Console\Decorate\SimpleEventAwareTrait;
use Inhere\Console\Contract\ApplicationInterface;
use Inhere\Console\Contract\ErrorHandlerInterface;
use Inhere\Console\Decorate\InputOutputAwareTrait;
use Inhere\Console\Decorate\ApplicationHelpTrait;
use Inhere\Console\Decorate\StyledOutputAwareTrait;
use Inhere\Console\IO\Input;
Expand Down Expand Up @@ -90,7 +90,7 @@ abstract class AbstractApplication implements ApplicationInterface
*/
protected string $commandName = '';

/**
/*
* @var string Command delimiter char. e.g dev:serve
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Component/Interact/AbstractSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Inhere\Console\Component\Interact;

use Inhere\Console\Component\InteractiveHandle;
use Inhere\Console\Concern\InteractiveHandle;

/**
* class AbstractSelect
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Interact/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Inhere\Console\Component\Interact;

use Inhere\Console\Component\InteractiveHandle;
use Inhere\Console\Concern\InteractiveHandle;
use Inhere\Console\Console;
use Inhere\Console\Util\Show;
use function stripos;
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Interact/IShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use Closure;
use Inhere\Console\Component\Formatter\Title;
use Inhere\Console\Component\InteractiveHandle;
use Inhere\Console\Concern\InteractiveHandle;
use Inhere\Console\Console;
use Inhere\Console\Util\Interact;
use Inhere\Console\Util\Show;
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Interact/LimitedAsk.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Inhere\Console\Component\Interact;

use Closure;
use Inhere\Console\Component\InteractiveHandle;
use Inhere\Console\Concern\InteractiveHandle;
use Inhere\Console\Console;
use Inhere\Console\Util\Show;
use function sprintf;
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Interact/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Inhere\Console\Component\Interact;

use Inhere\Console\Component\InteractiveHandle;
use Inhere\Console\Concern\InteractiveHandle;
use RuntimeException;
use Toolkit\Sys\Sys;
use Toolkit\Sys\Util\ShellUtil;
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Interact/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Inhere\Console\Component\Interact;

use Closure;
use Inhere\Console\Component\InteractiveHandle;
use Inhere\Console\Concern\InteractiveHandle;
use Inhere\Console\Console;
use Inhere\Console\Util\Show;
use function trim;
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Interact/Terminal.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Inhere\Console\Component\Interact;

use Inhere\Console\Component\InteractiveHandle;
use Inhere\Console\Concern\InteractiveHandle;

/**
* Class Terminal
Expand Down
16 changes: 16 additions & 0 deletions src/Component/Symbol/GitEmoji.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php declare(strict_types=1);

namespace Inhere\Console\Component\Symbol;

/**
* class GitEmoji
*
* @author inhere
*/
class GitEmoji
{
public static function search(string $key): array
{
return [];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
* @license https://github.com/inhere/php-console/blob/master/LICENSE
*/

namespace Inhere\Console\Component\Interact;
namespace Inhere\Console\Concern;

use Inhere\Console\Component\InteractiveHandle;
use Toolkit\Stdlib\Str\StrValue;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* @license https://github.com/inhere/php-console/blob/master/LICENSE
*/

namespace Inhere\Console\Component;
namespace Inhere\Console\Concern;

use Toolkit\Stdlib\Obj;

/**
* Class InteractMessage
*
* @package Inhere\Console\Component
* @package Inhere\Console\Concern
*/
abstract class InteractiveHandle
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license https://github.com/inhere/php-console/blob/master/LICENSE
*/

namespace Inhere\Console\Concern;
namespace Inhere\Console\Decorate;

use Inhere\Console\AbstractApplication;
use Inhere\Console\Application;
Expand All @@ -17,13 +17,12 @@
/**
* Trait AttachApplicationTrait
*
* @package Inhere\Console\Concern
* @package Inhere\Console\Decorate
*/
trait AttachApplicationTrait
{
use SimpleEventAwareTrait {
fire as parentFire;

}

/**
Expand All @@ -47,9 +46,9 @@ public function getApp(): AbstractApplication
}

/**
* @param AbstractApplication $app
* @param Application $app
*/
public function setApp(AbstractApplication $app): void
public function setApp(Application $app): void
{
$this->app = $app;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license https://github.com/inhere/php-console/blob/master/LICENSE
*/

namespace Inhere\Console\Concern;
namespace Inhere\Console\Decorate;

use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
Expand All @@ -16,7 +16,7 @@
/**
* Class InputOutputAwareTrait
*
* @package Inhere\Console\Concern
* @package Inhere\Console\Decorate
*/
trait InputOutputAwareTrait
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
* @license https://github.com/inhere/php-console/blob/master/LICENSE
*/

namespace Inhere\Console\Concern;
namespace Inhere\Console\Decorate;

use function count;
use function in_array;

/**
* Class SimpleEventStaticTrait
*
* @package Inhere\Console\Concern
* @package Inhere\Console\Decorate
*/
trait SimpleEventAwareTrait
{
Expand Down
4 changes: 2 additions & 2 deletions src/Handler/AbstractHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

use Inhere\Console\Annotate\DocblockRules;
use Inhere\Console\Component\ErrorHandler;
use Inhere\Console\Concern\AttachApplicationTrait;
use Inhere\Console\Concern\InputOutputAwareTrait;
use Inhere\Console\Decorate\AttachApplicationTrait;
use Inhere\Console\Decorate\InputOutputAwareTrait;
use Inhere\Console\Decorate\UserInteractAwareTrait;
use Inhere\Console\Console;
use Inhere\Console\ConsoleEvent;
Expand Down

0 comments on commit 7259524

Please sign in to comment.