From 031742a69cc7aa2163efe1018503b14129223ed5 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo <1102197+priyadi@users.noreply.github.com> Date: Sat, 6 Jul 2024 11:40:57 +0700 Subject: [PATCH] build: satisfy latest phpstan (#82) * build: satisfy latest phpstan * fix * fix --- CHANGELOG.md | 1 + composer.json | 4 ++-- src/ObjectCache/ObjectCache.php | 4 ++-- src/Transformer/Context/PresetMapping.php | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a31ef98..3b7fa9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * fix: exclude `symfony/property-info` version 7.1.2 and 6.4.9, https://github.com/symfony/symfony/issues/57634 +* build: satisfy latest phpstan ## 1.5.2 diff --git a/composer.json b/composer.json index 96763e3..75c5d85 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "symfony/console": "^6.4 || ^7.0", "symfony/dependency-injection": "^6.4 || ^7.0", "symfony/property-access": "^6.4 || ^7.0", - "symfony/property-info": "^6.4 || ^7.0, !=7.1.2, !=6.4.9", + "symfony/property-info": "6.4.0 - 6.4.8 || 7.0.0 - 7.0.8 || 7.1.0 - 7.1.1 || ^7.2", "symfony/serializer": "^6.4 || ^7.0", "symfony/service-contracts": "^3.0", "symfony/var-exporter": "^6.4.1 || ^6.5 || ^7.0.1 || ^7.1" @@ -48,7 +48,7 @@ "doctrine/orm": "^2.14 || ^3.0", "doctrine/persistence": "^3.1", "ekino/phpstan-banned-code": "^1.0", - "phpstan/phpstan": "^1.10.50", + "phpstan/phpstan": "^1.11.6", "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-phpunit": "^1.3", "phpunit/phpunit": "^10.5", diff --git a/src/ObjectCache/ObjectCache.php b/src/ObjectCache/ObjectCache.php index 326133a..d928d7e 100644 --- a/src/ObjectCache/ObjectCache.php +++ b/src/ObjectCache/ObjectCache.php @@ -74,7 +74,7 @@ public function preCache(mixed $source, Type $targetType): void $this->preCache[$source] = $arrayObject; } - $this->preCache->offsetGet($source)?->offsetSet($targetTypeString, true); + $this->preCache->offsetGet($source)->offsetSet($targetTypeString, true); } public function undoPreCache(mixed $source, Type $targetType): void @@ -165,7 +165,7 @@ public function saveTarget( $this->cache[$source] = $arrayObject; } - $this->cache->offsetGet($source)?->offsetSet($targetTypeString, $target); + $this->cache->offsetGet($source)->offsetSet($targetTypeString, $target); // remove precache diff --git a/src/Transformer/Context/PresetMapping.php b/src/Transformer/Context/PresetMapping.php index 2882037..d46ccaf 100644 --- a/src/Transformer/Context/PresetMapping.php +++ b/src/Transformer/Context/PresetMapping.php @@ -62,7 +62,7 @@ public function mergeFrom(self $presetMapping): void } foreach ($classToTargetMapping as $class => $target) { - $this->mappings->offsetGet($source)?->offsetSet($class, $target); + $this->mappings->offsetGet($source)->offsetSet($class, $target); } } }