| Total Complexity | 6 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 94.74% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class textareaExtension extends AbstractTypeExtension |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * {@inheritdoc} |
||
| 22 | */ |
||
| 23 | 100 | public function configureOptions(OptionsResolver $resolver) |
|
| 24 | { |
||
| 25 | $map_attr = function (Options $options, $value) { |
||
| 26 | 100 | if ($value === null) { |
|
| 27 | $value = []; |
||
| 28 | } |
||
| 29 | 100 | $value['rows'] = !empty($options['widget_config']['height']) ? $options['widget_config']['height'] : 6; |
|
| 30 | 100 | $value['cols'] = !empty($options['widget_config']['width']) ? $options['widget_config']['width'] : 50; |
|
| 31 | |||
| 32 | 100 | return $value; |
|
| 33 | 1 | }; |
|
| 34 | 1 | $resolver->setDefault('attr', $map_attr); |
|
| 35 | |||
| 36 | 1 | helper::add_normalizers($resolver, [ |
|
| 37 | 'type_config' => [ |
||
| 38 | 1 | 'output_mode' => 'html', |
|
| 39 | 1 | 'specialchars_quotes' => ENT_QUOTES, |
|
| 40 | 1 | 'specialchars_charset' => 'UTF-8', |
|
| 41 | 'forbidden_patterns' => [], |
||
| 42 | 1 | 'maxlength' => 0, |
|
| 43 | 'purify' => false, |
||
| 44 | 'purify_config' => [] |
||
| 45 | ] |
||
| 46 | ]); |
||
| 47 | 1 | } |
|
| 48 | |||
| 49 | 99 | public function finishView(FormView $view, FormInterface $form, array $options) |
|
| 52 | 99 | } |
|
| 53 | |||
| 54 | 1 | public static function getExtendedTypes() : iterable |
|
| 59 |