-
-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Autocomplete] Apply PHP CS Fixer fixes
- Loading branch information
1 parent
db61002
commit 0ff4d2d
Showing
13 changed files
with
171 additions
and
64 deletions.
There are no files selected for viewing
17 changes: 9 additions & 8 deletions
17
src/Autocomplete/tests/Fixtures/Autocompleter/CustomGroupByProductAutocompleter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
<?php | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Autocompleter; | ||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Doctrine\ORM\EntityRepository; | ||
use Doctrine\ORM\QueryBuilder; | ||
use Symfony\Component\HttpFoundation\RequestStack; | ||
use Symfony\Bundle\SecurityBundle\Security; | ||
use Symfony\UX\Autocomplete\Doctrine\EntitySearchUtil; | ||
use Symfony\UX\Autocomplete\EntityAutocompleterInterface; | ||
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product; | ||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Autocompleter; | ||
|
||
class CustomGroupByProductAutocompleter extends CustomProductAutocompleter | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Autocompleter; | ||
|
||
use Doctrine\ORM\EntityRepository; | ||
|
@@ -14,9 +23,8 @@ class CustomProductAutocompleter implements EntityAutocompleterInterface | |
{ | ||
public function __construct( | ||
private RequestStack $requestStack, | ||
private EntitySearchUtil $entitySearchUtil | ||
) | ||
{ | ||
private EntitySearchUtil $entitySearchUtil, | ||
) { | ||
} | ||
|
||
public function getEntityClass(): string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\DBAL\Types\Types; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
#[ORM\Entity()] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Entity; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
|
37 changes: 23 additions & 14 deletions
37
src/Autocomplete/tests/Fixtures/Factory/CategoryFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,39 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory; | ||
|
||
use Doctrine\ORM\EntityRepository; | ||
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category; | ||
use Zenstruck\Foundry\RepositoryProxy; | ||
use Zenstruck\Foundry\ModelFactory; | ||
use Zenstruck\Foundry\Proxy; | ||
use Zenstruck\Foundry\RepositoryProxy; | ||
|
||
/** | ||
* @extends ModelFactory<Category> | ||
* | ||
* @method static Category|Proxy createOne(array $attributes = []) | ||
* @method static Category[]|Proxy[] createMany(int $number, array|callable $attributes = []) | ||
* @method static Category|Proxy find(object|array|mixed $criteria) | ||
* @method static Category|Proxy findOrCreate(array $attributes) | ||
* @method static Category|Proxy first(string $sortedField = 'id') | ||
* @method static Category|Proxy last(string $sortedField = 'id') | ||
* @method static Category|Proxy random(array $attributes = []) | ||
* @method static Category|Proxy randomOrCreate(array $attributes = [])) | ||
* @method static Category[]|Proxy[] all() | ||
* @method static Category[]|Proxy[] findBy(array $attributes) | ||
* @method static Category[]|Proxy[] randomSet(int $number, array $attributes = [])) | ||
* @method static Category[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])) | ||
* @method static Category|Proxy createOne(array $attributes = []) | ||
* @method static Category[]|Proxy[] createMany(int $number, array|callable $attributes = []) | ||
* @method static Category|Proxy find(object|array|mixed $criteria) | ||
* @method static Category|Proxy findOrCreate(array $attributes) | ||
* @method static Category|Proxy first(string $sortedField = 'id') | ||
* @method static Category|Proxy last(string $sortedField = 'id') | ||
* @method static Category|Proxy random(array $attributes = []) | ||
* @method static Category|Proxy randomOrCreate(array $attributes = [])) | ||
* @method static Category[]|Proxy[] all() | ||
* @method static Category[]|Proxy[] findBy(array $attributes) | ||
* @method static Category[]|Proxy[] randomSet(int $number, array $attributes = [])) | ||
* @method static Category[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])) | ||
* @method static EntityRepository|RepositoryProxy repository() | ||
* @method Category|Proxy create(array|callable $attributes = []) | ||
* @method Category|Proxy create(array|callable $attributes = []) | ||
*/ | ||
final class CategoryFactory extends ModelFactory | ||
{ | ||
|
37 changes: 23 additions & 14 deletions
37
src/Autocomplete/tests/Fixtures/Factory/IngredientFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,40 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory; | ||
|
||
use Doctrine\ORM\EntityRepository; | ||
use Symfony\Component\Uid\UuidV4; | ||
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Ingredient; | ||
use Zenstruck\Foundry\RepositoryProxy; | ||
use Zenstruck\Foundry\ModelFactory; | ||
use Zenstruck\Foundry\Proxy; | ||
use Zenstruck\Foundry\RepositoryProxy; | ||
|
||
/** | ||
* @extends ModelFactory<Ingredient> | ||
* | ||
* @method static Ingredient|Proxy createOne(array $attributes = []) | ||
* @method static Ingredient[]|Proxy[] createMany(int $number, array|callable $attributes = []) | ||
* @method static Ingredient|Proxy find(object|array|mixed $criteria) | ||
* @method static Ingredient|Proxy findOrCreate(array $attributes) | ||
* @method static Ingredient|Proxy first(string $sortedField = 'id') | ||
* @method static Ingredient|Proxy last(string $sortedField = 'id') | ||
* @method static Ingredient|Proxy random(array $attributes = []) | ||
* @method static Ingredient|Proxy randomOrCreate(array $attributes = [])) | ||
* @method static Ingredient[]|Proxy[] all() | ||
* @method static Ingredient[]|Proxy[] findBy(array $attributes) | ||
* @method static Ingredient[]|Proxy[] randomSet(int $number, array $attributes = [])) | ||
* @method static Ingredient[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])) | ||
* @method static Ingredient|Proxy createOne(array $attributes = []) | ||
* @method static Ingredient[]|Proxy[] createMany(int $number, array|callable $attributes = []) | ||
* @method static Ingredient|Proxy find(object|array|mixed $criteria) | ||
* @method static Ingredient|Proxy findOrCreate(array $attributes) | ||
* @method static Ingredient|Proxy first(string $sortedField = 'id') | ||
* @method static Ingredient|Proxy last(string $sortedField = 'id') | ||
* @method static Ingredient|Proxy random(array $attributes = []) | ||
* @method static Ingredient|Proxy randomOrCreate(array $attributes = [])) | ||
* @method static Ingredient[]|Proxy[] all() | ||
* @method static Ingredient[]|Proxy[] findBy(array $attributes) | ||
* @method static Ingredient[]|Proxy[] randomSet(int $number, array $attributes = [])) | ||
* @method static Ingredient[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])) | ||
* @method static EntityRepository|RepositoryProxy repository() | ||
* @method Ingredient|Proxy create(array|callable $attributes = []) | ||
* @method Ingredient|Proxy create(array|callable $attributes = []) | ||
*/ | ||
final class IngredientFactory extends ModelFactory | ||
{ | ||
|
37 changes: 23 additions & 14 deletions
37
src/Autocomplete/tests/Fixtures/Factory/ProductFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,39 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory; | ||
|
||
use Doctrine\ORM\EntityRepository; | ||
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Product; | ||
use Zenstruck\Foundry\RepositoryProxy; | ||
use Zenstruck\Foundry\ModelFactory; | ||
use Zenstruck\Foundry\Proxy; | ||
use Zenstruck\Foundry\RepositoryProxy; | ||
|
||
/** | ||
* @extends ModelFactory<Product> | ||
* | ||
* @method static Product|Proxy createOne(array $attributes = []) | ||
* @method static Product[]|Proxy[] createMany(int $number, array|callable $attributes = []) | ||
* @method static Product|Proxy find(object|array|mixed $criteria) | ||
* @method static Product|Proxy findOrCreate(array $attributes) | ||
* @method static Product|Proxy first(string $sortedField = 'id') | ||
* @method static Product|Proxy last(string $sortedField = 'id') | ||
* @method static Product|Proxy random(array $attributes = []) | ||
* @method static Product|Proxy randomOrCreate(array $attributes = [])) | ||
* @method static Product[]|Proxy[] all() | ||
* @method static Product[]|Proxy[] findBy(array $attributes) | ||
* @method static Product[]|Proxy[] randomSet(int $number, array $attributes = [])) | ||
* @method static Product[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])) | ||
* @method static Product|Proxy createOne(array $attributes = []) | ||
* @method static Product[]|Proxy[] createMany(int $number, array|callable $attributes = []) | ||
* @method static Product|Proxy find(object|array|mixed $criteria) | ||
* @method static Product|Proxy findOrCreate(array $attributes) | ||
* @method static Product|Proxy first(string $sortedField = 'id') | ||
* @method static Product|Proxy last(string $sortedField = 'id') | ||
* @method static Product|Proxy random(array $attributes = []) | ||
* @method static Product|Proxy randomOrCreate(array $attributes = [])) | ||
* @method static Product[]|Proxy[] all() | ||
* @method static Product[]|Proxy[] findBy(array $attributes) | ||
* @method static Product[]|Proxy[] randomSet(int $number, array $attributes = [])) | ||
* @method static Product[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])) | ||
* @method static EntityRepository|RepositoryProxy repository() | ||
* @method Product|Proxy create(array|callable $attributes = []) | ||
* @method Product|Proxy create(array|callable $attributes = []) | ||
*/ | ||
final class ProductFactory extends ModelFactory | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
|
@@ -15,7 +24,7 @@ public function configureOptions(OptionsResolver $resolver) | |
{ | ||
$resolver->setDefaults([ | ||
'class' => Ingredient::class, | ||
'choice_label' => function(Ingredient $ingredient) { | ||
'choice_label' => function (Ingredient $ingredient) { | ||
return $ingredient->getName(); | ||
}, | ||
'multiple' => true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form; | ||
|
||
use Doctrine\ORM\EntityRepository; | ||
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType; | ||
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category; | ||
use Symfony\Bundle\SecurityBundle\Security; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\HttpFoundation\RequestStack; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
use Symfony\Bundle\SecurityBundle\Security; | ||
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField; | ||
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType; | ||
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category; | ||
|
||
#[AsEntityAutocompleteField] | ||
class CategoryAutocompleteType extends AbstractType | ||
|
@@ -22,15 +31,15 @@ public function configureOptions(OptionsResolver $resolver) | |
{ | ||
$resolver->setDefaults([ | ||
'class' => Category::class, | ||
'choice_label' => function(Category $category) { | ||
'choice_label' => function (Category $category) { | ||
return '<strong>'.$category->getName().'</strong>'; | ||
}, | ||
'query_builder' => function(EntityRepository $repository) { | ||
'query_builder' => function (EntityRepository $repository) { | ||
return $repository->createQueryBuilder('category') | ||
->andWhere('category.name LIKE :search') | ||
->setParameter('search', '%foo%'); | ||
}, | ||
'security' => function(Security $security) { | ||
'security' => function (Security $security) { | ||
if ($this->requestStack->getCurrentRequest()?->query->get('enforce_test_security')) { | ||
return $security->isGranted('ROLE_USER'); | ||
} | ||
|
13 changes: 11 additions & 2 deletions
13
src/Autocomplete/tests/Fixtures/Form/CategoryNoChoiceLabelAutocompleteType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form; | ||
|
||
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType; | ||
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField; | ||
use Symfony\UX\Autocomplete\Form\BaseEntityAutocompleteType; | ||
use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\Category; | ||
|
||
#[AsEntityAutocompleteField] | ||
class CategoryNoChoiceLabelAutocompleteType extends AbstractType | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form; | ||
|
||
use Doctrine\ORM\EntityRepository; | ||
|
@@ -17,7 +26,7 @@ public function configureOptions(OptionsResolver $resolver) | |
{ | ||
$resolver->setDefaults([ | ||
'class' => Ingredient::class, | ||
'choice_label' => function(Ingredient $ingredient) { | ||
'choice_label' => function (Ingredient $ingredient) { | ||
return '<strong>'.$ingredient->getName().'</strong>'; | ||
}, | ||
'multiple' => true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\Autocomplete\Tests\Fixtures\Form; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
|