From 7da9a154b1d614f4fc1ece9472566880ef76497d Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Wed, 23 Oct 2024 09:57:10 +0200 Subject: [PATCH] feat: drop support PHP < 8.1 --- ecs.php | 3 +-- .../DBAL/Types/CronExpressionType.php | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ecs.php b/ecs.php index cd1db6b..d463917 100644 --- a/ecs.php +++ b/ecs.php @@ -3,11 +3,10 @@ declare(strict_types=1); use Symplify\EasyCodingStandard\Config\ECSConfig; -use Symplify\EasyCodingStandard\ValueObject\Option; return static function (ECSConfig $config): void { $config->import('vendor/sylius-labs/coding-standard/ecs.php'); - $config->parameters()->set(Option::PATHS, [ + $config->paths([ 'src', 'tests' ]); }; diff --git a/src/Doctrine/DBAL/Types/CronExpressionType.php b/src/Doctrine/DBAL/Types/CronExpressionType.php index 04458ee..a85baf2 100644 --- a/src/Doctrine/DBAL/Types/CronExpressionType.php +++ b/src/Doctrine/DBAL/Types/CronExpressionType.php @@ -22,6 +22,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform): st /** * @param mixed $value + * @throws InvalidType|ValueNotConvertible */ public function convertToPHPValue($value, AbstractPlatform $platform): ?CronExpression { @@ -32,12 +33,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?CronExpr if (!is_string($value)) { if (class_exists(InvalidType::class)) { throw InvalidType::new($value, CronExpression::class, ['string']); - } else { - /** - * @psalm-suppress UndefinedMethod - */ - throw ConversionException::conversionFailedInvalidType($value, CronExpression::class, ['string']); } + + /** + * @psalm-suppress UndefinedMethod + */ + throw ConversionException::conversionFailedInvalidType($value, CronExpression::class, ['string']); } if ('' === $value) { @@ -49,12 +50,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?CronExpr } catch (\Throwable $e) { if (class_exists(ValueNotConvertible::class)) { throw ValueNotConvertible::new($value, CronExpression::class, null, $e); - } else { - /** - * @psalm-suppress UndefinedMethod - */ - throw ConversionException::conversionFailed($value, CronExpression::class, $e); } + + /** + * @psalm-suppress UndefinedMethod + */ + throw ConversionException::conversionFailed($value, CronExpression::class, $e); } }