Completed
Pull Request — master (#512)
by Alan
20s
created
src/Hal/Exception/ConfigException/SearchValidationException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,6 +62,6 @@
 block discarded – undo
62 62
      */
63 63
     public static function invalidCustomMetricComparison(string $configMetricValue): SearchValidationException
64 64
     {
65
-        return new self('Invalid search expression for key ' . $configMetricValue);
65
+        return new self('Invalid search expression for key '.$configMetricValue);
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
src/Hal/Search/Search.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     private function matchExpectedName(Metric $metric, string $expectedName): bool
135 135
     {
136
-        return (bool)preg_match('@' . $expectedName . '@i', $metric->getName());
136
+        return (bool) preg_match('@'.$expectedName.'@i', $metric->getName());
137 137
     }
138 138
 
139 139
     /**
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     private function matchInstanceOf(Metric $metric, array $instanceOf): bool
145 145
     {
146
-        $implements = (array)$metric->get('implements');
146
+        $implements = (array) $metric->get('implements');
147 147
         foreach ($instanceOf as $expectedInterface) {
148 148
             $expectedInterface = ltrim($expectedInterface, '\\');
149 149
             if (!in_array($expectedInterface, $implements, true)) {
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
     private function usesClasses(Metric $metric, array $usesClasses): bool
163 163
     {
164 164
         /** @var array<string> $externals */
165
-        $externals = (array)$metric->get('externals');
165
+        $externals = (array) $metric->get('externals');
166 166
         foreach ($usesClasses as $expectedClass) {
167 167
             foreach ($externals as $use) {
168
-                if (1 === preg_match('@' . $expectedClass . '@i', $use)) {
168
+                if (1 === preg_match('@'.$expectedClass.'@i', $use)) {
169 169
                     return true;
170 170
                 }
171 171
             }
Please login to merge, or discard this patch.
src/Hal/Violation/Checkers/AbstractViolationsChecker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         foreach ($this->metrics->all() as $metric) {
35 35
             /** @var ViolationsHandlerInterface $violationsHandler */
36 36
             $violationsHandler = $metric->get('violations');
37
-            array_map(function (Violation $violation): void {
37
+            array_map(function(Violation $violation): void {
38 38
                 ++$this->violationsByLevel[$violation->getLevel()];
39 39
             }, $violationsHandler->getAll());
40 40
         }
Please login to merge, or discard this patch.
src/Hal/Violation/Class_/TooComplexMethodCode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
     public function apply(Metric $metric): void
29 29
     {
30
-        if (! $metric instanceof ClassMetric) {
30
+        if (!$metric instanceof ClassMetric) {
31 31
             return;
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/Hal/Violation/ViolationParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
      */
30 30
     public function apply(Metrics $metrics): void
31 31
     {
32
-        array_map(function (Metric $metric): void {
32
+        array_map(function(Metric $metric): void {
33 33
             $metric->set('violations', new ViolationsHandler());
34 34
 
35
-            array_map(static function (Violation $violation) use ($metric): void {
35
+            array_map(static function(Violation $violation) use ($metric): void {
36 36
                 $violation->apply($metric);
37 37
             }, $this->violationsChecker);
38 38
         }, $metrics->all());
Please login to merge, or discard this patch.
src/Hal/Violation/Package/StableAbstractionsPrinciple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
     public function apply(Metric $metric): void
28 28
     {
29
-        if (! $metric instanceof PackageMetric) {
29
+        if (!$metric instanceof PackageMetric) {
30 30
             return;
31 31
         }
32 32
 
Please login to merge, or discard this patch.
src/Hal/Violation/Package/StableDependenciesPrinciple.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function apply(Metric $metric): void
37 37
     {
38
-        if (! $metric instanceof PackageMetric) {
38
+        if (!$metric instanceof PackageMetric) {
39 39
             return;
40 40
         }
41 41
         $this->metric = $metric;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $thisInstability = round($instability, 3);
70 70
         $packages = implode(
71 71
             "\n* ",
72
-            array_map(static function (string $name, float $instability): string {
72
+            array_map(static function(string $name, float $instability): string {
73 73
                 $name = '\\' === $name ? 'global' : substr($name, 0, -1);
74 74
                 return sprintf('%s (%f0.3)', $name, round($instability, 3));
75 75
             }, array_keys($this->violatingInstabilities), $this->violatingInstabilities)
Please login to merge, or discard this patch.
src/Hal/Violation/ViolationsHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
     {
55 55
         return array_reduce(
56 56
             $this->data,
57
-            static fn (string $previous, Violation $violation): string => $previous . $violation->getName() . ',',
57
+            static fn (string $previous, Violation $violation): string => $previous.$violation->getName().',',
58 58
             ''
59 59
         );
60 60
     }
Please login to merge, or discard this patch.
src/Hal/DependencyInjection/DependencyInjectionProcessor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,13 +72,13 @@
 block discarded – undo
72 72
 
73 73
     public function __construct()
74 74
     {
75
-        $this->dependencyInjectionLoader = static function (array $cliArguments): ApplicationInterface {
75
+        $this->dependencyInjectionLoader = static function(array $cliArguments): ApplicationInterface {
76 76
             $fileSystem = new System();
77 77
             $fileReader = new Reader();
78 78
             $fileWriter = new Writer();
79 79
 
80 80
             $versionInfo = new VersionInfo($fileReader);
81
-            $versionInfo->inferVersionFromSemver(dirname(__DIR__, 3) . '/.semver');
81
+            $versionInfo->inferVersionFromSemver(dirname(__DIR__, 3).'/.semver');
82 82
 
83 83
             $output = new CliOutput();
84 84
             $config = (
Please login to merge, or discard this patch.