Passed
Push — master ( d29b77...fa6b97 )
by Christian
01:54
created
src/Report/Console/TimePeriodFormatter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
         $weeksPassed = floor($daysPassed / 7);
27 27
         $daysPassed = $daysPassed % 7;
28 28
 
29
-        $timePassed = $daysPassed.' days';
29
+        $timePassed = $daysPassed . ' days';
30 30
         if ($weeksPassed) {
31
-            $timePassed = $weeksPassed.' weeks and '.$timePassed;
31
+            $timePassed = $weeksPassed . ' weeks and ' . $timePassed;
32 32
         }
33 33
 
34 34
         return $timePassed;
Please login to merge, or discard this patch.
src/Report/Html/TemplateFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 {
7 7
     public static function getTemplate(string $file): \Text_Template
8 8
     {
9
-        return new \Text_Template(__DIR__.'/Template/'.$file, '{{', '}}');
9
+        return new \Text_Template(__DIR__ . '/Template/' . $file, '{{', '}}');
10 10
     }
11 11
 }
Please login to merge, or discard this patch.
src/FilePosition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 {
7 7
     public static function createPosition(string $file, int $line): string
8 8
     {
9
-        return $file.':'.$line;
9
+        return $file . ':' . $line;
10 10
     }
11 11
 }
Please login to merge, or discard this patch.
src/Source/TombstoneVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 
70 70
     private function visitMethodNode(ClassMethod $node): void
71 71
     {
72
-        $methodName = $this->currentClass.($node->isStatic() ? '::' : '->').$node->name;
72
+        $methodName = $this->currentClass . ($node->isStatic() ? '::' : '->') . $node->name;
73 73
         $this->currentMethod[] = $methodName;
74 74
     }
75 75
 
Please login to merge, or discard this patch.
src/Report/Html/Renderer/DashboardRenderer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             'full_path' => $this->sourceDir,
91 91
             'date' => date('r'),
92 92
         ]);
93
-        $this->dashboardTemplate->renderTo($this->reportDir.DIRECTORY_SEPARATOR.'dashboard.html');
93
+        $this->dashboardTemplate->renderTo($this->reportDir . DIRECTORY_SEPARATOR . 'dashboard.html');
94 94
     }
95 95
 
96 96
     private function renderTombstonesView(AnalyzerResult $result): string
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
             $deadSince = '';
118 118
             if ($date) {
119 119
                 if ($age = TimePeriodFormatter::formatAge($date)) {
120
-                    $deadSince = 'for '.$age;
120
+                    $deadSince = 'for ' . $age;
121 121
                 } else {
122
-                    $deadSince = 'since '.$date;
122
+                    $deadSince = 'since ' . $date;
123 123
                 }
124 124
             }
125 125
             $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
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
     private function renderDirectory(ResultDirectory $directory): void
70 70
     {
71 71
         $directoryPath = $directory->getPath();
72
-        $pathToRoot = './'.str_repeat('../', substr_count($directoryPath, '/') + ($directoryPath ? 1 : 0));
72
+        $pathToRoot = './' . str_repeat('../', substr_count($directoryPath, '/') + ($directoryPath ? 1 : 0));
73 73
         $filesList = '';
74 74
         foreach ($directory->getDirectories() as $subDir) {
75 75
             $name = $subDir->getName();
76
-            $link = './'.$subDir->getName().'/index.html';
76
+            $link = './' . $subDir->getName() . '/index.html';
77 77
             if ($subDir->getDeadCount() || $subDir->getUndeadCount()) {
78 78
                 $filesList .= $this->renderDirectoryItem($name, $link, $subDir, $pathToRoot);
79 79
             }
80 80
         }
81 81
         foreach ($directory->getFiles() as $fileResult) {
82 82
             $name = basename($fileResult->getFile());
83
-            $link = './'.$name.'.html';
83
+            $link = './' . $name . '.html';
84 84
             if ($fileResult->getDeadCount() || $fileResult->getUndeadCount()) {
85 85
                 $filesList .= $this->renderDirectoryItem($name, $link, $fileResult, $pathToRoot);
86 86
             }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             'date' => date('r'),
95 95
         ]);
96 96
 
97
-        $reportFile = $this->reportDir.DIRECTORY_SEPARATOR.$directoryPath.'/index.html';
97
+        $reportFile = $this->reportDir . DIRECTORY_SEPARATOR . $directoryPath . '/index.html';
98 98
         $reportDir = dirname($reportFile);
