We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 6 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 92.86% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class Base64Encoder |
||
| 8 | { |
||
| 9 | 107 | public static function encodeUrlSafe(string $value, bool $padding = false): string |
|
| 10 | { |
||
| 11 | 107 | $result = \base64_encode($value); |
|
| 12 | 107 | $result = \str_replace(['+', '/'], ['-', '_'], $result); |
|
| 13 | |||
| 14 | 107 | if (!$padding) { |
|
| 15 | 101 | $result = \str_replace('=', '', $result); |
|
| 16 | } |
||
| 17 | |||
| 18 | 107 | return $result; |
|
| 19 | } |
||
| 20 | |||
| 21 | 68 | public static function decodeUrlSafe(string $value, bool $strict = true): string |
|
| 36 | } |
||
| 37 | } |
||
| 38 |