Upgrade to 3.4.3

This commit is contained in:
Bastian Allgeier
2020-09-15 10:25:09 +02:00
parent 54b9ba3047
commit d8e797dd9b
108 changed files with 1750 additions and 523 deletions

View File

@@ -54,7 +54,7 @@ class Collection extends BaseCollection
* Creates a new Collection with the given objects
*
* @param array $objects
* @param object $parent
* @param object|null $parent
*/
public function __construct($objects = [], $parent = null)
{
@@ -101,6 +101,7 @@ class Collection extends BaseCollection
/**
* Appends an element to the data array
*
* @param mixed ...$args
* @param mixed $key Optional collection key, will be determined from the item if not given
* @param mixed $item
* @return \Kirby\Cms\Collection
@@ -126,6 +127,7 @@ class Collection extends BaseCollection
* @param string $field
* @param bool $i Ignore upper/lowercase for group names
* @return \Kirby\Cms\Collection
* @throws \Kirby\Exception\Exception
*/
public function groupBy($field, bool $i = true)
{
@@ -203,7 +205,9 @@ class Collection extends BaseCollection
{
$collection = $this->clone();
foreach ($keys as $key) {
if (is_a($key, 'Kirby\Toolkit\Collection') === true) {
if (is_array($key) === true) {
return $this->not(...$key);
} elseif (is_a($key, 'Kirby\Toolkit\Collection') === true) {
$collection = $collection->not(...$key->keys());
} elseif (is_object($key) === true) {
$key = $key->id();
@@ -240,6 +244,7 @@ class Collection extends BaseCollection
/**
* Prepends an element to the data array
*
* @param mixed ...$args
* @param mixed $key Optional collection key, will be determined from the item if not given
* @param mixed $item
* @return \Kirby\Cms\Collection
@@ -307,7 +312,7 @@ class Collection extends BaseCollection
/**
* Searches the collection
*
* @param string $query
* @param string|null $query
* @param array $params
* @return self
*/
@@ -321,7 +326,7 @@ class Collection extends BaseCollection
* to an array. This can also take a callback
* function to further modify the array result.
*
* @param Closure $map
* @param \Closure|null $map
* @return array
*/
public function toArray(Closure $map = null): array