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