| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | final class Javascript extends FileExtensionCompactor |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * {@inheritdoc} |
||
| 29 | */ |
||
| 30 | public function __construct(array $extensions = ['js']) |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | protected function compactContent(string $contents): string |
||
| 39 | { |
||
| 40 | try { |
||
| 41 | return Minifier::minify($contents); |
||
| 42 | } catch (Exception $e) { |
||
| 43 | // Returns unchanged content |
||
| 44 | |||
| 45 | return $contents; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | protected function supports(string $file): bool |
||
| 59 | } |
||
| 60 | } |
||
| 61 |