Skip to content

Commit 7b4ec71

Browse files
cs fix
1 parent 29e5cfb commit 7b4ec71

22 files changed

+156
-78
lines changed

tests/Unit/Analyzer/ClassDescriptionBuilderTest.php

+22-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public function test_it_should_create_builder_with_dependency_and_interface(): v
1616
{
1717
$FQCN = 'HappyIsland';
1818
$classDescriptionBuilder = new ClassDescriptionBuilder();
19-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
19+
$classDescriptionBuilder->setFilePath('src/Foo.php')
20+
->setClassName($FQCN);
2021

2122
$classDependency = new ClassDependency('DepClass', 10);
2223

@@ -35,7 +36,8 @@ public function test_it_should_create_final_class(): void
3536
{
3637
$FQCN = 'HappyIsland';
3738
$classDescriptionBuilder = new ClassDescriptionBuilder();
38-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
39+
$classDescriptionBuilder->setFilePath('src/Foo.php')
40+
->setClassName($FQCN);
3941
$classDescriptionBuilder->setFinal(true);
4042

4143
$classDescription = $classDescriptionBuilder->build();
@@ -49,7 +51,8 @@ public function test_it_should_create_not_final_class(): void
4951
{
5052
$FQCN = 'HappyIsland';
5153
$classDescriptionBuilder = new ClassDescriptionBuilder();
52-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
54+
$classDescriptionBuilder->setFilePath('src/Foo.php')
55+
->setClassName($FQCN);
5356
$classDescriptionBuilder->setFinal(false);
5457

5558
$classDescription = $classDescriptionBuilder->build();
@@ -63,7 +66,8 @@ public function test_it_should_create_abstract_class(): void
6366
{
6467
$FQCN = 'HappyIsland';
6568
$classDescriptionBuilder = new ClassDescriptionBuilder();
66-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
69+
$classDescriptionBuilder->setFilePath('src/Foo.php')
70+
->setClassName($FQCN);
6771
$classDescriptionBuilder->setAbstract(true);
6872

6973
$classDescription = $classDescriptionBuilder->build();
@@ -77,7 +81,8 @@ public function test_it_should_create_not_abstract_class(): void
7781
{
7882
$FQCN = 'HappyIsland';
7983
$classDescriptionBuilder = new ClassDescriptionBuilder();
80-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
84+
$classDescriptionBuilder->setFilePath('src/Foo.php')
85+
->setClassName($FQCN);
8186
$classDescriptionBuilder->setAbstract(false);
8287

8388
$classDescription = $classDescriptionBuilder->build();
@@ -91,7 +96,8 @@ public function test_it_should_create_annotated_class(): void
9196
{
9297
$FQCN = 'HappyIsland';
9398
$classDescriptionBuilder = new ClassDescriptionBuilder();
94-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
99+
$classDescriptionBuilder->setFilePath('src/Foo.php')
100+
->setClassName($FQCN);
95101
$classDescriptionBuilder->addDocBlock('/**
96102
* @psalm-immutable
97103
*/');
@@ -112,7 +118,8 @@ public function test_it_should_add_attributes(): void
112118
{
113119
$FQCN = 'HappyIsland';
114120
$classDescriptionBuilder = new ClassDescriptionBuilder();
115-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
121+
$classDescriptionBuilder->setFilePath('src/Foo.php')
122+
->setClassName($FQCN);
116123
$classDescriptionBuilder->addAttribute('AttrClass', 27);
117124

118125
$classDescription = $classDescriptionBuilder->build();
@@ -127,7 +134,8 @@ public function test_it_should_create_interface(): void
127134
{
128135
$FQCN = 'HappyIsland';
129136
$classDescriptionBuilder = new ClassDescriptionBuilder();
130-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
137+
$classDescriptionBuilder->setFilePath('src/Foo.php')
138+
->setClassName($FQCN);
131139
$classDescriptionBuilder->setInterface(true);
132140

133141
$classDescription = $classDescriptionBuilder->build();
@@ -141,7 +149,8 @@ public function test_it_should_create_not_interface(): void
141149
{
142150
$FQCN = 'HappyIsland';
143151
$classDescriptionBuilder = new ClassDescriptionBuilder();
144-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
152+
$classDescriptionBuilder->setFilePath('src/Foo.php')
153+
->setClassName($FQCN);
145154
$classDescriptionBuilder->setInterface(false);
146155

147156
$classDescription = $classDescriptionBuilder->build();
@@ -155,7 +164,8 @@ public function test_it_should_create_trait(): void
155164
{
156165
$FQCN = 'HappyIsland';
157166
$classDescriptionBuilder = new ClassDescriptionBuilder();
158-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
167+
$classDescriptionBuilder->setFilePath('src/Foo.php')
168+
->setClassName($FQCN);
159169
$classDescriptionBuilder->setTrait(true);
160170

161171
$classDescription = $classDescriptionBuilder->build();
@@ -169,7 +179,8 @@ public function test_it_should_create_not_trait(): void
169179
{
170180
$FQCN = 'HappyIsland';
171181
$classDescriptionBuilder = new ClassDescriptionBuilder();
172-
$classDescriptionBuilder->setFilePath('src/Foo.php')->setClassName($FQCN);
182+
$classDescriptionBuilder->setFilePath('src/Foo.php')
183+
->setClassName($FQCN);
173184
$classDescriptionBuilder->setTrait(false);
174185

175186
$classDescription = $classDescriptionBuilder->build();

tests/Unit/Expressions/ForClasses/ContainDocBlockLikeTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public function test_it_should_return_true_if_contains_doc_block(): void
1616
$expression = new ContainDocBlockLike('myDocBlock');
1717

1818
$classDescription = (new ClassDescriptionBuilder())
19-
->setFilePath('src/Foo.php')->setClassName('HappyIsland\Myclass')
19+
->setFilePath('src/Foo.php')
20+
->setClassName('HappyIsland\Myclass')
2021
->addDocBlock('/** */myDocBlock with other information')
2122
->build();
2223

@@ -36,7 +37,8 @@ public function test_it_should_return_false_if_not_contains_doc_block(): void
3637
$expression = new ContainDocBlockLike('anotherDocBlock');
3738

3839
$classDescription = (new ClassDescriptionBuilder())
39-
->setFilePath('src/Foo.php')->setClassName('HappyIsland\Myclass')
40+
->setFilePath('src/Foo.php')
41+
->setClassName('HappyIsland\Myclass')
4042
->addDocBlock('/** */myDocBlock with other information')
4143
->build();
4244

tests/Unit/Expressions/ForClasses/ExtendTest.php

+12-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public function test_it_should_return_no_violation_on_success(): void
1616
$extend = new Extend('My\BaseClass');
1717

1818
$classDescription = (new ClassDescriptionBuilder())
19-
->setFilePath('src/Foo.php')->setClassName('My\Class')
19+
->setFilePath('src/Foo.php')
20+
->setClassName('My\Class')
2021
->addExtends('My\BaseClass', 10)
2122
->build();
2223

@@ -31,7 +32,8 @@ public function test_it_should_work_with_wildcards(): void
3132
$extend = new Extend('My\B14*');
3233

3334
$classDescription = (new ClassDescriptionBuilder())
34-
->setFilePath('src/Foo.php')->setClassName('My\Class')
35+
->setFilePath('src/Foo.php')
36+
->setClassName('My\Class')
3537
->addExtends('My\B14Class', 10)
3638
->build();
3739

@@ -46,7 +48,8 @@ public function test_it_should_return_violation_error_when_argument_is_a_regex()
4648
$extend = new Extend('App\Providers\(Auth|Event|Route|Horizon)ServiceProvider');
4749

4850
$classDescription = (new ClassDescriptionBuilder())
49-
->setFilePath('src/Foo.php')->setClassName('My\Class')
51+
->setFilePath('src/Foo.php')
52+
->setClassName('My\Class')
5053
->addExtends('My\BaseClass', 10)
5154
->build();
5255

@@ -60,7 +63,8 @@ public function test_it_should_return_violation_error_when_class_not_extend(): v
6063
$extend = new Extend('My\BaseClass');
6164

6265
$classDescription = (new ClassDescriptionBuilder())
63-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
66+
->setFilePath('src/Foo.php')
67+
->setClassName('HappyIsland')
6468
->addExtends('My\AnotherClass', 10)
6569
->build();
6670

@@ -76,7 +80,8 @@ public function test_it_should_return_violation_error_if_extend_is_null(): void
7680
$extend = new Extend('My\BaseClass');
7781

7882
$classDescription = (new ClassDescriptionBuilder())
79-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
83+
->setFilePath('src/Foo.php')
84+
->setClassName('HappyIsland')
8085
->build();
8186

8287
$because = 'we want to add this rule for our software';
@@ -94,7 +99,8 @@ public function test_it_should_accept_multiple_extends(): void
9499
$extend = new Extend('My\FirstExtend', 'My\SecondExtend');
95100

96101
$classDescription = (new ClassDescriptionBuilder())
97-
->setFilePath('src/Foo.php')->setClassName('My\Class')
102+
->setFilePath('src/Foo.php')
103+
->setClassName('My\Class')
98104
->addExtends('My\SecondExtend', 10)
99105
->build();
100106

tests/Unit/Expressions/ForClasses/HaveAttributeTest.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public function test_it_should_return_true_if_contains_doc_block(): void
1616
$expression = new HaveAttribute('myAttribute');
1717

1818
$classDescription = (new ClassDescriptionBuilder())
19-
->setFilePath('src/Foo.php')->setClassName('HappyIsland\Myclass')
19+
->setFilePath('src/Foo.php')
20+
->setClassName('HappyIsland\Myclass')
2021
->addAttribute('myAttribute', 1)
2122
->build();
2223

@@ -36,7 +37,8 @@ public function test_it_should_return_true_if_contains_doc_block_without_because
3637
$expression = new HaveAttribute('myAttribute');
3738

3839
$classDescription = (new ClassDescriptionBuilder())
39-
->setFilePath('src/Foo.php')->setClassName('HappyIsland\Myclass')
40+
->setFilePath('src/Foo.php')
41+
->setClassName('HappyIsland\Myclass')
4042
->addAttribute('myAttribute', 1)
4143
->build();
4244

@@ -55,7 +57,8 @@ public function test_it_should_return_false_if_not_contains_doc_block(): void
5557
$expression = new HaveAttribute('anotherAttribute');
5658

5759
$classDescription = (new ClassDescriptionBuilder())
58-
->setFilePath('src/Foo.php')->setClassName('HappyIsland\Myclass')
60+
->setFilePath('src/Foo.php')
61+
->setClassName('HappyIsland\Myclass')
5962
->addAttribute('myAttribute', 1)
6063
->build();
6164

tests/Unit/Expressions/ForClasses/ImplementTest.php

+10-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public function test_it_should_return_violation_error(): void
1616
$implementConstraint = new Implement('interface');
1717

1818
$classDescription = (new ClassDescriptionBuilder())
19-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
19+
->setFilePath('src/Foo.php')
20+
->setClassName('HappyIsland')
2021
->build();
2122

2223
$because = 'we want to add this rule for our software';
@@ -34,7 +35,8 @@ public function test_it_should_return_true_if_not_depends_on_namespace(): void
3435
$implementConstraint = new Implement('interface');
3536

3637
$classDescription = (new ClassDescriptionBuilder())
37-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
38+
->setFilePath('src/Foo.php')
39+
->setClassName('HappyIsland')
3840
->addInterface('Foo', 1)
3941
->build();
4042

@@ -50,7 +52,8 @@ public function test_it_should_return_false_if_depends_on_namespace(): void
5052
$implementConstraint = new Implement('interface');
5153

5254
$classDescription = (new ClassDescriptionBuilder())
53-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
55+
->setFilePath('src/Foo.php')
56+
->setClassName('HappyIsland')
5457
->addInterface('interface', 1)
5558
->build();
5659

@@ -67,7 +70,8 @@ public function test_it_should_check_the_complete_fqcn(): void
6770
$implementConstraint = new Implement('\Foo\Order');
6871

6972
$classDescription = (new ClassDescriptionBuilder())
70-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
73+
->setFilePath('src/Foo.php')
74+
->setClassName('HappyIsland')
7175
->addInterface('\Foo\Orderable', 1)
7276
->build();
7377

@@ -84,7 +88,8 @@ public function test_it_should_return_if_is_an_interface(): void
8488
$implementConstraint = new Implement($interface);
8589

8690
$classDescription = (new ClassDescriptionBuilder())
87-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
91+
->setFilePath('src/Foo.php')
92+
->setClassName('HappyIsland')
8893
->setInterface(true)
8994
->build();
9095

tests/Unit/Expressions/ForClasses/IsAbstractTest.php

+12-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public function test_it_should_return_violation_error(): void
1717
$isAbstract = new IsAbstract();
1818

1919
$classDescription = (new ClassDescriptionBuilder())
20-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
20+
->setFilePath('src/Foo.php')
21+
->setClassName('HappyIsland')
2122
->build();
2223

2324
$because = 'we want to add this rule for our software';
@@ -35,7 +36,8 @@ public function test_it_should_return_true_if_is_abstract(): void
3536
$isAbstract = new IsAbstract();
3637

3738
$classDescription = (new ClassDescriptionBuilder())
38-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
39+
->setFilePath('src/Foo.php')
40+
->setClassName('HappyIsland')
3941
->setFinal(true)
4042
->setReadonly(true)
4143
->setAbstract(true)
@@ -54,7 +56,8 @@ public function test_interfaces_can_not_be_abstract_and_should_be_ignored(): voi
5456
$isNotAbstract = new IsNotAbstract();
5557

5658
$classDescription = (new ClassDescriptionBuilder())
57-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
59+
->setFilePath('src/Foo.php')
60+
->setClassName('HappyIsland')
5861
->setInterface(true)
5962
->build();
6063

@@ -68,7 +71,8 @@ public function test_traits_can_not_be_abstract_and_should_be_ignored(): void
6871
$isNotAbstract = new IsNotAbstract();
6972

7073
$classDescription = (new ClassDescriptionBuilder())
71-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
74+
->setFilePath('src/Foo.php')
75+
->setClassName('HappyIsland')
7276
->setTrait(true)
7377
->build();
7478

@@ -82,7 +86,8 @@ public function test_enums_can_not_be_abstract_and_should_be_ignored(): void
8286
$isNotAbstract = new IsNotAbstract();
8387

8488
$classDescription = (new ClassDescriptionBuilder())
85-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
89+
->setFilePath('src/Foo.php')
90+
->setClassName('HappyIsland')
8691
->setEnum(true)
8792
->build();
8893

@@ -96,7 +101,8 @@ public function test_final_classes_can_not_be_abstract_and_should_be_ignored():
96101
$isNotAbstract = new IsNotAbstract();
97102

98103
$classDescription = (new ClassDescriptionBuilder())
99-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
104+
->setFilePath('src/Foo.php')
105+
->setClassName('HappyIsland')
100106
->setFinal(true)
101107
->build();
102108

tests/Unit/Expressions/ForClasses/IsEnumTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public function test_it_should_return_violation_error(): void
1515
$isEnum = new IsEnum();
1616

1717
$classDescription = (new ClassDescriptionBuilder())
18-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
18+
->setFilePath('src/Foo.php')
19+
->setClassName('HappyIsland')
1920
->build();
2021

2122
$because = 'we want to add this rule for our software';
@@ -33,7 +34,8 @@ public function test_it_should_return_true_if_is_enum(): void
3334
$isEnum = new IsEnum();
3435

3536
$classDescription = (new ClassDescriptionBuilder())
36-
->setFilePath('src/Foo.php')->setClassName('HappyIsland')
37+
->setFilePath('src/Foo.php')
38+
->setClassName('HappyIsland')
3739
->setEnum(true)
3840
->build();
3941

0 commit comments

Comments
 (0)