Skip to content

Commit 9d5399d

Browse files
authored
Feature/Upgrade illuminate/collections package. (#7)
1 parent a299910 commit 9d5399d

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"ext-json": "*",
1616
"ramsey/uuid": "^4.1",
1717
"nesbot/carbon": "^2.40",
18-
"illuminate/collections": "^8.20",
18+
"illuminate/collections": "^9.0.0",
1919
"lambdish/phunctional": "^2.1",
2020
"doctrine/instantiator": "^1.4",
2121
"complex-heart/contracts": "^1.0.0"

src/Traits/IsModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trait IsModel
2222
/**
2323
* Initialize the Model. Just as the constructor will do.
2424
*
25-
* @param array<string, mixed> $source
25+
* @param array<int|string, mixed> $source
2626
* @param callable|null $onFail
2727
*
2828
* @return static
@@ -76,7 +76,7 @@ protected function withOverrides(array $overrides)
7676
final protected function mapSource(array $source): array
7777
{
7878
// check if the array is indexed or associative.
79-
$isIndexed = fn($source): bool => !([] === $source) && array_keys($source) === range(0, count($source) - 1);
79+
$isIndexed = fn($source): bool => ([] !== $source) && array_keys($source) === range(0, count($source) - 1);
8080

8181
return $isIndexed($source)
8282
// combine the attributes keys with the provided source values.

src/TypedCollection.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ public function push(...$values)
138138
*
139139
* @throws InvariantViolation
140140
*/
141-
#[\ReturnTypeWillChange]
142-
public function offsetSet($key, $value)
141+
public function offsetSet($key, $value): void
143142
{
144143
if ($this->keyType !== 'mixed') {
145144
$this->checkKeyType($key);
@@ -154,7 +153,7 @@ public function offsetSet($key, $value)
154153
* Push an item onto the beginning of the collection.
155154
*
156155
* @param mixed $value
157-
* @param null $key
156+
* @param int|string $key
158157
*
159158
* @return static
160159
* @throws InvariantViolation

0 commit comments

Comments
 (0)