| 1 | <?php |
||
| 17 | class Builder |
||
| 18 | { |
||
| 19 | |||
| 20 | /** |
||
| 21 | * SHA256 Hash Algorithm |
||
| 22 | */ |
||
| 23 | private const SHA256 = 'sha256'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * SHA384 Hash Algorithm |
||
| 27 | */ |
||
| 28 | private const SHA384 = 'sha384'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * SHA512 Hash Algorithm |
||
| 32 | */ |
||
| 33 | private const SHA512 = 'sha512'; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Builder constructor. |
||
| 37 | */ |
||
| 38 | public function __construct() |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $file |
||
| 45 | * |
||
| 46 | * @param $algorithm |
||
| 47 | * |
||
| 48 | * @return string |
||
| 49 | * @throws Exception |
||
| 50 | */ |
||
| 51 | public function sri(string $file, $algorithm) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param string $file |
||
| 64 | * |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public function versioning(string $file) |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @param string $path |
||
| 74 | * |
||
| 75 | * @return string |
||
| 76 | * @throws Exception |
||
| 77 | */ |
||
| 78 | public function attribute(string $path): string |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @param string $algorithm |
||
| 98 | * |
||
| 99 | * @return string |
||
| 100 | * @throws Exception |
||
| 101 | */ |
||
| 102 | private static function selectAlgorithm(string $algorithm): string |
||
| 113 | |||
| 114 | private static function parseExtension(string $path): string |
||
| 118 | |||
| 119 | } |
||
| 120 |