Skip to content

Commit

Permalink
Allow Symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Dec 3, 2023
1 parent 0e34cf9 commit 2fc711e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 33 deletions.
10 changes: 2 additions & 8 deletions Form/Extension/FormFlowFormExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ public static function getExtendedTypes() : iterable {
return [FormType::class];
}

/**
* @return void
*/
public function configureOptions(OptionsResolver $resolver) {
public function configureOptions(OptionsResolver $resolver): void {
$resolver->setDefined([
'flow_instance',
'flow_instance_key',
Expand All @@ -39,10 +36,7 @@ public function configureOptions(OptionsResolver $resolver) {
]);
}

/**
* @return void
*/
public function buildForm(FormBuilderInterface $builder, array $options) {
public function buildForm(FormBuilderInterface $builder, array $options): void {
if (array_key_exists('flow_instance', $options) && array_key_exists('flow_instance_key', $options)) {
$builder->add($options['flow_instance_key'], HiddenType::class, [
'data' => $options['flow_instance'],
Expand Down
10 changes: 2 additions & 8 deletions Form/Extension/FormFlowHiddenFieldExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,14 @@ public static function getExtendedTypes() : iterable {
return [HiddenType::class];
}

/**
* @return void
*/
public function configureOptions(OptionsResolver $resolver) {
public function configureOptions(OptionsResolver $resolver): void {
$resolver->setDefined([
'flow_instance_key',
'flow_step_key',
]);
}

/**
* @return void
*/
public function finishView(FormView $view, FormInterface $form, array $options) {
public function finishView(FormView $view, FormInterface $form, array $options): void {
if (array_key_exists('flow_instance_key', $options) && $view->vars['name'] === $options['flow_instance_key']) {
$view->vars['value'] = $options['data'];
$view->vars['full_name'] = $options['flow_instance_key'];
Expand Down
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
"homepage": "https://github.com/craue/CraueFormFlowBundle",
"require": {
"php": "^7.3 || ^8",
"symfony/config": "^4.4 || ^5.4 || ^6.3",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.3",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.3",
"symfony/form": "^4.4 || ^5.4 || ^6.3",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.3",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.3",
"symfony/options-resolver": "^4.4 || ^5.4 || ^6.3",
"symfony/security-core": "^4.4 || ^5.4 || ^6.3",
"symfony/translation": "^4.4 || ^5.4 || ^6.3",
"symfony/validator": "^4.4 || ^5.4 || ^6.3",
"symfony/yaml": "^4.4 || ^5.4 || ^6.3"
"symfony/config": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/form": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/options-resolver": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/security-core": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/translation": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/validator": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/yaml": "^4.4 || ^5.4 || ^6.3 || ^7.0"
},
"require-dev": {
"craue/translations-tests": "^1.1",
Expand All @@ -45,12 +45,12 @@
"phpstan/phpstan-strict-rules": "^1.1",
"phpstan/phpstan-symfony": "^1.1",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.3",
"symfony/css-selector": "^4.4 || ^5.4 || ^6.3",
"symfony/mime": "^4.4 || ^5.4 || ^6.3",
"symfony/phpunit-bridge": "^6.3",
"symfony/security-bundle": "^4.4 || ^5.4 || ^6.3",
"symfony/twig-bundle": "^4.4 || ^5.4 || ^6.3"
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/css-selector": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/mime": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/phpunit-bridge": "^6.3 || ^7.0",
"symfony/security-bundle": "^4.4 || ^5.4 || ^6.3 || ^7.0",
"symfony/twig-bundle": "^4.4 || ^5.4 || ^6.3 || ^7.0"
},
"minimum-stability": "stable",
"autoload": {
Expand Down

0 comments on commit 2fc711e

Please sign in to comment.