1 | <?php |
||
21 | abstract class AbstractProxy implements Proxy |
||
22 | { |
||
23 | public const RETROFIT_NO_DEFAULT_VALUE = '__retrofit_no_default_value__'; |
||
24 | |||
25 | /** |
||
26 | * Creates a [@see DefaultServiceMethod] |
||
27 | * |
||
28 | * @var ServiceMethodFactory |
||
29 | */ |
||
30 | private $serviceMethodFactory; |
||
31 | |||
32 | /** |
||
33 | * A retrofit http client |
||
34 | * |
||
35 | * @var HttpClient |
||
36 | */ |
||
37 | private $client; |
||
38 | |||
39 | /** |
||
40 | * Constructor |
||
41 | * |
||
42 | * @param ServiceMethodFactory $serviceMethodFactory |
||
43 | * @param HttpClient $client |
||
44 | */ |
||
45 | 20 | public function __construct(ServiceMethodFactory $serviceMethodFactory, HttpClient $client) |
|
50 | |||
51 | /** @noinspection MagicMethodsValidityInspection */ |
||
52 | /** |
||
53 | * Constructs a [@see Call] object based on an interface method and arguments, then passes it through a |
||
54 | * [@see CallAdapter] before returning. |
||
55 | * |
||
56 | * @param string $interfaceName |
||
57 | * @param string $methodName |
||
58 | * @param array $args |
||
59 | * @param array $defaultArgs |
||
60 | * @return mixed |
||
61 | */ |
||
62 | 15 | public function __handleRetrofitRequest(string $interfaceName, string $methodName, array $args, array $defaultArgs) |
|
69 | |||
70 | /** |
||
71 | * Append any default args to argument array |
||
72 | * |
||
73 | * @param array $args |
||
74 | * @param array $defaultArgs |
||
75 | * @return array |
||
76 | */ |
||
77 | 15 | private function createArgs(array $args, array $defaultArgs): array |
|
91 | } |
||
92 |