Skip to content

Commit 32b041f

Browse files
committed
Merge branch 'master' into upgrade-1.1
2 parents df60074 + b8cedf1 commit 32b041f

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ DB_COLLATION=utf8mb4_unicode_ci
1111
DB_PREFIX=
1212

1313
REDIS_HOST=localhost
14-
REDIS_AUTH=
14+
REDIS_AUTH=(null)
1515
REDIS_PORT=6379
1616
REDIS_DB=0

app/Controller/Controller.php renamed to app/Controller/AbstractController.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,28 @@
1212

1313
namespace App\Controller;
1414

15+
use Hyperf\Di\Annotation\Inject;
1516
use Hyperf\HttpServer\Contract\RequestInterface;
1617
use Hyperf\HttpServer\Contract\ResponseInterface;
1718
use Psr\Container\ContainerInterface;
1819

19-
abstract class Controller
20+
abstract class AbstractController
2021
{
2122
/**
23+
* @Inject
2224
* @var ContainerInterface
2325
*/
2426
protected $container;
2527

2628
/**
29+
* @Inject
2730
* @var RequestInterface
2831
*/
2932
protected $request;
3033

3134
/**
35+
* @Inject
3236
* @var ResponseInterface
3337
*/
3438
protected $response;
35-
36-
public function __construct(ContainerInterface $container)
37-
{
38-
$this->container = $container;
39-
$this->request = $container->get(RequestInterface::class);
40-
$this->response = $container->get(ResponseInterface::class);
41-
}
4239
}

app/Controller/IndexController.php

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

1313
namespace App\Controller;
1414

15-
class IndexController extends Controller
15+
class IndexController extends AbstractController
1616
{
1717
public function index()
1818
{

config/autoload/redis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
return [
1414
'default' => [
1515
'host' => env('REDIS_HOST', 'localhost'),
16-
'auth' => env('REDIS_AUTH', ''),
16+
'auth' => env('REDIS_AUTH', null),
1717
'port' => (int) env('REDIS_PORT', 6379),
1818
'db' => (int) env('REDIS_DB', 0),
1919
'pool' => [

0 commit comments

Comments
 (0)