Skip to content

Commit 24de133

Browse files
authored
Fix illegal offset type (#3)
1 parent de7a89f commit 24de133

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: true
1717
matrix:
18-
php: [7.2, 7.3, 7.4, 8.0, 8.1]
18+
php: [7.3, 7.4, 8.0, 8.1]
1919
stability: [lowest, highest]
2020

2121
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
}
1818
},
1919
"require": {
20-
"php": "^7.2 || ^8.0",
21-
"illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0",
22-
"illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0"
20+
"php": "^7.3 || ^8.0",
21+
"illuminate/database": "^8.35 || ^9.0",
22+
"illuminate/support": "^8.35 || ^9.0"
2323
},
2424
"require-dev": {
2525
"mockery/mockery": "~1.3.3 || ^1.4.2",
2626
"nunomaduro/larastan": "^1.0",
27-
"orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0",
27+
"orchestra/testbench": "^6.0 || ^7.0",
2828
"phpunit/phpunit": "^8.0,<8.5.12 || ^9.3.3",
2929
"zing/coding-standard": "^5.3"
3030
},

ecs.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Zing\CodingStandard\Set\ECSSetList;
88

99
return static function (ContainerConfigurator $containerConfigurator): void {
10-
$containerConfigurator->import(ECSSetList::PHP_72);
10+
$containerConfigurator->import(ECSSetList::PHP_73);
1111
$containerConfigurator->import(ECSSetList::CUSTOM);
1212

1313
$parameters = $containerConfigurator->parameters();

rector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
return static function (ContainerConfigurator $containerConfigurator): void {
1818
$containerConfigurator->import(RectorSetList::CUSTOM);
1919
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY);
20-
$containerConfigurator->import(LevelSetList::UP_TO_PHP_72);
20+
$containerConfigurator->import(LevelSetList::UP_TO_PHP_73);
2121

2222
$parameters = $containerConfigurator->parameters();
2323
$parameters->set(

src/Relations/BelongsToOne.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function match(array $models, Collection $results, $relation): array
5050
// children back to their parent using the dictionary and the keys on the
5151
// parent models. Then we should return these hydrated models back out.
5252
foreach ($models as $model) {
53-
$key = $model->getAttribute($this->parentKey);
53+
$key = $this->getDictionaryKey($model->getAttribute($this->parentKey));
5454
if (isset($dictionary[$key])) {
5555
$value = $dictionary[$key];
5656
$model->setRelation($relation, reset($value));

src/Relations/MorphToOne.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function match(array $models, Collection $results, $relation): array
5050
// children back to their parent using the dictionary and the keys on the
5151
// parent models. Then we should return these hydrated models back out.
5252
foreach ($models as $model) {
53-
$key = $model->getAttribute($this->parentKey);
53+
$key = $this->getDictionaryKey($model->getAttribute($this->parentKey));
5454
if (isset($dictionary[$key])) {
5555
$value = $dictionary[$key];
5656
$model->setRelation($relation, reset($value));

0 commit comments

Comments
 (0)