Passed
Push — master ( 98c468...65840f )
by Christian
02:19
created
src/Report/Html/Renderer/DashboardRenderer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             'full_path' => $this->rootDir,
90 90
             'date' => date('r'),
91 91
         ]);
92
-        $this->dashboardTemplate->renderTo($this->reportDir.DIRECTORY_SEPARATOR.'dashboard.html');
92
+        $this->dashboardTemplate->renderTo($this->reportDir . DIRECTORY_SEPARATOR . 'dashboard.html');
93 93
     }
94 94
 
95 95
     private function renderTombstonesView(AnalyzerResult $result): string
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
             $deadSince = '';
117 117
             if ($date) {
118 118
                 if ($age = TimePeriodFormatter::formatAge($date)) {
119
-                    $deadSince = 'for '.$age;
119
+                    $deadSince = 'for ' . $age;
120 120
                 } else {
121
-                    $deadSince = 'since '.$date;
121
+                    $deadSince = 'since ' . $date;
122 122
                 }
123 123
             }
124 124
             $this->deadTemplate->setVar([
Please login to merge, or discard this patch.
src/Report/Html/Renderer/DirectoryRenderer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -68,18 +68,18 @@  discard block
 block discarded – undo
68 68
     private function renderDirectory(ResultDirectory $directory): void
69 69
     {
70 70
         $directoryPath = $directory->getPath();
71
-        $pathToRoot = './'.str_repeat('../', substr_count($directoryPath, '/') + ($directoryPath ? 1 : 0));
71
+        $pathToRoot = './' . str_repeat('../', substr_count($directoryPath, '/') + ($directoryPath ? 1 : 0));
72 72
         $filesList = '';
73 73
         foreach ($directory->getDirectories() as $subDir) {
74 74
             $name = $subDir->getName();
75
-            $link = './'.$subDir->getName().'/index.html';
75
+            $link = './' . $subDir->getName() . '/index.html';
76 76
             if ($subDir->getDeadCount() || $subDir->getUndeadCount()) {
77 77
                 $filesList .= $this->renderDirectoryItem($name, $link, $subDir, $pathToRoot);
78 78
             }
79 79
         }
80 80
         foreach ($directory->getFiles() as $fileResult) {
81 81
             $name = basename($fileResult->getFile());
82
-            $link = './'.$name.'.html';
82
+            $link = './' . $name . '.html';
83 83
             if ($fileResult->getDeadCount() || $fileResult->getUndeadCount()) {
84 84
                 $filesList .= $this->renderDirectoryItem($name, $link, $fileResult, $pathToRoot);
85 85
             }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             'date' => date('r'),
94 94
         ]);
95 95
 
96
-        $reportFile = $this->reportDir.DIRECTORY_SEPARATOR.$directoryPath.'/index.html';
96
+        $reportFile = $this->reportDir . DIRECTORY_SEPARATOR . $directoryPath . '/index.html';
97 97
         $reportDir = dirname($reportFile);
98 98
         if (!is_dir($reportDir)) {
99 99
             mkdir($reportDir, 0777, true);
@@ -154,19 +154,19 @@  discard block
 block discarded – undo
154 154
     private function renderBreadcrumb(string $directoryPath): string
155 155
     {
156 156
         if (!$directoryPath) {
157
-            return '<li class="breadcrumb-item">'.$this->rootDir.'</li> ';
157
+            return '<li class="breadcrumb-item">' . $this->rootDir . '</li> ';
158 158
         }
159 159
 
160 160
         $parts = explode('/', $directoryPath);
161 161
         $numParts = count($parts);
162
-        $breadcrumbString = '<li class="breadcrumb-item"><a href="./'.str_repeat('../', $numParts).'index.html">'.$this->rootDir.'</a></li> ';
162
+        $breadcrumbString = '<li class="breadcrumb-item"><a href="./' . str_repeat('../', $numParts) . 'index.html">' . $this->rootDir . '</a></li> ';
163 163
 
164 164
         $folderUp = $numParts - 1;
165 165
         while ($label = array_shift($parts)) {
166 166
             if (!$parts) {
167
-                $breadcrumbString .= '<li class="breadcrumb-item active">'.$label.'</li> ';
167
+                $breadcrumbString .= '<li class="breadcrumb-item active">' . $label . '</li> ';
168 168
             } else {
169
-                $link = './'.str_repeat('../', $folderUp).'index.html';
169
+                $link = './' . str_repeat('../', $folderUp) . 'index.html';
170 170
                 $breadcrumbString .= sprintf('<li class="breadcrumb-item"><a href="%s">%s</a></li> ', $link, $label);
171 171
             }
172 172
             --$folderUp;
Please login to merge, or discard this patch.
src/Report/Html/Renderer/FileRenderer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $sourceCode = $this->formatSourceCode($fileResult);
54 54
         $relativeFilePath = PathNormalizer::makeRelativeTo($fileResult->getFile(), $this->rootDir);
55 55
         $this->fileTemplate->setVar([
56
-            'path_to_root' => './'.str_repeat('../', substr_count($relativeFilePath, '/')),
56
+            'path_to_root' => './' . str_repeat('../', substr_count($relativeFilePath, '/')),
57 57
             'full_path' => $fileResult->getFile(),
58 58
             'breadcrumb' => $this->renderBreadcrumb($relativeFilePath),
59 59
             'tombstones_list' => $tombstonesList,
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             'date' => date('r'),
62 62
         ]);
63 63
 
64
-        $reportFile = $this->reportDir.DIRECTORY_SEPARATOR.$relativeFilePath.'.html';
64
+        $reportFile = $this->reportDir . DIRECTORY_SEPARATOR . $relativeFilePath . '.html';
65 65
         $reportDir = dirname($reportFile);
66 66
         if (!is_dir($reportDir)) {
67 67
             mkdir($reportDir, 0777, true);
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
     {
137 137
         $parts = explode('/', $relativeFilePath);
138 138
         $numParts = count($parts);
139
-        $breadcrumbString = '<li class="breadcrumb-item"><a href="./'.str_repeat('../', $numParts - 1).'index.html">'.$this->rootDir.'</a></li> ';
139
+        $breadcrumbString = '<li class="breadcrumb-item"><a href="./' . str_repeat('../', $numParts - 1) . 'index.html">' . $this->rootDir . '</a></li> ';
140 140
 
141 141
         $folderUp = $numParts - 2;
142 142
         while ($label = array_shift($parts)) {
143 143
             if (!$parts) {
144
-                $breadcrumbString .= '<li class="breadcrumb-item active">'.$label.'</li> ';
144
+                $breadcrumbString .= '<li class="breadcrumb-item active">' . $label . '</li> ';
145 145
             } else {
146
-                $link = './'.str_repeat('../', $folderUp).'index.html';
146
+                $link = './' . str_repeat('../', $folderUp) . 'index.html';
147 147
                 $breadcrumbString .= sprintf('<li class="breadcrumb-item"><a href="%s">%s</a></li> ', $link, $label);
148 148
             }
149 149
             --$folderUp;
Please login to merge, or discard this patch.
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->rootDir = $rootDir;
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.