Skip to content

Commit

Permalink
Add Symfony 7 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
JoppeDC authored and weaverryan committed Oct 3, 2023
1 parent 2879dfa commit 4bccd48
Show file tree
Hide file tree
Showing 34 changed files with 184 additions and 179 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test-turbo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1']
dependency-version: ['lowest', 'highest']
php-version: ['8.1', '8.2']
include:
- php-version: '8.1'
dependency-version: 'lowest'
- php-version: '8.2'
dependency-version: 'highest'

services:
mercure:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1']
dependency-version: ['lowest', 'highest']
php-version: ['8.1', '8.2']
include:
- php-version: '8.1'
dependency-version: 'lowest'
- php-version: '8.2'
dependency-version: 'highest'
component: ${{ fromJson(needs.tests-php-components.outputs.components )}}
exclude:
- component: Swup # has no tests
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"dev"
],
"require-dev": {
"symfony/filesystem": "^5.2|^6.0",
"symfony/finder": "^5.4|^6.0",
"symfony/filesystem": "^5.2|^6.0|^7.0",
"symfony/finder": "^5.4|^6.0|^7.0",
"php-cs-fixer/shim": "^3.13"
}
}
28 changes: 14 additions & 14 deletions src/Autocomplete/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@
},
"require": {
"php": ">=8.1",
"symfony/dependency-injection": "^5.4|^6.0",
"symfony/http-foundation": "^5.4|^6.0",
"symfony/http-kernel": "^5.4|^6.0",
"symfony/property-access": "^5.4|^6.0",
"symfony/string": "^5.4|^6.0"
"symfony/dependency-injection": "^6.3|^7.0",
"symfony/http-foundation": "^6.3|^7.0",
"symfony/http-kernel": "^6.3|^7.0",
"symfony/property-access": "^6.3|^7.0",
"symfony/string": "^6.3|^7.0"
},
"require-dev": {
"doctrine/collections": "^1.6.8|^2.0",
"doctrine/doctrine-bundle": "^2.4.3",
"doctrine/orm": "^2.9.4",
"fakerphp/faker": "^1.22",
"mtdowling/jmespath.php": "^2.6",
"symfony/form": "^5.4|^6.0",
"symfony/options-resolver": "^5.4|^6.0",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/form": "^6.3|^7.0",
"symfony/options-resolver": "^6.3|^7.0",
"symfony/framework-bundle": "^6.3|^7.0",
"symfony/maker-bundle": "^1.40",
"symfony/phpunit-bridge": "^5.4|^6.0",
"symfony/process": "^5.4|^6.0",
"symfony/security-bundle": "^5.4|^6.0",
"symfony/security-csrf": "^5.4|^6.0",
"symfony/twig-bundle": "^5.4|^6.0",
"symfony/uid": "^5.4|^6.0",
"symfony/phpunit-bridge": "^6.3|^7.0",
"symfony/process": "^6.3|^7.0",
"symfony/security-bundle": "^6.3|^7.0",
"symfony/security-csrf": "^6.3|^7.0",
"symfony/twig-bundle": "^6.3|^7.0",
"symfony/uid": "^6.3|^7.0",
"twig/twig": "^2.14.7|^3.0.4",
"zenstruck/browser": "^1.1",
"zenstruck/foundry": "^1.33"
Expand Down
6 changes: 3 additions & 3 deletions src/Autocomplete/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Or, create the field by hand::
// src/Form/FoodAutocompleteField.php
// ...

use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
use Symfony\UX\Autocomplete\Form\ParentEntityAutocompleteType;

Expand Down Expand Up @@ -231,7 +231,7 @@ to the options above, you can also pass:
that should be required to access the endpoint. Or, pass a callback and
return ``true`` to grant access or ``false`` to deny access::

use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;

[
'security' => function(Security $security): bool {
Expand Down Expand Up @@ -418,8 +418,8 @@ and tag this service with ``ux.entity_autocompleter``, including an ``alias`` op
use App\Entity\Food;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use Symfony\Component\Security\Core\Security;
use Symfony\UX\Autocomplete\EntityAutocompleterInterface;

#[AutoconfigureTag('ux.entity_autocompleter', ['alias' => 'food'])]
Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/src/AutocompleteResultsExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
namespace Symfony\UX\Autocomplete;

use Doctrine\ORM\Tools\Pagination\Paginator;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException;
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyAccess\PropertyPath;
use Symfony\Component\PropertyAccess\PropertyPathInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;
use Symfony\UX\Autocomplete\Doctrine\DoctrineRegistryWrapper;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/src/EntityAutocompleterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;

/**
* Interface for classes that will have an "autocomplete" endpoint exposed.
Expand Down
6 changes: 3 additions & 3 deletions src/Autocomplete/src/Form/ParentEntityAutocompleteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function configureOptions(OptionsResolver $resolver)
// }
'filter_query' => null,
// set to the string role that's required to view the autocomplete results
// or a callable: function(Symfony\Component\Security\Core\Security $security): bool
// or a callable: function(Symfony\Bundle\SecurityBundle\Security $security): bool
'security' => false,
// set the max results number that a query on automatic endpoint return.
'max_results' => 10,
Expand All @@ -102,13 +102,13 @@ public function getBlockPrefix(): string
return 'ux_entity_autocomplete';
}

public function mapDataToForms($data, $forms)
public function mapDataToForms($data, $forms): void
{
$form = current(iterator_to_array($forms, false));
$form->setData($data);
}

public function mapFormsToData($forms, &$data)
public function mapFormsToData($forms, &$data): void
{
$form = current(iterator_to_array($forms, false));
$data = $form->getData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Form\ChoiceList\Factory\Cache\ChoiceLabel;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyAccess\PropertyPathInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\UX\Autocomplete\Doctrine\EntityMetadata;
use Symfony\UX\Autocomplete\Doctrine\EntityMetadataFactory;
use Symfony\UX\Autocomplete\Doctrine\EntitySearchUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\UX\Autocomplete\Doctrine\EntitySearchUtil;
use Symfony\UX\Autocomplete\EntityAutocompleterInterface;
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\UX\Autocomplete\Doctrine\EntitySearchUtil;
use Symfony\UX\Autocomplete\EntityAutocompleterInterface;
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Symfony\Component\Form\AbstractType;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
use Symfony\UX\Autocomplete\Form\ParentEntityAutocompleteType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Symfony\Component\Form\AbstractType;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
use Symfony\UX\Autocomplete\Form\ParentEntityAutocompleteType;

Expand Down
13 changes: 6 additions & 7 deletions src/Autocomplete/tests/Fixtures/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testForm(FormFactoryInterface $formFactory, Environment $twig, R
$form->handleRequest($request);

return new Response($twig->render('form.html.twig', [
'form' => $form->createView()
'form' => $form->createView(),
]));
}

Expand Down Expand Up @@ -118,18 +118,17 @@ protected function configureContainer(ContainerConfigurator $c): void
]);

$c->extension('security', [
'enable_authenticator_manager' => true,
'password_hashers' => [
PasswordAuthenticatedUserInterface::class => 'plaintext'
PasswordAuthenticatedUserInterface::class => 'plaintext',
],
'providers' => [
'users_in_memory' => [
'memory' => [
'users' => [
'mr_autocompleter' => ['password' => 'symfonypass', 'roles' => ['ROLE_USER']]
'mr_autocompleter' => ['password' => 'symfonypass', 'roles' => ['ROLE_USER']],
],
],
]
],
],
'firewalls' => [
'main' => [
Expand Down Expand Up @@ -157,14 +156,14 @@ protected function configureContainer(ContainerConfigurator $c): void
->public()
->arg(1, new Reference('ux.autocomplete.entity_search_util'))
->tag(AutocompleteFormTypePass::ENTITY_AUTOCOMPLETER_TAG, [
'alias' => 'custom_product'
'alias' => 'custom_product',
]);

$services->set(CustomGroupByProductAutocompleter::class)
->public()
->arg(1, new Reference('ux.autocomplete.entity_search_util'))
->tag(AutocompleteFormTypePass::ENTITY_AUTOCOMPLETER_TAG, [
'alias' => 'custom_group_by_product'
'alias' => 'custom_group_by_product',
]);

$services->alias('public.results_executor', 'ux.autocomplete.results_executor')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
namespace Symfony\UX\Autocomplete\Tests\Unit;

use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;
use Symfony\UX\Autocomplete\AutocompleteResultsExecutor;
use Symfony\UX\Autocomplete\Doctrine\DoctrineRegistryWrapper;
use Symfony\UX\Autocomplete\EntityAutocompleterInterface;
Expand Down
14 changes: 7 additions & 7 deletions src/Chartjs/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
},
"require": {
"php": ">=8.1",
"symfony/config": "^5.4|^6.0",
"symfony/dependency-injection": "^5.4|^6.0",
"symfony/http-kernel": "^5.4|^6.0",
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"symfony/stimulus-bundle": "^2.9.1"
},
"require-dev": {
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/phpunit-bridge": "^5.4|^6.0",
"symfony/twig-bundle": "^5.4|^6.0",
"symfony/var-dumper": "^5.4|^6.0"
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0",
"symfony/twig-bundle": "^5.4|^6.0|^7.0",
"symfony/var-dumper": "^5.4|^6.0|^7.0"
},
"conflict": {
"symfony/flex": "<1.13"
Expand Down
22 changes: 11 additions & 11 deletions src/Cropperjs/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
"require": {
"php": ">=8.1",
"intervention/image": "^2.5",
"symfony/config": "^5.4|^6.0",
"symfony/dependency-injection": "^5.4|^6.0",
"symfony/form": "^5.4|^6.0",
"symfony/http-kernel": "^5.4|^6.0",
"symfony/options-resolver": "^5.4|^6.0",
"symfony/validator": "^5.4|^6.0"
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/form": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"symfony/options-resolver": "^5.4|^6.0|^7.0",
"symfony/validator": "^5.4|^6.0|^7.0"
},
"require-dev": {
"symfony/expression-language": "^5.4|^6.0",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/phpunit-bridge": "^5.4|^6.0",
"symfony/twig-bundle": "^5.4|^6.0",
"symfony/var-dumper": "^5.4|^6.0",
"symfony/expression-language": "^5.4|^6.0|^7.0",
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0",
"symfony/twig-bundle": "^5.4|^6.0|^7.0",
"symfony/var-dumper": "^5.4|^6.0|^7.0",
"twig/twig": "^2.14.7|^3.0.4"
},
"conflict": {
Expand Down
18 changes: 9 additions & 9 deletions src/Dropzone/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
},
"require": {
"php": ">=8.1",
"symfony/config": "^5.4|^6.0",
"symfony/dependency-injection": "^5.4|^6.0",
"symfony/form": "^5.4|^6.0",
"symfony/http-kernel": "^5.4|^6.0",
"symfony/options-resolver": "^5.4|^6.0"
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/form": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"symfony/options-resolver": "^5.4|^6.0|^7.0"
},
"require-dev": {
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/phpunit-bridge": "^5.4|^6.0",
"symfony/twig-bundle": "^5.4|^6.0",
"symfony/var-dumper": "^5.4|^6.0",
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0",
"symfony/twig-bundle": "^5.4|^6.0|^7.0",
"symfony/var-dumper": "^5.4|^6.0|^7.0",
"twig/twig": "^2.14.7|^3.0.4"
},
"extra": {
Expand Down
14 changes: 7 additions & 7 deletions src/LazyImage/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
},
"require": {
"php": ">=8.1",
"symfony/config": "^5.4|^6.0",
"symfony/http-kernel": "^5.4|^6.0",
"symfony/dependency-injection": "^5.4|^6.0"
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0"
},
"require-dev": {
"intervention/image": "^2.5",
"kornrunner/blurhash": "^1.1",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/phpunit-bridge": "^5.2|^6.0",
"symfony/twig-bundle": "^5.4|^6.0",
"symfony/var-dumper": "^5.4|^6.0"
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/phpunit-bridge": "^5.2|^6.0|^7.0",
"symfony/twig-bundle": "^5.4|^6.0|^7.0",
"symfony/var-dumper": "^5.4|^6.0|^7.0"
},
"extra": {
"thanks": {
Expand Down

0 comments on commit 4bccd48

Please sign in to comment.