Skip to content

Commit

Permalink
deprecate CoreCommandTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Jun 12, 2017
1 parent c5a8eab commit b0b08ef
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/Core/Asset/AssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ public static function getJSObject($data, $quoteKey = false)

foreach ($array as $key => $value)
{
$encodedKey = json_encode($key);
$encodedKey = json_encode((string) $key);

if (!$quoteKey && preg_match('/[^0-9A-Za-z_]+/m', $key) == 0)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Core/Console/CoreCommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
* The CoreCommandTrait class.
*
* @since 3.0
*
* @deprecated Extend \Windwalker\Core\Console\CoreCommand instead.
*/
trait CoreCommandTrait
{
/**
* Property console.
*
* @var CoreConsole
*/
protected $console;
public function bootCoreCommandTrait()
{
throw new \LogicException('Please do not use this trait, extend Windwalker\Core\Console\CoreCommand instead.');
}
}
6 changes: 2 additions & 4 deletions src/Core/Migration/Command/Migration/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@

namespace Windwalker\Core\Migration\Command\Migration;

use Windwalker\Console\Command\AbstractCommand;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Core\Migration\Command\MigrationCommandTrait;

/**
* The CreateCommand class.
*
* @since 2.0
*/
class CreateCommand extends AbstractCommand
class CreateCommand extends CoreCommand
{
use CoreCommandTrait;
use MigrationCommandTrait;

/**
Expand Down
6 changes: 2 additions & 4 deletions src/Core/Migration/Command/Migration/StatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@

namespace Windwalker\Core\Migration\Command\Migration;

use Windwalker\Console\Command\AbstractCommand;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Core\Migration\Command\MigrationCommandTrait;

/**
* The StatusCommand class.
*
* @since 2.0
*/
class StatusCommand extends AbstractCommand
class StatusCommand extends CoreCommand
{
use CoreCommandTrait;
use MigrationCommandTrait;

/**
Expand Down
7 changes: 2 additions & 5 deletions src/Core/Package/Command/Package/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

namespace Windwalker\Core\Package\Command\Package;

use Windwalker\Console\Command\Command;
use Windwalker\Console\Prompter\BooleanPrompter;
use Windwalker\Console\Prompter\TextPrompter;
use Windwalker\Core\Console\ConsoleHelper;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Core\Package\AbstractPackage;
use Windwalker\Filesystem\File;
use Windwalker\Filesystem\Folder;
Expand All @@ -22,10 +21,8 @@
*
* @since 3.0
*/
class InstallCommand extends Command
class InstallCommand extends CoreCommand
{
use CoreCommandTrait;

/**
* Property name.
*
Expand Down
6 changes: 2 additions & 4 deletions src/Core/Queue/Command/Queue/FailedTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@

namespace Windwalker\Core\Queue\Command\Queue;

use Windwalker\Console\Command\Command;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Core\Migration\Command\MigrationCommandTrait;

/**
* The WorkerCommand class.
*
* @since 3.2
*/
class FailedTableCommand extends Command
class FailedTableCommand extends CoreCommand
{
use CoreCommandTrait;
use MigrationCommandTrait;

/**
Expand Down
7 changes: 2 additions & 5 deletions src/Core/Queue/Command/Queue/RemoveFailedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@

namespace Windwalker\Core\Queue\Command\Queue;

use Windwalker\Console\Command\Command;
use Windwalker\Console\Exception\WrongArgumentException;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;

/**
* The WorkerCommand class.
*
* @since 3.2
*/
class RemoveFailedCommand extends Command
class RemoveFailedCommand extends CoreCommand
{
use CoreCommandTrait;

/**
* Property name.
*
Expand Down
7 changes: 2 additions & 5 deletions src/Core/Queue/Command/Queue/RestartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

namespace Windwalker\Core\Queue\Command\Queue;

use Windwalker\Console\Command\Command;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Core\DateTime\Chronos;
use Windwalker\Filesystem\File;

Expand All @@ -18,10 +17,8 @@
*
* @since 3.2
*/
class RestartCommand extends Command
class RestartCommand extends CoreCommand
{
use CoreCommandTrait;

/**
* Property name.
*
Expand Down
7 changes: 2 additions & 5 deletions src/Core/Queue/Command/Queue/RetryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@

namespace Windwalker\Core\Queue\Command\Queue;

use Windwalker\Console\Command\Command;
use Windwalker\Console\Exception\WrongArgumentException;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Utilities\Arr;

/**
* The WorkerCommand class.
*
* @since 3.2
*/
class RetryCommand extends Command
class RetryCommand extends CoreCommand
{
use CoreCommandTrait;

/**
* Property name.
*
Expand Down
6 changes: 2 additions & 4 deletions src/Core/Queue/Command/Queue/TableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@

namespace Windwalker\Core\Queue\Command\Queue;

use Windwalker\Console\Command\Command;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Core\Migration\Command\MigrationCommandTrait;

/**
* The WorkerCommand class.
*
* @since 3.2
*/
class TableCommand extends Command
class TableCommand extends CoreCommand
{
use CoreCommandTrait;
use MigrationCommandTrait;

/**
Expand Down
7 changes: 2 additions & 5 deletions src/Core/Queue/Command/Queue/WorkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

namespace Windwalker\Core\Queue\Command\Queue;

use Windwalker\Console\Command\Command;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Core\Queue\Job\JobInterface;
use Windwalker\Core\Queue\QueueMessage;
use Windwalker\Core\Queue\Worker;
Expand All @@ -21,10 +20,8 @@
*
* @since 3.2
*/
class WorkerCommand extends Command
class WorkerCommand extends CoreCommand
{
use CoreCommandTrait;

/**
* Property name.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Queue/Driver/ResqueQueueDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Windwalker\Core\Queue\Driver;

use Windwalker\Core\Queue\Resque\Resque;
use Windwalker\Core\Queue\QueueMessage;
use Windwalker\Core\Queue\Resque\Resque;

/**
* The ResqueQueueDriver class.
Expand Down
4 changes: 1 addition & 3 deletions src/Debugger/Templates/_global/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
* @license GNU General Public License version 2 or later;
*/

use Windwalker\Core\Package\AbstractPackage;
use Windwalker\Core\Router\PackageRouter;
use Windwalker\Structure\Structure;use Windwalker\Uri\UriData;
use Windwalker\Core\Package\AbstractPackage;use Windwalker\Core\Router\PackageRouter;use Windwalker\Structure\Structure;use Windwalker\Uri\UriData;

/**
* @var Structure $uri
Expand Down
7 changes: 2 additions & 5 deletions src/SystemPackage/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@
namespace Windwalker\SystemPackage\Command;

use Symfony\Component\Process\Process;
use Windwalker\Console\Command\Command;
use Windwalker\Core\Console\ConsoleHelper;
use Windwalker\Core\Console\CoreCommandTrait;
use Windwalker\Core\Console\CoreCommand;
use Windwalker\Utilities\Arr;

/**
* The DeployCommand class.
*
* @since 3.0
*/
class RunCommand extends Command
class RunCommand extends CoreCommand
{
use CoreCommandTrait;

/**
* Property name.
*
Expand Down

0 comments on commit b0b08ef

Please sign in to comment.