1 | <?php |
||
2 | |||
3 | /* |
||
4 | * @copyright 2019 Mautic Contributors. All rights reserved |
||
5 | * @author Mautic |
||
6 | * |
||
7 | * @link http://mautic.org |
||
8 | * |
||
9 | * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html |
||
10 | */ |
||
11 | |||
12 | namespace Mautic\LeadBundle\Form\Type; |
||
13 | |||
14 | use Mautic\LeadBundle\Model\LeadModel; |
||
15 | use Symfony\Component\Form\AbstractType; |
||
16 | use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
||
17 | use Symfony\Component\OptionsResolver\Options; |
||
18 | use Symfony\Component\OptionsResolver\OptionsResolver; |
||
19 | |||
20 | class PreferenceChannelsType extends AbstractType |
||
21 | { |
||
22 | /** |
||
23 | * @var LeadModel |
||
24 | */ |
||
25 | private $leadModel; |
||
26 | |||
27 | public function __construct(LeadModel $leadModel) |
||
28 | { |
||
29 | $this->leadModel = $leadModel; |
||
30 | } |
||
31 | |||
32 | public function configureOptions(OptionsResolver $resolver) |
||
33 | { |
||
34 | $model = $this->leadModel; |
||
35 | |||
36 | $resolver->setDefaults( |
||
37 | [ |
||
38 | 'choices' => function (Options $options) use ($model) { |
||
0 ignored issues
–
show
|
|||
39 | return $model->getPreferenceChannels(); |
||
40 | }, |
||
41 | 'placeholder' => '', |
||
42 | 'attr' => ['class' => 'form-control'], |
||
43 | 'label_attr' => ['class' => 'control-label'], |
||
44 | 'multiple' => false, |
||
45 | 'expanded' => false, |
||
46 | 'required' => false, |
||
47 | ] |
||
48 | ); |
||
49 | } |
||
50 | |||
51 | public function getParent() |
||
52 | { |
||
53 | return ChoiceType::class; |
||
54 | } |
||
55 | } |
||
56 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.