| Total Complexity | 9 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 76.92% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class AssetUtil |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Returns a value indicating whether a URL is relative. |
||
| 14 | * |
||
| 15 | * A relative URL does not have host info part. |
||
| 16 | * @param string $url the URL to be checked |
||
| 17 | * @return bool whether the URL is relative |
||
| 18 | */ |
||
| 19 | 23 | public static function isRelative(string $url): bool |
|
| 20 | { |
||
| 21 | 23 | return strncmp($url, '//', 2) && strpos($url, '://') === false; |
|
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param AssetBundle $bundle |
||
| 26 | * @param string $pathAsset |
||
| 27 | * @param array $assetMap |
||
| 28 | * |
||
| 29 | * @return string|null |
||
| 30 | */ |
||
| 31 | 23 | public static function resolveAsset(AssetBundle $bundle, string $pathAsset, array $assetMap): ?string |
|
| 51 | } |
||
| 52 | } |
||
| 53 |