Moved Macroable from Hyperf\Database\Model\Collection to Hyperf\Utils\Collection. (#4017)

This commit is contained in:
李铭昕 2021-09-08 14:55:45 +08:00 committed by GitHub
parent cb077017e1
commit bb85d29ca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 5 deletions

View File

@ -3,12 +3,17 @@
## Fixed
- [#4028](https://github.com/hyperf/hyperf/pull/4028) Fixed the success rate calculation in grafana dashboard.
- [#4030](https://github.com/hyperf/hyperf/pull/4030) Fixed bug that async-queue broken caused by uncompress model failed.
- [#4030](https://github.com/hyperf/hyperf/pull/4030) Fixed bug that async-queue broken caused by uncompressing model failed.
## Added
- [#4017](https://github.com/hyperf/hyperf/pull/4017) Added `Macroable` into `Hyperf\Utils\Collection`.
- [#4021](https://github.com/hyperf/hyperf/pull/4021) Added argument `$attempts` into `$callback` when using function `retry()`.
## Removed
- [#4017](https://github.com/hyperf/hyperf/pull/4017) Removed `Macroable` from `Hyperf\Database\Model\Collection` because it already exists in `Hyperf\Utils\Collection`.
# v2.2.7 - 2021-09-06
# Fixed

View File

@ -80,6 +80,7 @@
"symfony/finder": "^5.0",
"symfony/property-access": "^5.0",
"symfony/serializer": "^5.0",
"symfony/var-dumper": "^5.3",
"twig/twig": "^3.0",
"vlucas/phpdotenv": "^5.0"
},

View File

@ -16,7 +16,7 @@
},
"require": {
"php": ">=7.2",
"hyperf/utils": "~2.2.0",
"hyperf/utils": "~2.2.8",
"nesbot/carbon": "^2.0",
"psr/container": "^1.0|^2.0",
"psr/event-dispatcher": "^1.0"

View File

@ -17,12 +17,9 @@ use Hyperf\Utils\Arr;
use Hyperf\Utils\Collection as BaseCollection;
use Hyperf\Utils\Contracts\Arrayable;
use Hyperf\Utils\Str;
use Hyperf\Utils\Traits\Macroable;
class Collection extends BaseCollection implements CompressInterface
{
use Macroable;
/**
* Find a model in the collection by key.
*

View File

@ -18,6 +18,7 @@ use Countable;
use Exception;
use Hyperf\Utils\Contracts\Arrayable;
use Hyperf\Utils\Contracts\Jsonable;
use Hyperf\Utils\Traits\Macroable;
use IteratorAggregate;
use JsonSerializable;
use stdClass;
@ -50,6 +51,8 @@ use Traversable;
*/
class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable
{
use Macroable;
/**
* The items contained in the collection.
*