We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08aa3dc commit 6977ee9Copy full SHA for 6977ee9
app/Presenter/Analyze/Class/Shared/MetricMapper.php
@@ -4,20 +4,13 @@
4
5
use App\Application\Analyze\AnalyzeMetric;
6
7
-/**
8
- * @todo : its work but it's not efficient
9
- */
10
class MetricMapper
11
{
12
public function from(array $metrics): array
13
14
- $class = [];
15
-
16
- foreach ($metrics as $metric) {
17
- $class[] = $this->makeClass($metric);
18
- }
19
20
- return $class;
+ return array_map(function (AnalyzeMetric $metric) {
+ return $this->makeClass($metric);
+ }, $metrics);
21
}
22
23
private function makeClass(AnalyzeMetric $metric): Metric
0 commit comments