Completed
Pull Request — master (#448)
by
unknown
08:31
created
phpmetrics/tests/Metric/examples/cyclomatic1.php 1 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 1 patch
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.
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.
phpmetrics/tests/binary/PharTest.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__ . '/../../releases/phpmetrics.phar';
15
+        $this->phar = __DIR__.'/../../releases/phpmetrics.phar';
16 16
     }
17 17
 
18 18
     public function testICanRunPhar()
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function testICanProvideOneDirectoryToParse()
28 28
     {
29
-        $command = sprintf('%s --exclude="" %s 2>&1', $this->phar, __DIR__ . '/examples/1');
29
+        $command = sprintf('%s --exclude="" %s 2>&1', $this->phar, __DIR__.'/examples/1');
30 30
         $r = shell_exec($command);
31 31
 
32 32
         $this->assertNotNull($r);
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
         $command = sprintf(
41 41
             '%s --exclude="" %s,%s  2>&1',
42 42
             $this->phar,
43
-            __DIR__ . '/examples/1',
44
-            __DIR__ . '/examples/2'
43
+            __DIR__.'/examples/1',
44
+            __DIR__.'/examples/2'
45 45
         );
46 46
         $r = shell_exec($command);
47 47
 
Please login to merge, or discard this patch.
phpmetrics/tests/binary/ReportTest.php 1 patch
Spacing   +8 added lines, -8 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
 
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
             '%s --report-csv="%s" %s,%s  2>&1',
60 60
             $this->phar,
61 61
             $destination,
62
-            __DIR__ . '/examples/1',
63
-            __DIR__ . '/examples/2'
62
+            __DIR__.'/examples/1',
63
+            __DIR__.'/examples/2'
64 64
         );
65 65
         shell_exec($command);
66 66
         $this->assertFileExists($destination);
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
             '%s --report-json="%s" %s,%s  2>&1',
77 77
             $this->phar,
78 78
             $destination,
79
-            __DIR__ . '/examples/1',
80
-            __DIR__ . '/examples/2'
79
+            __DIR__.'/examples/1',
80
+            __DIR__.'/examples/2'
81 81
         );
82 82
         shell_exec($command);
83 83
         $this->assertFileExists($destination);
Please login to merge, or discard this patch.