Completed
Pull Request — master (#448)
by
unknown
08:31
created
phpmetrics/tests/Metric/Class_/Structural/LcomVisitorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     public function provideExamples()
44 44
     {
45 45
         return [
46
-            [ __DIR__ . '/../../examples/lcom1.php', 'MyClassA', 2]
46
+            [__DIR__.'/../../examples/lcom1.php', 'MyClassA', 2]
47 47
         ];
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/Class_/Coupling/ExternalsVisitorTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
     public function provideExamples()
49 49
     {
50 50
         return [
51
-            [ __DIR__ . '/../../examples/externals1.php', 'A', ['H', 'C', 'B', 'D']],
52
-            [ __DIR__ . '/../../examples/externals1.php', 'B', []],
53
-            [ __DIR__ . '/../../examples/externals1.php', 'C', []],
54
-            [ __DIR__ . '/../../examples/externals1.php', 'D', []],
55
-            [ __DIR__ . '/../../examples/externals1.php', 'E', ['D', 'F', 'G']],
56
-            [ __DIR__ . '/../../examples/externals1.php', 'F', ['G', 'H']],
57
-            [ __DIR__ . '/../../examples/externals1.php', 'G', []],
58
-            [ __DIR__ . '/../../examples/externals1.php', 'H', []],
59
-            [ __DIR__ . '/../../examples/externals1.php', 'NS1\\A', ['NS2\\B']],
51
+            [__DIR__.'/../../examples/externals1.php', 'A', ['H', 'C', 'B', 'D']],
52
+            [__DIR__.'/../../examples/externals1.php', 'B', []],
53
+            [__DIR__.'/../../examples/externals1.php', 'C', []],
54
+            [__DIR__.'/../../examples/externals1.php', 'D', []],
55
+            [__DIR__.'/../../examples/externals1.php', 'E', ['D', 'F', 'G']],
56
+            [__DIR__.'/../../examples/externals1.php', 'F', ['G', 'H']],
57
+            [__DIR__.'/../../examples/externals1.php', 'G', []],
58
+            [__DIR__.'/../../examples/externals1.php', 'H', []],
59
+            [__DIR__.'/../../examples/externals1.php', 'NS1\\A', ['NS2\\B']],
60 60
         ];
61 61
     }
62 62
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     public function provideExamplesAnnotation()
97 97
     {
98 98
         return [
99
-            [ __DIR__ . '/../../examples/annotations1.php', 'C\\A', ['A\\Route', 'B\\Json']],
99
+            [__DIR__.'/../../examples/annotations1.php', 'C\\A', ['A\\Route', 'B\\Json']],
100 100
         ];
101 101
     }
102 102
 }
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/Class_/Complexity/SystemComplexityVisitorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     public function provideExamples()
53 53
     {
54 54
         return [
55
-            [ __DIR__ . '/../../examples/systemcomplexity1.php', 'A', 2.5, 1.0, 3.5],
55
+            [__DIR__.'/../../examples/systemcomplexity1.php', 'A', 2.5, 1.0, 3.5],
56 56
         ];
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/Class_/Complexity/KanDefectVisitorTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         $traverser->traverse($stmts);
40 40
 
41
-        $metric =  $metrics->get($classname);
41
+        $metric = $metrics->get($classname);
42 42
         $this->assertNotNull($metric);
43 43
 
44 44
         $this->assertSame($expected, $metric->get('kanDefect'));
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public function provideExamples()
49 49
     {
50 50
         return [
51
-            [ __DIR__ . '/../../examples/kan1.php', 'A', .89],
51
+            [__DIR__.'/../../examples/kan1.php', 'A', .89],
52 52
         ];
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
tests/Metric/Class_/Complexity/CyclomaticComplexityVisitorTest.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
     public static function provideExamplesForWmc()
107 107
     {
108 108
         return [
109
-            'A' => [__DIR__ . '/../../examples/cyclomatic1.php', 'A', 10],
110
-            'B' => [__DIR__ . '/../../examples/cyclomatic1.php', 'B', 4],
111
-            'Foo\\C' => [__DIR__ . '/../../examples/cyclomatic_anon.php', 'Foo\\C', 1],
112
-            'SwitchCase' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'SwitchCase', 4],
113
-            'IfElseif' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'IfElseif', 7],
114
-            'Loops' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'Loops', 5],
115
-            'CatchIt' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'CatchIt', 3],
116
-            'Logical' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'Logical', 11],
109
+            'A' => [__DIR__.'/../../examples/cyclomatic1.php', 'A', 10],
110
+            'B' => [__DIR__.'/../../examples/cyclomatic1.php', 'B', 4],
111
+            'Foo\\C' => [__DIR__.'/../../examples/cyclomatic_anon.php', 'Foo\\C', 1],
112
+            'SwitchCase' => [__DIR__.'/../../examples/cyclomatic_full.php', 'SwitchCase', 4],
113
+            'IfElseif' => [__DIR__.'/../../examples/cyclomatic_full.php', 'IfElseif', 7],
114
+            'Loops' => [__DIR__.'/../../examples/cyclomatic_full.php', 'Loops', 5],
115
+            'CatchIt' => [__DIR__.'/../../examples/cyclomatic_full.php', 'CatchIt', 3],
116
+            'Logical' => [__DIR__.'/../../examples/cyclomatic_full.php', 'Logical', 11],
117 117
         ];
