Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Redis class to RedisService (#631) #632

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cli/ValetPlus/DriverConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ class DriverConfigurator
protected $files;
/** @var Site */
protected $site;
/** @var Redis */
/** @var RedisService */
protected $redis;

/**
* @param CommandLine $cli
* @param Filesystem $files
* @param Site $site
* @param Redis $redis
* @param RedisService $redis
*/
public function __construct(
CommandLine $cli,
Filesystem $files,
Site $site,
Redis $redis
RedisService $redis
) {
$this->cli = $cli;
$this->files = $files;
Expand Down
8 changes: 4 additions & 4 deletions cli/ValetPlus/Extended/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use WeProvide\ValetPlus\Mailhog;
use WeProvide\ValetPlus\Mysql;
use WeProvide\ValetPlus\Rabbitmq;
use WeProvide\ValetPlus\Redis;
use WeProvide\ValetPlus\RedisService;
use WeProvide\ValetPlus\Varnish;

class Status extends ValetStatus
Expand All @@ -23,7 +23,7 @@ class Status extends ValetStatus
protected $mailhog;
/** @var Varnish */
protected $varnish;
/** @var Redis */
/** @var RedisService */
protected $redis;
/** @var Rabbitmq */
protected $rabbitmq;
Expand All @@ -36,7 +36,7 @@ class Status extends ValetStatus
* @param Mysql $mysql
* @param Mailhog $mailhog
* @param Varnish $varnish
* @param Redis $redis
* @param RedisService $redis
* @param Rabbitmq $rabbitmq
*/
public function __construct(
Expand All @@ -47,7 +47,7 @@ public function __construct(
Mysql $mysql,
Mailhog $mailhog,
Varnish $varnish,
Redis $redis,
RedisService $redis,
Rabbitmq $rabbitmq
) {
parent::__construct($config, $brew, $cli, $files);
Expand Down
5 changes: 4 additions & 1 deletion cli/ValetPlus/Redis.php → cli/ValetPlus/RedisService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

use function Valet\info;

class Redis extends AbstractService
/**
* We name this class RedisService to avoid class collision when `shivammathur/extensions/[email protected]` is installed.
*/
class RedisService extends AbstractService
{
/** @var string */
protected const SERVICE_NAME = 'redis';
Expand Down
2 changes: 1 addition & 1 deletion cli/includes/facades.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Elasticsearch extends ValetPlusFacade
class Varnish extends ValetPlusFacade
{
}
class Redis extends ValetPlusFacade
class RedisService extends ValetPlusFacade
{
}
class Rabbitmq extends ValetPlusFacade
Expand Down
22 changes: 11 additions & 11 deletions cli/valet.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
Mysql::restart();
Mailhog::restart();
Varnish::restart();
Redis::restart();
RedisService::restart();
Rabbitmq::restart();
break;
case 'mysql':
Expand All @@ -135,7 +135,7 @@

return info('Varnish has been started.');
case 'redis':
Redis::restart();
RedisService::restart();

return info('Redis has been started.');
case 'rabbitmq':
Expand All @@ -157,7 +157,7 @@
Mysql::restart();
Mailhog::restart();
Varnish::restart();
Redis::restart();
RedisService::restart();
Rabbitmq::restart();
break;
case 'mysql':
Expand All @@ -173,7 +173,7 @@

return info('Varnish has been restarted.');
case 'redis':
Redis::restart();
RedisService::restart();

return info('Redis has been restarted.');
case 'rabbitmq':
Expand All @@ -195,7 +195,7 @@
Mysql::stop();
Mailhog::stop();
Varnish::stop();
Redis::stop();
RedisService::stop();
Rabbitmq::stop();
break;
case 'mysql':
Expand All @@ -211,7 +211,7 @@

return info('Varnish has been stopped.');
case 'redis':
Redis::stop();
RedisService::stop();

return info('Redis has been stopped.');
case 'rabbitmq':
Expand Down Expand Up @@ -246,7 +246,7 @@
info('Removing varnish...');
Varnish::uninstall();
info('Removing redis...');
Redis::uninstall();
RedisService::uninstall();
info('Removing rabbitmq...');
Rabbitmq::uninstall();
info('Removing elasticsearch...');
Expand Down Expand Up @@ -347,21 +347,21 @@

switch ($mode) {
case 'install':
Redis::install();
RedisService::install();

break;
case 'enable':
case 'on':
Redis::enable();
RedisService::enable();

break;
case 'disable':
case 'off':
Redis::disable();
RedisService::disable();

break;
case 'uninstall':
Redis::uninstall();
RedisService::uninstall();

break;
}
Expand Down