@@ -17,8 +17,8 @@ |
||
17 | 17 | /** |
18 | 18 | * @inheritdoc |
19 | 19 | */ |
20 | - public function getBody($asArray = true) { |
|
21 | - return json_decode($this->body,$asArray); |
|
20 | + public function getBody($asArray = true){ |
|
21 | + return json_decode($this->body, $asArray); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -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 |
@@ -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 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class EntryPointException extends SDKException { |
6 | 6 | |
7 | - public function __construct($message) { |
|
7 | + public function __construct($message){ |
|
8 | 8 | parent::__construct($message); |
9 | 9 | } |
10 | 10 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class EntryPointException extends SDKException { |
6 | 6 | |
7 | - public function __construct($message) { |
|
7 | + public function __construct($message){ |
|
8 | 8 | parent::__construct($message); |
9 | 9 | } |
10 | 10 |
@@ -8,8 +8,8 @@ |
||
8 | 8 | |
9 | 9 | protected $message = 'Authentication Exception [%s] occurred in SDK Client. Message: %s'; |
10 | 10 | |
11 | - public function __construct($message) { |
|
12 | - parent::__construct(sprintf($this->message,get_called_class(),$message)); |
|
11 | + public function __construct($message){ |
|
12 | + parent::__construct(sprintf($this->message, get_called_class(), $message)); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | } |
16 | 16 | \ No newline at end of file |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class EntryPointException extends SDKException { |
6 | 6 | |
7 | - public function __construct($message) { |
|
7 | + public function __construct($message){ |
|
8 | 8 | parent::__construct($message); |
9 | 9 | } |
10 | 10 |
@@ -8,8 +8,8 @@ |
||
8 | 8 | |
9 | 9 | protected $message = 'EntryPoint Exception [%s] occurred on EntryPoint %s: %s'; |
10 | 10 | |
11 | - public function __construct($EntryPoint,$data) { |
|
12 | - parent::__construct(sprintf($this->message,get_called_class(),$EntryPoint,$data)); |
|
11 | + public function __construct($EntryPoint, $data){ |
|
12 | + parent::__construct(sprintf($this->message, get_called_class(), $EntryPoint, $data)); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | } |
16 | 16 | \ No newline at end of file |
@@ -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 |
@@ -14,14 +14,14 @@ |
||
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 | - $this->setResponse(new FileResponse($this->Request->getResponse(),$this->Request->getCurlObject(),$this->downloadDir)); |
|
24 | + $this->setResponse(new FileResponse($this->Request->getResponse(), $this->Request->getCurlObject(), $this->downloadDir)); |
|
25 | 25 | return $this; |
26 | 26 | } |
27 | 27 |
@@ -12,14 +12,14 @@ |
||
12 | 12 | * The directory in which to download the File |
13 | 13 | * @var string |
14 | 14 | */ |
15 | - protected $downloadDir = null; |
|
15 | + protected $downloadDir = NULL; |
|
16 | 16 | |
17 | 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 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; |
@@ -8,14 +8,14 @@ |
||
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 | - $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject())); |
|
18 | + $this->setResponse(new JSON($this->Request->getResponse(), $this->Request->getCurlObject())); |
|
19 | 19 | return $this; |
20 | 20 | } |
21 | 21 |
@@ -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; |
@@ -13,7 +13,7 @@ |
||
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; |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $data[$fileField] = $this->setFileFieldValue($data[$fileField]); |
48 | 48 | }else{ |
49 | 49 | foreach ($this->Data as $key => $value){ |
50 | - if (!array_key_exists($key,$this->_REQUIRED_DATA)){ |
|
50 | + if (!array_key_exists($key, $this->_REQUIRED_DATA)){ |
|
51 | 51 | $data[$key] = $this->setFileFieldValue($value); |
52 | 52 | } |
53 | 53 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | protected function configureData($data){ |
35 | 35 | if (!empty($this->Options)){ |
36 | 36 | $fileField = end($this->Options); |
37 | - }else{ |
|
37 | + } else{ |
|
38 | 38 | throw new RequiredOptionsException(get_called_class()); |
39 | 39 | } |
40 | 40 | if (is_string($data) && isset($fileField)){ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | if (is_array($data)){ |
46 | 46 | if (isset($fileField)){ |
47 | 47 | $data[$fileField] = $this->setFileFieldValue($data[$fileField]); |
48 | - }else{ |
|
48 | + } else{ |
|
49 | 49 | foreach ($this->Data as $key => $value){ |
50 | 50 | if (!array_key_exists($key,$this->_REQUIRED_DATA)){ |
51 | 51 | $data[$key] = $this->setFileFieldValue($value); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | protected $_REQUIRED_DATA = array( |
24 | 24 | 'format' => 'sugar-html-json', |
25 | - 'delete_if_fails' => false |
|
25 | + 'delete_if_fails' => FALSE |
|
26 | 26 | ); |
27 | 27 | |
28 | 28 | /** |
@@ -6,15 +6,15 @@ |
||
6 | 6 | |
7 | 7 | class OAuth2Token extends AbstractPostEntryPoint { |
8 | 8 | |
9 | - protected $_AUTH_REQUIRED = false; |
|
9 | + protected $_AUTH_REQUIRED = FALSE; |
|
10 | 10 | protected $_URL = 'oauth2/token'; |
11 | 11 | protected $_REQUIRED_DATA = array( |
12 | - 'username' => null, |
|
13 | - 'password' => null, |
|
12 | + 'username' => NULL, |
|
13 | + 'password' => NULL, |
|
14 | 14 | 'grant_type' => 'password', |
15 | - 'client_id' => null, |
|
16 | - 'client_secret' => null, |
|
17 | - 'platform' => null |
|
15 | + 'client_id' => NULL, |
|
16 | + 'client_secret' => NULL, |
|
17 | + 'platform' => NULL |
|
18 | 18 | ); |
19 | 19 | protected $_DATA_TYPE = 'array'; |
20 | 20 |
@@ -9,9 +9,9 @@ |
||
9 | 9 | */ |
10 | 10 | protected $_REQUIRED_DATA = array( |
11 | 11 | 'grant_type' => 'refresh_token', |
12 | - 'refresh_token' => null, |
|
13 | - 'client_id' => null, |
|
14 | - 'client_secret' => null |
|
12 | + 'refresh_token' => NULL, |
|
13 | + 'client_id' => NULL, |
|
14 | + 'client_secret' => NULL |
|
15 | 15 | ); |
16 | 16 | |
17 | 17 | } |
18 | 18 | \ No newline at end of file |