Upgrade to 3.8.3

This commit is contained in:
Bastian Allgeier
2022-12-06 15:37:13 +01:00
parent f9e812cb0c
commit 8381ccb96c
69 changed files with 752 additions and 966 deletions

View File

@@ -99,11 +99,11 @@ class Collection extends Iterator implements Countable
*/
public function __set(string $key, $value): void
{
if ($this->caseSensitive === true) {
$this->data[$key] = $value;
} else {
$this->data[strtolower($key)] = $value;
if ($this->caseSensitive !== true) {
$key = strtolower($key);
}
$this->data[$key] = $value;
}
/**
@@ -380,11 +380,11 @@ class Collection extends Iterator implements Countable
public function find(...$keys)
{
if (count($keys) === 1) {
if (is_array($keys[0]) === true) {
$keys = $keys[0];
} else {
if (is_array($keys[0]) === false) {
return $this->findByKey($keys[0]);
}
$keys = $keys[0];
}
$result = [];
@@ -551,12 +551,14 @@ class Collection extends Iterator implements Countable
// make sure we have a proper key for each group
if (is_array($value) === true) {
throw new Exception('You cannot group by arrays or objects');
} elseif (is_object($value) === true) {
}
if (is_object($value) === true) {
if (method_exists($value, '__toString') === false) {
throw new Exception('You cannot group by arrays or objects');
} else {
$value = (string)$value;
}
$value = (string)$value;
}
if (isset($groups[$value]) === false) {