Skip to content

Commit 6929b2c

Browse files
committed
fixed CS
1 parent ea8b654 commit 6929b2c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+87
-101
lines changed

Constraints/AbstractComparisonValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function validate($value, Constraint $constraint)
3434
$this->context->addViolation($constraint->message, array(
3535
'{{ value }}' => $this->formatValue($value, self::OBJECT_TO_STRING | self::PRETTY_DATE),
3636
'{{ compared_value }}' => $this->formatValue($constraint->value, self::OBJECT_TO_STRING | self::PRETTY_DATE),
37-
'{{ compared_value_type }}' => $this->formatTypeOf($constraint->value)
37+
'{{ compared_value_type }}' => $this->formatTypeOf($constraint->value),
3838
));
3939
}
4040
}

Constraints/BlankValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function validate($value, Constraint $constraint)
2828
{
2929
if ('' !== $value && null !== $value) {
3030
$this->context->addViolation($constraint->message, array(
31-
'{{ value }}' => $this->formatValue($value)
31+
'{{ value }}' => $this->formatValue($value),
3232
));
3333
}
3434
}

Constraints/CardSchemeValidator.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ class CardSchemeValidator extends ConstraintValidator
2828
* American Express card numbers start with 34 or 37 and have 15 digits.
2929
*/
3030
'AMEX' => array(
31-
'/^3[47][0-9]{13}$/'
31+
'/^3[47][0-9]{13}$/',
3232
),
3333
/**
3434
* China UnionPay cards start with 62 and have between 16 and 19 digits.
3535
* Please note that these cards do not follow Luhn Algorithm as a checksum.
3636
*/
3737
'CHINA_UNIONPAY' => array(
38-
'/^62[0-9]{14,17}$/'
38+
'/^62[0-9]{14,17}$/',
3939
),
4040
/**
4141
* Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits.
@@ -53,45 +53,45 @@ class CardSchemeValidator extends ConstraintValidator
5353
'/^6011[0-9]{12}$/',
5454
'/^64[4-9][0-9]{13}$/',
5555
'/^65[0-9]{14}$/',
56-
'/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/'
56+
'/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/',
5757
),
5858
/**
5959
* InstaPayment cards begin with 637 through 639 and have 16 digits
6060
*/
6161
'INSTAPAYMENT' => array(
62-
'/^63[7-9][0-9]{13}$/'
62+
'/^63[7-9][0-9]{13}$/',
6363
),
6464
/**
6565
* JCB cards beginning with 2131 or 1800 have 15 digits.
6666
* JCB cards beginning with 35 have 16 digits.
6767
*/
6868
'JCB' => array(
69-
'/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/'
69+
'/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/',
7070
),
7171
/**
7272
* Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits
7373
*/
7474
'LASER' => array(
75-
'/^(6304|670[69]|6771)[0-9]{12,15}$/'
75+
'/^(6304|670[69]|6771)[0-9]{12,15}$/',
7676
),
7777
/**
7878
* Maestro cards begin with either 5018, 5020, 5038, 5893, 6304, 6759, 6761, 6762, 6763 or 0604
7979
* They have between 12 and 19 digits
8080
*/
8181
'MAESTRO' => array(
82-
'/^(5018|5020|5038|6304|6759|6761|676[23]|0604)[0-9]{8,15}$/'
82+
'/^(5018|5020|5038|6304|6759|6761|676[23]|0604)[0-9]{8,15}$/',
8383
),
8484
/**
8585
* All MasterCard numbers start with the numbers 51 through 55. All have 16 digits.
8686
*/
8787
'MASTERCARD' => array(
88-
'/^5[1-5][0-9]{14}$/'
88+
'/^5[1-5][0-9]{14}$/',
8989
),
9090
/**
9191
* All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13.
9292
*/
9393
'VISA' => array(
94-
'/^4([0-9]{12}|[0-9]{15})$/'
94+
'/^4([0-9]{12}|[0-9]{15})$/',
9595
),
9696
);
9797

