Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7ffd8d3

Browse filesBrowse files
committed
fixed CS on Form PHP templates
1 parent 0ba1acc commit 7ffd8d3
Copy full SHA for 7ffd8d3
Expand file treeCollapse file tree

22 files changed

+31
-31
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php
+1-1Lines 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): ?>
+2-2Lines 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>

‎src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php
+5-5Lines 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>
+1-1Lines 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>

‎src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php
+3-3Lines 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 ?>
+1-1Lines 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]) ?>
+1-1Lines 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']);

‎src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/date_widget.html.php
+2-2Lines 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 ?>
+1-1Lines 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']) ?>

‎src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php
+2-2Lines 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 ?>
+1-1Lines 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 : 'hidden')) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'hidden']) ?>
+1-1Lines 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 : 'number')) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'number']) ?>
+1-1Lines 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 : 'text')) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'text']) ?>
+1-1Lines 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 : 'password')) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'password']) ?>
+1-1Lines 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 : 'text')) ?> %
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'text']) ?> %
+1-1Lines 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 : 'range'));
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'range']);
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset')) ?>
1+
<?php echo $view['form']->block($form, 'button_widget', ['type' => isset($type) ? $type : 'reset']) ?>
+1-1Lines 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 : 'search')) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'search']) ?>
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit')) ?>
1+
<?php echo $view['form']->block($form, 'button_widget', ['type' => isset($type) ? $type : 'submit']) ?>
+1-1Lines 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 : 'tel'));
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'tel']);

‎src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php if ($widget == 'single_text'): ?>
22
<?php echo $view['form']->block($form, 'form_widget_simple'); ?>
33
<?php else: ?>
4-
<?php $vars = $widget == 'text' ? array('attr' => array('size' => 1)) : array() ?>
4+
<?php $vars = $widget == 'text' ? ['attr' => ['size' => 1]] : [] ?>
55
<div <?php echo $view['form']->block($form, 'widget_container_attributes') ?>>
66
<?php
77
// There should be no spaces between the colons and the widgets, that's why
+1-1Lines 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 : 'url')) ?>
1+
<?php echo $view['form']->block($form, 'form_widget_simple', ['type' => isset($type) ? $type : 'url']) ?>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.