Skip to content

Commit c24426a

Browse files
committed
test: fix for last Latte
1 parent 55c28c8 commit c24426a

File tree

3 files changed

+19
-54
lines changed

3 files changed

+19
-54
lines changed

tests/Forms.Latte/expected/FormMacros.button.phtml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
22
%A%
33
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
4-
?><form<?php
5-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
6-
), false) ?>>
4+
?><form<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) ?>>
75
<button<?php
86
$_input = end($this->global->formsStack)["send"];
97
echo $_input->getControlPart()->attributes() ?>>

tests/Forms.Latte/expected/FormMacros.forms.phtml

+17-48
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,10 @@
5151

5252
<LABEL title=hello<?php
5353
$_input = end($this->global->formsStack)["username"];
54-
echo $_input->getLabelPart()->addAttributes(array (
55-
'title' => NULL,
56-
))->attributes() ?>>Name</LABEL>
54+
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>>Name</LABEL>
5755
<input value=val type class="hello"<?php
5856
$_input = end($this->global->formsStack)["username"];
59-
echo $_input->getControlPart()->addAttributes(array (
60-
'value' => NULL,
61-
'type' => NULL,
62-
'class' => NULL,
63-
))->attributes() ?>>
57+
echo $_input->getControlPart()->addAttributes(['value' => null, 'type' => null, 'class' => null])->attributes() ?>>
6458

6559
<label<?php
6660
$_input = is_object($form['username']) ? $form['username'] : end($this->global->formsStack)[$form['username']];
@@ -104,9 +98,7 @@
10498

10599
<label title=hello<?php
106100
$_input = end($this->global->formsStack)["sex"];
107-
echo $_input->getLabelPart($key)->addAttributes(array (
108-
'title' => NULL,
109-
))->attributes() ?>> <input<?php
101+
echo $_input->getLabelPart($key)->addAttributes(['title' => null])->attributes() ?>> <input<?php
110102
$_input = end($this->global->formsStack)["sex"];
111103
echo $_input->getControlPart($key)->attributes() ?>> </label>
112104
<?php
@@ -120,36 +112,28 @@
120112
echo $_input->getLabelPart()->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
121113
<label title="hello"<?php
122114
$_input = end($this->global->formsStack)["sex"];
123-
echo $_input->getLabelPart()->addAttributes(array (
124-
'title' => NULL,
125-
))->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
115+
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
126116

127117

128118
<?php if ($_label = end($this->global->formsStack)["checkbox"]->getLabelPart("")) echo $_label->startTag() ?> <?php
129119
echo end($this->global->formsStack)["checkbox"]->getControlPart("") /* line 41 */ ?> Label<?php if ($_label) echo $_label->endTag() ?>
130120

131121
<label title=hello<?php
132122
$_input = end($this->global->formsStack)["checkbox"];
133-
echo $_input->getLabelPart("")->addAttributes(array (
134-
'title' => NULL,
135-
))->attributes() ?>> <input<?php
123+
echo $_input->getLabelPart("")->addAttributes(['title' => null])->attributes() ?>> <input<?php
136124
$_input = end($this->global->formsStack)["checkbox"];
137125
echo $_input->getControlPart("")->attributes() ?>> </label>
138126
<label title=hello<?php
139127
$_input = end($this->global->formsStack)["checkbox"];
140-
echo $_input->getLabelPart()->addAttributes(array (
141-
'title' => NULL,
142-
))->attributes() ?>> <input<?php
128+
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>> <input<?php
143129
$_input = end($this->global->formsStack)["checkbox"];
144130
echo $_input->getControlPart()->attributes() ?>> </label>
145131
<label<?php
146132
$_input = end($this->global->formsStack)["checkbox"];
147133
echo $_input->getLabelPart("")->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
148134
<label title=hello<?php
149135
$_input = end($this->global->formsStack)["checkbox"];
150-
echo $_input->getLabelPart()->addAttributes(array (
151-
'title' => NULL,
152-
))->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
136+
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
153137

