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