Constraints/ChoiceValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@ public function validate($value, Constraint $constraint)
6969

7070
if ($constraint->min !== null && $count < $constraint->min) {
7171
$this->context->addViolation($constraint->minMessage, array(
72-
'{{ limit }}' => $constraint->min
72+
'{{ limit }}' => $constraint->min,
7373
), $value, (int) $constraint->min);
7474

7575
return;
7676
}
7777

7878
if ($constraint->max !== null && $count > $constraint->max) {
7979
$this->context->addViolation($constraint->maxMessage, array(
80-
'{{ limit }}' => $constraint->max
80+
'{{ limit }}' => $constraint->max,
8181
), $value, (int) $constraint->max);
8282

8383
return;
8484
}
8585
} elseif (!in_array($value, $choices, $constraint->strict)) {
8686
$this->context->addViolation($constraint->message, array(
87-
'{{ value }}' => $this->formatValue($value)
87+
'{{ value }}' => $this->formatValue($value),
8888
));
8989
}
9090
}

Constraints/CollectionValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function validate($value, Constraint $constraint)
4646
$this->context->validateValue($value[$field], $fieldConstraint->constraints, '['.$field.']', $group);
4747
} elseif (!$fieldConstraint instanceof Optional && !$constraint->allowMissingFields) {
4848
$this->context->addViolationAt('['.$field.']', $constraint->missingFieldsMessage, array(
49-
'{{ field }}' => $this->formatValue($field)
49+
'{{ field }}' => $this->formatValue($field),
5050
), null);
5151
}
5252
}
@@ -55,7 +55,7 @@ public function validate($value, Constraint $constraint)
5555
foreach ($value as $field => $fieldValue) {
5656
if (!isset($constraint->fields[$field])) {
5757
$this->context->addViolationAt('['.$field.']', $constraint->extraFieldsMessage, array(
58-
'{{ field }}' => $this->formatValue($field)
58+
'{{ field }}' => $this->formatValue($field),
5959
), $fieldValue);
6060
}
6161
}

Constraints/FileValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ public function validate($value, Constraint $constraint)
9797

9898
if (!is_file($path)) {
9999
$this->context->addViolation($constraint->notFoundMessage, array(
100-
'{{ file }}' => $this->formatValue($path)
100+
'{{ file }}' => $this->formatValue($path),
101101
));
102102

103103
return;
104104
}
105105

106106
if (!is_readable($path)) {
107107
$this->context->addViolation($constraint->notReadableMessage, array(
108-
'{{ file }}' => $this->formatValue($path)
108+
'{{ file }}' => $this->formatValue($path),
109109
));
110110

111111
return;

Constraints/ImageValidator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function validate($value, Constraint $constraint)
6060
if ($width < $constraint->minWidth) {
6161
$this->context->addViolation($constraint->minWidthMessage, array(
6262
'{{ width }}' => $width,
63-
'{{ min_width }}' => $constraint->minWidth
63+
'{{ min_width }}' => $constraint->minWidth,
6464
));
6565

6666
return;
@@ -75,7 +75,7 @@ public function validate($value, Constraint $constraint)
7575
if ($width > $constraint->maxWidth) {
7676
$this->context->addViolation($constraint->maxWidthMessage, array(
7777
'{{ width }}' => $width,
78-
'{{ max_width }}' => $constraint->maxWidth
78+
'{{ max_width }}' => $constraint->maxWidth,
7979
));
8080

8181
return;
@@ -90,7 +90,7 @@ public function validate($value, Constraint $constraint)
9090
if ($height < $constraint->minHeight) {
9191
$this->context->addViolation($constraint->minHeightMessage, array(
9292
'{{ height }}' => $height,
93-
'{{ min_height }}' => $constraint->minHeight
93+
'{{ min_height }}' => $constraint->minHeight,
9494
));
9595

9696
return;
@@ -105,7 +105,7 @@ public function validate($value, Constraint $constraint)
105105
if ($height > $constraint->maxHeight) {
106106
$this->context->addViolation($constraint->maxHeightMessage, array(
107107
'{{ height }}' => $height,
108-
'{{ max_height }}' => $constraint->maxHeight
108+
'{{ max_height }}' => $constraint->maxHeight,
109109
));
110110
}
111111
}

Constraints/IsbnValidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ private function isValidIsbn13($isbn)
100100
}
101101

102102
for ($i = 1; $i < 12; $i += 2) {
103-
$checkSum += $isbn{$i} * 3;
103+
$checkSum += $isbn{$i}
104+
* 3;
104105
}
105106

106107
return 0 === $checkSum % 10;

Constraints/IssnValidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function validate($value, Constraint $constraint)
5555
$canonical = strtoupper(str_replace('-', '', $value));
5656

5757
// Calculate a checksum. "X" equals 10.
58-
$checkSum = 'X' === $canonical{7} ? 10 : $canonical{7};
58+
$checkSum = 'X' === $canonical{7}
59+
? 10 : $canonical{7};
5960

6061
for ($i = 0; $i < 7; ++$i) {
6162
// Multiply the first digit by 8, the second by 7, etc.

Mapping/ClassMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function __sleep()
131131
'members',
132132
'name',
133133
'properties',
134-
'defaultGroup'
134+
'defaultGroup',
135135
));
136136
}
137137

