Passed
Push — master ( cc91a3...057c43 )
by Christian
02:20
created
src/Report/HtmlReportGenerator.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $this->reportDir = $reportDir;
31 31
         $this->sourceDir = $sourceDir;
32
-        $this->templateDir = __DIR__.'/Html/Template';
32
+        $this->templateDir = __DIR__ . '/Html/Template';
33 33
     }
34 34
 
35 35
     public function getName(): string
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
     private function copySkeleton(): void
55 55
     {
56 56
         $this->createDirectory($this->reportDir);
57
-        $this->copyDirectoryFiles($this->templateDir.DIRECTORY_SEPARATOR.'css', $this->reportDir.DIRECTORY_SEPARATOR.'css');
58
-        $this->copyDirectoryFiles($this->templateDir.DIRECTORY_SEPARATOR.'icons', $this->reportDir.DIRECTORY_SEPARATOR.'icons');
59
-        $this->copyDirectoryFiles($this->templateDir.DIRECTORY_SEPARATOR.'img', $this->reportDir.DIRECTORY_SEPARATOR.'img');
57
+        $this->copyDirectoryFiles($this->templateDir . DIRECTORY_SEPARATOR . 'css', $this->reportDir . DIRECTORY_SEPARATOR . 'css');
58
+        $this->copyDirectoryFiles($this->templateDir . DIRECTORY_SEPARATOR . 'icons', $this->reportDir . DIRECTORY_SEPARATOR . 'icons');
59
+        $this->copyDirectoryFiles($this->templateDir . DIRECTORY_SEPARATOR . 'img', $this->reportDir . DIRECTORY_SEPARATOR . 'img');
60 60
     }
61 61
 
62 62
     private function copyDirectoryFiles(string $templateDir, string $reportDir): void
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $this->createDirectory($reportDir);
65 65
         $handle = opendir($templateDir);
66 66
         if (!$handle) {
67
-            throw new HtmlReportException('Could not read template files from '.$templateDir);
67
+            throw new HtmlReportException('Could not read template files from ' . $templateDir);
68 68
         }
69 69
 
70 70
         while ($file = readdir($handle)) {
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
                 continue;
73 73
             }
74 74
 
75
-            $templateFile = $templateDir.DIRECTORY_SEPARATOR.$file;
76
-            $reportFile = $reportDir.DIRECTORY_SEPARATOR.$file;
75
+            $templateFile = $templateDir . DIRECTORY_SEPARATOR . $file;
76
+            $reportFile = $reportDir . DIRECTORY_SEPARATOR . $file;
77 77
 
78 78
             if (is_dir($templateFile)) {
79 79
                 $this->copyDirectoryFiles($templateFile, $reportFile);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             }
82 82
 
83 83
             if ([email protected]($templateFile, $reportFile)) {
84
-                throw new HtmlReportException('Could not copy '.$templateFile.' to '.$reportFile);
84
+                throw new HtmlReportException('Could not copy ' . $templateFile . ' to ' . $reportFile);
85 85
             }
86 86
         }
87 87
         closedir($handle);
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
     {
92 92
         if (!is_dir($dir)) {
93 93
             if ([email protected]($dir, 0777, true)) {
94
-                throw new HtmlReportException('Could not create directory '.$dir);
94
+                throw new HtmlReportException('Could not create directory ' . $dir);
95 95
             }
96 96
         } elseif (!is_writable($dir)) {
97
-            throw new HtmlReportException('Directory '.$dir.' has to be writable');
97
+            throw new HtmlReportException('Directory ' . $dir . ' has to be writable');
98 98
         }
99 99
     }
100 100
 }
Please login to merge, or discard this patch.
src/Report/PhpReportGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,6 +24,6 @@
 block discarded – undo
24 24
     public function generate(AnalyzerResult $result): void
25 25
     {
26 26
         $serialized = str_replace("'", "\\'", serialize($result));
27
-        file_put_contents($this->filePath, "<?php return unserialize('".$serialized."');");
27
+        file_put_contents($this->filePath, "<?php return unserialize('" . $serialized . "');");
28 28
     }
29 29
 }
Please login to merge, or discard this patch.
src/Report/ReportExporter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@
 block discarded – undo
32 32
             }
