1 | <?php |
||
9 | class Quote extends BaseRequest |
||
10 | { |
||
11 | const ENDPOINT = 'stock/{symbol}/quote'; |
||
12 | |||
13 | /** |
||
14 | * IEX Cloud Documentation provides for the optional field to be added to |
||
15 | * the end of the endpoint uri in order to retrieve a specific field. |
||
16 | * This property allows that functionality to be used in this SDK. |
||
17 | */ |
||
18 | public $field; |
||
19 | |||
20 | /** |
||
21 | * Create constructor. |
||
22 | * |
||
23 | * @param IEXCloud $api |
||
24 | */ |
||
25 | 3 | public function __construct(IEXCloud $api) |
|
29 | |||
30 | /** |
||
31 | * If the field property is set, add it to the end of the endpoint string. |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | 1 | protected function getFullEndpoint(): string |
|
41 | |||
42 | /** |
||
43 | * @return bool|void |
||
44 | * @throws WrongData |
||
45 | */ |
||
46 | 2 | protected function validateParams(): void |
|
52 | |||
53 | /** |
||
54 | * Setter for field property |
||
55 | * |
||
56 | * @param string $field |
||
57 | * |
||
58 | * @return Quote |
||
59 | */ |
||
60 | public function only(string $field): self |
||
66 | } |
||
67 |