| 1 | <?php |
||
| 12 | class Builder |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * SHA256 Hash Algorithm |
||
| 17 | */ |
||
| 18 | private const SHA256 = 'sha256'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * SHA384 Hash Algorithm |
||
| 22 | */ |
||
| 23 | private const SHA384 = 'sha384'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * SHA512 Hash Algorithm |
||
| 27 | */ |
||
| 28 | private const SHA512 = 'sha512'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * |
||
| 32 | */ |
||
| 33 | private const SCRIPT = 'script'; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * |
||
| 37 | */ |
||
| 38 | private const LINK = 'link'; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Builder constructor. |
||
| 42 | */ |
||
| 43 | public function __construct() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param string $file |
||
| 50 | * |
||
| 51 | * @param $algo |
||
| 52 | * |
||
| 53 | * @return string |
||
| 54 | * @throws Exception |
||
| 55 | */ |
||
| 56 | public function sri(string $file, $algo) |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @param string $file |
||
| 69 | * |
||
| 70 | * @return string |
||
| 71 | */ |
||
| 72 | public function versioning(string $file) |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @param string $type |
||
| 79 | * |
||
| 80 | * @return string |
||
| 81 | * @throws Exception |
||
| 82 | */ |
||
| 83 | public function attribute(string $type): string |
||
| 99 | |||
| 100 | /** |
||
| 101 | * @param string $algorithm |
||
| 102 | * |
||
| 103 | * @return string |
||
| 104 | * @throws Exception |
||
| 105 | */ |
||
| 106 | private static function selectAlgorithm(string $algorithm): string |
||
| 117 | |||
| 118 | } |
||
| 119 |