99 99
         if (!is_dir($reportDir)) {
100 100
             mkdir($reportDir, 0777, true);
@@ -155,19 +155,19 @@  discard block
 block discarded – undo
155 155
     private function renderBreadcrumb(string $directoryPath): string
156 156
     {
157 157
         if (!$directoryPath) {
158
-            return '<li class="breadcrumb-item">'.$this->sourceDir.'</li> ';
158
+            return '<li class="breadcrumb-item">' . $this->sourceDir . '</li> ';
159 159
         }
160 160
 
161 161
         $parts = explode('/', $directoryPath);
162 162
         $numParts = count($parts);
163
-        $breadcrumbString = '<li class="breadcrumb-item"><a href="./'.str_repeat('../', $numParts).'index.html">'.$this->sourceDir.'</a></li> ';
163
+        $breadcrumbString = '<li class="breadcrumb-item"><a href="./' . str_repeat('../', $numParts) . 'index.html">' . $this->sourceDir . '</a></li> ';
164 164
 
165 165
         $folderUp = $numParts - 1;
166 166
         while ($label = array_shift($parts)) {
167 167
             if (!$parts) {
168
-                $breadcrumbString .= '<li class="breadcrumb-item active">'.$label.'</li> ';
168
+                $breadcrumbString .= '<li class="breadcrumb-item active">' . $label . '</li> ';
169 169
             } else {
170
-                $link = './'.str_repeat('../', $folderUp).'index.html';
170
+                $link = './' . str_repeat('../', $folderUp) . 'index.html';
171 171
                 $breadcrumbString .= sprintf('<li class="breadcrumb-item"><a href="%s">%s</a></li> ', $link, $label);
172 172
             }
173 173
             --$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
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $sourceCode = $this->formatSourceCode($fileResult);
55 55
         $relativeFilePath = PathNormalizer::makeRelativeTo($fileResult->getFile(), $this->sourceDir);
56 56
         $this->fileTemplate->setVar([
57
-            'path_to_root' => './'.str_repeat('../', substr_count($relativeFilePath, '/')),
57
+            'path_to_root' => './' . str_repeat('../', substr_count($relativeFilePath, '/')),
58 58
             'full_path' => $fileResult->getFile(),
59 59
             'breadcrumb' => $this->renderBreadcrumb($relativeFilePath),
60 60
             'tombstones_list' => $tombstonesList,
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             'date' => date('r'),
63 63
         ]);
64 64
 
65
-        $reportFile = $this->reportDir.DIRECTORY_SEPARATOR.$relativeFilePath.'.html';
65
+        $reportFile = $this->reportDir . DIRECTORY_SEPARATOR . $relativeFilePath . '.html';
66 66
         $reportDir = dirname($reportFile);
67 67
         if (!is_dir($reportDir)) {
68 68
             mkdir($reportDir, 0777, true);
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
     {
138 138
         $parts = explode('/', $relativeFilePath);
139 139
         $numParts = count($parts);
140
-        $breadcrumbString = '<li class="breadcrumb-item"><a href="./'.str_repeat('../', $numParts - 1).'index.html">'.$this->sourceDir.'</a></li> ';
140
+        $breadcrumbString = '<li class="breadcrumb-item"><a href="./' . str_repeat('../', $numParts - 1) . 'index.html">' . $this->sourceDir . '</a></li> ';
141 141
 
142 142
         $folderUp = $numParts - 2;
143 143
         while ($label = array_shift($parts)) {
144 144
             if (!$parts) {
145
-                $breadcrumbString .= '<li class="breadcrumb-item active">'.$label.'</li> ';
145
+                $breadcrumbString .= '<li class="breadcrumb-item active">' . $label . '</li> ';
146 146
             } else {
147
-                $link = './'.str_repeat('../', $folderUp).'index.html';
147
+                $link = './' . str_repeat('../', $folderUp) . 'index.html';
148 148
                 $breadcrumbString .= sprintf('<li class="breadcrumb-item"><a href="%s">%s</a></li> ', $link, $label);
149 149
             }
150 150
             --$folderUp;
Please login to merge, or discard this patch.
src/PathTools.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
             $path = preg_replace('#^(\\.[/\\\\])+#', '', $path);
21 21
         }
22 22
 
23
-        return self::normalizeDirectorySeparator($rootDir.($path ? DIRECTORY_SEPARATOR.$path : ''));
23
+        return self::normalizeDirectorySeparator($rootDir . ($path ? DIRECTORY_SEPARATOR.$path : ''));
24 24
     }
25 25
 
26 26
     private static function normalizeDirectorySeparator(string $path): string
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->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.