33 33
             $generatorName = $reportGenerator->getName();
34 34
             ++$i;
35
-            $this->output->write('Generate '.$generatorName.' report... ');
35
+            $this->output->write('Generate ' . $generatorName . ' report... ');
36 36
             try {
37 37
                 $reportGenerator->generate($result);
38 38
                 $this->output->writeln('Done');
39 39
             } catch (\Exception $e) {
40
-                $this->output->writeln('Could not generate '.$generatorName.' report: '.$e->getMessage());
40
+                $this->output->writeln('Could not generate ' . $generatorName . ' report: ' . $e->getMessage());
41 41
             }
42 42
         }
43 43
     }
Please login to merge, or discard this patch.
src/Source/TombstoneExtractor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,19 +36,19 @@
 block discarded – undo
36 36
     {
37 37
         $this->visitor->setCurrentFile($filePath);
38 38
         if (!is_readable($filePath)) {
39
-            throw new TombstoneExtractionException('File "'.$filePath.'" is not readable.');
39
+            throw new TombstoneExtractionException('File "' . $filePath . '" is not readable.');
40 40
         }
41 41
 
42 42
         try {
43 43
             $code = file_get_contents($filePath);
44 44
             $stmts = $this->parser->parse($code);
45 45
             if (null === $stmts) {
46
-                throw new TombstoneExtractionException('PHP code in "'.$filePath.'" could not be parsed.');
46
+                throw new TombstoneExtractionException('PHP code in "' . $filePath . '" could not be parsed.');
47 47
             }
48 48
 
49 49
             $this->traverser->traverse($stmts);
50 50
         } catch (Error $e) {
51
-            throw new TombstoneExtractionException('PHP code in "'.$filePath.'" could not be parsed.', null, $e);
51
+            throw new TombstoneExtractionException('PHP code in "' . $filePath . '" could not be parsed.', null, $e);
52 52
         }
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
src/Cli/Command.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,12 +59,12 @@
 block discarded – undo
59 59
 
60 60
     private function doExecute(): void
61 61
     {
62
-        $configFile = $this->input->getOption('config') ?? getcwd().DIRECTORY_SEPARATOR.'tombstone.yml';
62
+        $configFile = $this->input->getOption('config') ?? getcwd() . DIRECTORY_SEPARATOR . 'tombstone.yml';
63 63
         if (!file_exists($configFile)) {
64
-            throw new \InvalidArgumentException('Could not find configuration file '.$configFile);
64
+            throw new \InvalidArgumentException('Could not find configuration file ' . $configFile);
65 65
         }
66 66
 
67
-        $this->output->debug('Load config from '.$configFile);
67
+        $this->output->debug('Load config from ' . $configFile);
68 68
         $configLoader = ConfigurationLoader::create();
69 69
         $config = $configLoader->loadConfiguration([new YamlConfigProvider($configFile)]);
70 70
         $rootDir = $config['rootDir'];
Please login to merge, or discard this patch.
src/Config/Configuration.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
     private function isNoDirectory(): callable
87 87
     {
88
-        return function (string $path): bool {
88
+        return function(string $path): bool {
89 89
             $path = realpath($path);
90 90
 
91 91
             return !(false !== $path && is_dir($path));
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
     private function isNotWritable(): callable
96 96
     {
97
-        return function (string $path): bool {
97
+        return function(string $path): bool {
98 98
             $directory = dirname($path);
99 99
             $directory = realpath($directory);
100 100
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     private function isNoWritableDirectory(): callable
106 106
     {
107
-        return function (string $path): bool {
107
+        return function(string $path): bool {
108 108
             $path = realpath($path);
109 109
 
110 110
             return !(false !== $path && is_dir($path) && is_writeable($path));
Please login to merge, or discard this patch.
src/Config/YamlConfigProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         }
30 30
 
31 31
         if (isset($config['source']['directories'])) {
32
-            $config['source']['directories'] = array_map(function (string $directory) use ($configFileDir): string {
32
+            $config['source']['directories'] = array_map(function(string $directory) use ($configFileDir): string {
33 33
                 return PathTools::makePathAbsolute($directory, $configFileDir);
34 34
             }, $config['source']['directories']);
35 35
         }
Please login to merge, or discard this patch.