diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 72a54d84..47c6867e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,51 +16,36 @@ jobs: env: SYMFONY_REQUIRE: ${{ matrix.symfony }} SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.symfony-deprecations }} - DB_DSN_MYSQL: mysql://test:test@127.0.0.1/craue_form_flow_tests - DB_DSN_POSTGRESQL: pgsql://test:test@127.0.0.1/craue_form_flow_tests + DB_DSN_MYSQL: mysql://test:test@127.0.0.1/craue_form_flow_tests?serverVersion=8.0.44 + DB_DSN_POSTGRESQL: pgsql://test:test@127.0.0.1/craue_form_flow_tests?serverVersion=18.1 DB_DSN_SQLITE: sqlite:///sqlite.db strategy: fail-fast: false matrix: include: - - - php: '7.3' - dependencies: lowest - symfony-deprecations: max[indirect]=5 - php: '8.4' dependencies: highest - - - php: '7.4' - symfony: '5.4.*' - - - php: '8.0' - symfony: '5.4.*' - php: '8.1' - symfony: '5.4.*' + symfony: '6.4.*' - php: '8.2' symfony: '6.4.*' - php: '8.3' symfony: '6.4.*' - - - php: '8.2' - symfony: '7.2.*' - php: '8.4' symfony: '7.4.*' - stability: dev - allow-failure: true - php: '8.4' symfony: '8.0.*' services: mysql: - image: mysql:${{ (matrix.php == '7.3' && '5.7') || '8.0' }} + image: mysql:8.0.44 env: MYSQL_USER: test MYSQL_PASSWORD: test @@ -75,7 +60,7 @@ jobs: - 3306:3306 postgres: - image: postgres + image: postgres:18.1 env: POSTGRES_USER: test POSTGRES_PASSWORD: test diff --git a/.gitignore b/.gitignore index 8751a3b9..ad227c47 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /phpstan.neon /phpunit.xml /vendor +/var diff --git a/CraueFormFlowBundle.php b/CraueFormFlowBundle.php index 1047f6f8..7ed260d0 100644 --- a/CraueFormFlowBundle.php +++ b/CraueFormFlowBundle.php @@ -15,7 +15,7 @@ class CraueFormFlowBundle extends Bundle { /** * @return void */ - public function boot() { + public function boot(): void { /* * Removes all temporary files created while handling file uploads. * Use a shutdown function to clean up even in case of a fatal error. diff --git a/DependencyInjection/CraueFormFlowExtension.php b/DependencyInjection/CraueFormFlowExtension.php index cfce10dc..da98bb30 100644 --- a/DependencyInjection/CraueFormFlowExtension.php +++ b/DependencyInjection/CraueFormFlowExtension.php @@ -7,7 +7,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; /** * Registration of the extension via DI. @@ -23,11 +23,11 @@ class CraueFormFlowExtension extends Extension implements CompilerPassInterface /** * @return void */ - public function load(array $config, ContainerBuilder $container) { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('form_flow.xml'); - $loader->load('twig.xml'); - $loader->load('util.xml'); + public function load(array $config, ContainerBuilder $container): void { + $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('form_flow.php'); + $loader->load('twig.php'); + $loader->load('util.php'); $container->registerForAutoconfiguration(FormFlowInterface::class)->addTag(self::FORM_FLOW_TAG); } @@ -35,7 +35,7 @@ public function load(array $config, ContainerBuilder $container) { /** * @return void */ - public function process(ContainerBuilder $container) { + public function process(ContainerBuilder $container): void { $baseFlowDefinitionMethodCalls = $container->getDefinition('craue.form.flow')->getMethodCalls(); foreach (array_keys($container->findTaggedServiceIds(self::FORM_FLOW_TAG)) as $id) { diff --git a/Form/FormFlow.php b/Form/FormFlow.php index db8adcac..67e53c86 100644 --- a/Form/FormFlow.php +++ b/Form/FormFlow.php @@ -538,9 +538,10 @@ protected function getRequestedStepNumber() { case 'POST': return intval($request->request->get($this->getFormStepKey(), $defaultStepNumber)); case 'GET': - return $this->allowDynamicStepNavigation || $this->allowRedirectAfterSubmit ? - intval($request->get($this->dynamicStepNavigationStepParameter, $defaultStepNumber)) : - $defaultStepNumber; + $result = $request->attributes->get($this->dynamicStepNavigationStepParameter, $request); + $var = ($request !== $result) ? $result : $request->query->get($this->dynamicStepNavigationStepParameter, (string)$defaultStepNumber); + + return ($this->allowDynamicStepNavigation || $this->allowRedirectAfterSubmit) ? (int)$var : $defaultStepNumber; } return $defaultStepNumber; @@ -625,7 +626,8 @@ protected function determineInstanceId() { $instanceId = null; if ($this->allowDynamicStepNavigation || $this->allowRedirectAfterSubmit) { - $instanceId = $request->get($this->getDynamicStepNavigationInstanceParameter()); + $requestData = in_array($request->getMethod(), ['POST', 'PUT'], true) ? $request->request : $request->query; + $instanceId = $requestData->get($this->getDynamicStepNavigationInstanceParameter()); } if ($instanceId === null) { @@ -652,7 +654,7 @@ protected function bindFlow() { $reset = true; } - if (in_array($request->getMethod(), ['POST', 'PUT'], true) && $request->get($this->getFormStepKey()) !== null && !$this->dataManager->exists($this)) { + if (in_array($request->getMethod(), ['POST', 'PUT'], true) && $request->request->get($this->getFormStepKey()) !== null && !$this->dataManager->exists($this)) { // flow is expired, drop posted data and reset $request->request->replace(); $reset = true; diff --git a/Resources/config/form_flow.php b/Resources/config/form_flow.php new file mode 100644 index 00000000..f45a9543 --- /dev/null +++ b/Resources/config/form_flow.php @@ -0,0 +1,47 @@ +services(); + $parameters = $container->parameters(); + $parameters->set('craue.form.flow.class', \Craue\FormFlowBundle\Form\FormFlow::class); + $parameters->set('craue.form.flow.storage.class', \Craue\FormFlowBundle\Storage\SessionStorage::class); + $parameters->set('craue.form.flow.event_listener.previous_step_invalid.class', \Craue\FormFlowBundle\EventListener\PreviousStepInvalidEventListener::class); + $parameters->set('craue.form.flow.event_listener.previous_step_invalid.event', \Craue\FormFlowBundle\Form\FormFlowEvents::PREVIOUS_STEP_INVALID); + $parameters->set('craue.form.flow.event_listener.flow_expired.class', \Craue\FormFlowBundle\EventListener\FlowExpiredEventListener::class); + $parameters->set('craue.form.flow.event_listener.flow_expired.event', \Craue\FormFlowBundle\Form\FormFlowEvents::FLOW_EXPIRED); + + $services->set('craue.form.flow.storage_default', '%craue.form.flow.storage.class%') + ->private() + ->args([service('request_stack')]); + + $services->alias('craue.form.flow.storage', 'craue.form.flow.storage_default') + ->public(); + + $services->set('craue.form.flow.data_manager_default', \Craue\FormFlowBundle\Storage\DataManager::class) + ->private() + ->args([service('craue.form.flow.storage')]); + + $services->alias('craue.form.flow.data_manager', 'craue.form.flow.data_manager_default'); + + $services->set('craue.form.flow', '%craue.form.flow.class%') + ->call('setDataManager', [service('craue.form.flow.data_manager')]) + ->call('setFormFactory', [service('form.factory')]) + ->call('setRequestStack', [service('request_stack')]) + ->call('setEventDispatcher', [service('event_dispatcher')->ignoreOnInvalid()]); + + $services->set('craue.form.flow.form_extension', \Craue\FormFlowBundle\Form\Extension\FormFlowFormExtension::class) + ->tag('form.type_extension', ['extended_type' => \Symfony\Component\Form\Extension\Core\Type\FormType::class]); + + $services->set('craue.form.flow.hidden_field_extension', \Craue\FormFlowBundle\Form\Extension\FormFlowHiddenFieldExtension::class) + ->tag('form.type_extension', ['extended_type' => \Symfony\Component\Form\Extension\Core\Type\HiddenType::class]); + + $services->set('craue.form.flow.event_listener.previous_step_invalid', '%craue.form.flow.event_listener.previous_step_invalid.class%') + ->tag('kernel.event_listener', ['event' => '%craue.form.flow.event_listener.previous_step_invalid.event%', 'method' => 'onPreviousStepInvalid']) + ->call('setTranslator', [service('translator')]); + + $services->set('craue.form.flow.event_listener.flow_expired', '%craue.form.flow.event_listener.flow_expired.class%') + ->tag('kernel.event_listener', ['event' => '%craue.form.flow.event_listener.flow_expired.event%', 'method' => 'onFlowExpired']) + ->call('setTranslator', [service('translator')]); +}; diff --git a/Resources/config/form_flow.xml b/Resources/config/form_flow.xml deleted file mode 100644 index dd9075ff..00000000 --- a/Resources/config/form_flow.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Craue\FormFlowBundle\Form\FormFlow - Craue\FormFlowBundle\Storage\SessionStorage - Craue\FormFlowBundle\EventListener\PreviousStepInvalidEventListener - Craue\FormFlowBundle\Form\FormFlowEvents::PREVIOUS_STEP_INVALID - Craue\FormFlowBundle\EventListener\FlowExpiredEventListener - Craue\FormFlowBundle\Form\FormFlowEvents::FLOW_EXPIRED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/config/twig.php b/Resources/config/twig.php new file mode 100644 index 00000000..fe8c30c9 --- /dev/null +++ b/Resources/config/twig.php @@ -0,0 +1,13 @@ +services(); + $parameters = $container->parameters(); + $parameters->set('craue_twig_extensions.formflow.class', \Craue\FormFlowBundle\Twig\Extension\FormFlowExtension::class); + + $services->set('twig.extension.craue_formflow', '%craue_twig_extensions.formflow.class%') + ->tag('twig.extension') + ->call('setFormFlowUtil', [service('craue_formflow_util')]); +}; diff --git a/Resources/config/twig.xml b/Resources/config/twig.xml deleted file mode 100644 index 5b99d019..00000000 --- a/Resources/config/twig.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Craue\FormFlowBundle\Twig\Extension\FormFlowExtension - - - - - - - - - - - diff --git a/Resources/config/util.php b/Resources/config/util.php new file mode 100644 index 00000000..1297e7a1 --- /dev/null +++ b/Resources/config/util.php @@ -0,0 +1,15 @@ +services(); + $parameters = $container->parameters(); + $parameters->set('craue_formflow.util.class', \Craue\FormFlowBundle\Util\FormFlowUtil::class); + + $services->set('craue_formflow_util', '%craue_formflow.util.class%') + ->public(); + + $services->alias(\Craue\FormFlowBundle\Util\FormFlowUtil::class, 'craue_formflow_util') + ->private(); +}; diff --git a/Resources/config/util.xml b/Resources/config/util.xml deleted file mode 100644 index c3c9442f..00000000 --- a/Resources/config/util.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Craue\FormFlowBundle\Util\FormFlowUtil - - - - - - - - - diff --git a/Storage/DoctrineStorage.php b/Storage/DoctrineStorage.php index 39f942f8..98252da5 100644 --- a/Storage/DoctrineStorage.php +++ b/Storage/DoctrineStorage.php @@ -5,6 +5,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; +use Doctrine\DBAL\Schema\PrimaryKeyConstraint; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; @@ -50,10 +51,19 @@ class DoctrineStorage implements StorageInterface { public function __construct(Connection $conn, StorageKeyGeneratorInterface $storageKeyGenerator) { $this->conn = $conn; $this->storageKeyGenerator = $storageKeyGenerator; - // TODO just call `createSchemaManager()` as soon as DBAL >= 3.1 is required - $this->schemaManager = \method_exists($this->conn, 'createSchemaManager') ? $this->conn->createSchemaManager() : $this->conn->getSchemaManager(); - $this->keyColumn = $this->conn->quoteIdentifier(self::KEY_COLUMN); - $this->valueColumn = $this->conn->quoteIdentifier(self::VALUE_COLUMN); + $this->schemaManager = $this->conn->createSchemaManager(); + + // BC for doctrine/dbal < 4 + /* @phpstan-ignore function.alreadyNarrowedType */ + if(method_exists($this->conn, 'quoteSingleIdentifier')) { + $this->keyColumn = $this->conn->quoteSingleIdentifier(self::KEY_COLUMN); + $this->valueColumn = $this->conn->quoteSingleIdentifier(self::VALUE_COLUMN); + } else { + /* @phpstan-ignore method.deprecated */ + $this->keyColumn = $this->conn->quoteIdentifier(self::KEY_COLUMN); + /* @phpstan-ignore method.deprecated */ + $this->valueColumn = $this->conn->quoteIdentifier(self::VALUE_COLUMN); + } } /** @@ -134,15 +144,7 @@ private function getRawValueForKey($key) { ->setParameter('key', $this->generateKey($key)) ; - // TODO just call `executeQuery()` as soon as DBAL >= 2.13.1 is required - $result = \method_exists($qb, 'executeQuery') ? $qb->executeQuery() : $qb->execute(); - - // TODO remove as soon as Doctrine DBAL >= 3.0 is required - if (!\method_exists($result, 'fetchOne')) { - return $result->fetchColumn(); - } - - return $result->fetchOne(); + return $qb->executeQuery()->fetchOne(); } private function tableExists() { @@ -155,12 +157,23 @@ private function createTable() { new Column($this->valueColumn, Type::getType(Types::TEXT)), ]); - $table->setPrimaryKey([$this->keyColumn]); + // BC for doctrine/dbal < 4 + /* @phpstan-ignore function.alreadyNarrowedType */ + if (method_exists($table, 'addPrimaryKeyConstraint')) { + $table->addPrimaryKeyConstraint( + PrimaryKeyConstraint::editor() + ->setUnquotedColumnNames($this->keyColumn) + ->create() + ); + } else { + /* @phpstan-ignore method.deprecated */ + $table->setPrimaryKey([$this->keyColumn]); + } + $this->schemaManager->createTable($table); } private function generateKey($key) { return $this->storageKeyGenerator->generate($key); } - } diff --git a/Tests/IntegrationTestBundle/DependencyInjection/Compiler/DoctrineStorageCompilerPass.php b/Tests/IntegrationTestBundle/DependencyInjection/Compiler/DoctrineStorageCompilerPass.php index 4e22ff38..d8471874 100644 --- a/Tests/IntegrationTestBundle/DependencyInjection/Compiler/DoctrineStorageCompilerPass.php +++ b/Tests/IntegrationTestBundle/DependencyInjection/Compiler/DoctrineStorageCompilerPass.php @@ -5,6 +5,7 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; /** @@ -18,8 +19,8 @@ class DoctrineStorageCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container) : void { if ($container->has('doctrine.dbal.default_connection')) { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config')); - $loader->load('doctrine_storage.xml'); + $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config')); + $loader->load('doctrine_storage.php'); } } diff --git a/Tests/IntegrationTestBundle/Resources/config/controller.php b/Tests/IntegrationTestBundle/Resources/config/controller.php new file mode 100644 index 00000000..d2f766db --- /dev/null +++ b/Tests/IntegrationTestBundle/Resources/config/controller.php @@ -0,0 +1,12 @@ +services(); + $parameters = $container->parameters(); + + $services->load('Craue\\FormFlowBundle\\Tests\\IntegrationTestBundle\\Controller\\', '../../Controller/*') + ->autowire() + ->autoconfigure(); +}; diff --git a/Tests/IntegrationTestBundle/Resources/config/controller.xml b/Tests/IntegrationTestBundle/Resources/config/controller.xml deleted file mode 100644 index b4fc4542..00000000 --- a/Tests/IntegrationTestBundle/Resources/config/controller.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/Tests/IntegrationTestBundle/Resources/config/doctrine_storage.php b/Tests/IntegrationTestBundle/Resources/config/doctrine_storage.php new file mode 100644 index 00000000..ce7d45d3 --- /dev/null +++ b/Tests/IntegrationTestBundle/Resources/config/doctrine_storage.php @@ -0,0 +1,24 @@ +services(); + $parameters = $container->parameters(); + + $services->set('craue.form.flow.storageKeyGenerator', \Craue\FormFlowBundle\Storage\UserSessionStorageKeyGenerator::class) + ->args([ + service('security.token_storage'), + service('request_stack'), + ]); + + $services->set('craue.form.flow.storage.doctrine', \Craue\FormFlowBundle\Storage\DoctrineStorage::class) + ->private() + ->args([ + service('doctrine.dbal.default_connection'), + service('craue.form.flow.storageKeyGenerator'), + ]); + + $services->alias('craue.form.flow.storage', 'craue.form.flow.storage.doctrine') + ->public(); +}; diff --git a/Tests/IntegrationTestBundle/Resources/config/doctrine_storage.xml b/Tests/IntegrationTestBundle/Resources/config/doctrine_storage.xml deleted file mode 100644 index 0e50f4c0..00000000 --- a/Tests/IntegrationTestBundle/Resources/config/doctrine_storage.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/Tests/IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.php b/Tests/IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.php new file mode 100644 index 00000000..890baefb --- /dev/null +++ b/Tests/IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.php @@ -0,0 +1,12 @@ +services(); + $parameters = $container->parameters(); + + $services->load('Craue\\FormFlowBundle\\Tests\\IntegrationTestBundle\\Form\\', '../../Form/*') + ->public() + ->autoconfigure(); +}; diff --git a/Tests/IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.xml b/Tests/IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.xml deleted file mode 100644 index 07615d04..00000000 --- a/Tests/IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/Tests/IntegrationTestBundle/Resources/config/form_flow_with_parent_service.php b/Tests/IntegrationTestBundle/Resources/config/form_flow_with_parent_service.php new file mode 100644 index 00000000..b3e443d9 --- /dev/null +++ b/Tests/IntegrationTestBundle/Resources/config/form_flow_with_parent_service.php @@ -0,0 +1,12 @@ +services(); + $parameters = $container->parameters(); + + $services->load('Craue\\FormFlowBundle\\Tests\\IntegrationTestBundle\\Form\\', '../../Form/*') + ->parent('craue.form.flow') + ->public(); +}; diff --git a/Tests/IntegrationTestBundle/Resources/config/form_flow_with_parent_service.xml b/Tests/IntegrationTestBundle/Resources/config/form_flow_with_parent_service.xml deleted file mode 100644 index 870dab5f..00000000 --- a/Tests/IntegrationTestBundle/Resources/config/form_flow_with_parent_service.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/Tests/config/config.yml b/Tests/config/config.yml index f8b78166..ad99013f 100644 --- a/Tests/config/config.yml +++ b/Tests/config/config.yml @@ -1,6 +1,6 @@ imports: - - { resource: '@CraueFormFlowBundle/Resources/config/form_flow.xml' } - - { resource: '@IntegrationTestBundle/Resources/config/controller.xml' } + - { resource: '@CraueFormFlowBundle/Resources/config/form_flow.php' } + - { resource: '@IntegrationTestBundle/Resources/config/controller.php' } - { resource: config_hacks.php } framework: @@ -27,4 +27,3 @@ security: twig: debug: '%kernel.debug%' strict_variables: '%kernel.debug%' - exception_controller: ~ diff --git a/Tests/config/config_flows_with_autoconfiguration.yml b/Tests/config/config_flows_with_autoconfiguration.yml index c4614521..d9058ba2 100644 --- a/Tests/config/config_flows_with_autoconfiguration.yml +++ b/Tests/config/config_flows_with_autoconfiguration.yml @@ -1,3 +1,3 @@ imports: - { resource: config.yml } - - { resource: '@IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.xml' } + - { resource: '@IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.php' } diff --git a/Tests/config/config_flows_with_parent_service.yml b/Tests/config/config_flows_with_parent_service.yml index 27defdfc..3c53a1d8 100644 --- a/Tests/config/config_flows_with_parent_service.yml +++ b/Tests/config/config_flows_with_parent_service.yml @@ -1,3 +1,3 @@ imports: - { resource: config.yml } - - { resource: '@IntegrationTestBundle/Resources/config/form_flow_with_parent_service.xml' } + - { resource: '@IntegrationTestBundle/Resources/config/form_flow_with_parent_service.php' } diff --git a/composer.json b/composer.json index 35503b23..fa429cf7 100644 --- a/composer.json +++ b/composer.json @@ -21,42 +21,48 @@ ], "homepage": "https://github.com/craue/CraueFormFlowBundle", "require": { - "php": "^7.3 || ^8", - "symfony/config": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/dependency-injection": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/form": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/http-foundation": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/http-kernel": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/options-resolver": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/security-core": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/translation": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/validator": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/yaml": "^5.4 || ^6.4 || ^7.2 || ^8.0" + "php": "^7.4 || ^8.1", + "symfony/config": "^6.4 || ^7.2 || ^8.0", + "symfony/dependency-injection": "^6.4 || ^7.2 || ^8.0", + "symfony/event-dispatcher": "^6.4 || ^7.2 || ^8.0", + "symfony/form": "^6.4 || ^7.2 || ^8.0", + "symfony/http-foundation": "^6.4 || ^7.2 || ^8.0", + "symfony/http-kernel": "^6.4 || ^7.2 || ^8.0", + "symfony/options-resolver": "^6.4 || ^7.2 || ^8.0", + "symfony/security-core": "^6.4 || ^7.2 || ^8.0", + "symfony/translation": "^6.4 || ^7.2 || ^8.0", + "symfony/validator": "^6.4 || ^7.2 || ^8.0", + "symfony/yaml": "^6.4 || ^7.2 || ^8.0" }, "require-dev": { - "craue/translations-tests": "^1.1", + "craue/translations-tests": "dev-symfony8 as 1.2", "doctrine/collections": "^1.8 || ^2.1", "doctrine/common": "^2.9 || ^3.0", - "doctrine/dbal": "^2.10 || ^3.0", - "doctrine/doctrine-bundle": "^1.10 || ^2.0", + "doctrine/dbal": "^3.1 || ^4.4", + "doctrine/doctrine-bundle": "^1.10 || ^2.0 || ^3.2", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.10", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", "phpstan/phpstan-symfony": "^1.1", "phpunit/phpunit": "^9.5", - "symfony/browser-kit": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/css-selector": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/framework-bundle": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/mime": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/phpunit-bridge": "^7.3", - "symfony/security-bundle": "^5.4 || ^6.4 || ^7.2 || ^8.0", - "symfony/twig-bundle": "^5.4 || ^6.4 || ^7.2 || ^8.0" + "symfony/browser-kit": "^6.4 || ^7.2 || ^8.0", + "symfony/css-selector": "^6.4 || ^7.2 || ^8.0", + "symfony/framework-bundle": "^6.4 || ^7.2 || ^8.0", + "symfony/mime": "^6.4 || ^7.2 || ^8.0", + "symfony/phpunit-bridge": "^7.3 || ^8.0", + "symfony/security-bundle": "^6.4 || ^7.2 || ^8.0", + "symfony/twig-bundle": "^6.4 || ^7.2 || ^8.0" }, "conflict": { "doctrine/dbal": "<2.10" }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/relthyg/CraueTranslationsTests" + } + ], "minimum-stability": "stable", "autoload": { "psr-4": { diff --git a/phpstan-config.neon b/phpstan-config.neon index 18ff4872..e2ae63d0 100644 --- a/phpstan-config.neon +++ b/phpstan-config.neon @@ -10,25 +10,3 @@ parameters: - message: '#^Unsafe usage of new static\(\)\.$#' path: Form/Step.php - # TODO remove as soon as Doctrine DBAL >= 2.13.1 is required - - - message: """ - #^Call to deprecated method execute\\(\\) of class Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder\\: - Use \\{@see executeQuery\\(\\)\\} or \\{@see executeStatement\\(\\)\\} instead\\.$# - """ - path: Storage/DoctrineStorage.php - # TODO remove as soon as Doctrine DBAL >= 3.0 is required - - - message: '#^Cannot call method fetchColumn\(\) on Doctrine\\DBAL\\Result\|int\|string\.$#' - path: Storage/DoctrineStorage.php - # TODO remove as soon as Doctrine DBAL >= 3.1 is required - - - message: "#^Call to function method_exists\\(\\) with Doctrine\\\\DBAL\\\\Connection and 'createSchemaManager' will always evaluate to true\\.$#" - path: Storage/DoctrineStorage.php - # TODO remove as soon as Doctrine DBAL >= 3.1 is required - - - message: """ - #^Call to deprecated method getSchemaManager\\(\\) of class Doctrine\\\\DBAL\\\\Connection\\: - Use \\{@see createSchemaManager\\(\\)\\} instead\\.$# - """ - path: Storage/DoctrineStorage.php