Skip to content

Commit 2aceea8

Browse files
committed
feature #2973 [Autocomplete][Chartjs][Cropperjs][Dropzone][Icons][LazyImage][LiveComponent][Map][Notify][React][StimulusBundle][Svelte][Swup][TogglePassword][Toolkit][Translator][Turbo][TwigComponent][Typed][Vue] Add support for Symfony 8 (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [Autocomplete][Chartjs][Cropperjs][Dropzone][Icons][LazyImage][LiveComponent][Map][Notify][React][StimulusBundle][Svelte][Swup][TogglePassword][Toolkit][Translator][Turbo][TwigComponent][Typed][Vue] Add support for Symfony 8 | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> As suggested in symfony/webpack-encore-bundle#248, I added new jobs for testing explicit Symfony version. The Symfony 8.0.x-dev job is failing because it needs zenstruck/foundry#891, which is not possible to use because Foundry is not compatible with Symfony 8 yet (opened zenstruck/foundry#960) There is a lot of changes, but these are only small modifications (composer.json, CHANGELOG.md, and fixing method typings) I also updated the deprecated packages, that's fine, it makes things easier for us to handle Commits ------- 998de8d Add support for Symfony 8
2 parents 337b860 + 998de8d commit 2aceea8

File tree

80 files changed

+342
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+342
-230
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,17 @@ jobs:
4646
- php-version: '8.1'
4747
symfony-version: '6.4.*'
4848
os: 'windows-latest'
49+
# Explicit Symfony versions
50+
- php-version: '8.1'
51+
symfony-version: '6.4.*'
52+
- php-version: '8.2'
53+
symfony-version: '7.3.*' # TODO: change to '7.4' when Symfony 7.4 is released
54+
- php-version: '8.4'
55+
symfony-version: '8.0.x-dev' # TODO: change to '8.0' when Symfony 8.0 is released
56+
minimum-stability: 'dev' # TODO: remove when Symfony 8.0 is released
4957

5058
env:
51-
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=5.4' }}
59+
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=5.4' }} # TODO: To change to '>=6.4' in 3.x
5260
steps:
5361
- uses: actions/checkout@v4
5462

src/Autocomplete/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 2.29.0
4+
5+
- Add Symfony 8 support
6+
37
## 2.28.0
48

59
- Default plugins like `clear_button` or `remove_button` can now be removed when setting their value to `false` in the `tom_select_options.plugins` option, for example:

