Total Complexity | 3 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | class QuestionJsonEnricher implements JsonEnricher |
||
9 | { |
||
10 | /** |
||
11 | * @var UuidFactoryInterface |
||
12 | */ |
||
13 | private $uuidFactory; |
||
14 | |||
15 | /** |
||
16 | * @param UuidFactoryInterface $uuidFactory |
||
17 | */ |
||
18 | public function __construct(UuidFactoryInterface $uuidFactory) |
||
19 | { |
||
20 | $this->uuidFactory = $uuidFactory; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @param string $json |
||
25 | * @return string |
||
26 | */ |
||
27 | public function enrich(string $json): string |
||
38 | } |
||
39 | } |
||
40 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: