Total Complexity | 3 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
7 | class SignedUrl extends MD5UrlSigner |
||
8 | { |
||
9 | /** |
||
10 | * The key that is used to generate secure signatures. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $signatureKey; |
||
15 | |||
16 | /** |
||
17 | * The URL's query parameter name for the expiration. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $expiresParameter; |
||
22 | |||
23 | /** |
||
24 | * The URL's query parameter name for the signature. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $signatureParameter; |
||
29 | |||
30 | public function __construct() |
||
31 | { |
||
32 | $this->signatureKey = config('signed-url.signatureKey'); |
||
|
|||
33 | $this->expiresParameter = config('signed-url.parameters.expires'); |
||
34 | $this->signatureParameter = config('signed-url.parameters.signature'); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Get a secure URL to a controller action. |
||
39 | * |
||
40 | * @param string $url |
||
41 | * @param \DateTime|int|null $expiration Defaults to the config value |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | public function sign($url, $expiration = null) |
||
50 | } |
||
51 | } |
||
52 |