@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * Setter for request method. |
33 | 33 | * |
34 | 34 | * @param string $method |
35 | - * @return PeterColes\Betfair\Http\Client |
|
35 | + * @return Client |
|
36 | 36 | */ |
37 | 37 | public function setMethod(string $method) |
38 | 38 | { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * Setter for request end point URI. |
45 | 45 | * |
46 | 46 | * @param string $endPoint |
47 | - * @return PeterColes\Betfair\Http\Client |
|
47 | + * @return Client |
|
48 | 48 | */ |
49 | 49 | public function setEndPoint(string $endPoint) |
50 | 50 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * Setter for request headers. |
57 | 57 | * |
58 | 58 | * @param array $headers |
59 | - * @return PeterColes\Betfair\Http\Client |
|
59 | + * @return Client |
|
60 | 60 | */ |
61 | 61 | public function addHeaders(array $headers) |
62 | 62 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * Setter for request form data. |
69 | 69 | * |
70 | 70 | * @param array $formData |
71 | - * @return PeterColes\Betfair\Http\Client |
|
71 | + * @return Client |
|
72 | 72 | */ |
73 | 73 | public function setFormData(array $formData) |
74 | 74 | { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * Setter for request filter(s). |
81 | 81 | * |
82 | 82 | * @param MarketFilter $filter |
83 | - * @return PeterColes\Betfair\Http\Client |
|
83 | + * @return Client |
|
84 | 84 | */ |
85 | 85 | public function setFilter(MarketFilter $filter) { |
86 | 86 | $this->options['json']['filter'] = $filter; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * It's optional, so we only pass a value if there is one |
93 | 93 | * |
94 | 94 | * @param string|null $locale |
95 | - * @return PeterColes\Betfair\Http\Client |
|
95 | + * @return Client |
|
96 | 96 | */ |
97 | 97 | public function setLocale($locale) { |
98 | 98 | if ($locale) { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | protected $uri = ''; |
16 | 16 | |
17 | - protected $options = []; |
|
17 | + protected $options = [ ]; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * instantiate Guzzle client (unless one is injected). |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function __construct($client = null) |
26 | 26 | { |
27 | 27 | $this->guzzleClient = $client ?: new Client; |
28 | - $this->options['headers'] = ['Accept' => 'application/json']; |
|
28 | + $this->options[ 'headers' ] = [ 'Accept' => 'application/json' ]; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function addHeaders(array $headers) |
62 | 62 | { |
63 | - $this->options['headers'] = array_merge($this->options['headers'], $headers); |
|
63 | + $this->options[ 'headers' ] = array_merge($this->options[ 'headers' ], $headers); |
|
64 | 64 | return $this; |
65 | 65 | } |
66 | 66 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function setFormData(array $formData) |
74 | 74 | { |
75 | - $this->options['form_params'] = $formData; |
|
75 | + $this->options[ 'form_params' ] = $formData; |
|
76 | 76 | return $this; |
77 | 77 | } |
78 | 78 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @return PeterColes\Betfair\Http\Client |
84 | 84 | */ |
85 | 85 | public function setFilter(MarketFilter $filter) { |
86 | - $this->options['json']['filter'] = $filter; |
|
86 | + $this->options[ 'json' ][ 'filter' ] = $filter; |
|
87 | 87 | return $this; |
88 | 88 | } |
89 | 89 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function setLocale($locale) { |
98 | 98 | if ($locale) { |
99 | - $this->options['json']['locale'] = $locale; |
|
99 | + $this->options[ 'json' ][ 'locale' ] = $locale; |
|
100 | 100 | } |
101 | 101 | return $this; |
102 | 102 | } |
@@ -23,15 +23,15 @@ |
||
23 | 23 | */ |
24 | 24 | public function __call($method, $params) |
25 | 25 | { |
26 | - if (in_array($method, ['listCompetitions', 'listCountries', 'listEvents', 'listEventTypes', 'listMarketTypes', 'listVenues'])) { |
|
26 | + if (in_array($method, [ 'listCompetitions', 'listCountries', 'listEvents', 'listEventTypes', 'listMarketTypes', 'listVenues' ])) { |
|
27 | 27 | |
28 | - $filters = isset($params[2]) ? $params[2] : []; |
|
29 | - $locale = isset($params[3]) ? $params[3] : []; |
|
28 | + $filters = isset($params[ 2 ]) ? $params[ 2 ] : [ ]; |
|
29 | + $locale = isset($params[ 3 ]) ? $params[ 3 ] : [ ]; |
|
30 | 30 | |
31 | 31 | return $this->httpClient |
32 | 32 | ->setMethod('post') |
33 | 33 | ->setEndPoint(self::ENDPOINT.$method.'/') |
34 | - ->addHeaders(['X-Application' => $params[0], 'X-Authentication' => $params[1], 'Content-Type' => 'application/json']) |
|
34 | + ->addHeaders([ 'X-Application' => $params[ 0 ], 'X-Authentication' => $params[ 1 ], 'Content-Type' => 'application/json' ]) |
|
35 | 35 | ->setFilter(new MarketFilter($filters)) |
36 | 36 | ->setLocale($locale) |
37 | 37 | ->send(); |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | $result = $this->httpClient |
21 | 21 | ->setMethod('post') |
22 | 22 | ->setEndPoint(self::ENDPOINT.'login/') |
23 | - ->addHeaders(['X-Application' => $appKey]) |
|
24 | - ->setFormData(['username' => $username, 'password' => $password]) |
|
23 | + ->addHeaders([ 'X-Application' => $appKey ]) |
|
24 | + ->setFormData([ 'username' => $username, 'password' => $password ]) |
|
25 | 25 | ->send(); |
26 | 26 | |
27 | 27 | return $result->token; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $this->httpClient |
33 | 33 | ->setEndPoint(self::ENDPOINT.'keepAlive/') |
34 | - ->addHeaders(['X-Application' => $appKey, 'X-Authentication' => $sessionToken]) |
|
34 | + ->addHeaders([ 'X-Application' => $appKey, 'X-Authentication' => $sessionToken ]) |
|
35 | 35 | ->send(); |
36 | 36 | } |
37 | 37 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $this->httpClient |
41 | 41 | ->setEndPoint(self::ENDPOINT.'logout/') |
42 | - ->addHeaders(['X-Application' => $appKey, 'X-Authentication' => $sessionToken]) |
|
42 | + ->addHeaders([ 'X-Application' => $appKey, 'X-Authentication' => $sessionToken ]) |
|
43 | 43 | ->send(); |
44 | 44 | } |
45 | 45 | } |