Skip to content

Commit

Permalink
feat: drop support PHP < 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris8934 committed Oct 23, 2024
1 parent 445d042 commit 7da9a15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]);
};
21 changes: 11 additions & 10 deletions src/Doctrine/DBAL/Types/CronExpressionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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) {
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 7da9a15

Please sign in to comment.