src/Autocomplete/composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@
2525
},
2626
"require": {
2727
"php": ">=8.1",
28-
"symfony/dependency-injection": "^6.3|^7.0",
28+
"symfony/dependency-injection": "^6.3|^7.0|^8.0",
2929
"symfony/deprecation-contracts": "^2.5|^3",
30-
"symfony/http-foundation": "^6.3|^7.0",
31-
"symfony/http-kernel": "^6.3|^7.0",
32-
"symfony/property-access": "^6.3|^7.0"
30+
"symfony/http-foundation": "^6.3|^7.0|^8.0",
31+
"symfony/http-kernel": "^6.3|^7.0|^8.0",
32+
"symfony/property-access": "^6.3|^7.0|^8.0"
3333
},
3434
"require-dev": {
3535
"doctrine/collections": "^1.6.8|^2.0",
3636
"doctrine/doctrine-bundle": "^2.4.3",
3737
"doctrine/orm": "^2.9.4|^3.0",
3838
"fakerphp/faker": "^1.22",
3939
"mtdowling/jmespath.php": "^2.6",
40-
"symfony/form": "^6.3|^7.0",
41-
"symfony/options-resolver": "^6.3|^7.0",
42-
"symfony/framework-bundle": "^6.3|^7.0",
40+
"symfony/form": "^6.3|^7.0|^8.0",
41+
"symfony/options-resolver": "^6.3|^7.0|^8.0",
42+
"symfony/framework-bundle": "^6.3|^7.0|^8.0",
4343
"symfony/maker-bundle": "^1.40",
44-
"symfony/phpunit-bridge": "^6.3|^7.0",
45-
"symfony/process": "^6.3|^7.0",
46-
"symfony/security-bundle": "^6.3|^7.0",
47-
"symfony/twig-bundle": "^6.3|^7.0",
48-
"symfony/uid": "^6.3|^7.0",
44+
"symfony/phpunit-bridge": "^6.3|^7.0|^8.0",
45+
"symfony/process": "^6.3|^7.0|^8.0",
46+
"symfony/security-bundle": "^6.3|^7.0|^8.0",
47+
"symfony/twig-bundle": "^6.3|^7.0|^8.0",
48+
"symfony/uid": "^6.3|^7.0|^8.0",
4949
"twig/twig": "^2.14.7|^3.0.4",
5050
"zenstruck/browser": "^1.1",
5151
"zenstruck/foundry": "^2.0"

src/Autocomplete/doc/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Or, create the field by hand::
112112
#[AsEntityAutocompleteField]
113113
class FoodAutocompleteField extends AbstractType
114114
{
115-
public function configureOptions(OptionsResolver $resolver)
115+
public function configureOptions(OptionsResolver $resolver): void
116116
{
117117
$resolver->setDefaults([
118118
'class' => Food::class,
@@ -512,7 +512,7 @@ your ``configureOptions()`` method:
512512

513513
.. code-block:: diff
514514
515-
public function configureOptions(OptionsResolver $resolver)
515+
public function configureOptions(OptionsResolver $resolver): void
516516
{
517517
$resolver->setDefaults([
518518
'class' => Food::class,

src/Autocomplete/src/Form/ParentEntityAutocompleteType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
) {
3434
}
3535

36-
public function buildForm(FormBuilderInterface $builder, array $options)
36+
public function buildForm(FormBuilderInterface $builder, array $options): void
3737
{
3838
$formType = $builder->getType()->getInnerType();
3939
$attribute = AsEntityAutocompleteField::getInstance($formType::class);
@@ -52,7 +52,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
5252
->setDataMapper($this);
5353
}
5454

55-
public function finishView(FormView $view, FormInterface $form, array $options)
55+
public function finishView(FormView $view, FormInterface $form, array $options): void
5656
{
5757
// Add a custom block prefix to inner field to ease theming:
5858
array_splice($view['autocomplete']->vars['block_prefixes'], -1, 0, 'ux_entity_autocomplete_inner');
@@ -65,7 +65,7 @@ public function finishView(FormView $view, FormInterface $form, array $options)
6565
$view->vars['compound_data'] = true;
6666
}
6767

68-
public function configureOptions(OptionsResolver $resolver)
68+
public function configureOptions(OptionsResolver $resolver): void
6969
{
7070
$resolver->setDefaults([
7171
'multiple' => false,

src/Autocomplete/tests/Fixtures/Form/AlternateRouteAutocompleteType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#[AsEntityAutocompleteField(route: 'ux_autocomplete_alternate')]
2121
class AlternateRouteAutocompleteType extends AbstractType
2222
{
23-
public function configureOptions(OptionsResolver $resolver)
23+
public function configureOptions(OptionsResolver $resolver): void
2424
{
2525
$resolver->setDefaults([
2626
'class' => Ingredient::class,

src/Autocomplete/tests/Fixtures/Form/CategoryAutocompleteType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(private RequestStack $requestStack)
2727
{
2828
}
2929

30-
public function configureOptions(OptionsResolver $resolver)
30+
public function configureOptions(OptionsResolver $resolver): void
3131
{
3232
$resolver->setDefaults([
3333
'class' => Category::class,

src/Autocomplete/tests/Fixtures/Form/CategoryNoChoiceLabelAutocompleteType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#[AsEntityAutocompleteField]
2121
class CategoryNoChoiceLabelAutocompleteType extends AbstractType
2222
{
23-
public function configureOptions(OptionsResolver $resolver)
23+
public function configureOptions(OptionsResolver $resolver): void
2424
{
2525
$resolver->setDefaults([
2626
'class' => Category::class,

src/Autocomplete/tests/Fixtures/Form/IngredientAutocompleteType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#[AsEntityAutocompleteField]
2323
class IngredientAutocompleteType extends AbstractType
2424
{
25-
public function configureOptions(OptionsResolver $resolver)
25+
public function configureOptions(OptionsResolver $resolver): void
2626
{
2727
$resolver->setDefaults([
2828
'class' => Ingredient::class,

src/Autocomplete/tests/Fixtures/Form/ProductWithTagsAutocompleteType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#[AsEntityAutocompleteField]
2121
class ProductWithTagsAutocompleteType extends AbstractType
2222
{
23-
public function configureOptions(OptionsResolver $resolver)
23+
public function configureOptions(OptionsResolver $resolver): void
2424
{
2525
$resolver->setDefaults([
2626
'class' => Product::class,

0 commit comments

Comments
 (0)