1 | <?php |
||
12 | class UrlSigner implements UrlSignerContract { |
||
13 | use InteractsWithTime; |
||
14 | |||
15 | /** |
||
16 | * The encryption key resolver callable. |
||
17 | * |
||
18 | * @var callable |
||
19 | */ |
||
20 | protected $keyResolver; |
||
21 | |||
22 | /** |
||
23 | * Create a signed URL. |
||
24 | * |
||
25 | * @param string $url |
||
26 | * @param array $parameters |
||
27 | * @param \DateTimeInterface|\DateInterval|int $expiration |
||
28 | * @return string |
||
29 | * @throws \Throwable |
||
30 | */ |
||
31 | public function sign($url, $parameters = [], $expiration = null): string { |
||
50 | |||
51 | /** |
||
52 | * Create a temporary signed URL. |
||
53 | * |
||
54 | * @param string $url |
||
55 | * @param \DateTimeInterface|\DateInterval|int $expiration |
||
56 | * @param array $parameters |
||
57 | * @return string |
||
58 | * @throws \Throwable |
||
59 | */ |
||
60 | public function temporarySign($url, $expiration, $parameters = []): string { |
||
63 | |||
64 | /** |
||
65 | * Validate a signed url. |
||
66 | * |
||
67 | * @param string $url |
||
68 | * |
||
69 | * @return bool |
||
70 | * @throws \Throwable |
||
71 | */ |
||
72 | public function validate($url) { |
||
86 | |||
87 | |||
88 | /** |
||
89 | * Set the encryption key resolver. |
||
90 | * |
||
91 | * @param callable $keyResolver |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function setKeyResolver(callable $keyResolver) { |
||
99 | } |
||
100 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.