Skip to content

Commit 9c70d1a

Browse files
committed
fixed CS on Form PHP templates
1 parent ce7ef30 commit 9c70d1a

22 files changed

+31
-31
lines changed

Resources/views/Form/attributes.html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php foreach ($attr as $k => $v): ?>
22
<?php if ('placeholder' === $k || 'title' === $k): ?>
3-
<?php printf('%s="%s" ', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
3+
<?php printf('%s="%s" ', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, [], $translation_domain) : $v)) ?>
44
<?php elseif (true === $v): ?>
55
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
66
<?php elseif (false !== $v): ?>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php if (!$label) { $label = isset($label_format)
2-
? strtr($label_format, array('%name%' => $name, '%id%' => $id))
2+
? strtr($label_format, ['%name%' => $name, '%id%' => $id])
33
: $view['form']->humanize($name); } ?>
4-
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, array(), $translation_domain) : $label) ?></button>
4+
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, [], $translation_domain) : $label) ?></button>

Resources/views/Form/choice_widget_collapsed.html.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<?php if ($required && null === $placeholder && $placeholder_in_choices === false && $multiple === false && (!isset($attr['size']) || $attr['size'] <= 1)):
33
$required = false;
44
endif; ?>
5-
<?php echo $view['form']->block($form, 'widget_attributes', array(
5+
<?php echo $view['form']->block($form, 'widget_attributes', [
66
'required' => $required,
7-
)) ?>
7+
]) ?>
88
<?php if ($multiple): ?> multiple="multiple"<?php endif ?>
99
>
10-
<?php if (null !== $placeholder): ?><option value=""<?php if ($required && empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo '' != $placeholder ? $view->escape(false !== $translation_domain ? $view['translator']->trans($placeholder, array(), $translation_domain) : $placeholder) : '' ?></option><?php endif; ?>
10+
<?php if (null !== $placeholder): ?><option value=""<?php if ($required && empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo '' != $placeholder ? $view->escape(false !== $translation_domain ? $view['translator']->trans($placeholder, [], $translation_domain) : $placeholder) : '' ?></option><?php endif; ?>
1111
<?php if (count($preferred_choices) > 0): ?>
12-
<?php echo $view['form']->block($form, 'choice_widget_options', array('choices' => $preferred_choices)) ?>
12+
<?php echo $view['form']->block($form, 'choice_widget_options', ['choices' => $preferred_choices]) ?>
1313
<?php if (count($choices) > 0 && null !== $separator): ?>
1414
<option disabled="disabled"><?php echo $separator ?></option>
1515
<?php endif ?>
1616
<?php endif ?>
17-
<?php echo $view['form']->block($form, 'choice_widget_options', array('choices' => $choices)) ?>
17+
<?php echo $view['form']->block($form, 'choice_widget_options', ['choices' => $choices]) ?>
1818
</select>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
22
<?php foreach ($form as $child): ?>
33
<?php echo $view['form']->widget($child) ?>
4-
<?php echo $view['form']->label($child, null, array('translation_domain' => $choice_translation_domain)) ?>
4+
<?php echo $view['form']->label($child, null, ['translation_domain' => $choice_translation_domain]) ?>
55
<?php endforeach ?>
66
</div>

Resources/views/Form/choice_widget_options.html.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<?php $formHelper = $view['form']; ?>
55
<?php foreach ($choices as $group_label => $choice): ?>
66
<?php if (is_array($choice) || $choice instanceof ChoiceGroupView): ?>
7-
<optgroup label="<?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($group_label, array(), $choice_translation_domain) : $group_label) ?>">
8-
<?php echo $formHelper->block($form, 'choice_widget_options', array('choices' => $choice)) ?>
7+
<optgroup label="<?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($group_label, [], $choice_translation_domain) : $group_label) ?>">
8+
<?php echo $formHelper->block($form, 'choice_widget_options', ['choices' => $choice]) ?>
99
</optgroup>
1010
<?php else: ?>
11-
<option value="<?php echo $view->escape($choice->value) ?>" <?php echo $formHelper->block($form, 'choice_attributes', array('choice_attr' => $choice->attr)) ?><?php if ($is_selected($choice->value, $value)): ?> selected="selected"<?php endif?>><?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($choice->label, array(), $choice_translation_domain) : $choice->label) ?></option>
11+
<option value="<?php echo $view->escape($choice->value) ?>" <?php echo $formHelper->block($form, 'choice_attributes', ['choice_attr' => $choice->attr]) ?><?php if ($is_selected($choice->value, $value)): ?> selected="selected"<?php endif?>><?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($choice->label, [], $choice_translation_domain) : $choice->label) ?></option>
1212
<?php endif ?>
1313
<?php endforeach ?>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php if (isset($prototype)): ?>
22
<?php $attr['data-prototype'] = $view->escape($view['form']->row($prototype)) ?>
33
<?php endif ?>
4-
<?php echo $view['form']->widget($form, array('attr' => $attr)) ?>
4+
<?php echo $view['form']->widget($form, ['attr' => $attr]) ?>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'color'));
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'color']);

Resources/views/Form/date_widget.html.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<?php echo $view['form']->block($form, 'form_widget_simple'); ?>
33
<?php else: ?>
44
<div <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
5-
<?php echo str_replace(array('{{ year }}', '{{ month }}', '{{ day }}'), array(
5+
<?php echo str_replace(['{{ year }}', '{{ month }}', '{{ day }}'], [
66
$view['form']->widget($form['year']),
77
$view['form']->widget($form['month']),
88
$view['form']->widget($form['day']),
9-
), $date_pattern) ?>
9+
], $date_pattern) ?>
1010
</div>
1111
<?php endif ?>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'email')) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'email']) ?>

Resources/views/Form/form_label.html.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?php if ($required) { $label_attr['class'] = trim((isset($label_attr['class']) ? $label_attr['class'] : '').' required'); } ?>
33
<?php if (!$compound) { $label_attr['for'] = $id; } ?>
44
<?php if (!$label) { $label = isset($label_format)
5-
? strtr($label_format, array('%name%' => $name, '%id%' => $id))
5+
? strtr($label_format, ['%name%' => $name, '%id%' => $id])
66
: $view['form']->humanize($name); } ?>
7-
<label<?php if ($label_attr) { echo ' '.$view['form']->block($form, 'attributes', array('attr' => $label_attr)); } ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, array(), $translation_domain) : $label) ?></label>
7+
<label<?php if ($label_attr) { echo ' '.$view['form']->block($form, 'attributes', ['attr' => $label_attr]); } ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, [], $translation_domain) : $label) ?></label>
88
<?php endif ?>

0 commit comments

Comments
 (0)