2021-11-02 15:06:17 +08:00
# v3.0.0 - TBD
2022-02-21 20:23:48 +08:00
- [#4238 ](https://github.com/hyperf/hyperf/issues/4238 ) Upgraded the minimum php version to `^8.0` for all components;
2021-11-02 15:06:17 +08:00
## BC breaks
- 框架移除了 `@Annotation` 的支持,全部使用 `PHP8` 原生注解 `Attribute` ,更新前务必检查项目中,是否已经全部替换为 `Attribute` 。
2022-04-12 18:41:01 +08:00
可以执行以下脚本,将 `Doctrine Annotations` 转化为 `PHP8 Attributes` .
2021-11-02 15:06:17 +08:00
2022-04-12 18:41:01 +08:00
**注意: 这个脚本只能在 2.2 版本下执行**
2021-11-02 15:06:17 +08:00
```shell
2022-04-12 18:41:01 +08:00
composer require hyperf/code-generator
php bin/hyperf.php code:generate -D app
2021-11-02 15:06:17 +08:00
```
2022-04-12 18:41:01 +08:00
- 升级模型脚本
2021-12-27 12:18:56 +08:00
> 因为模型基类增加了成员变量的类型支持,所以需要使用以下脚本,将其升级为新版本。
```shell
composer require hyperf/code-generator
2021-12-27 17:14:07 +08:00
php vendor/bin/regenerate-models.php $PWD/app/Model
2021-12-27 12:18:56 +08:00
```
2022-04-12 18:41:01 +08:00
- 框架为类库增加了更多的类型限制,所以从 `2.2` 更新到 `3.0` 版本时,需要跑一遍静态检测。
```shell
composer analyse
```
2021-11-02 15:06:17 +08:00
## Dependencies Upgrade
- Upgraded `php-amqplib/php-amqplib` to `^3.1` ;
- Upgraded `phpstan/phpstan` to `^1.0` ;
2021-12-07 12:26:20 +08:00
- Upgraded `mix/redis-subscribe` to `mix/redis-subscriber:^3.0`
- Upgraded `psr/simple-cache` to `^1.0|^2.0|^3.0`
2021-11-02 15:06:17 +08:00
## Added
- [#4196 ](https://github.com/hyperf/hyperf/pull/4196 ) Added `Hyperf\Amqp\IO\IOFactory` which used to create amqp io by yourself.
2021-12-01 14:12:08 +08:00
- [#4304 ](https://github.com/hyperf/hyperf/pull/4304 ) Support `$suffix` for trait `Hyperf\Utils\Traits\StaticInstance` .
2021-12-27 17:14:07 +08:00
- [#4400 ](https://github.com/hyperf/hyperf/pull/4400 ) Added `$description` which used to set command description easily for `Hyperf\Command\Command` .
2022-01-27 13:46:54 +08:00
- [#4277 ](https://github.com/hyperf/hyperf/pull/4277 ) Added `Hyperf\Utils\IPReader` to get local IP.
2022-02-01 14:28:33 +08:00
- [#4497 ](https://github.com/hyperf/hyperf/pull/4497 ) Added `Hyperf\Coordinator\Timer` which can be stopped safely.
2022-02-15 15:31:58 +08:00
- [#4523 ](https://github.com/hyperf/hyperf/pull/4523 ) Support callback conditions for `Conditionable::when()` and `Conditionable::unless()` .
2022-04-07 10:26:59 +08:00
- [#4663 ](https://github.com/hyperf/hyperf/pull/4663 ) Make `Hyperf\Utils\Stringable` implements `Stringable` .
2021-11-02 16:57:36 +08:00
2021-11-02 20:37:59 +08:00
## Optimized
- [#4147 ](https://github.com/hyperf/hyperf/pull/4147 ) Optimized code for nacos which you can use `http://xxx.com/yyy/` instead of `http://xxx.com:8848/` to connect `nacos` .
2021-12-16 15:22:52 +08:00
- [#4367 ](https://github.com/hyperf/hyperf/pull/4367 ) Optimized `DataFormatterInterface` which uses object instead of array as inputs.
2022-04-17 21:00:09 +08:00
- [#4547 ](https://github.com/hyperf/hyperf/pull/4547 ) Optimized code of `Str::contains` `Str::startsWith` and `Str::endsWith` based on `PHP8` .
2022-03-11 14:02:57 +08:00
- [#4596 ](https://github.com/hyperf/hyperf/pull/4596 ) Optimized `Hyperf\Context\Context` which support `coroutineId` for `set()` `override()` and `getOrSet()` .
2022-04-17 18:56:43 +08:00
- [#4658 ](https://github.com/hyperf/hyperf/pull/4658 ) The method name is used as the routing path, when the path is null in route annotations.
2022-04-12 14:43:18 +08:00
- [#4668 ](https://github.com/hyperf/hyperf/pull/4668 ) Optimized class `Hyperf\Utils\Str` whose methods `padBoth` `padLeft` and `padRight` support `multibyte` .
2022-04-13 20:34:09 +08:00
- [#4678 ](https://github.com/hyperf/hyperf/pull/4679 ) Close all another servers when one of them closed.
2022-04-15 18:00:56 +08:00
- [#4688 ](https://github.com/hyperf/hyperf/pull/4688 ) Added `SafeCaller` to avoid server shutdown which caused by exceptions.
2021-11-02 20:37:59 +08:00
2021-11-04 11:50:02 +08:00
## Changed
2021-11-05 10:42:57 +08:00
- [#4199 ](https://github.com/hyperf/hyperf/pull/4199 ) Changed the `public` property `$message` to `protected` for `Hyperf\AsyncQueue\Event\Event` .
2021-11-04 11:50:02 +08:00
- [#4214 ](https://github.com/hyperf/hyperf/pull/4214 ) Renamed `$circularDependences` to `$checkCircularDependencies` for `Dag` .
2021-11-05 16:06:17 +08:00
- [#4225 ](https://github.com/hyperf/hyperf/pull/4225 ) Split `hyperf/coordinator` from `hyperf/utils` .
2021-11-18 11:07:53 +08:00
- [#4269 ](https://github.com/hyperf/hyperf/pull/4269 ) Changed the default priority of listener to `0` from `1` .
2021-12-13 19:39:48 +08:00
- [#4345 ](https://github.com/hyperf/hyperf/pull/4345 ) Renamed `Hyperf\Kafka\Exception\ConnectionCLosedException` to `Hyperf\Kafka\Exception\ConnectionClosedException` .
2022-01-09 10:17:07 +08:00
- [#4434 ](https://github.com/hyperf/hyperf/pull/4434 ) The method `Hyperf\Database\Model\Builder::insertOrIgnore` will be return affected count.
2022-02-01 12:34:22 +08:00
- [#4495 ](https://github.com/hyperf/hyperf/pull/4495 ) Changed the default value to `null` for `Hyperf\DbConnection\Db::__connection()` .
2022-02-05 19:26:37 +08:00
- [#4460 ](https://github.com/hyperf/hyperf/pull/4460 ) Use `??` instead of `?:` for `$callback` when using `Stringable::when()` .
2022-02-07 15:48:35 +08:00
- [#4502 ](https://github.com/hyperf/hyperf/pull/4502 ) Use `Hyperf\Engine\Channel` instead of `Hyperf\Coroutine\Channel` in `hyperf/reactive-x` .
2022-03-18 09:55:36 +08:00
- [#4611 ](https://github.com/hyperf/hyperf/pull/4611 ) Changed return type to `void` for `Hyperf\Event\Contract\ListenerInterface::process()` .
2022-04-12 18:41:01 +08:00
- [#4669 ](https://github.com/hyperf/hyperf/pull/4669 ) Changed all annotations which only support `PHP` >= `8.0` .
2022-04-13 18:33:32 +08:00
- [#4678 ](https://github.com/hyperf/hyperf/pull/4678 ) Support event dispatcher for command by default.
2022-04-13 21:28:07 +08:00
- [#4680 ](https://github.com/hyperf/hyperf/pull/4680 ) Stop processes which controlled by `ProcessManager` when server shutdown.
2021-11-04 11:50:02 +08:00
2021-11-02 16:57:36 +08:00
## Removed
- [#4199 ](https://github.com/hyperf/hyperf/pull/4199 ) Removed deprecated handler `Hyperf\AsyncQueue\Signal\DriverStopHandler` .
2022-01-26 10:54:31 +08:00
- [#4482 ](https://github.com/hyperf/hyperf/pull/4482 ) Removed deprecated `Hyperf\Utils\Resource` .
- [#4487 ](https://github.com/hyperf/hyperf/pull/4487 ) Removed log warning from cache component when the key is greater than 64 characters.
2022-03-11 14:02:57 +08:00
- [#4596 ](https://github.com/hyperf/hyperf/pull/4596 ) Removed `Hyperf\Utils\Context` , please use `Hyperf\Context\Context` instead.
2022-03-23 17:04:34 +08:00
- [#4623 ](https://github.com/hyperf/hyperf/pull/4623 ) Removed AliyunOssHook for `hyperf/filesystem` .
2022-04-12 18:14:22 +08:00
- [#4667 ](https://github.com/hyperf/hyperf/pull/4667 ) Removed `doctrine/annotations` , please use `PHP8 Attributes` .
2021-11-23 19:47:49 +08:00
## Deprecated
- `Hyperf\Utils\Contracts\Arrayable` will be deprecated, please use `Hyperf\Contract\Arrayable` instead.
2021-12-11 09:47:27 +08:00
- `Hyperf\AsyncQueue\Message` will be deprecated, please use `Hyperf\AsyncQueue\JobMessage` instead.
2022-02-21 20:23:48 +08:00
## Fixed
- [#4549 ](https://github.com/hyperf/hyperf/pull/4549 ) Fixed bug that `PhpParser::getExprFromValue()` does not support assoc array.