Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
34 | public function findTranslationFiles(ThemeInterface $theme) |
||
35 | { |
||
36 | $files = $this->translationFilesFinder->findTranslationFiles($theme); |
||
37 | |||
38 | /** |
||
39 | * PHP 5.* bug, fixed in PHP 7: https://bugs.php.net/bug.php?id=50688 |
||
40 | * "usort(): Array was modified by the user comparison function" |
||
41 | */ |
||
42 | @usort($files, function ($firstFile, $secondFile) use ($theme) { |
||
|
|||
43 | $firstFile = str_replace($theme->getPath(), '', $firstFile); |
||
44 | $secondFile = str_replace($theme->getPath(), '', $secondFile); |
||
45 | |||
46 | return strpos($secondFile, 'translations') - strpos($firstFile, 'translations'); |
||
47 | }); |
||
48 | |||
49 | return $files; |
||
50 | } |
||
51 | } |
||
52 |
If you suppress an error, we recommend checking for the error condition explicitly: