1 | <?php |
||
25 | class SaudiAddress |
||
26 | { |
||
27 | /** |
||
28 | * The package version. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | const VERSION = 1.3; |
||
33 | |||
34 | /** |
||
35 | * The Config repository instance. |
||
36 | * |
||
37 | * @var \AliAlharthi\SaudiAddress\ConfigInterface |
||
38 | */ |
||
39 | protected $config; |
||
40 | |||
41 | /** |
||
42 | * Constructor. |
||
43 | * |
||
44 | * @param string $apiKey |
||
45 | * @param string $apiSubscription |
||
46 | */ |
||
47 | public function __construct($apiKey = null, $apiSubscription = 'Development', $cache = false) |
||
51 | |||
52 | /** |
||
53 | * Create a new Saudi National Address API instance. |
||
54 | * |
||
55 | * @param string $apiKey |
||
56 | * @param string $apiSubscription |
||
57 | * @return SaudiAddress |
||
58 | */ |
||
59 | public static function make($apiKey = null, $apiSubscription = 'Development', $cache = false) |
||
63 | |||
64 | /** |
||
65 | * Returns the current package version. |
||
66 | * |
||
67 | * @return double |
||
68 | */ |
||
69 | public static function getVersion() |
||
73 | |||
74 | /** |
||
75 | * Returns the Config repository instance. |
||
76 | * |
||
77 | * @return \AliAlharthi\SaudiAddress\ConfigInterface |
||
78 | */ |
||
79 | public function getConfig() |
||
83 | |||
84 | /** |
||
85 | * Sets the Config repository instance. |
||
86 | * |
||
87 | * @param \AliAlharthi\SaudiAddress\ConfigInterface $config |
||
88 | * @return SaudiAddress |
||
89 | */ |
||
90 | public function setConfig(ConfigInterface $config) |
||
96 | /** |
||
97 | * Returns the Saudi National Address API key. |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getApiKey() |
||
105 | |||
106 | /** |
||
107 | * Sets the Saudi National Address API key. |
||
108 | * |
||
109 | * @param string $apiKey |
||
110 | * @return SaudiAddress |
||
111 | */ |
||
112 | public function setApiKey($apiKey) |
||
118 | |||
119 | /** |
||
120 | * Dynamically handle missing methods. |
||
121 | * |
||
122 | * @param string $method |
||
123 | * @param array $parameters |
||
124 | * @return \AliAlharthi\SaudiAddress\Api\ApiInterface |
||
125 | */ |
||
126 | public function __call($method, array $parameters) |
||
130 | |||
131 | /** |
||
132 | * Returns the Api class instance for the given method. |
||
133 | * |
||
134 | * @param string $method |
||
135 | * @return \AliAlharthi\SaudiAddress\Api\ApiInterface |
||
136 | * @throws \BadMethodCallException |
||
137 | */ |
||
138 | protected function getApiInstance($method) |
||
148 | } |
||
149 |