From 13425b13faa4eb74b72760337a4423e8e5383411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Robles?= Date: Thu, 10 Aug 2023 16:48:04 +0200 Subject: [PATCH] fix phpstan errors --- src/PropertiesMapper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PropertiesMapper.php b/src/PropertiesMapper.php index 9dd1335..492684a 100644 --- a/src/PropertiesMapper.php +++ b/src/PropertiesMapper.php @@ -58,9 +58,9 @@ public function run(): static continue; } - $propertyTypes = $propertyInfoExtractor->getTypes($this->dataClass, $propertyKey); + $propertyTypes = $propertyInfoExtractor->getTypes($this->dataClass, $propertyKey) ?? []; - if (! $propertyTypes || count($propertyTypes) === 0) { + if (count($propertyTypes) === 0) { $this->data[$propertyKey] = $value; continue; @@ -140,7 +140,7 @@ protected function normalisePropertyKey(string $key): string|null /** * Map data value into model instance. * - * @param class-string<\Illuminate\Database\Eloquent\Model> $model + * @param class-string<\Illuminate\Database\Eloquent\Model> $modelClass */ protected function mapIntoModel(string $modelClass, string $propertyKey, mixed $value) {