From df81959a23e94803935159abfde422c444965067 Mon Sep 17 00:00:00 2001 From: Serhii Donii Date: Tue, 4 Jun 2024 17:45:45 +0300 Subject: [PATCH] feat(o10r-symfony-template-154): Upgrade doctrine/orm to 3.0 --- phpstan.neon | 1 - tools/prepare-configs.php | 12 +++++++++--- tools/update_versions.sh | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 tools/update_versions.sh diff --git a/phpstan.neon b/phpstan.neon index f03a9b0..309bd4f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,4 +2,3 @@ parameters: level: max paths: - src - diff --git a/tools/prepare-configs.php b/tools/prepare-configs.php index 38fe752..e1f606b 100644 --- a/tools/prepare-configs.php +++ b/tools/prepare-configs.php @@ -6,12 +6,18 @@ require_once __DIR__ . '/../vendor/autoload.php'; -$doctrineVersion = interface_exists('Doctrine\DBAL\ServerVersionProvider') ? '4.0' : '2'; +enum DoctrineType { + case doctrine3; + case doctrine4; +} + +$doctrineVersion = interface_exists('Doctrine\DBAL\ServerVersionProvider') ? + DoctrineType::doctrine4 : DoctrineType::doctrine3; -if ('4.0' === $doctrineVersion) { +if (DoctrineType::doctrine4 === $doctrineVersion) { $skipPath = __DIR__ . '/../src/Doctrine/Driver/IamDecorator.php'; } else { - $skipPath = __DIR__ . '/../src/Doctrine/Driver/IamDecoratorDoctrine30.php'; + $skipPath = __DIR__ . '/../src/Doctrine/Driver/IamDecoratorDoctrine40.php'; } $neonFile = __DIR__ . '/../phpstan.neon'; diff --git a/tools/update_versions.sh b/tools/update_versions.sh new file mode 100644 index 0000000..18cbfa3 --- /dev/null +++ b/tools/update_versions.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +#!/usr/bin/env bash + +rm -rf tests/App/var/cache/* +symfonyVersion=${1:-6.4.*} +dbalVersion=${2:-3.0} + +rm -rf vendor composer.lock; +composer require symfony/config:$symfonyVersion --no-update --no-scripts +composer require symfony/dependency-injection:$symfonyVersion --no-update --no-scripts +composer require symfony/http-kernel:$symfonyVersion --no-update --no-scripts +composer require symfony/cache:$symfonyVersion --no-update --no-scripts +composer require doctrine/dbal:$dbalVersion --no-update --no-scripts -W +composer require --dev symfony/yaml:$symfonyVersion --no-update --no-scripts +composer require --dev symfony/phpunit-bridge:$symfonyVersion --no-update --no-scripts +composer require --dev symfony/framework-bundle:$symfonyVersion --no-update --no-scripts + +composer install +