diff --git a/spec/Packagist/Api/Result/PackageSpec.php b/spec/Packagist/Api/Result/PackageSpec.php index 7746267..089b09f 100644 --- a/spec/Packagist/Api/Result/PackageSpec.php +++ b/spec/Packagist/Api/Result/PackageSpec.php @@ -29,6 +29,8 @@ public function let(Maintainer $maintainer, Version $version, Downloads $downloa 'dependents' => 42, 'github_stars' => 3086, 'github_forks' => 1124, + // A dynamic property, causes deprecation warnings in PHP 8.2+ and is now ignored in AbstractResult + 'supports_cheese' => true, ]); } diff --git a/src/Packagist/Api/Result/AbstractResult.php b/src/Packagist/Api/Result/AbstractResult.php index c51c5b9..58fdceb 100644 --- a/src/Packagist/Api/Result/AbstractResult.php +++ b/src/Packagist/Api/Result/AbstractResult.php @@ -16,6 +16,9 @@ public function fromArray(array $data): void if (null === $value && !$this->isNullable($property)) { continue; } + if (!property_exists($this, $property)) { + continue; + } $this->$property = $value; } }