Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit a782f37

Browse files
authored
Rename Redis class to RedisService (#631) (#632)
.. to avoid class collision with native Redis
1 parent 55684b8 commit a782f37

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

cli/ValetPlus/DriverConfigurator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ class DriverConfigurator
1919
protected $files;
2020
/** @var Site */
2121
protected $site;
22-
/** @var Redis */
22+
/** @var RedisService */
2323
protected $redis;
2424

2525
/**
2626
* @param CommandLine $cli
2727
* @param Filesystem $files
2828
* @param Site $site
29-
* @param Redis $redis
29+
* @param RedisService $redis
3030
*/
3131
public function __construct(
3232
CommandLine $cli,
3333
Filesystem $files,
3434
Site $site,
35-
Redis $redis
35+
RedisService $redis
3636
) {
3737
$this->cli = $cli;
3838
$this->files = $files;

cli/ValetPlus/Extended/Status.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use WeProvide\ValetPlus\Mailhog;
1313
use WeProvide\ValetPlus\Mysql;
1414
use WeProvide\ValetPlus\Rabbitmq;
15-
use WeProvide\ValetPlus\Redis;
15+
use WeProvide\ValetPlus\RedisService;
1616
use WeProvide\ValetPlus\Varnish;
1717

1818
class Status extends ValetStatus
@@ -23,7 +23,7 @@ class Status extends ValetStatus
2323
protected $mailhog;
2424
/** @var Varnish */
2525
protected $varnish;
26-
/** @var Redis */
26+
/** @var RedisService */
2727
protected $redis;
2828
/** @var Rabbitmq */
2929
protected $rabbitmq;
@@ -36,7 +36,7 @@ class Status extends ValetStatus
3636
* @param Mysql $mysql
3737
* @param Mailhog $mailhog
3838
* @param Varnish $varnish
39-
* @param Redis $redis
39+
* @param RedisService $redis
4040
* @param Rabbitmq $rabbitmq
4141
*/
4242
public function __construct(
@@ -47,7 +47,7 @@ public function __construct(
4747
Mysql $mysql,
4848
Mailhog $mailhog,
4949
Varnish $varnish,
50-
Redis $redis,
50+
RedisService $redis,
5151
Rabbitmq $rabbitmq
5252
) {
5353
parent::__construct($config, $brew, $cli, $files);
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
use function Valet\info;
88

9-
class Redis extends AbstractService
9+
/**
10+
* We name this class RedisService to avoid class collision when `shivammathur/extensions/redis@8.1` is installed.
11+
*/
12+
class RedisService extends AbstractService
1013
{
1114
/** @var string */
1215
protected const SERVICE_NAME = 'redis';

cli/includes/facades.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Elasticsearch extends ValetPlusFacade
4141
class Varnish extends ValetPlusFacade
4242
{
4343
}
44-
class Redis extends ValetPlusFacade
44+
class RedisService extends ValetPlusFacade
4545
{
4646
}
4747
class Rabbitmq extends ValetPlusFacade

cli/valet.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
Mysql::restart();
121121
Mailhog::restart();
122122
Varnish::restart();
123-
Redis::restart();
123+
RedisService::restart();
124124
Rabbitmq::restart();
125125
break;
126126
case 'mysql':
@@ -136,7 +136,7 @@
136136

137137
return info('Varnish has been started.');
138138
case 'redis':
139-
Redis::restart();
139+
RedisService::restart();
140140

141141
return info('Redis has been started.');
142142
case 'rabbitmq':
@@ -158,7 +158,7 @@
158158
Mysql::restart();
159159
Mailhog::restart();
160160
Varnish::restart();
161-
Redis::restart();
161+
RedisService::restart();
162162
Rabbitmq::restart();
163163
break;
164164
case 'mysql':
@@ -174,7 +174,7 @@
174174

175175
return info('Varnish has been restarted.');
176176
case 'redis':
177-
Redis::restart();
177+
RedisService::restart();
178178

179179
return info('Redis has been restarted.');
180180
case 'rabbitmq':
@@ -196,7 +196,7 @@
196196
Mysql::stop();
197197
Mailhog::stop();
198198
Varnish::stop();
199-
Redis::stop();
199+
RedisService::stop();
200200
Rabbitmq::stop();
201201
break;
202202
case 'mysql':
@@ -212,7 +212,7 @@
212212

213213
return info('Varnish has been stopped.');
214214
case 'redis':
215-
Redis::stop();
215+
RedisService::stop();
216216

217217
return info('Redis has been stopped.');
218218
case 'rabbitmq':
@@ -247,7 +247,7 @@
247247
info('Removing varnish...');
248248
Varnish::uninstall();
249249
info('Removing redis...');
250-
Redis::uninstall();
250+
RedisService::uninstall();
251251
info('Removing rabbitmq...');
252252
Rabbitmq::uninstall();
253253
info('Removing elasticsearch...');
@@ -348,21 +348,21 @@
348348

349349
switch ($mode) {
350350
case 'install':
351-
Redis::install();
351+
RedisService::install();
352352

353353
break;
354354
case 'enable':
355355
case 'on':
356-
Redis::enable();
356+
RedisService::enable();
357357

358358
break;
359359
case 'disable':
360360
case 'off':
361-
Redis::disable();
361+
RedisService::disable();
362362

363363
break;
364364
case 'uninstall':
365-
Redis::uninstall();
365+
RedisService::uninstall();
366366

367367
break;
368368
}

0 commit comments

Comments
 (0)