Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
19 | public function process(AssetInterface $asset, AssetFactory $factory): ?AssetInterface |
||
20 | { |
||
21 | 1 | $path = $asset->getTargetPath(); |
|
22 | if (null === $path) { |
||
23 | 1 | return null; |
|
24 | 1 | } |
|
25 | 1 | ||
26 | $ext = pathinfo($path, PATHINFO_EXTENSION); |
||
27 | 1 | ||
28 | 1 | $lastModified = $factory->getLastModified($asset); |
|
29 | if (null !== $lastModified) { |
||
30 | 1 | $path = substr_replace( |
|
31 | $path, |
||
32 | 1 | "$lastModified.$ext", |
|
33 | -1 * strlen($ext) |
||
|
|||
34 | ); |
||
35 | $asset->setTargetPath($path); |
||
36 | } |
||
37 | return null; |
||
38 | } |
||
40 |