Skip to content

Commit

Permalink
Ignore false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
LaravelFreelancerNL committed Sep 18, 2024
1 parent 59af0f7 commit 45fdc88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Eloquent/Concerns/IsAranguentModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ protected function insertAndSetId(IlluminateEloquentBuilder $query, $attributes)
$matches = [];
preg_match('/\/(.*)$/', $id, $matches);

$this->setAttribute('id', $matches[1]);
// We know the exact string format for $matches when the attribute is _id
/** @var array{0: string, 1: string} $matches */
$this->setAttribute('id', $matches[1]); // @phpstan-ignore arrayUnpacking.stringOffset
}
if ($keyName === 'id' || $keyName === '_key') {
$this->updateIdWithKey($id);
Expand Down

0 comments on commit 45fdc88

Please sign in to comment.