Skip to content

Commit

Permalink
Adapt to the latest version of Hyperf (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia authored Apr 28, 2023
1 parent bb7902a commit e7967d9
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ vendor/
.phpunit*
*.cache
composer.lock
.vscode/
22 changes: 18 additions & 4 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
$header = <<<'EOF'
This file is part of Hyperf.
Expand All @@ -23,13 +32,18 @@
'location' => 'after_declare_strict',
],
'array_syntax' => [
'syntax' => 'short'
'syntax' => 'short',
],
'list_syntax' => [
'syntax' => 'short'
'syntax' => 'short',
],
'concat_space' => [
'spacing' => 'one'
'spacing' => 'one',
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => null,
],
'blank_line_before_statement' => [
'statements' => [
Expand All @@ -38,7 +52,7 @@
],
'general_phpdoc_annotation_remove' => [
'annotations' => [
'author'
'author',
],
],
'ordered_imports' => [
Expand Down
2 changes: 1 addition & 1 deletion app/Listener/DbQueryExecutedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
*/
namespace App\Listener;

use Hyperf\Collection\Arr;
use Hyperf\Database\Events\QueryExecuted;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Logger\LoggerFactory;
use Hyperf\Utils\Arr;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;

Expand Down
2 changes: 1 addition & 1 deletion config/autoload/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
return [
'default' => [
'driver' => Hyperf\Cache\Driver\RedisDriver::class,
'packer' => Hyperf\Utils\Packer\PhpSerializerPacker::class,
'packer' => Hyperf\Codec\Packer\PhpSerializerPacker::class,
'prefix' => 'c:',
],
];
2 changes: 2 additions & 0 deletions config/autoload/databases.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use function Hyperf\Support\env;

return [
'default' => [
'driver' => env('DB_DRIVER', 'mysql'),
Expand Down
2 changes: 2 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Hyperf\Contract\StdoutLoggerInterface;
use Psr\Log\LogLevel;

use function Hyperf\Support\env;

return [
'app_name' => env('APP_NAME', 'skeleton'),
'app_env' => env('APP_ENV', 'dev'),
Expand Down
2 changes: 1 addition & 1 deletion config/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use Hyperf\Context\ApplicationContext;
use Hyperf\Di\Container;
use Hyperf\Di\Definition\DefinitionSourceFactory;
use Hyperf\Utils\ApplicationContext;

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

Expand Down
3 changes: 2 additions & 1 deletion installer/OptionalPackages.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Composer\Package\RootPackageInterface;
use Composer\Package\Version\VersionParser;
use FilesystemIterator;
use InvalidArgumentException;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

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

return trim($value);
Expand Down
2 changes: 1 addition & 1 deletion installer/resources/config_center/config_etcd.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'drivers' => [
'etcd' => [
'driver' => Hyperf\ConfigEtcd\EtcdDriver::class,
'packer' => Hyperf\Utils\Packer\JsonPacker::class,
'packer' => Hyperf\Codec\Packer\JsonPacker::class,
'namespaces' => [
'/application',
],
Expand Down

0 comments on commit e7967d9

Please sign in to comment.