Skip to content

Commit e7967d9

Browse files
authored
Adapt to the latest version of Hyperf (#87)
1 parent bb7902a commit e7967d9

File tree

9 files changed

+29
-9
lines changed

9 files changed

+29
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ vendor/
1212
.phpunit*
1313
*.cache
1414
composer.lock
15+
.vscode/

.php-cs-fixer.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
declare(strict_types=1);
4+
/**
5+
* This file is part of Hyperf.
6+
*
7+
* @link https://www.hyperf.io
8+
* @document https://hyperf.wiki
9+
* @contact [email protected]
10+
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
11+
*/
312
$header = <<<'EOF'
413
This file is part of Hyperf.
514
@@ -23,13 +32,18 @@
2332
'location' => 'after_declare_strict',
2433
],
2534
'array_syntax' => [
26-
'syntax' => 'short'
35+
'syntax' => 'short',
2736
],
2837
'list_syntax' => [
29-
'syntax' => 'short'
38+
'syntax' => 'short',
3039
],
3140
'concat_space' => [
32-
'spacing' => 'one'
41+
'spacing' => 'one',
42+
],
43+
'global_namespace_import' => [
44+
'import_classes' => true,
45+
'import_constants' => true,
46+
'import_functions' => null,
3347
],
3448
'blank_line_before_statement' => [
3549
'statements' => [
@@ -38,7 +52,7 @@
3852
],
3953
'general_phpdoc_annotation_remove' => [
4054
'annotations' => [
41-
'author'
55+
'author',
4256
],
4357
],
4458
'ordered_imports' => [

app/Listener/DbQueryExecutedListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
*/
1212
namespace App\Listener;
1313

14+
use Hyperf\Collection\Arr;
1415
use Hyperf\Database\Events\QueryExecuted;
1516
use Hyperf\Event\Annotation\Listener;
1617
use Hyperf\Event\Contract\ListenerInterface;
1718
use Hyperf\Logger\LoggerFactory;
18-
use Hyperf\Utils\Arr;
1919
use Psr\Container\ContainerInterface;
2020
use Psr\Log\LoggerInterface;
2121

config/autoload/cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
return [
1313
'default' => [
1414
'driver' => Hyperf\Cache\Driver\RedisDriver::class,
15-
'packer' => Hyperf\Utils\Packer\PhpSerializerPacker::class,
15+
'packer' => Hyperf\Codec\Packer\PhpSerializerPacker::class,
1616
'prefix' => 'c:',
1717
],
1818
];

config/autoload/databases.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
use function Hyperf\Support\env;
13+
1214
return [
1315
'default' => [
1416
'driver' => env('DB_DRIVER', 'mysql'),

config/config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use Hyperf\Contract\StdoutLoggerInterface;
1313
use Psr\Log\LogLevel;
1414

15+
use function Hyperf\Support\env;
16+
1517
return [
1618
'app_name' => env('APP_NAME', 'skeleton'),
1719
'app_env' => env('APP_ENV', 'dev'),

config/container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* @contact [email protected]
1313
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1414
*/
15+
use Hyperf\Context\ApplicationContext;
1516
use Hyperf\Di\Container;
1617
use Hyperf\Di\Definition\DefinitionSourceFactory;
17-
use Hyperf\Utils\ApplicationContext;
1818

1919
$container = new Container((new DefinitionSourceFactory())());
2020

installer/OptionalPackages.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Composer\Package\RootPackageInterface;
2121
use Composer\Package\Version\VersionParser;
2222
use FilesystemIterator;
23+
use InvalidArgumentException;
2324
use RecursiveDirectoryIterator;
2425
use RecursiveIteratorIterator;
2526

@@ -128,7 +129,7 @@ public function installHyperfScript()
128129
implode('', $ask),
129130
function ($value) {
130131
if ($value === 'y' || $value === 'yes') {
131-
throw new \InvalidArgumentException('You should type a time zone name, like Asia/Shanghai. Or type n to skip.');
132+
throw new InvalidArgumentException('You should type a time zone name, like Asia/Shanghai. Or type n to skip.');
132133
}
133134

134135
return trim($value);

installer/resources/config_center/config_etcd.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
'drivers' => [
1919
'etcd' => [
2020
'driver' => Hyperf\ConfigEtcd\EtcdDriver::class,
21-
'packer' => Hyperf\Utils\Packer\JsonPacker::class,
21+
'packer' => Hyperf\Codec\Packer\JsonPacker::class,
2222
'namespaces' => [
2323
'/application',
2424
],

0 commit comments

Comments
 (0)