118 118
     }
119 119
 
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
     public static function provideExamplesForCcn()
122 122
     {
123 123
         return [
124
-            'A' => [__DIR__ . '/../../examples/cyclomatic1.php', 'A', 8],
125
-            'B' => [__DIR__ . '/../../examples/cyclomatic1.php', 'B', 4],
126
-            'Foo\\C' => [__DIR__ . '/../../examples/cyclomatic_anon.php', 'Foo\\C', 1],
127
-            'SwitchCase' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'SwitchCase', 4],
128
-            'IfElseif' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'IfElseif', 7],
129
-            'Loops' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'Loops', 5],
130
-            'CatchIt' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'CatchIt', 3],
131
-            'Logical' => [__DIR__ . '/../../examples/cyclomatic_full.php', 'Logical', 11],
124
+            'A' => [__DIR__.'/../../examples/cyclomatic1.php', 'A', 8],
125
+            'B' => [__DIR__.'/../../examples/cyclomatic1.php', 'B', 4],
126
+            'Foo\\C' => [__DIR__.'/../../examples/cyclomatic_anon.php', 'Foo\\C', 1],
127
+            'SwitchCase' => [__DIR__.'/../../examples/cyclomatic_full.php', 'SwitchCase', 4],
128
+            'IfElseif' => [__DIR__.'/../../examples/cyclomatic_full.php', 'IfElseif', 7],
129
+            'Loops' => [__DIR__.'/../../examples/cyclomatic_full.php', 'Loops', 5],
130
+            'CatchIt' => [__DIR__.'/../../examples/cyclomatic_full.php', 'CatchIt', 3],
131
+            'Logical' => [__DIR__.'/../../examples/cyclomatic_full.php', 'Logical', 11],
132 132
         ];
133 133
     }
134 134
 
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
     public static function provideExamplesForMaxCc()
137 137
     {
138 138
         return [
139
-            [__DIR__ . '/../../examples/cyclomatic1.php', 'A', 6],
140
-            [__DIR__ . '/../../examples/cyclomatic1.php', 'B', 4],
139
+            [__DIR__.'/../../examples/cyclomatic1.php', 'A', 6],
140
+            [__DIR__.'/../../examples/cyclomatic1.php', 'B', 4],
141 141
         ];
142 142
     }
143 143
 }
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/Package/PackageCollectingVisitorTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,11 +57,11 @@
 block discarded – undo
57 57
 CODE
58 58
         );
59 59
 
60
-        $metric =  $metrics->get('PackA\\');
60
+        $metric = $metrics->get('PackA\\');
61 61
         $this->assertInstanceOf(PackageMetric::class, $metric);
62 62
         $this->assertSame(['PackageA\\ClassA'], $metric->getClasses());
63 63
 
64
-        $metric =  $metrics->get('PackageA\\ClassA');
64
+        $metric = $metrics->get('PackageA\\ClassA');
65 65
         $this->assertNotNull($metric);
66 66
         $this->assertSame('PackA\\', $metric->get('package'));
67 67
     }
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/examples/kan1.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,22 +2,22 @@
 block discarded – undo
2 2
 class A {
3 3
     public function foo()
4 4
     {
5
-        if(true) {
5
+        if (true) {
6 6
 
7 7
         }
8 8
 
9
-        switch(true) {
9
+        switch (true) {
10 10
             case false:
11 11
                 break;
12 12
         }
13 13
 
14
-        switch(true) {
14
+        switch (true) {
15 15
             case false:
16 16
                 break;
17 17
         }
18 18
 
19 19
 
20
-        while(false) {
20
+        while (false) {
21 21
 
22 22
         }
23 23
 
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/examples/halstead2.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-function maxi ($a, $b){
2
+function maxi($a, $b) {
3 3
     if ($a > $b) return $a;
4 4
     return $b;
5 5
 }
6 6
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 function maxi ($a, $b){
3
-    if ($a > $b) return $a;
3
+    if ($a > $b) {
4
+        return $a;
5
+    }
4 6
     return $b;
5 7
 }
6 8
\ No newline at end of file
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/examples/externals1.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
     class A {
4 4
         public function foo($foo, C $c) : H
5 5
         {
6
-             $x = new B;
6
+                $x = new B;
7 7
             D::foo();
8 8
         }
9 9
     }
Please login to merge, or discard this patch.