Completed
Pull Request — master (#481)
by
unknown
18s
created
src/Hal/Application/Config/Validator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         }
49 49
         $groupsRaw = $config->get('groups');
50 50
 
51
-        $groups = array_map(static function (array $groupRaw) {
51
+        $groups = array_map(static function(array $groupRaw) {
52 52
             return new Group($groupRaw['name'], $groupRaw['match']);
53 53
         }, $groupsRaw);
54 54
         $config->set('groups', $groups);
Please login to merge, or discard this patch.
templates/html_report/loc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php require __DIR__ . '/_header.php'; ?>
1
+<?php require __DIR__.'/_header.php'; ?>
2 2
 
3 3
 
4 4
 <?php
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 
14 14
 // 2. percentile map
15 15
 $json = [];
16
-if(count($array) > 1) {
16
+if (count($array) > 1) {
17 17
     $range = range(0.5, 1, .05);
18 18
     foreach ($range as $percentile) {
19
-        $json[] = (object)[
19
+        $json[] = (object) [
20 20
             'lloc' => percentile($array, $percentile),
21 21
             'percentile' => round($percentile * 100),
22 22
         ];
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                         <td><span class="path"><?php echo $class['name']; ?></span></td>
58 58
                         <?php foreach (['lloc', 'cloc', 'volume', 'intelligentContent', 'commentWeight'] as $attribute) {?>
59 59
                             <td>
60
-                                <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>>
60
+                                <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>>
61 61
                                 <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?>
62 62
                                 </span>
63 63
                             </td>
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 </div>
71 71
 
72 72
 
73
-<?php require __DIR__ . '/_footer.php'; ?>
73
+<?php require __DIR__.'/_footer.php'; ?>
74 74
 
75 75
 
76 76
 <script>
Please login to merge, or discard this patch.
templates/html_report/oop.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require __DIR__ . '/_header.php'; ?>
2
+require __DIR__.'/_header.php'; ?>
3 3
 
4 4
 <?php
5 5
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                             <td><span class="path"><?php echo $class['name']; ?></span></td>
78 78
                             <?php foreach (['lcom', 'volume', 'ccn', 'ccnMethodMax', 'bugs', 'difficulty'] as $attribute) {?>
79 79
                                 <td>
80
-                                    <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>>
80
+                                    <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>>
81 81
                                     <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?>
82 82
                                     </span>
83 83
                                 </td>
@@ -90,4 +90,4 @@  discard block
 block discarded – undo
90 90
     </div>
91 91
 
92 92
 
93
-<?php require __DIR__ . '/_footer.php'; ?>
93
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.
templates/html_report/coupling.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php require __DIR__ . '/_header.php'; ?>
1
+<?php require __DIR__.'/_header.php'; ?>
2 2
 
3 3
 <div class="row">
4 4
     <div class="column">
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
                         <td><span class="path"><?php echo $class['name']; ?></span></td>
27 27
                         <?php foreach (['afferentCoupling', 'efferentCoupling', 'instability', 'pageRank'] as $attribute) {?>
28 28
                             <td>
29
-                                <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]);?>>
29
+                                <span class="badge" <?php echo gradientStyleFor($classes, $attribute, $class[$attribute]); ?>>
30 30
                                 <?php echo isset($class[$attribute]) ? $class[$attribute] : ''; ?>
31 31
                                 </span>
32 32
                             </td>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 </div>
43 43
 
44
-<?php require __DIR__ . '/_footer.php'; ?>
44
+<?php require __DIR__.'/_footer.php'; ?>
45 45
 
46 46
 
47 47
 <script type="text/javascript">
Please login to merge, or discard this patch.
src/Hal/Component/File/Finder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,15 +59,15 @@
 block discarded – undo
59 59
         $files = [];
60 60
         foreach ($paths as $path) {
61 61
             if (is_dir($path)) {
62
-                $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
62
+                $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
63 63
                 $directory = new RecursiveDirectoryIterator($path);
64 64
                 $iterator = new RecursiveIteratorIterator($directory);
65 65
 
66 66
                 $filterRegex = sprintf(
67 67
                     '`^%s%s%s$`',
68 68
                     preg_quote($path, '`'),
69
-                    !empty($this->excludedDirs) ? '((?!' . implode('|', array_map('preg_quote', $this->excludedDirs)) . ').)+' : '.+',
70
-                    '\.(' . implode('|', $this->extensions) . ')'
69
+                    !empty($this->excludedDirs) ? '((?!'.implode('|', array_map('preg_quote', $this->excludedDirs)).').)+' : '.+',
70
+                    '\.('.implode('|', $this->extensions).')'
71 71
                 );
72 72
 
73 73
                 $filteredIterator = new RegexIterator(
Please login to merge, or discard this patch.
src/Hal/Report/Json/SummaryReporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
             return;
42 42
         }
43 43
         if (!file_exists(dirname($logFile)) || !is_writable(dirname($logFile))) {
44
-            throw new \RuntimeException('You don\'t have permissions to write JSON report in ' . $logFile);
44
+            throw new \RuntimeException('You don\'t have permissions to write JSON report in '.$logFile);
45 45
         }
46 46
 
47 47
         $summaryWriter = new SummaryWriter($metrics, new Consolidated($metrics), $this->config);
Please login to merge, or discard this patch.
templates/html_report/_footer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 </div>
2 2
 
3 3
 <!-- Sidebar -->
4
-<?php if(!isset($fullwidth) || $fullwidth === false) {?>
4
+<?php if (!isset($fullwidth) || $fullwidth === false) {?>
5 5
 <div id="sidebar">
6 6
     <div class="content">
7 7
         <div class="logo">
8
-            <a href="https://github.com/phpmetrics/phpmetrics"><img src="<?php echo $this->assetPath;?>images/phpmetrics-maintenability.png"
8
+            <a href="https://github.com/phpmetrics/phpmetrics"><img src="<?php echo $this->assetPath; ?>images/phpmetrics-maintenability.png"
9 9
                                                  alt="Logo PhpMetrics"/></a>
10 10
             <h1>PhpMetrics</h1>
11 11
         </div>
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
                             <path d="M0 0h24v24H0z" fill="none"/>
29 29
                             <path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/>
30 30
                         </svg>
31
-                        Violations (<?php echo $sum->violations->total;?>)
31
+                        Violations (<?php echo $sum->violations->total; ?>)
32 32
                     </a>
33 33
                 </li>
34
-                <?php if($this->isHomePage()) {?>
34
+                <?php if ($this->isHomePage()) {?>
35 35
                     <li>
36 36
                         <a href="composer.html">
37 37
                             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="24px" height="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
                         </a>
40 40
                     </li>
41 41
                 <?php } ?>
42
-                <?php if($this->isHomePage() && $config->has('junit')) { ?>
42
+                <?php if ($this->isHomePage() && $config->has('junit')) { ?>
43 43
                     <li>
44 44
                         <a href="junit.html">
45 45
                             <svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                         Package relations
134 134
                     </a>
135 135
                 </li>
136
-                <?php if($this->isHomePage() && $config->has('git')) { ?>
136
+                <?php if ($this->isHomePage() && $config->has('git')) { ?>
137 137
                 <li>
138 138
                     <a href="git.html">
139 139
                         <img src="images/logo-git.png" alt="">
Please login to merge, or discard this patch.
src/Hal/Search/SearchesValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
             $registry = new Registry();
23 23
             $allowedKeys = array_merge($allowedKeys, $registry->allForStructures());
24 24
 
25
-            $diff = array_diff(array_keys((array)$config), $allowedKeys);
25
+            $diff = array_diff(array_keys((array) $config), $allowedKeys);
26 26
             if (count($diff) > 0) {
27 27
                 throw new ConfigException(
28 28
                     sprintf(
Please login to merge, or discard this patch.
src/Hal/Search/Search.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function __construct($name, array $config)
27 27
     {
28 28
         $this->name = $name;
29
-        $this->config = (object)$config;
29
+        $this->config = (object) $config;
30 30
     }
31 31
 
32 32
     /**
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     public function matches(Metric $metric)
49 49
     {
50
-        $configAsArray = (array)$this->config;
50
+        $configAsArray = (array) $this->config;
51 51
 
52 52
         if (!empty($this->config->type)) {
53 53
             // Does the search concerns type ?
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 
119 119
     private function matchExpectedName(Metric $metric, $expectedName)
120 120
     {
121
-        return preg_match('@' . $expectedName . '@i', $metric->getName());
121
+        return preg_match('@'.$expectedName.'@i', $metric->getName());
122 122
     }
123 123
 
124 124
     private function matchInstanceOf(Metric $metric, $instanceOf)
125 125
     {
126 126
         foreach ($instanceOf as $expectedInterface) {
127 127
             $expectedInterface = ltrim($expectedInterface, '\\');
128
-            if (!in_array($expectedInterface, (array)$metric->get('implements'))) {
128
+            if (!in_array($expectedInterface, (array) $metric->get('implements'))) {
129 129
                 return false;
130 130
             }
131 131
         }
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
     private function usesClasses(Metric $metric, $usesClasses)
137 137
     {
138 138
         foreach ($usesClasses as $expectedClass) {
139
-            foreach ((array)$metric->get('externals') as $use) {
140
-                if (preg_match('@' . $expectedClass . '@i', $use)) {
139
+            foreach ((array) $metric->get('externals') as $use) {
140
+                if (preg_match('@'.$expectedClass.'@i', $use)) {
141 141
                     return true;
142 142
                 }
143 143
             }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     private function matchesMetric(Metric $metric, $metricName, $metricValue)
150 150
     {
151 151
         if (!preg_match_all('!^([=><]*)([\d\.]+)!', $metricValue, $matches, PREG_SET_ORDER)) {
152
-            throw new \LogicException('Invalid search expression for key ' . $metricValue);
152
+            throw new \LogicException('Invalid search expression for key '.$metricValue);
153 153
         }
154 154
         list(, $operator, $expected) = $matches[0];
155 155
 
Please login to merge, or discard this patch.