Skip to content

Commit 0ff4d2d

Browse files
committed
[Autocomplete] Apply PHP CS Fixer fixes
1 parent db61002 commit 0ff4d2d

13 files changed

+171
-64
lines changed

src/Autocomplete/tests/Fixtures/Autocompleter/CustomGroupByProductAutocompleter.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?php
22

3-
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Autocompleter;
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
411

5-
use Doctrine\ORM\EntityRepository;
6-
use Doctrine\ORM\QueryBuilder;
7-
use Symfony\Component\HttpFoundation\RequestStack;
8-
use Symfony\Bundle\SecurityBundle\Security;
9-
use Symfony\UX\Autocomplete\Doctrine\EntitySearchUtil;
10-
use Symfony\UX\Autocomplete\EntityAutocompleterInterface;
11-
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
12+
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Autocompleter;
1213

1314
class CustomGroupByProductAutocompleter extends CustomProductAutocompleter
1415
{

src/Autocomplete/tests/Fixtures/Autocompleter/CustomProductAutocompleter.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Autocompleter;
413

514
use Doctrine\ORM\EntityRepository;
@@ -14,9 +23,8 @@ class CustomProductAutocompleter implements EntityAutocompleterInterface
1423
{
1524
public function __construct(
1625
private RequestStack $requestStack,
17-
private EntitySearchUtil $entitySearchUtil
18-
)
19-
{
26+
private EntitySearchUtil $entitySearchUtil,
27+
) {
2028
}
2129

2230
public function getEntityClass(): string

src/Autocomplete/tests/Fixtures/Entity/Category.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity;
413

514
use Doctrine\Common\Collections\ArrayCollection;
615
use Doctrine\Common\Collections\Collection;
7-
use Doctrine\DBAL\Types\Types;
816
use Doctrine\ORM\Mapping as ORM;
917

1018
#[ORM\Entity()]

src/Autocomplete/tests/Fixtures/Entity/Ingredient.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity;
413

514
use Doctrine\ORM\Mapping as ORM;

src/Autocomplete/tests/Fixtures/Entity/Product.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity;
413

514
use Doctrine\Common\Collections\ArrayCollection;

src/Autocomplete/tests/Fixtures/Factory/CategoryFactory.php

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory;
413

514
use Doctrine\ORM\EntityRepository;
615
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
7-
use Zenstruck\Foundry\RepositoryProxy;
816
use Zenstruck\Foundry\ModelFactory;
917
use Zenstruck\Foundry\Proxy;
18+
use Zenstruck\Foundry\RepositoryProxy;
1019

1120
/**
1221
* @extends ModelFactory<Category>
1322
*
14-
* @method static Category|Proxy createOne(array $attributes = [])
15-
* @method static Category[]|Proxy[] createMany(int $number, array|callable $attributes = [])
16-
* @method static Category|Proxy find(object|array|mixed $criteria)
17-
* @method static Category|Proxy findOrCreate(array $attributes)
18-
* @method static Category|Proxy first(string $sortedField = 'id')
19-
* @method static Category|Proxy last(string $sortedField = 'id')
20-
* @method static Category|Proxy random(array $attributes = [])
21-
* @method static Category|Proxy randomOrCreate(array $attributes = []))
22-
* @method static Category[]|Proxy[] all()
23-
* @method static Category[]|Proxy[] findBy(array $attributes)
24-
* @method static Category[]|Proxy[] randomSet(int $number, array $attributes = []))
25-
* @method static Category[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
23+
* @method static Category|Proxy createOne(array $attributes = [])
24+
* @method static Category[]|Proxy[] createMany(int $number, array|callable $attributes = [])
25+
* @method static Category|Proxy find(object|array|mixed $criteria)
26+
* @method static Category|Proxy findOrCreate(array $attributes)
27+
* @method static Category|Proxy first(string $sortedField = 'id')
28+
* @method static Category|Proxy last(string $sortedField = 'id')
29+
* @method static Category|Proxy random(array $attributes = [])
30+
* @method static Category|Proxy randomOrCreate(array $attributes = []))
31+
* @method static Category[]|Proxy[] all()
32+
* @method static Category[]|Proxy[] findBy(array $attributes)
33+
* @method static Category[]|Proxy[] randomSet(int $number, array $attributes = []))
34+
* @method static Category[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
2635
* @method static EntityRepository|RepositoryProxy repository()
27-
* @method Category|Proxy create(array|callable $attributes = [])
36+
* @method Category|Proxy create(array|callable $attributes = [])
2837
*/
2938
final class CategoryFactory extends ModelFactory
3039
{

src/Autocomplete/tests/Fixtures/Factory/IngredientFactory.php

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory;
413

514
use Doctrine\ORM\EntityRepository;
615
use Symfony\Component\Uid\UuidV4;
716
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Ingredient;
8-
use Zenstruck\Foundry\RepositoryProxy;
917
use Zenstruck\Foundry\ModelFactory;
1018
use Zenstruck\Foundry\Proxy;
19+
use Zenstruck\Foundry\RepositoryProxy;
1120

1221
/**
1322
* @extends ModelFactory<Ingredient>
1423
*
15-
* @method static Ingredient|Proxy createOne(array $attributes = [])
16-
* @method static Ingredient[]|Proxy[] createMany(int $number, array|callable $attributes = [])
17-
* @method static Ingredient|Proxy find(object|array|mixed $criteria)
18-
* @method static Ingredient|Proxy findOrCreate(array $attributes)
19-
* @method static Ingredient|Proxy first(string $sortedField = 'id')
20-
* @method static Ingredient|Proxy last(string $sortedField = 'id')
21-
* @method static Ingredient|Proxy random(array $attributes = [])
22-
* @method static Ingredient|Proxy randomOrCreate(array $attributes = []))
23-
* @method static Ingredient[]|Proxy[] all()
24-
* @method static Ingredient[]|Proxy[] findBy(array $attributes)
25-
* @method static Ingredient[]|Proxy[] randomSet(int $number, array $attributes = []))
26-
* @method static Ingredient[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
24+
* @method static Ingredient|Proxy createOne(array $attributes = [])
25+
* @method static Ingredient[]|Proxy[] createMany(int $number, array|callable $attributes = [])
26+
* @method static Ingredient|Proxy find(object|array|mixed $criteria)
27+
* @method static Ingredient|Proxy findOrCreate(array $attributes)
28+
* @method static Ingredient|Proxy first(string $sortedField = 'id')
29+
* @method static Ingredient|Proxy last(string $sortedField = 'id')
30+
* @method static Ingredient|Proxy random(array $attributes = [])
31+
* @method static Ingredient|Proxy randomOrCreate(array $attributes = []))
32+
* @method static Ingredient[]|Proxy[] all()
33+
* @method static Ingredient[]|Proxy[] findBy(array $attributes)
34+
* @method static Ingredient[]|Proxy[] randomSet(int $number, array $attributes = []))
35+
* @method static Ingredient[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
2736
* @method static EntityRepository|RepositoryProxy repository()
28-
* @method Ingredient|Proxy create(array|callable $attributes = [])
37+
* @method Ingredient|Proxy create(array|callable $attributes = [])
2938
*/
3039
final class IngredientFactory extends ModelFactory
3140
{

src/Autocomplete/tests/Fixtures/Factory/ProductFactory.php

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory;
413

514
use Doctrine\ORM\EntityRepository;
615
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product;
7-
use Zenstruck\Foundry\RepositoryProxy;
816
use Zenstruck\Foundry\ModelFactory;
917
use Zenstruck\Foundry\Proxy;
18+
use Zenstruck\Foundry\RepositoryProxy;
1019

1120
/**
1221
* @extends ModelFactory<Product>
1322
*
14-
* @method static Product|Proxy createOne(array $attributes = [])
15-
* @method static Product[]|Proxy[] createMany(int $number, array|callable $attributes = [])
16-
* @method static Product|Proxy find(object|array|mixed $criteria)
17-
* @method static Product|Proxy findOrCreate(array $attributes)
18-
* @method static Product|Proxy first(string $sortedField = 'id')
19-
* @method static Product|Proxy last(string $sortedField = 'id')
20-
* @method static Product|Proxy random(array $attributes = [])
21-
* @method static Product|Proxy randomOrCreate(array $attributes = []))
22-
* @method static Product[]|Proxy[] all()
23-
* @method static Product[]|Proxy[] findBy(array $attributes)
24-
* @method static Product[]|Proxy[] randomSet(int $number, array $attributes = []))
25-
* @method static Product[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
23+
* @method static Product|Proxy createOne(array $attributes = [])
24+
* @method static Product[]|Proxy[] createMany(int $number, array|callable $attributes = [])
25+
* @method static Product|Proxy find(object|array|mixed $criteria)
26+
* @method static Product|Proxy findOrCreate(array $attributes)
27+
* @method static Product|Proxy first(string $sortedField = 'id')
28+
* @method static Product|Proxy last(string $sortedField = 'id')
29+
* @method static Product|Proxy random(array $attributes = [])
30+
* @method static Product|Proxy randomOrCreate(array $attributes = []))
31+
* @method static Product[]|Proxy[] all()
32+
* @method static Product[]|Proxy[] findBy(array $attributes)
33+
* @method static Product[]|Proxy[] randomSet(int $number, array $attributes = []))
34+
* @method static Product[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
2635
* @method static EntityRepository|RepositoryProxy repository()
27-
* @method Product|Proxy create(array|callable $attributes = [])
36+
* @method Product|Proxy create(array|callable $attributes = [])
2837
*/
2938
final class ProductFactory extends ModelFactory
3039
{

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
413

514
use Symfony\Component\Form\AbstractType;
@@ -15,7 +24,7 @@ public function configureOptions(OptionsResolver $resolver)
1524
{
1625
$resolver->setDefaults([
1726
'class' => Ingredient::class,
18-
'choice_label' => function(Ingredient $ingredient) {
27+
'choice_label' => function (Ingredient $ingredient) {
1928
return $ingredient->getName();
2029
},
2130
'multiple' => true,

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
413

514
use Doctrine\ORM\EntityRepository;
6-
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
7-
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
15+
use Symfony\Bundle\SecurityBundle\Security;
816
use Symfony\Component\Form\AbstractType;
917
use Symfony\Component\HttpFoundation\RequestStack;
1018
use Symfony\Component\OptionsResolver\OptionsResolver;
11-
use Symfony\Bundle\SecurityBundle\Security;
1219
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
20+
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
21+
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
1322

1423
#[AsEntityAutocompleteField]
1524
class CategoryAutocompleteType extends AbstractType
@@ -22,15 +31,15 @@ public function configureOptions(OptionsResolver $resolver)
2231
{
2332
$resolver->setDefaults([
2433
'class' => Category::class,
25-
'choice_label' => function(Category $category) {
34+
'choice_label' => function (Category $category) {
2635
return '<strong>'.$category->getName().'</strong>';
2736
},
28-
'query_builder' => function(EntityRepository $repository) {
37+
'query_builder' => function (EntityRepository $repository) {
2938
return $repository->createQueryBuilder('category')
3039
->andWhere('category.name LIKE :search')
3140
->setParameter('search', '%foo%');
3241
},
33-
'security' => function(Security $security) {
42+
'security' => function (Security $security) {
3443
if ($this->requestStack->getCurrentRequest()?->query->get('enforce_test_security')) {
3544
return $security->isGranted('ROLE_USER');
3645
}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
413

5-
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
6-
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
714
use Symfony\Component\Form\AbstractType;
815
use Symfony\Component\OptionsResolver\OptionsResolver;
916
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
17+
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType;
18+
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category;
1019

1120
#[AsEntityAutocompleteField]
1221
class CategoryNoChoiceLabelAutocompleteType extends AbstractType

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
413

514
use Doctrine\ORM\EntityRepository;
@@ -17,7 +26,7 @@ public function configureOptions(OptionsResolver $resolver)
1726
{
1827
$resolver->setDefaults([
1928
'class' => Ingredient::class,
20-
'choice_label' => function(Ingredient $ingredient) {
29+
'choice_label' => function (Ingredient $ingredient) {
2130
return '<strong>'.$ingredient->getName().'</strong>';
2231
},
2332
'multiple' => true,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form;
413

514
use Symfony\Component\Form\AbstractType;

0 commit comments

Comments
 (0)