@@ -32,6 +32,6 @@ |
||
32 | 32 | [, $v] = $matches; |
33 | 33 | /** @var array{string, string, string, string} $v As the .semver file is always on the same format. */ |
34 | 34 | $v[3] = trim($v[3], "'"); |
35 | - self::$version = 'v' . $v[0] . '.' . $v[1] . '.' . $v[2] . ('' !== $v[3] ? '-' . $v[3] : ''); |
|
35 | + self::$version = 'v'.$v[0].'.'.$v[1].'.'.$v[2].('' !== $v[3] ? '-'.$v[3] : ''); |
|
36 | 36 | } |
37 | 37 | } |
@@ -62,6 +62,6 @@ |
||
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 | } |
@@ -133,7 +133,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -34,7 +34,7 @@ |
||
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 | } |
@@ -27,7 +27,7 @@ |
||
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 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | public function apply(Metric $metric): void |
26 | 26 | { |
27 | - if (! $metric instanceof ClassMetric) { |
|
27 | + if (!$metric instanceof ClassMetric) { |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 |
@@ -29,10 +29,10 @@ |
||
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()); |
@@ -26,7 +26,7 @@ |
||
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 |
@@ -35,7 +35,7 @@ discard block |
||
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 |
||
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) |