Skip to content

Commit d3a6b76

Browse files
committed
Format code
1 parent 69462bf commit d3a6b76

File tree

21 files changed

+108
-48
lines changed

21 files changed

+108
-48
lines changed

bin/hyperf.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env php
22
<?php
3+
4+
declare(strict_types=1);
35
/**
46
* This file is part of Hyperf.
57
*
@@ -8,6 +10,11 @@
810
* @contact group@hyperf.io
911
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1012
*/
13+
use Hyperf\Contract\ApplicationInterface;
14+
use Hyperf\Di\ClassLoader;
15+
use Hyperf\Engine\DefaultOption;
16+
use Psr\Container\ContainerInterface;
17+
1118
ini_set('display_errors', 'on');
1219
ini_set('display_startup_errors', 'on');
1320
ini_set('memory_limit', '1G');
@@ -18,14 +25,14 @@
1825

1926
require BASE_PATH . '/vendor/autoload.php';
2027

21-
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', Hyperf\Engine\DefaultOption::hookFlags());
28+
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', DefaultOption::hookFlags());
2229

2330
// Self-called anonymous function that creates its own scope and keep the global namespace clean.
2431
(function () {
25-
Hyperf\Di\ClassLoader::init();
26-
/** @var Psr\Container\ContainerInterface $container */
32+
ClassLoader::init();
33+
/** @var ContainerInterface $container */
2734
$container = require BASE_PATH . '/config/container.php';
2835

29-
$application = $container->get(Hyperf\Contract\ApplicationInterface::class);
36+
$application = $container->get(ApplicationInterface::class);
3037
$application->run();
3138
})();

config/autoload/cache.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
* @contact group@hyperf.io
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
use Hyperf\Cache\Driver\RedisDriver;
13+
use Hyperf\Codec\Packer\PhpSerializerPacker;
14+
1215
return [
1316
'default' => [
14-
'driver' => Hyperf\Cache\Driver\RedisDriver::class,
15-
'packer' => Hyperf\Codec\Packer\PhpSerializerPacker::class,
17+
'driver' => RedisDriver::class,
18+
'packer' => PhpSerializerPacker::class,
1619
'prefix' => 'c:',
1720
'skip_cache_results' => [],
1821
],

config/autoload/devtool.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@
1313
'generator' => [
1414
'amqp' => [
1515
'consumer' => [
16-
'namespace' => 'App\\Amqp\\Consumer',
16+
'namespace' => 'App\Amqp\Consumer',
1717
],
1818
'producer' => [
19-
'namespace' => 'App\\Amqp\\Producer',
19+
'namespace' => 'App\Amqp\Producer',
2020
],
2121
],
2222
'aspect' => [
23-
'namespace' => 'App\\Aspect',
23+
'namespace' => 'App\Aspect',
2424
],
2525
'command' => [
26-
'namespace' => 'App\\Command',
26+
'namespace' => 'App\Command',
2727
],
2828
'controller' => [
29-
'namespace' => 'App\\Controller',
29+
'namespace' => 'App\Controller',
3030
],
3131
'job' => [
32-
'namespace' => 'App\\Job',
32+
'namespace' => 'App\Job',
3333
],
3434
'listener' => [
35-
'namespace' => 'App\\Listener',
35+
'namespace' => 'App\Listener',
3636
],
3737
'middleware' => [
38-
'namespace' => 'App\\Middleware',
38+
'namespace' => 'App\Middleware',
3939
],
4040
'Process' => [
41-
'namespace' => 'App\\Processes',
41+
'namespace' => 'App\Processes',
4242
],
4343
],
4444
];

config/autoload/exceptions.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
* @contact group@hyperf.io
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
use App\Exception\Handler\AppExceptionHandler;
13+
use Hyperf\HttpServer\Exception\Handler\HttpExceptionHandler;
14+
1215
return [
1316
'handler' => [
1417
'http' => [
15-
Hyperf\HttpServer\Exception\Handler\HttpExceptionHandler::class,
16-
App\Exception\Handler\AppExceptionHandler::class,
18+
HttpExceptionHandler::class,
19+
AppExceptionHandler::class,
1720
],
1821
],
1922
];

config/autoload/listeners.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* @contact group@hyperf.io
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
use Hyperf\ExceptionHandler\Listener\ErrorExceptionHandler;
13+
1214
return [
13-
Hyperf\ExceptionHandler\Listener\ErrorExceptionHandler::class,
15+
ErrorExceptionHandler::class,
1416
];

config/autoload/logger.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@
99
* @contact group@hyperf.io
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
use Monolog\Formatter\LineFormatter;
13+
use Monolog\Handler\StreamHandler;
14+
use Monolog\Logger;
15+
1216
return [
1317
'default' => [
1418
'handler' => [
15-
'class' => Monolog\Handler\StreamHandler::class,
19+
'class' => StreamHandler::class,
1620
'constructor' => [
1721
'stream' => BASE_PATH . '/runtime/logs/hyperf.log',
18-
'level' => Monolog\Logger::DEBUG,
22+
'level' => Logger::DEBUG,
1923
],
2024
],
2125
'formatter' => [
22-
'class' => Monolog\Formatter\LineFormatter::class,
26+
'class' => LineFormatter::class,
2327
'constructor' => [
2428
'format' => null,
2529
'dateFormat' => 'Y-m-d H:i:s',

config/autoload/server.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* @contact group@hyperf.io
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
use Hyperf\Framework\Bootstrap\PipeMessageCallback;
13+
use Hyperf\Framework\Bootstrap\WorkerExitCallback;
14+
use Hyperf\Framework\Bootstrap\WorkerStartCallback;
1215
use Hyperf\Server\Event;
1316
use Hyperf\Server\Server;
1417
use Swoole\Constant;
@@ -43,8 +46,8 @@
4346
Constant::OPTION_BUFFER_OUTPUT_SIZE => 2 * 1024 * 1024,
4447
],
4548
'callbacks' => [
46-
Event::ON_WORKER_START => [Hyperf\Framework\Bootstrap\WorkerStartCallback::class, 'onWorkerStart'],
47-
Event::ON_PIPE_MESSAGE => [Hyperf\Framework\Bootstrap\PipeMessageCallback::class, 'onPipeMessage'],
48-
Event::ON_WORKER_EXIT => [Hyperf\Framework\Bootstrap\WorkerExitCallback::class, 'onWorkerExit'],
49+
Event::ON_WORKER_START => [WorkerStartCallback::class, 'onWorkerStart'],
50+
Event::ON_PIPE_MESSAGE => [PipeMessageCallback::class, 'onPipeMessage'],
51+
Event::ON_WORKER_EXIT => [WorkerExitCallback::class, 'onWorkerExit'],
4952
],
5053
];

config/container.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Initialize a dependency injection container that implemented PSR-11 and return the container.
45
*/

installer/OptionalPackages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class OptionalPackages
2929
{
3030
/**
31-
* @const string Regular expression for matching package name and version
31+
* @var string Regular expression for matching package name and version
3232
*/
3333
public const PACKAGE_REGEX = '/^(?P<name>[^:]+\/[^:]+)([:]*)(?P<version>.*)$/';
3434

installer/resources/async_queue/async_queue.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
* @contact group@hyperf.io
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
use Hyperf\AsyncQueue\Driver\RedisDriver;
13+
1214
return [
1315
'default' => [
14-
'driver' => \Hyperf\AsyncQueue\Driver\RedisDriver::class,
16+
'driver' => RedisDriver::class,
1517
'redis' => [
1618
'pool' => 'default',
1719
],

0 commit comments

Comments
 (0)