mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
Merge branch 'refactor-using-rector-202303' into rector/rules-up-to-php74
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Search\SearchProvider;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class AdvancedSearchType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* @var SearchProvider
|
||||
*/
|
||||
protected $searchProvider;
|
||||
|
||||
public function __construct(SearchProvider $searchProvider)
|
||||
{
|
||||
$this->searchProvider = $searchProvider;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$this->searchProvider
|
||||
->getHasAdvancedFormByName($options['search_service'])
|
||||
->createSearchForm($builder);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver
|
||||
->setRequired('search_service')
|
||||
->setAllowedTypes('search_service', ['string']);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user