154138

155139
<?php
@@ -164,9 +148,7 @@
164148
$_input = end($this->global->formsStack)["checklist"];
165149
echo $_input->getLabelPart($key)->attributes() ?>> <input title=hello<?php
166150
$_input = end($this->global->formsStack)["checklist"];
167-
echo $_input->getControlPart($key)->addAttributes(array (
168-
'title' => NULL,
169-
))->attributes() ?>> </label>
151+
echo $_input->getControlPart($key)->addAttributes(['title' => null])->attributes() ?>> </label>
170152
<?php
171153
$iterations++;
172154
}
@@ -178,19 +160,13 @@
178160
echo $_input->getLabelPart()->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
179161
<label title="hello"<?php
180162
$_input = end($this->global->formsStack)["checklist"];
181-
echo $_input->getLabelPart()->addAttributes(array (
182-
'title' => NULL,
183-
))->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
163+
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
184164

185165

186166
<?php
187167
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
188168
if (1) {
189-
?><form id="myForm" class="ajax"<?php
190-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
191-
'id' => NULL,
192-
'class' => NULL,
193-
), false) ?>>
169+
?><form id="myForm" class="ajax"<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), ['id' => null, 'class' => null], false) ?>>
194170
<input<?php
195171
$_input = end($this->global->formsStack)["username"];
196172
echo $_input->getControlPart()->attributes() ?>>
@@ -205,26 +181,21 @@
205181
<?php
206182
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
207183
?><form<?php
208-
if ($_tmp = array_filter(['nclass'])) echo ' class="', LR\Filters::escapeHtmlAttr(implode(" ", array_unique($_tmp))), '"';
209-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
210-
'class' => NULL,
211-
), false) ?>>
184+
echo ($_tmp = array_filter(['nclass'])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($_tmp))) . '"' : "";
185+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), ['class' => null], false) ?>>
212186
<input<?php
213187
$_input = end($this->global->formsStack)["username"];
214-
echo $_input->getControlPart()->addAttributes(array (
215-
'class' => NULL,
216-
))->attributes();
217-
if ($_tmp = array_filter(['nclass'])) echo ' class="', LR\Filters::escapeHtmlAttr(implode(" ", array_unique($_tmp))), '"' ?>>
188+
echo $_input->getControlPart()->addAttributes(['class' => null])->attributes();
189+
echo ($_tmp = array_filter(['nclass'])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($_tmp))) . '"' : "";
190+
?>>
218191
<?php
219192
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack), false);
220193
?></form>
221194

222195

223196
<?php
224197
$form = $_form = $this->global->formsStack[] = is_object($this->global->uiControl['myForm']) ? $this->global->uiControl['myForm'] : $this->global->uiControl[$this->global->uiControl['myForm']];
225-
?><FORM<?php
226-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
227-
), false) ?>>
198+
?><FORM<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) ?>>
228199
<input<?php
229200
$_input = end($this->global->formsStack)["username"];
230201
echo $_input->getControlPart()->attributes() ?>>
@@ -240,9 +211,7 @@
240211

241212
<textarea title="<?php echo LR\Filters::escapeHtmlAttr(10) /* line 76 */ ?>"<?php
242213
$_input = end($this->global->formsStack)["area"];
243-
echo $_input->getControlPart()->addAttributes(array (
244-
'title' => NULL,
245-
))->attributes() ?>><?php echo $_input->getControl()->getHtml() ?></textarea>
214+
echo $_input->getControlPart()->addAttributes(['title' => null])->attributes() ?>><?php echo $_input->getControl()->getHtml() ?></textarea>
246215

247216

248217
<select<?php

tests/Forms.Latte/expected/FormMacros.get.phtml

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
<?php
99
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
10-
?><form<?php
11-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
12-
), false) ?>>
10+
?><form<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) ?>>
1311
<?php
1412
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack), false);
1513
?></form>

0 commit comments

Comments
 (0)