Completed
Pull Request — master (#448)
by
unknown
08:31
created
phpmetrics/tests/Metric/examples/nbmethods1.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
     public function setB($b)
40 40
     {
41
-        $this->b = (string)$b;
41
+        $this->b = (string) $b;
42 42
         return $this;
43 43
     }
44 44
 
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/examples/halstead3.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2
-function f_switch($a){
3
-    switch ($a){
2
+function f_switch($a) {
3
+    switch ($a) {
4 4
         case 0 :
5 5
             printf("zero");
6 6
         case 10 :
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/examples/cyclomatic1.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@
 block discarded – undo
14 14
         if(true) {
15 15
 
16 16
         } else {
17
-	        if (true) {
17
+            if (true) {
18 18
 
19
-	        } else if (true) {
19
+            } else if (true) {
20 20
 
21
-	        } elseif (true) {
21
+            } elseif (true) {
22 22
 
23
-	        } elseif (true) {
23
+            } elseif (true) {
24 24
 
25
-	        }
25
+            }
26 26
         }
27 27
     }
28 28
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 class A {
3 3
     public function foo1()
4 4
     {
5
-        if(true) {
6
-            if(false) {
5
+        if (true) {
6
+            if (false) {
7 7
 
8 8
             }
9 9
         }
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
     public function foo2()
13 13
     {
14
-        if(true) {
14
+        if (true) {
15 15
 
16 16
         } else {
17 17
 	        if (true) {
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
 class B {
35 35
     public function foo()
36 36
     {
37
-        if(true) {
37
+        if (true) {
38 38
 
39 39
         }
40 40
 
41
-        foreach([] as $foo) {
42
-            if(false) {
41
+        foreach ([] as $foo) {
42
+            if (false) {
43 43
                 continue;
44 44
             }
45 45
         }
Please login to merge, or discard this patch.
phpmetrics/tests/Metric/examples/halstead4.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-function f_while($a){
2
+function f_while($a) {
3 3
     $i = 2;
4 4
     if ($a < 0) return 0;
5
-    while ($a > 0){
5
+    while ($a > 0) {
6 6
         $a -= 100;
7 7
         $i *= 2;
8 8
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 function f_while($a){
3 3
     $i = 2;
4
-    if ($a < 0) return 0;
4
+    if ($a < 0) {
5
+        return 0;
6
+    }
5 7
     while ($a > 0){
6 8
         $a -= 100;
7 9
         $i *= 2;
Please login to merge, or discard this patch.
phpmetrics/tests/Component/File/FinderTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public function testPathsGivenAreRecoveredOverExcluded()
14 14
     {
15
-        $exampleRoot = __DIR__ . DIRECTORY_SEPARATOR . 'examples';
15
+        $exampleRoot = __DIR__.DIRECTORY_SEPARATOR.'examples';
16 16
 
17 17
         $extensions = ['php', 'inc', 'phtml'];
18 18
         $excludedDirs = [
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
         $files = $finder->fetch($inputFiles);
27 27
 
28 28
         $expected = [
29
-            $exampleRoot . DIRECTORY_SEPARATOR . 'included' . DIRECTORY_SEPARATOR . 'includedFile.php',
30
-            $exampleRoot . DIRECTORY_SEPARATOR . 'includedFile.php.inc',
29
+            $exampleRoot.DIRECTORY_SEPARATOR.'included'.DIRECTORY_SEPARATOR.'includedFile.php',
30
+            $exampleRoot.DIRECTORY_SEPARATOR.'includedFile.php.inc',
31 31
         ];
32 32
 
33 33
         //Sorting the expected and the actual array values to assert both array are same.
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 
40 40
     public function testGivenPathsAreIgnoredRegardingExclusion()
41 41
     {
42
-        $exampleRoot = __DIR__ . DIRECTORY_SEPARATOR . 'examples';
42
+        $exampleRoot = __DIR__.DIRECTORY_SEPARATOR.'examples';
43 43
         $actualFoundFiles = (new Finder(['php'], ['tests']))->fetch([$exampleRoot]);
44 44
         $expectedFoundFiles = [
45
-            $exampleRoot . DIRECTORY_SEPARATOR . 'excluded' . DIRECTORY_SEPARATOR . 'excludedFile.php',
46
-            $exampleRoot . DIRECTORY_SEPARATOR . 'included' . DIRECTORY_SEPARATOR . 'includedFile.php',
45
+            $exampleRoot.DIRECTORY_SEPARATOR.'excluded'.DIRECTORY_SEPARATOR.'excludedFile.php',
46
+            $exampleRoot.DIRECTORY_SEPARATOR.'included'.DIRECTORY_SEPARATOR.'includedFile.php',
47 47
         ];
48 48
         sort($actualFoundFiles);
49 49
         sort($expectedFoundFiles);
Please login to merge, or discard this patch.
phpmetrics/tests/Component/Issuer/IssuerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 
66 66
     protected function terminate($status)
67 67
     {
68
-        throw new \RuntimeException('Terminated: ' . $status);
68
+        throw new \RuntimeException('Terminated: '.$status);
69 69
     }
70 70
 
71 71
     protected function log($logfile, $log)
Please login to merge, or discard this patch.
phpmetrics/tests/Application/Config/File/ConfigFileReaderTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function testJsonConfigFile()
12 12
     {
13
-        $filename = __DIR__ . '/examples/config.json';
13
+        $filename = __DIR__.'/examples/config.json';
14 14
 
15 15
         $config = new \Hal\Application\Config\Config();
16 16
 
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
     {
27 27
         return [
28 28
             'exclude' => 'tests',
29
-            'report-html' => __DIR__ . '/examples/tmp/report/',
29
+            'report-html' => __DIR__.'/examples/tmp/report/',
30 30
             'report-json' => '/tmp/report.json',
31 31
             'report-csv' => '/tmp/report.csv',
32 32
             'report-violations' => '/tmp/violations.xml',
33 33
             'extensions' => 'php,php8',
34 34
             'git' => 'git',
35 35
             'files' => [
36
-                __DIR__ . '/examples/src/Hal/Component'
36
+                __DIR__.'/examples/src/Hal/Component'
37 37
             ],
38 38
             'groups' => [
39 39
                 [
Please login to merge, or discard this patch.
phpmetrics/tests/Report/Html/ReporterTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         // prepares destination
31 31
         $destination = implode(DIRECTORY_SEPARATOR, [
32 32
             sys_get_temp_dir(),
33
-            'phpmetrics-html' . uniqid('', true)
33
+            'phpmetrics-html'.uniqid('', true)
34 34
         ]);
35 35
 
36 36
         $config->set('report-html', $destination);
Please login to merge, or discard this patch.
phpmetrics/tests/binary/BinTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     /** @return void */
13 13
     public function setUp()
14 14
     {
15
-        $this->phar = __DIR__ . '/../../bin/phpmetrics';
15
+        $this->phar = __DIR__.'/../../bin/phpmetrics';
16 16
     }
17 17
 
18 18
     public function testICanRunBinFile()
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function testICanProvideOneDirectoryToParse()
26 26
     {
27
-        $command = sprintf('%s --exclude="" %s 2>&1', $this->phar, __DIR__ . '/examples/1');
27
+        $command = sprintf('%s --exclude="" %s 2>&1', $this->phar, __DIR__.'/examples/1');
28 28
         $r = shell_exec($command);
29 29
 
30 30
         $this->assertNotNull($r);
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
         $command = sprintf(
39 39
             '%s --exclude="" %s,%s  2>&1',
40 40
             $this->phar,
41
-            __DIR__ . '/examples/1',
42
-            __DIR__ . '/examples/2'
41
+            __DIR__.'/examples/1',
42
+            __DIR__.'/examples/2'
43 43
         );
44 44
         $r = shell_exec($command);
45 45
 
Please login to merge, or discard this patch.