1 | <?php |
||
12 | class SplashRequestParameterFetcher implements ParameterFetcher |
||
13 | { |
||
14 | /** |
||
15 | * Returns whether this fetcher factory can handle the parameter passed in parameter for the url $url. |
||
16 | * |
||
17 | * @param ReflectionParameter $reflectionParameter |
||
18 | * @param string $url |
||
19 | * |
||
20 | * @return bool |
||
21 | */ |
||
22 | public function canHandle(ReflectionParameter $reflectionParameter, string $url = null) : bool |
||
27 | |||
28 | /** |
||
29 | * Returns some data needed by this fetcher to fetch data from the request. |
||
30 | * This data MUST be serializable (and will be serialized). This function will be called only once |
||
31 | * and data cached. You can perform expensive computation in this function. |
||
32 | * |
||
33 | * @param ReflectionParameter $reflectionParameter |
||
34 | * @param string|null $url |
||
35 | * |
||
36 | * @return mixed |
||
37 | */ |
||
38 | public function getFetcherData(ReflectionParameter $reflectionParameter, string $url = null) |
||
53 | |||
54 | /** |
||
55 | * Returns the value to be injected in this parameter. |
||
56 | * |
||
57 | * @param mixed $data The data generated by "getFetcherData" |
||
58 | * @param SplashRequestContext $context |
||
59 | * |
||
60 | * @return mixed |
||
61 | */ |
||
62 | public function fetchValue($data, SplashRequestContext $context) |
||
70 | } |
||
71 |