Skip to content

Commit

Permalink
Use Hyperf\Coroutine\Channel\Pool instead of `Hyperf\Utils\ChannelP…
Browse files Browse the repository at this point in the history
…ool` (#5671)
  • Loading branch information
huangdijia committed Apr 25, 2023
1 parent 9c4a1a3 commit 1e769fc
Show file tree
Hide file tree
Showing 78 changed files with 137 additions and 15 deletions.
14 changes: 10 additions & 4 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@
*/
namespace PHPSTORM_META;

use function di;
use function make;
use function optional;
use function tap;

// Reflect
override(\Psr\Container\ContainerInterface::get(0), map(['' => '@']));
override(\Hyperf\Context\Context::get(0), map(['' => '@']));
override(\make(0), map(['' => '@']));
override(\di(0), map(['' => '@']));
override(\optional(0), type(0));
override(\tap(0), type(0));
override(make(0), map(['' => '@']));
override(di(0), map(['' => '@']));
override(optional(0), type(0));
override(tap(0), type(0));
override(\Hyperf\Tappable\tap(0), type(0));
1 change: 1 addition & 0 deletions CHANGELOG-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [#5666](https://github.com/hyperf/hyperf/pull/5666) Split `Packers` to `hyperf/codec`.
- [#5668](https://github.com/hyperf/hyperf/pull/5668) Split `hyperf/support` from `hyperf/utils`.
- [#5670](https://github.com/hyperf/hyperf/pull/5670) Split `hyperf/code-parser` from `hyperf/utils`.
- [#5671](https://github.com/hyperf/hyperf/pull/5671) Use `Hyperf\Coroutine\Channel\Pool` instead of `Hyperf\Utils\ChannelPool`.

# v3.0.17 - 2023-04-19

Expand Down
1 change: 1 addition & 0 deletions src/amqp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"doctrine/instantiator": "^1.2.0",
"hyperf/codec": "~3.0.0",
"hyperf/contract": "~3.0.0",
"hyperf/coroutine": "~3.0.0",
"hyperf/utils": "~3.0.0",
"hyperf/process": "~3.0.0",
"hyperf/pool": "~3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/amqp/src/AMQPConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
use Hyperf\Amqp\Exception\SendChannelTimeoutException;
use Hyperf\Coordinator\Constants;
use Hyperf\Coordinator\CoordinatorManager;
use Hyperf\Coroutine\Channel\Manager as ChannelManager;
use Hyperf\Coroutine\Coroutine;
use Hyperf\Coroutine\Exception\ChannelClosedException;
use Hyperf\Engine\Channel;
use Hyperf\Utils\Channel\ChannelManager;
use Hyperf\Utils\Exception\ChannelClosedException;
use PhpAmqpLib\Channel\AMQPChannel;
use PhpAmqpLib\Channel\Frame;
use PhpAmqpLib\Connection\AbstractConnection;
Expand Down
2 changes: 1 addition & 1 deletion src/amqp/tests/ConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Hyperf\Amqp\ConnectionFactory;
use Hyperf\Amqp\Consumer;
use Hyperf\Coroutine\Concurrent;
use Hyperf\Utils\Exception\ChannelClosedException;
use Hyperf\Coroutine\Exception\ChannelClosedException;
use Hyperf\Utils\Reflection\ClassInvoker;
use HyperfTest\Amqp\Stub\AMQPConnectionStub;
use HyperfTest\Amqp\Stub\ContainerStub;
Expand Down
2 changes: 1 addition & 1 deletion src/amqp/tests/Stub/AMQPConnectionStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace HyperfTest\Amqp\Stub;

use Hyperf\Amqp\AMQPConnection;
use Hyperf\Utils\Channel\ChannelManager;
use Hyperf\Coroutine\Channel\Manager as ChannelManager;

class AMQPConnectionStub extends AMQPConnection
{
Expand Down
1 change: 1 addition & 0 deletions src/async-queue/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"psr/container": "^1.0|^2.0",
"psr/event-dispatcher": "^1.0",
"hyperf/codec": "~3.0.0",
"hyperf/collection": "~3.0.0",
"hyperf/contract": "~3.0.0",
"hyperf/command": "~3.0.0",
"hyperf/utils": "~3.0.0"
Expand Down
2 changes: 2 additions & 0 deletions src/async-queue/src/Driver/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
use Psr\EventDispatcher\EventDispatcherInterface;
use Throwable;

use function Hyperf\Coroutine\parallel;

abstract class Driver implements DriverInterface
{
protected PackerInterface $packer;
Expand Down
1 change: 1 addition & 0 deletions src/cache/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"psr/container": "^1.0|^2.0",
"psr/simple-cache": "^1.0|^2.0|^3.0",
"hyperf/codec": "~3.0.0",
"hyperf/collection": "~3.0.0",
"hyperf/contract": "~3.0.0",
"hyperf/utils": "~3.0.0"
},
Expand Down
2 changes: 2 additions & 0 deletions src/cache/src/Helper/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

use Hyperf\Stringable\Str;

use function Hyperf\Collection\data_get;

class StringHelper
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/collection/tests/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use function Hyperf\Collection\data_fill;
use function Hyperf\Collection\data_get;
use function Hyperf\Collection\data_set;
use function Hyperf\Collection\head;
use function Hyperf\Collection\last;
use function Hyperf\Collection\value;

/**
Expand Down
1 change: 1 addition & 0 deletions src/command/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"require": {
"php": ">=8.0",
"hyperf/tappable": "~3.0.0",
"hyperf/utils": "~3.0.0",
"psr/event-dispatcher": "^1.0",
"symfony/console": "^5.0|^6.0"
Expand Down
1 change: 1 addition & 0 deletions src/command/src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

use function Hyperf\Collection\collect;
use function Hyperf\Coroutine\run;
use function Hyperf\Tappable\tap;

abstract class Command extends SymfonyCommand
{
Expand Down
1 change: 1 addition & 0 deletions src/config/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"require": {
"php": ">=8.0",
"hyperf/collection": "~3.0.0",
"hyperf/contract": "~3.0.0",
"hyperf/support": "~3.0.0",
"hyperf/utils": "~3.0.0",
Expand Down
3 changes: 3 additions & 0 deletions src/config/src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
use Hyperf\Collection\Arr;
use Hyperf\Contract\ConfigInterface;

use function Hyperf\Collection\data_get;
use function Hyperf\Collection\data_set;

class Config implements ConfigInterface
{
public function __construct(private array $configs)
Expand Down
2 changes: 2 additions & 0 deletions src/crontab/tests/CrontabManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Hyperf\Crontab\Parser;
use PHPUnit\Framework\TestCase;

use function Hyperf\Tappable\tap;

/**
* @internal
* @coversNothing
Expand Down
2 changes: 2 additions & 0 deletions src/database-pgsql/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
},
"require": {
"php": ">=8.0",
"hyperf/collection": "~3.0.0",
"hyperf/tappable": "~3.0.0",
"ext-swoole": ">=5.0",
"hyperf/database": "~3.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Exception;
use Throwable;

use function Hyperf\Tappable\tap;

trait PostgreSqlSwooleExtManagesTransactions
{
/**
Expand Down
1 change: 1 addition & 0 deletions src/database-pgsql/src/Query/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Hyperf\Stringable\Str;

use function Hyperf\Collection\collect;
use function Hyperf\Collection\last;

class PostgresGrammar extends Grammar
{
Expand Down
2 changes: 2 additions & 0 deletions src/database-pgsql/src/Schema/PostgresBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Hyperf\Database\PgSQL\Query\Processors\PostgresProcessor;
use Hyperf\Database\Schema\Builder;

use function Hyperf\Collection\head;

class PostgresBuilder extends Builder
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/database/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
},
"require": {
"php": ">=8.0",
"hyperf/collection": "~3.0.0",
"hyperf/code-parser": "~3.0.0",
"hyperf/macroable": "~3.0.0",
"hyperf/tappable": "~3.0.0",
"hyperf/utils": "~3.0.0",
"nesbot/carbon": "^2.0",
"psr/container": "^1.0|^2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Exception;
use Throwable;

use function Hyperf\Tappable\tap;

trait ManagesTransactions
{
/**
Expand Down
1 change: 1 addition & 0 deletions src/database/src/Model/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use ReflectionMethod;

use function Hyperf\Collection\collect;
use function Hyperf\Tappable\tap;

/**
* @mixin \Hyperf\Database\Query\Builder
Expand Down
1 change: 1 addition & 0 deletions src/database/src/Model/Concerns/HasAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use LogicException;

use function Hyperf\Collection\collect;
use function Hyperf\Tappable\tap;

trait HasAttributes
{
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Model/Concerns/HasRelationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
use Hyperf\Database\Model\Relations\Relation;
use Hyperf\Stringable\Str;

use function Hyperf\Tappable\tap;

trait HasRelationships
{
/**
Expand Down
1 change: 1 addition & 0 deletions src/database/src/Model/FactoryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use InvalidArgumentException;

use function Hyperf\Collection\collect;
use function Hyperf\Tappable\tap;

class FactoryBuilder
{
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
use Throwable;

use function Hyperf\Collection\collect;
use function Hyperf\Collection\last;
use function Hyperf\Tappable\tap;

/**
* @mixin ModelIDE
Expand Down
1 change: 1 addition & 0 deletions src/database/src/Model/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use InvalidArgumentException;

use function Hyperf\Collection\collect;
use function Hyperf\Tappable\tap;

class BelongsToMany extends Relation
{
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Model/Relations/HasOneOrMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Hyperf\Database\Model\Model;
use Traversable;

use function Hyperf\Tappable\tap;

abstract class HasOneOrMany extends Relation
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Model/Relations/MorphOneOrMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Hyperf\Database\Model\Builder;
use Hyperf\Database\Model\Model;

use function Hyperf\Collection\last;

abstract class MorphOneOrMany extends HasOneOrMany
{
/**
Expand Down
1 change: 1 addition & 0 deletions src/database/src/Model/Relations/MorphTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Hyperf\Database\Model\Model;

use function Hyperf\Collection\collect;
use function Hyperf\Collection\head;

class MorphTo extends BelongsTo
{
Expand Down
1 change: 1 addition & 0 deletions src/database/src/Model/Relations/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Hyperf\Utils\Traits\ForwardsCalls;

use function Hyperf\Collection\collect;
use function Hyperf\Collection\last;

/**
* @mixin \Hyperf\Database\Model\Builder
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Model/SoftDeletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

use Psr\EventDispatcher\StoppableEventInterface;

use function Hyperf\Tappable\tap;

/**
* @method static static|\Hyperf\Database\Model\Builder|\Hyperf\Database\Query\Builder restoreOrCreate(array $attributes = [], array $values = [])
* @method static static|\Hyperf\Database\Model\Builder|\Hyperf\Database\Query\Builder withTrashed(bool $withTrashed = true)
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Model/SoftDeletingScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
*/
namespace Hyperf\Database\Model;

use function Hyperf\Tappable\tap;

class SoftDeletingScope implements Scope
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
use RuntimeException;

use function Hyperf\Collection\collect;
use function Hyperf\Collection\last;
use function Hyperf\Tappable\tap;

class Builder
{
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Query/Grammars/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use RuntimeException;

use function Hyperf\Collection\collect;
use function Hyperf\Collection\head;
use function Hyperf\Collection\last;

class Grammar extends BaseGrammar
{
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Hyperf\Database\Schema\Grammars\Grammar as SchemaGrammar;
use LogicException;

use function Hyperf\Tappable\tap;

class Builder
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/database/src/Schema/Grammars/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Hyperf\Utils\Fluent;
use RuntimeException;

use function Hyperf\Tappable\tap;

abstract class Grammar extends BaseGrammar
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/exception-handler/tests/ExceptionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;

use function Hyperf\Coroutine\parallel;

/**
* @internal
* @coversNothing
Expand Down
2 changes: 1 addition & 1 deletion src/grpc-client/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"require": {
"php": ">=8.0",
"hyperf/code-parser": "~3.0.0",
"hyperf/coroutine": "~3.0.0",
"hyperf/grpc": "~3.0.0",
"hyperf/utils": "~3.0.0",
"jean85/pretty-package-versions": "^1.2|^2.0"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/grpc-client/src/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

use Google\Protobuf\Internal\Message;
use Hyperf\Context\ApplicationContext;
use Hyperf\Coroutine\Channel\Pool as ChannelPool;
use Hyperf\Grpc\Parser;
use Hyperf\Grpc\StatusCode;
use Hyperf\GrpcClient\Exception\GrpcClientException;
use Hyperf\Utils\ChannelPool;
use InvalidArgumentException;
use Swoole\Http2\Response;

Expand Down
2 changes: 1 addition & 1 deletion src/grpc-client/src/GrpcClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
*/
namespace Hyperf\GrpcClient;

use Hyperf\Coroutine\Channel\Pool as ChannelPool;
use Hyperf\Coroutine\Coroutine;
use Hyperf\Engine\Channel;
use Hyperf\Grpc\StatusCode;
use Hyperf\GrpcClient\Exception\GrpcClientException;
use Hyperf\Utils\ChannelPool;
use InvalidArgumentException;
use RuntimeException;
use Swoole\Coroutine\Http2\Client as SwooleHttp2Client;
Expand Down
Loading

0 comments on commit 1e769fc

Please sign in to comment.