fix deprecations: replace many strings by fqcn

This commit is contained in:
nobohan
2018-04-04 15:02:16 +02:00
parent 2eb81ab3ec
commit 678386ffd6
7 changed files with 168 additions and 159 deletions

View File

@@ -9,6 +9,7 @@ use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class AccompanyingPeriodType extends AbstractType
{
@@ -22,13 +23,13 @@ class AccompanyingPeriodType extends AbstractType
if ($options['period_action'] !== 'close') {
$builder
->add('openingDate', 'date', array(
"required" => true,
"required" => true,
'widget' => 'single_text',
'format' => 'dd-MM-yyyy'
));
}
// the closingDate should be seen only if period_action = close
// the closingDate should be seen only if period_action = close
// or period_action = update AND accopanying period is already closed
$builder->addEventListener(
FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) {
@@ -49,13 +50,13 @@ class AccompanyingPeriodType extends AbstractType
$form->add('closingMotive', 'closing_motive');
}
});
$builder->add('remark', 'textarea', array(
$builder->add('remark', TextareaType::class, array(
'required' => false
))
;
}
/**
* @param OptionsResolverInterface $resolver
*/
@@ -71,7 +72,7 @@ class AccompanyingPeriodType extends AbstractType
->addAllowedValues(array('period_action' => array(
'update', 'open', 'close', 'create')));
}
public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars['action'] = $options['period_action'];