Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ext-json": "*",
"ramsey/uuid": "^4.1",
"nesbot/carbon": "^2.40",
"illuminate/collections": "^8.20",
"illuminate/collections": "^9.0.0",
"lambdish/phunctional": "^2.1",
"doctrine/instantiator": "^1.4",
"complex-heart/contracts": "^1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/IsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait IsModel
/**
* Initialize the Model. Just as the constructor will do.
*
* @param array<string, mixed> $source
* @param array<int|string, mixed> $source
* @param callable|null $onFail
*
* @return static
Expand Down Expand Up @@ -76,7 +76,7 @@ protected function withOverrides(array $overrides)
final protected function mapSource(array $source): array
{
// check if the array is indexed or associative.
$isIndexed = fn($source): bool => !([] === $source) && array_keys($source) === range(0, count($source) - 1);
$isIndexed = fn($source): bool => ([] !== $source) && array_keys($source) === range(0, count($source) - 1);

return $isIndexed($source)
// combine the attributes keys with the provided source values.
Expand Down
5 changes: 2 additions & 3 deletions src/TypedCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ public function push(...$values)
*
* @throws InvariantViolation
*/
#[\ReturnTypeWillChange]
public function offsetSet($key, $value)
public function offsetSet($key, $value): void
{
if ($this->keyType !== 'mixed') {
$this->checkKeyType($key);
Expand All @@ -154,7 +153,7 @@ public function offsetSet($key, $value)
* Push an item onto the beginning of the collection.
*
* @param mixed $value
* @param null $key
* @param int|string $key
*
* @return static
* @throws InvariantViolation
Expand Down