From 694ec6e590b3e35fafe91eb77f298345b8b5738d Mon Sep 17 00:00:00 2001 From: david Date: Mon, 12 Jul 2021 16:59:00 +0200 Subject: [PATCH] Skip releases without a semver compliant version string in ComposerRepositoryTransformer --- src/Transformer/ComposerRepositoryTransformer.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Transformer/ComposerRepositoryTransformer.php b/src/Transformer/ComposerRepositoryTransformer.php index be92fa3..38d5af3 100644 --- a/src/Transformer/ComposerRepositoryTransformer.php +++ b/src/Transformer/ComposerRepositoryTransformer.php @@ -19,6 +19,7 @@ use SatisPress\ReleaseManager; use SatisPress\Repository\PackageRepository; use SatisPress\VersionParser; +use UnexpectedValueException; /** * Composer repository transformer class. @@ -165,6 +166,15 @@ protected function transform_item( Package $package ): array { 'version' => $version, ] ); + } catch ( UnexpectedValueException $e ) { + $this->logger->error( + 'Invalid version string for {package}:{version}.', + [ + 'exception' => $e, + 'package' => $package->get_name(), + 'version' => $version, + ] + ); } }