Skip to content

Commit b5022ae

Browse files
authored
Format code (#6994)
1 parent 71728e3 commit b5022ae

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

tests/Cases/ValidateAttributesTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ public function testValidateJson()
117117
$this->assertFalse($validator->validateJson('', [3.14]));
118118
$this->assertTrue($validator->validateJson('', '["a"]'));
119119
// object
120-
$this->assertFalse($validator->validateJson('', new class() {}));
121-
$this->assertTrue($validator->validateJson('', new class() implements Stringable {
120+
$this->assertFalse($validator->validateJson('', new class {}));
121+
$this->assertTrue($validator->validateJson('', new class implements Stringable {
122122
public function __toString(): string
123123
{
124124
return json_encode(['foo' => 'bar'], JSON_UNESCAPED_UNICODE);
125125
}
126126
}));
127127

128-
$this->assertTrue($validator->validateJson('', new class() {
128+
$this->assertTrue($validator->validateJson('', new class {
129129
public function __toString(): string
130130
{
131131
return json_encode(['foo' => 'bar'], JSON_UNESCAPED_UNICODE);

tests/Cases/ValidationPasswordRuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public function testPassesWithCustomRules()
335335
}
336336
};
337337

338-
$ruleObject = new class() implements Rule {
338+
$ruleObject = new class implements Rule {
339339
public function passes($attribute, $value): bool
340340
{
341341
return $value === 'aa';

tests/Cases/ValidationValidatorTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,15 +2358,15 @@ public function testValidateEmail()
23582358
$v = new Validator($trans, ['x' => ['not a string']], ['x' => 'Email']);
23592359
$this->assertFalse($v->passes());
23602360

2361-
$v = new Validator($trans, ['x' => new class() {
2361+
$v = new Validator($trans, ['x' => new class {
23622362
public function __toString()
23632363
{
23642364
return 'aslsdlks';
23652365
}
23662366
}], ['x' => 'Email']);
23672367
$this->assertFalse($v->passes());
23682368

2369-
$v = new Validator($trans, ['x' => new class() {
2369+
$v = new Validator($trans, ['x' => new class {
23702370
public function __toString()
23712371
{
23722372
return 'foo@gmail.com';
@@ -4496,7 +4496,7 @@ public function testCustomValidationObject()
44964496
$v = new Validator(
44974497
$this->getIlluminateArrayTranslator(),
44984498
['name' => 'taylor'],
4499-
['name' => new class() implements Rule {
4499+
['name' => new class implements Rule {
45004500
public function passes(string $attribute, mixed $value): bool
45014501
{
45024502
return $value === 'taylor';
@@ -4515,7 +4515,7 @@ public function message(): array|string
45154515
$v = new Validator(
45164516
$this->getIlluminateArrayTranslator(),
45174517
['name' => 'adam'],
4518-
['name' => [new class() implements Rule {
4518+
['name' => [new class implements Rule {
45194519
public function passes(string $attribute, mixed $value): bool
45204520
{
45214521
return $value === 'taylor';
@@ -4563,7 +4563,7 @@ public function message(): array|string
45634563
$this->getIlluminateArrayTranslator(),
45644564
['name' => 'taylor', 'states' => ['AR', 'TX'], 'number' => 9],
45654565
[
4566-
'states.*' => new class() implements Rule {
4566+
'states.*' => new class implements Rule {
45674567
public function passes(string $attribute, mixed $value): bool
45684568
{
45694569
return in_array($value, ['AK', 'HI']);
@@ -4600,7 +4600,7 @@ function ($attribute, $value, $fail) {
46004600
$v = new Validator(
46014601
$this->getIlluminateArrayTranslator(),
46024602
['name' => 42],
4603-
['name' => new class() implements Rule {
4603+
['name' => new class implements Rule {
46044604
public function passes(string $attribute, mixed $value): bool
46054605
{
46064606
return $value === 'taylor';
@@ -4621,7 +4621,7 @@ public function message(): array|string
46214621
$v = new Validator(
46224622
$this->getIlluminateArrayTranslator(),
46234623
['name' => 42],
4624-
['name' => [new class() implements Rule {
4624+
['name' => [new class implements Rule {
46254625
public function passes(string $attribute, mixed $value): bool
46264626
{
46274627
return $value === 'taylor';
@@ -4646,7 +4646,7 @@ public function testImplicitCustomValidationObjects()
46464646
$v = new Validator(
46474647
$this->getIlluminateArrayTranslator(),
46484648
['name' => ''],
4649-
['name' => $rule = new class() implements ImplicitRule {
4649+
['name' => $rule = new class implements ImplicitRule {
46504650
public $called = false;
46514651

46524652
public function passes(string $attribute, mixed $value): bool

0 commit comments

Comments
 (0)