Tests/ConstraintTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testInvalidAndRequiredOptionsPassed()
5353

5454
new ConstraintC(array(
5555
'option1' => 'default',
56-
'foo' => 'bar'
56+
'foo' => 'bar',
5757
));
5858
}
5959

Tests/Constraints/AbstractComparisonValidatorTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function testInvalidComparisonToValue($dirtyValue, $dirtyValueAsString, $
8787
$this->assertViolation('Constraint Message', array(
8888
'{{ value }}' => $dirtyValueAsString,
8989
'{{ compared_value }}' => $comparedValueString,
90-
'{{ compared_value_type }}' => $comparedValueType
90+
'{{ compared_value_type }}' => $comparedValueType,
9191
));
9292
}
9393

Tests/Constraints/AbstractConstraintValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function createContext()
7474
$this->metadata,
7575
$this->value,
7676
$this->group,
77-
$this->propertyPath
77+
$this->propertyPath,
7878
))
7979
->setMethods(array('validate', 'validateValue'))
8080
->getMock();

Tests/Constraints/BlankValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testBlankIsValid()
4141
public function testInvalidValues($value, $valueAsString)
4242
{
4343
$constraint = new Blank(array(
44-
'message' => 'myMessage'
44+
'message' => 'myMessage',
4545
));
4646

4747
$this->validator->validate($value, $constraint);

Tests/Constraints/CallbackValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function testSingleStaticMethod()
121121
{
122122
$object = new CallbackValidatorTest_Object();
123123
$constraint = new Callback(array(
124-
array(__CLASS__.'_Class', 'validateCallback')
124+
array(__CLASS__.'_Class', 'validateCallback'),
125125
));
126126

127127
$this->validator->validate($object, $constraint);

Tests/Constraints/ChoiceValidatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testValidChoiceCallbackClosure()
8989
{
9090
$constraint = new Choice(array('callback' => function () {
9191
return array('foo', 'bar');
92-
}));
92+
},));
9393

9494
$this->validator->validate('bar', $constraint);
9595

@@ -228,7 +228,7 @@ public function testStrictDisallowsDifferentType()
228228
$constraint = new Choice(array(
229229
'choices' => array(1, 2),
230230
'strict' => true,
231-
'message' => 'myMessage'
231+
'message' => 'myMessage',
232232
));
233233

234234
$this->validator->validate('2', $constraint);
@@ -243,7 +243,7 @@ public function testNonStrictWithMultipleChoices()
243243
$constraint = new Choice(array(
244244
'choices' => array(1, 2, 3),
245245
'multiple' => true,
246-
'strict' => false
246+
'strict' => false,
247247
));
248248

