@@ -17,7 +17,7 @@ |
||
17 | 17 | /** |
18 | 18 | * @inheritdoc |
19 | 19 | */ |
20 | - public function getBody($asArray = true) { |
|
20 | + public function getBody($asArray = true){ |
|
21 | 21 | return json_decode($this->body,$asArray); |
22 | 22 | } |
23 | 23 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | protected $message = 'EntryPoint Exception [%s] occurred on EntryPoint %s: %s'; |
10 | 10 | |
11 | - public function __construct($EntryPoint,$data) { |
|
11 | + public function __construct($EntryPoint,$data){ |
|
12 | 12 | parent::__construct(sprintf($this->message,get_called_class(),$EntryPoint,$data)); |
13 | 13 | } |
14 | 14 |
@@ -9,12 +9,12 @@ |
||
9 | 9 | |
10 | 10 | abstract class AbstractDeleteEntryPoint extends AbstractEntryPoint { |
11 | 11 | |
12 | - public function __construct($url, array $options = array()) { |
|
12 | + public function __construct($url, array $options = array()){ |
|
13 | 13 | $this->setRequest(new DELETE()); |
14 | 14 | parent::__construct($url, $options); |
15 | 15 | } |
16 | 16 | |
17 | - public function execute($data = null) { |
|
17 | + public function execute($data = null){ |
|
18 | 18 | parent::execute($data); |
19 | 19 | $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject())); |
20 | 20 | return $this; |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | public function __construct($url,$options = array()){ |
98 | 98 | $this->baseUrl = $url; |
99 | 99 | |
100 | - if (!empty($options)) { |
|
100 | + if (!empty($options)){ |
|
101 | 101 | $this->setOptions($options); |
102 | - }elseif(!$this->requiresOptions()){ |
|
102 | + } elseif(!$this->requiresOptions()){ |
|
103 | 103 | $this->configureURL(); |
104 | 104 | } |
105 | 105 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function setData($data){ |
123 | 123 | $this->Data = $data; |
124 | - if ($this->verifyData()) { |
|
124 | + if ($this->verifyData()){ |
|
125 | 125 | $this->Request->setBody($data); |
126 | 126 | } |
127 | 127 | return $this; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | /** |
131 | 131 | * @inheritdoc |
132 | 132 | */ |
133 | - public function setAuth($accessToken) { |
|
133 | + public function setAuth($accessToken){ |
|
134 | 134 | if ($this->authRequired()){ |
135 | 135 | $this->accessToken = $accessToken; |
136 | 136 | $this->Request->addHeader('OAuth-Token', $accessToken); |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | * @inheritdoc |
143 | 143 | * @throws InvalidURLException - When passed in URL contains $variables |
144 | 144 | */ |
145 | - public function setUrl($url) { |
|
145 | + public function setUrl($url){ |
|
146 | 146 | $this->Url = $url; |
147 | - if ($this->verifyUrl()) { |
|
147 | + if ($this->verifyUrl()){ |
|
148 | 148 | $this->Request->setURL($this->Url); |
149 | 149 | } |
150 | 150 | return $this; |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | /** |
154 | 154 | * @inheritdoc |
155 | 155 | */ |
156 | - public function setRequest(RequestInterface $Request) { |
|
156 | + public function setRequest(RequestInterface $Request){ |
|
157 | 157 | $this->Request = $Request; |
158 | 158 | return $this; |
159 | 159 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | /** |
162 | 162 | * @inheritdoc |
163 | 163 | */ |
164 | - public function setResponse(ResponseInterface $Response) { |
|
164 | + public function setResponse(ResponseInterface $Response){ |
|
165 | 165 | $this->Response = $Response; |
166 | 166 | return $this; |
167 | 167 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | /** |
170 | 170 | * @inheritdoc |
171 | 171 | */ |
172 | - public function getModule() { |
|
172 | + public function getModule(){ |
|
173 | 173 | return $this->Module; |
174 | 174 | } |
175 | 175 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | /** |
216 | 216 | * @inheritdoc |
217 | 217 | */ |
218 | - public function authRequired() { |
|
218 | + public function authRequired(){ |
|
219 | 219 | return $this->_AUTH_REQUIRED; |
220 | 220 | } |
221 | 221 | |
@@ -240,12 +240,12 @@ discard block |
||
240 | 240 | */ |
241 | 241 | protected function configureURL(){ |
242 | 242 | $url = $this->_URL; |
243 | - if ($this->requiresOptions()) { |
|
243 | + if ($this->requiresOptions()){ |
|
244 | 244 | $urlParts = explode("/", $this->_URL); |
245 | 245 | $o = 0; |
246 | - foreach ($urlParts as $key => $part) { |
|
247 | - if (strpos($part, "$") !== FALSE) { |
|
248 | - if (isset($this->Options[$o])) { |
|
246 | + foreach ($urlParts as $key => $part){ |
|
247 | + if (strpos($part, "$") !== FALSE){ |
|
248 | + if (isset($this->Options[$o])){ |
|
249 | 249 | $urlParts[$key] = $this->Options[$o]; |
250 | 250 | $o++; |
251 | 251 | } |
@@ -291,8 +291,8 @@ discard block |
||
291 | 291 | * @throws RequiredDataException |
292 | 292 | */ |
293 | 293 | protected function verifyData(){ |
294 | - if (isset($this->_DATA_TYPE)||!empty($this->_DATA_TYPE)) { |
|
295 | - if (gettype($this->Data) !== $this->_DATA_TYPE) { |
|
294 | + if (isset($this->_DATA_TYPE)||!empty($this->_DATA_TYPE)){ |
|
295 | + if (gettype($this->Data) !== $this->_DATA_TYPE){ |
|
296 | 296 | throw new RequiredDataException(get_called_class(),"Valid DataType is {$this->_DATA_TYPE}"); |
297 | 297 | } |
298 | 298 | } |
@@ -8,12 +8,12 @@ |
||
8 | 8 | |
9 | 9 | abstract class AbstractGetEntryPoint extends AbstractEntryPoint { |
10 | 10 | |
11 | - public function __construct($url, array $options = array()) { |
|
11 | + public function __construct($url, array $options = array()){ |
|
12 | 12 | $this->setRequest(new GET()); |
13 | 13 | parent::__construct($url, $options); |
14 | 14 | } |
15 | 15 | |
16 | - public function execute($data = null) { |
|
16 | + public function execute($data = null){ |
|
17 | 17 | parent::execute($data); |
18 | 18 | $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject())); |
19 | 19 | return $this; |
@@ -14,12 +14,12 @@ |
||
14 | 14 | */ |
15 | 15 | protected $downloadDir = null; |
16 | 16 | |
17 | - public function __construct($url, array $options = array()) { |
|
17 | + public function __construct($url, array $options = array()){ |
|
18 | 18 | $this->setRequest(new GETFile()); |
19 | 19 | parent::__construct($url, $options); |
20 | 20 | } |
21 | 21 | |
22 | - public function execute($data = null) { |
|
22 | + public function execute($data = null){ |
|
23 | 23 | parent::execute($data); |
24 | 24 | $this->setResponse(new FileResponse($this->Request->getResponse(),$this->Request->getCurlObject(),$this->downloadDir)); |
25 | 25 | return $this; |
@@ -8,12 +8,12 @@ |
||
8 | 8 | |
9 | 9 | abstract class AbstractPutEntryPoint extends AbstractEntryPoint { |
10 | 10 | |
11 | - public function __construct($url, array $options = array()) { |
|
11 | + public function __construct($url, array $options = array()){ |
|
12 | 12 | $this->setRequest(new PUT()); |
13 | 13 | parent::__construct($url, $options); |
14 | 14 | } |
15 | 15 | |
16 | - public function execute($data = null) { |
|
16 | + public function execute($data = null){ |
|
17 | 17 | parent::execute($data); |
18 | 18 | $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject())); |
19 | 19 | return $this; |
@@ -8,12 +8,12 @@ |
||
8 | 8 | |
9 | 9 | abstract class AbstractPostEntryPoint extends AbstractEntryPoint { |
10 | 10 | |
11 | - public function __construct($url, array $options = array()) { |
|
11 | + public function __construct($url, array $options = array()){ |
|
12 | 12 | $this->setRequest(new POST()); |
13 | 13 | parent::__construct($url, $options); |
14 | 14 | } |
15 | 15 | |
16 | - public function execute($data = null) { |
|
16 | + public function execute($data = null){ |
|
17 | 17 | parent::execute($data); |
18 | 18 | $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject())); |
19 | 19 | return $this; |
@@ -8,12 +8,12 @@ |
||
8 | 8 | |
9 | 9 | abstract class AbstractPostFileEntryPoint extends AbstractEntryPoint { |
10 | 10 | |
11 | - public function __construct($url, array $options = array()) { |
|
11 | + public function __construct($url, array $options = array()){ |
|
12 | 12 | $this->setRequest(new POSTFile()); |
13 | 13 | parent::__construct($url, $options); |
14 | 14 | } |
15 | 15 | |
16 | - public function execute($data = null) { |
|
16 | + public function execute($data = null){ |
|
17 | 17 | parent::execute($data); |
18 | 18 | $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject())); |
19 | 19 | return $this; |