8000 [Form][Validator] Fixed indentation · alexfilatov/symfony@c392f25 · GitHub
[go: up one dir, main page]

Skip to content

Commit c392f25

Browse files
Fabien Pennequinfabpot
authored andcommitted
[Form][Validator] Fixed indentation
1 parent 136647c commit c392f25

File tree

8 files changed

+48
-46
lines changed

8 files changed

+48
-46
lines changed

src/Symfony/Component/Form/CollectionField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
* $form->add(new CollectionField(new TextField('emails')));
2424
*
25-
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
25+
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
2626
*/
2727
class CollectionField extends FieldGroup
2828
{

src/Symfony/Component/Form/FieldFactory/ValidatorFieldFactoryGuesser.php

Lines changed: 27 additions & 27 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function guessClassForConstraint(Constraint $constraint)
110110
case 'boolean':
111111
case 'bool':
112112
return new FieldFactoryClassGuess(
113-
'Symfony\Component\Form\CheckboxField',
113+
'Symfony\Component\Form\CheckboxField',
114114
array(),
115115
FieldFactoryGuess::MEDIUM_CONFIDENCE
116116
);
@@ -119,131 +119,131 @@ public function guessClassForConstraint(Constraint $constraint)
119119
case 'numeric':
120120
case 'real':
121121
return new FieldFactoryClassGuess(
122-
'Symfony\Component\Form\NumberField',
122+
'Symfony\Component\Form\NumberField',
123123
array(),
124124
FieldFactoryGuess::MEDIUM_CONFIDENCE
125125
);
126126
case 'integer':
127127
case 'int':
128128
case 'long':
129129
return new FieldFactoryClassGuess(
130-
'Symfony\Component\Form\IntegerField',
130+
'Symfony\Component\Form\IntegerField',
131131
array(),
132132
FieldFactoryGuess::MEDIUM_CONFIDENCE
133133
);
134134
case 'string':
135135
return new FieldFactoryClassGuess(
136-
'Symfony\Component\Form\TextField',
136+
'Symfony\Component\Form\TextField',
137137
array(),
138138
FieldFactoryGuess::LOW_CONFIDENCE
139139
);
140140
}
141141
break;
142142
case 'Symfony\Component\Validator\Constraints\Choice':
143143
return new FieldFactoryClassGuess(
144-
'Symfony\Component\Form\ChoiceField',
144+
'Symfony\Component\Form\ChoiceField',
145145
array('choices' => $constraint->choices),
146146
FieldFactoryGuess::HIGH_CONFIDENCE
147147
);
148148
case 'Symfony\Component\Validator\Constraints\Country':
149149
return new FieldFactoryClassGuess(
150-
'Symfony\Component\Form\CountryField',
150+
'Symfony\Component\Form\CountryField',
151151
array(),
152152
FieldFactoryGuess::HIGH_CONFIDENCE
153153
);
154154
case 'Symfony\Component\Validator\Constraints\Date':
155155
return new FieldFactoryClassGuess(
156-
'Symfony\Component\Form\DateField',
156+
'Symfony\Component\Form\DateField',
157157
array('type' => 'string'),
158158
FieldFactoryGuess::HIGH_CONFIDENCE
159159
);
160160
case 'Symfony\Component\Validator\Constraints\DateTime':
161161
return new FieldFactoryClassGuess(
162-
'Symfony\Component\Form\DateTimeField',
162+
'Symfony\Component\Form\DateTimeField',
163163
array('type' => 'string'),
164164
FieldFactoryGuess::HIGH_CONFIDENCE
165165
);
166166
case 'Symfony\Component\Validator\Constraints\Email':
167167
return new FieldFa F438 ctoryClassGuess(
168-
'Symfony\Component\Form\TextField',
168+
'Symfony\Component\Form\TextField',
169169
array(),
170170
FieldFactoryGuess::HIGH_CONFIDENCE
171171
);
172172
case 'Symfony\Component\Validator\Constraints\File':
173173
return new FieldFactoryClassGuess(
174-
'Symfony\Component\Form\FileField',
174+
'Symfony\Component\Form\FileField',
175175
array(),
176176
FieldFactoryGuess::HIGH_CONFIDENCE
177177
);
178178
case 'Symfony\Component\Validator\Constraints\Image':
179179
return new FieldFactoryClassGuess(
180-
'Symfony\Component\Form\FileField',
180+
'Symfony\Component\Form\FileField',
181181
array(),
182182
FieldFactoryGuess::HIGH_CONFIDENCE
183183
);
184184
case 'Symfony\Component\Validator\Constraints\Ip':
185185
return new FieldFactoryClassGuess(
186-
'Symfony\Component\Form\TextField',
186+
'Symfony\Component\Form\TextField',
187187
array(),
188188
FieldFactoryGuess::MEDIUM_CONFIDENCE
189189
);
190190
case 'Symfony\Component\Validator\Constraints\Language':
191191
return new FieldFactoryClassGuess(
192-
'Symfony\Component\Form\LanguageField',
192+
'Symfony\Component\Form\LanguageField',
193193
array(),
194194
FieldFactoryGuess::HIGH_CONFIDENCE
195195
);
196196
case 'Symfony\Component\Validator\Constraints\Locale':
197197
return new FieldFactoryClassGuess(
198-
'Symfony\Component\Form\LocaleField',
198+
'Symfony\Component\Form\LocaleField',
199199
array(),
200200
FieldFactoryGuess::HIGH_CONFIDENCE
201201
);
202202
case 'Symfony\Component\Validator\Constraints\Max':
203203
return new FieldFactoryClassGuess(
204-
'Symfony\Component\Form\NumberField',
204+
'Symfony\Component\Form\NumberField',
205205
array(),
206206
FieldFactoryGuess::LOW_CONFIDENCE
207207
);
208208
case 'Symfony\Component\Validator\Constraints\MaxLength':
209209
return new FieldFactoryClassGuess(
210-
'Symfony\Component\Form\TextField',
210+
'Symfony\Component\Form\TextField',
211211
array(),
212212
FieldFactoryGuess::LOW_CONFIDENCE
213213
);
214214
case 'Symfony\Component\Validator\Constraints\Min':
215215
return new FieldFactoryClassGuess(
216-
'Symfony\Component\Form\NumberField',
216+
'Symfony\Component\Form\NumberField',
217217
array(),
218218
FieldFactoryGuess::LOW_CONFIDENCE
219219
);
220220
case 'Symfony\Component\Validator\Constraints\MinLength':
221221
return new FieldFactoryClassGuess(
222-
'Symfony\Component\Form\TextField',
222+
'Symfony\Component\Form\TextField',
223223
array(),
224224
FieldFactoryGuess::LOW_CONFIDENCE
225225
);
226226
case 'Symfony\Component\Validator\Constraints\Regex':
227227
return new FieldFactoryClassGuess(
228-
'Symfony\Component\Form\TextField',
228+
'Symfony\Component\Form\TextField',
229229
array(),
230230
FieldFactoryGuess::LOW_CONFIDENCE
231231
);
232232
case 'Symfony\Component\Validator\Constraints\Time':
233233
return new FieldFactoryClassGuess(
234-
'Symfony\Component\Form\TimeField',
234+
'Symfony\Component\Form\TimeField',
235235
array('type' => 'string'),
236236
FieldFactoryGuess::HIGH_CONFIDENCE
237237
);
238238
case 'Symfony\Component\Validator\Constraints\Url':
239239
return new FieldFactoryClassGuess(
240-
'Symfony\Component\Form\UrlField',
240+
'Symfony\Component\Form\UrlField',
241241
array(),
242242
FieldFactoryGuess::HIGH_CONFIDENCE
243243
);
244244
default:
245245
return new FieldFactoryClassGuess(
246-
'Symfony\Component\Form\TextField',
246+
'Symfony\Component\Form\TextField',
247247
array(),
248248
FieldFactoryGuess::LOW_CONFIDENCE
249249
);
@@ -261,17 +261,17 @@ public function guessRequiredForConstraint(Constraint $constraint)
261261
switch (get_class($constraint)) {
262262
case 'Symfony\Component\Validator\Constraints\NotNull':
263263
return new FieldFactoryGuess(
264-
true,
264+
true,
265265
FieldFactoryGuess::HIGH_CONFIDENCE
266266
);
267267
case 'Symfony\Component\Validator\Constraints\NotBlank':
268268
return new FieldFactoryGuess(
269-
true,
269+
true,
270270
FieldFactoryGuess::HIGH_CONFIDENCE
271271
);
272272
default:
273273
return new FieldFactoryGuess(
274-
false,
274+
false,
275275
FieldFactoryGuess::LOW_CONFIDENCE
276276
);
277277
}
@@ -288,12 +288,12 @@ public function guessMaxLengthForConstraint(Constraint $constraint)
288288
switch (get_class($constraint)) {
289289
case 'Symfony\Component\Validator\Constraints\MaxLength':
290290
return new FieldFactoryGuess(
291-
$constraint->limit,
291+
$constraint->limit,
292292
FieldFactoryGuess::HIGH_CONFIDENCE
293293
);
294294
case 'Symfony\Component\Validator\Constraints\Max':
295295
return new FieldFactoryGuess(
296-
strlen((string)$constraint->limit),
296+
strlen((string)$constraint->limit),
297297
FieldFactoryGuess::HIGH_CONFIDENCE
298298
);
299299
}