249249
$this->validator->validate(array('2', 3), $constraint);

Tests/Constraints/CollectionValidatorTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testWalkMultipleConstraints()
112112
'fields' => array(
113113
'foo' => $constraints,
114114
'bar' => $constraints,
115-
)
115+
),
116116
)));
117117

118118
$this->assertNoViolation();
@@ -137,7 +137,7 @@ public function testExtraFieldsDisallowed()
137137
)));
138138

139139
$this->assertViolation('myMessage', array(
140-
'{{ field }}' => '"baz"'
140+
'{{ field }}' => '"baz"',
141141
), 'property.path[baz]', 6);
142142
}
143143

@@ -196,7 +196,7 @@ public function testMissingFieldsDisallowed()
196196
)));
197197

198198
$this->assertViolation('myMessage', array(
199-
'{{ field }}' => '"foo"'
199+
'{{ field }}' => '"foo"',
200200
), 'property.path[foo]', null);
201201
}
202202

@@ -306,7 +306,7 @@ public function testRequiredFieldNotPresent()
306306
)));
307307

308308
$this->assertViolation('myMessage', array(
309-
'{{ field }}' => '"foo"'
309+
'{{ field }}' => '"foo"',
310310
), 'property.path[foo]', null);
311311
}
312312

@@ -354,7 +354,7 @@ public function testRequiredFieldMultipleConstraints()
354354
public function testObjectShouldBeLeftUnchanged()
355355
{
356356
$value = new \ArrayObject(array(
357-
'foo' => 3
357+
'foo' => 3,
358358
));
359359

360360
$constraint = new Range(array('min' => 2));
@@ -364,11 +364,11 @@ public function testObjectShouldBeLeftUnchanged()
364364
$this->validator->validate($value, new Collection(array(
365365
'fields' => array(
366366
'foo' => $constraint,
367-
)
367+
),
368368
)));
369369

370370
$this->assertEquals(array(
371-
'foo' => 3
371+
'foo' => 3,
372372
), (array) $value);
373373
}
374374
}

Tests/Constraints/CountValidatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function testInvalidValuesMax($value)
116116
{
117117
$constraint = new Count(array(
118118
'max' => 4,
119-
'maxMessage' => 'myMessage'
119+
'maxMessage' => 'myMessage',
120120
));
121121

122122
$this->validator->validate($value, $constraint);
@@ -134,7 +134,7 @@ public function testInvalidValuesMin($value)
134134
{
135135
$constraint = new Count(array(
136136
'min' => 4,
137-
'minMessage' => 'myMessage'
137+
'minMessage' => 'myMessage',
138138
));
139139

140140
$this->validator->validate($value, $constraint);
@@ -153,7 +153,7 @@ public function testInvalidValuesExact($value)
153153
$constraint = new Count(array(
154154
'min' => 4,
155155
'max' => 4,
156-
'exactMessage' => 'myMessage'
156+
'exactMessage' => 'myMessage',
157157
));
158158

159159
$this->validator->validate($value, $constraint);

Tests/Constraints/CountryValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getValidCountries()
7676
public function testInvalidCountries($country)
7777
{
7878
$constraint = new Country(array(
79-
'message' => 'myMessage'
79+
'message' => 'myMessage',
8080
));
8181

8282
$this->validator->validate($country, $constraint);

Tests/Constraints/CurrencyValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getValidCurrencies()
9090
public function testInvalidCurrencies($currency)
9191
{
9292
$constraint = new Currency(array(
93-
'message' => 'myMessage'
93+
'message' => 'myMessage',
9494
));
9595

9696
$this->validator->validate($currency, $constraint);

Tests/Constraints/DateTimeValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getValidDateTimes()
7575
public function testInvalidDateTimes($dateTime)
7676
{
7777
$constraint = new DateTime(array(
78-
'message' => 'myMessage'
78+
'message' => 'myMessage',
7979
));
8080

8181
$this->validator->validate($dateTime, $constraint);

0 commit comments

Comments
 (0)