Completed
Pull Request — master (#358)
by Oskar
12:42
created
src/Hal/Report/Html/template/packages.php 1 patch
Spacing   +2 added lines, -2 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
     <div class="row">
5 5
         <div class="column">
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             </div>
41 41
         </div>
42 42
     </div>
43
-<?php require __DIR__ . '/_footer.php'; ?>
43
+<?php require __DIR__.'/_footer.php'; ?>
44 44
 <?php
45 45
 $spots = [];
46 46
 foreach ($packages as $each) {
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/package_relations.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1
-<?php require __DIR__ . '/_header.php'; ?>
1
+<?php require __DIR__.'/_header.php'; ?>
2 2
 
3 3
 <?php
4 4
 $relations = [];
5
-$getPackageName = function ($name) {
5
+$getPackageName = function($name) {
6 6
     return $name === '\\' ? 'global' : substr($name, 0, -1);
7 7
 };
8 8
 foreach ($packages as $package) {
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     </div>
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/Metric/PackageMetric.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
         }
48 48
         $classDependencies = $this->getOutgoingClassDependencies();
49 49
         $packageDependencies = $this->getOutgoingPackageDependencies();
50
-        if (! in_array($className, $classDependencies)) {
50
+        if (!in_array($className, $classDependencies)) {
51 51
             $classDependencies[] = $className;
52 52
             $this->set('outgoing_class_dependencies', $classDependencies);
53 53
         }
54
-        if (! in_array($packageName, $packageDependencies)) {
54
+        if (!in_array($packageName, $packageDependencies)) {
55 55
             $packageDependencies[] = $packageName;
56 56
             $this->set('outgoing_package_dependencies', $packageDependencies);
57 57
         }
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
         }
76 76
         $classDependencies = $this->getIncomingClassDependencies();
77 77
         $packageDependencies = $this->getIncomingPackageDependencies();
78
-        if (! in_array($className, $classDependencies)) {
78
+        if (!in_array($className, $classDependencies)) {
79 79
             $classDependencies[] = $className;
80 80
             $this->set('incoming_class_dependencies', $classDependencies);
81 81
         }
82
-        if (! in_array($packageName, $packageDependencies)) {
82
+        if (!in_array($packageName, $packageDependencies)) {
83 83
             $packageDependencies[] = $packageName;
84 84
             $this->set('incoming_package_dependencies', $packageDependencies);
85 85
         }
Please login to merge, or discard this patch.
src/Hal/Metric/Package/PackageAbstraction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     {
12 12
         /* @var $packages PackageMetric[] */
13 13
         foreach ($metrics->all() as $eachPackage) {
14
-            if (! $eachPackage instanceof PackageMetric) {
14
+            if (!$eachPackage instanceof PackageMetric) {
15 15
                 continue;
16 16
             }
17 17
             $abstractClassCount = 0;
Please login to merge, or discard this patch.
src/Hal/Metric/Package/PackageCollectingVisitor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@
 block discarded – undo
42 42
                 $package = $matches[1];
43 43
             }
44 44
             if (preg_match('/^\s*\* @subpackage (.*)/m', $docBlockText, $matches)) {
45
-                $package = $package . '\\' . $matches[1];
45
+                $package = $package.'\\'.$matches[1];
46 46
             }
47 47
 
48
-            $packageName = $package . '\\';
49
-            if (! $packageMetric = $this->metrics->get($packageName)) {
48
+            $packageName = $package.'\\';
49
+            if (!$packageMetric = $this->metrics->get($packageName)) {
50 50
                 $packageMetric = new PackageMetric($packageName);
51 51
                 $this->metrics->attach($packageMetric);
52 52
             }
Please login to merge, or discard this patch.
src/Hal/Metric/Package/PackageDependencies.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public function calculate(Metrics $metrics)
14 14
     {
15
-        $classes = array_filter($metrics->all(), function (Metric $metric) {
15
+        $classes = array_filter($metrics->all(), function(Metric $metric) {
16 16
             return $metric instanceof ClassMetric || $metric instanceof InterfaceMetric;
17 17
         });
18 18
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     private function increaseDependencies(Metric $class, Metrics $metrics)
29 29
     {
30
-        if (! $class->has('package') || ! $class->has('externals')) {
30
+        if (!$class->has('package') || !$class->has('externals')) {
31 31
             return;
32 32
         }
33 33
         $incomingPackage = $metrics->get($class->get('package')); /* @var $incomingPackage PackageMetric */
@@ -56,6 +56,6 @@  discard block
 block discarded – undo
56 56
         }
57 57
         $parts = explode('\\', $className);
58 58
         array_pop($parts);
59
-        return implode('\\', $parts) . '\\';
59
+        return implode('\\', $parts).'\\';
60 60
     }
61 61
 }
Please login to merge, or discard this patch.
src/Hal/Metric/Package/PackageInstability.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     public function calculate(Metrics $metrics)
11 11
     {
12 12
         /* @var $packages PackageMetric[] */
13
-        $packages = array_filter($metrics->all(), function ($metric) {
13
+        $packages = array_filter($metrics->all(), function($metric) {
14 14
             return $metric instanceof PackageMetric;
15 15
         });
16 16
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         }
29 29
         // Set depending instabilities
30 30
         foreach ($packages as $eachPackage) {
31
-            $dependentInstabilities = array_map(function ($packageName) use ($instabilitiesByPackage) {
31
+            $dependentInstabilities = array_map(function($packageName) use ($instabilitiesByPackage) {
32 32
                 return isset($instabilitiesByPackage[$packageName]) ? $instabilitiesByPackage[$packageName] : null;
33 33
             }, $eachPackage->getOutgoingPackageDependencies());
34 34
             $dependentInstabilities = array_combine(
Please login to merge, or discard this patch.
src/Hal/Metric/Helper/MetricClassNameGenerator.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
     public static function getName(Node $node)
18 18
     {
19 19
         return ($node instanceof Node\Stmt\Class_ && $node->isAnonymous()) ?
20
-            'anonymous@' . spl_object_hash($node) :
21
-            $node->namespacedName->toString();
20
+            'anonymous@'.spl_object_hash($node) : $node->namespacedName->toString();
22 21
     }
23 22
 }
Please login to merge, or discard this patch.
src/Hal/Report/Csv/Reporter.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     /**
23 23
      * Reporter constructor.
24 24
      * @param Config $config
25
-     * @param OutputInterface $output
25
+     * @param Output $output
26 26
      */
27 27
     public function __construct(Config $config, Output $output)
28 28
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             return;
45 45
         }
46 46
         if (!file_exists(dirname($logFile)) || !is_writable(dirname($logFile))) {
47
-            throw new \RuntimeException('You don\'t have permissions to write CSV report in ' . $logFile);
47
+            throw new \RuntimeException('You don\'t have permissions to write CSV report in '.$logFile);
48 48
         }
49 49
 
50 50
         $availables = (new Registry())->allForStructures();
Please login to merge, or discard this patch.