src/Symfony/Component/Form/PropertyPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,6 @@ protected function updateProperty(&$objectOrArray, $currentIndex, $value)
384384

385385
protected function camelize($property)
386386
{
387-
return preg_replace(array('/(^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $property);
387+
return preg_replace(array('/(^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $property);
388388
}
389389
}

src/Symfony/Component/Validator/Mapping/ClassMetadata.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ public function addConstraint(Constraint $constraint)
9898
{
9999
if (!in_array(Constraint::CLASS_CONSTRAINT, (array)$constraint->targets())) {
100100
throw new ConstraintDefinitionException(sprintf(
101-
'The constraint %s cannot be put on classes',
102-
get_class($constraint)));
101+
'The constraint %s cannot be put on classes',
102+
get_class($constraint)
103+
));
103104
}
104105

105106
$constraint->addImplicitGroupName($this->getDefaultGroup());

src/Symfony/Component/Validator/Mapping/MemberMetadata.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ public function addConstraint(Constraint $constraint)
4545
{
4646
if (!in_array(Constraint::PROPERTY_CONSTRAINT, (array)$constraint->targets())) {
4747
throw new ConstraintDefinitionException(sprintf(
48-
'The constraint %s cannot be put on properties or getters',
49-
get_class($constraint)));
48+
'The constraint %s cannot be put on properties or getters',
49+
get_class($constraint)
50+
));
5051
}
5152

5253
if ($constraint instanceof Valid) {

tests/Symfony/Tests/Component/Form/CsrfProvider/SessionCsrfProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class SessionCsrfProviderTest extends \PHPUnit_Framework_TestCase
2020
protected function setUp()
2121
{
2222
$this->session = $this->getMock(
23-
'Symfony\Component\HttpFoundation\Session',
23+
'Symfony\Component\HttpFoundation\Session',
2424
array(),
2525
array(),
2626
'',

tests/Symfony/Tests/Component/Form/FieldFactory/FieldFactoryTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testGetInstanceCreatesClassWithHighestConfidence()
3535
->method('guessClass')
3636
->with($this->equalTo($object), $this->equalTo('firstName'))
3737
->will($this->returnValue(new FieldFactoryClassGuess(
38-
'Symfony\Component\Form\TextField',
38+
'Symfony\Component\Form\TextField',
3939
array('max_length' => 10),
4040
FieldFactoryGuess::MEDIUM_CONFIDENCE
4141
)));
@@ -45,7 +45,7 @@ public function testGetInstanceCreatesClassWithHighestConfidence()
4545
->method('guessClass')
4646
->with($this->equalTo($object), $this->equalTo('firstName'))
4747
->will($this->returnValue(new FieldFactoryClassGuess(
48-
'Symfony\Component\Form\PasswordField',
48+
'Symfony\Component\Form\PasswordField',
4949
array('max_length' => 7),
5050
FieldFactoryGuess::HIGH_CONFIDENCE
5151
)));
@@ -85,7 +85,7 @@ public function testOptionsCanBeOverridden()
8585
->method('guessClass')
8686
->with($this->equalTo($object), $this->equalTo('firstName'))
8787
->will($this->returnValue(new FieldFactoryClassGuess(
88-
'Symfony\Component\Form\TextField',
88+
'Symfony\Component\Form\TextField',
8989
array('max_length' => 10),
9090
FieldFactoryGuess::MEDIUM_CONFIDENCE
9191
)));
@@ -107,15 +107,15 @@ public function testGetInstanceUsesMaxLengthIfFoundAndTextField()
107107
->method('guessClass')
108108
->with($this->equalTo($object), $this->equalTo('firstName'))
109109
->will($this->returnValue(new FieldFactoryClassGuess(
110-
'Symfony\Component\Form\TextField',
110+
'Symfony\Component\Form\TextField',
111111
array('max_length' => 10),
112112
FieldFactoryGuess::MEDIUM_CONFIDENCE
113113
)));
114114
$guesser1->expects($this->once())
115115
->method('guessMaxLength')
116116
->with($this->equalTo($object), $this->equalTo('firstName'))
117117
->will($this->returnValue(new FieldFactoryGuess(
118-
15,
118+
15,
119119
FieldFactoryGuess::MEDIUM_CONFIDENCE
120120
)));
121121

@@ -124,7 +124,7 @@ public function testGetInstanceUsesMaxLengthIfFoundAndTextField()
124124
->method('guessMaxLength')
125125
->with($this->equalTo($object), $this->equalTo('firstName'))
126126
->will($this->returnValue(new FieldFactoryGuess(
127-
20,
127+
20,
128128
FieldFactoryGuess::HIGH_CONFIDENCE
129129
)));
130130

@@ -145,15 +145,15 @@ public function testGetInstanceUsesMaxLengthIfFoundAndSubclassOfTextField()
145145
->method('guessClass')
146146
->with($this->equalTo($object), $this->equalTo('firstName'))
147147
->will($this->returnValue(new FieldFactoryClassGuess(
148-
'Symfony\Component\Form\PasswordField',
148+
'Symfony\Component\Form\PasswordField',
149149
array('max_length' => 10),
150150
FieldFactoryGuess::MEDIUM_CONFIDENCE
151151
)));
152152
$guesser->expects($this->once())
153153
->method('guessMaxLength')
154154
->with($this->equalTo($object), $this->equalTo('firstName'))
155155
->will($this->returnValue(new FieldFactoryGuess(
156-
15,
156+
15,
157157
FieldFactoryGuess::MEDIUM_CONFIDENCE
158158
)));
159159

@@ -174,15 +174,15 @@ public function testGetInstanceUsesRequiredSettingWithHighestConfidence()
174174
->method('guessClass')
175175
->with($this->equalTo($object), $this->equalTo('firstName'))
176176
->will($this->returnValue(new FieldFactoryClassGuess(
177-
'Symfony\Component\Form\TextField',
177+
'Symfony\Component\Form\TextField',
178178
array(),
179179
FieldFactoryGuess::MEDIUM_CONFIDENCE
180180
)));
181181
$guesser1->expects($this->once())
182182
->method('guessRequired')
183183
->with($this->equalTo($object), $this->equalTo('firstName'))
184184
->will($this->returnValue(new FieldFactoryGuess(
185-
true,
185+
true,
186186
FieldFactoryGuess::MEDIUM_CONFIDENCE
187187
)));
188188

@@ -191,7 +191,7 @@ public function testGetInstanceUsesRequiredSettingWithHighestConfidence()
191191
->method('guessRequired')
192192
->with($this->equalTo($object), $this->equalTo('firstName'))
193193
->will($this->returnValue(new FieldFactoryGuess(
194-
false,
194+
false,
195195
FieldFactoryGuess::HIGH_CONFIDENCE
196196
)));
197197

tests/Symfony/Tests/Component/Form/FieldGroupTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ protected function createMockField($key)
762762
protected function createMockForm()
763763
{
764764
$form = $this->getMock(
765-
'Symfony\Component\Form\Form',
765+
'Symfony\Component\Form\Form',
766766
array(),
767767
array(),
768768
'',

0 commit comments

Comments
 (0)
0