Completed
Push — master ( 7873ee...3656be )
by Mike
03:26
created
src/EntryPoint/POST/RefreshToken.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/EntryPoint/POST/Bulk.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,22 +30,22 @@
 block discarded – undo
30 30
         'method' => ''
31 31
     );
32 32
 
33
-    protected function configureData($data) {
33
+    protected function configureData($data){
34 34
         $requestData = array(
35 35
             'requests' => array()
36 36
         );
37 37
         $counter = 0;
38
-        foreach($data as $key => $EntryPoint){
39
-            if (is_object($EntryPoint)) {
38
+        foreach ($data as $key => $EntryPoint){
39
+            if (is_object($EntryPoint)){
40 40
                 $requestData['requests'][$counter] = $this->bulkRequest;
41 41
                 $requestData['requests'][$counter]['method'] = $EntryPoint->getRequest()->getType();
42
-                if ($requestData['requests'][$counter]['method'] == "POST" || $requestData['requests'][$counter]['method'] == "PUT") {
42
+                if ($requestData['requests'][$counter]['method']=="POST" || $requestData['requests'][$counter]['method']=="PUT"){
43 43
                     $requestData['requests'][$counter]['data'] = $EntryPoint->getRequest()->getBody();
44
-                } else {
44
+                }else{
45 45
                     unset($requestData['requests'][$counter]['data']);
46 46
                 }
47 47
                 $requestData['requests'][$counter]['headers'] = $EntryPoint->getRequest()->getHeaders();
48
-                $requestData['requests'][$counter]['url'] = "v10/" . str_replace($this->baseUrl, "", $EntryPoint->getUrl());
48
+                $requestData['requests'][$counter]['url'] = "v10/".str_replace($this->baseUrl, "", $EntryPoint->getUrl());
49 49
 
50 50
                 $counter++;
51 51
             }
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@
 block discarded – undo
30 30
         'method' => ''
31 31
     );
32 32
 
33
-    protected function configureData($data) {
33
+    protected function configureData($data){
34 34
         $requestData = array(
35 35
             'requests' => array()
36 36
         );
37 37
         $counter = 0;
38 38
         foreach($data as $key => $EntryPoint){
39
-            if (is_object($EntryPoint)) {
39
+            if (is_object($EntryPoint)){
40 40
                 $requestData['requests'][$counter] = $this->bulkRequest;
41 41
                 $requestData['requests'][$counter]['method'] = $EntryPoint->getRequest()->getType();
42
-                if ($requestData['requests'][$counter]['method'] == "POST" || $requestData['requests'][$counter]['method'] == "PUT") {
42
+                if ($requestData['requests'][$counter]['method'] == "POST" || $requestData['requests'][$counter]['method'] == "PUT"){
43 43
                     $requestData['requests'][$counter]['data'] = $EntryPoint->getRequest()->getBody();
44
-                } else {
44
+                } else{
45 45
                     unset($requestData['requests'][$counter]['data']);
46 46
                 }
47 47
                 $requestData['requests'][$counter]['headers'] = $EntryPoint->getRequest()->getHeaders();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      * @inheritdoc
21 21
      */
22 22
     protected $_REQUIRED_DATA = array(
23
-        'requests' => null
23
+        'requests' => NULL
24 24
     );
25 25
 
26 26
     private $bulkRequest = array(
Please login to merge, or discard this patch.
src/Client/Interfaces/ClientInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * @param $EntryPoint - EPInterface Class Name
32 32
      * @return $this
33 33
      */
34
-    public function registerEntryPoint($function,$EntryPoint);
34
+    public function registerEntryPoint($function, $EntryPoint);
35 35
 
36 36
     /**
37 37
      * Login to the configured SugarCRM server
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @param $client_id
58 58
      * @return boolean
59 59
      */
60
-    public static function storeToken($token,$client_id);
60
+    public static function storeToken($token, $client_id);
61 61
 
62 62
     /**
63 63
      * Get an SDK Clients authentication Token from Storage
Please login to merge, or discard this patch.
src/Helpers/Helpers.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     public static function getSDKEntryPointRegistry(){
40 40
         $entryPoints = array();
41 41
         require __DIR__.DIRECTORY_SEPARATOR.'registry.php';
42
-        foreach ($entryPoints as $funcName => $className) {
42
+        foreach ($entryPoints as $funcName => $className){
43 43
             $className = "SugarAPI\\SDK\\EntryPoint\\" . $className;
44 44
             $entryPoints[$funcName] = $className;
45 45
         }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
      * @return string
16 16
      */
17 17
     public static function configureAPIURL($instance){
18
-        if (strpos($instance,"http")===FALSE){
18
+        if (strpos($instance, "http")===FALSE){
19 19
             $instance = "http://".$instance;
20 20
         }
21
-        if (strpos($instance,"rest/v10")!==FALSE){
21
+        if (strpos($instance, "rest/v10")!==FALSE){
22 22
             $instance = str_replace("rest/v10", "", $instance);
23 23
         }
24 24
         return rtrim($instance, "/").self::API_URL;
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
     public static function getSDKEntryPointRegistry(){
40 40
         $entryPoints = array();
41 41
         require __DIR__.DIRECTORY_SEPARATOR.'registry.php';
42
-        foreach ($entryPoints as $funcName => $className) {
43
-            $className = "SugarAPI\\SDK\\EntryPoint\\" . $className;
42
+        foreach ($entryPoints as $funcName => $className){
43
+            $className = "SugarAPI\\SDK\\EntryPoint\\".$className;
44 44
             $entryPoints[$funcName] = $className;
45 45
         }
46 46
         return $entryPoints;
Please login to merge, or discard this patch.
examples/BulkAPI.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-require_once __DIR__ . '/../vendor/autoload.php';
4
+require_once __DIR__.'/../vendor/autoload.php';
5 5
 
6 6
 try{
7
-    $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Pro/7700/',array('username' => 'admin','password'=>'asdf'));
7
+    $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Pro/7700/', array('username' => 'admin', 'password'=>'asdf'));
8 8
     $SugarAPI->login();
9 9
 
10 10
     $Accounts = $SugarAPI->filterRecords('Accounts')->setData(array('max_num'=> 5));
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@
 block discarded – undo
22 22
         echo "<h3>Requests Completed</h3><pre>";
23 23
         print_r($response->getBody());
24 24
         echo "</pre>";
25
-    }else{
25
+    } else{
26 26
         echo "<h3>Request Failed</h3><pre>";
27 27
         print_r($response);
28 28
         echo "</pre>";
29 29
     }
30 30
 
31
-}catch (\SugarAPI\SDK\Exception\Authentication\AuthenticationException $ex){
31
+} catch (\SugarAPI\SDK\Exception\Authentication\AuthenticationException $ex){
32 32
     echo "Credentials:<pre>";
33 33
     print_r($SugarAPI->getCredentials());
34 34
     echo "</pre> Error Message: ";
35 35
     print $ex->getMessage();
36
-}catch (\SugarAPI\SDK\Exception\SDKException $ex){
36
+} catch (\SugarAPI\SDK\Exception\SDKException $ex){
37 37
     echo $ex->__toString();
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
examples/Login.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 require_once __DIR__.'/../vendor/autoload.php';
4 4
 
5
-try {
5
+try{
6 6
     $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Ent/7621/', array(
7 7
         'username' => 'admin',
8 8
         'password' => 'asdf'
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
         'username' => 'admin',
19 19
         'password' => 'asdf'
20 20
     ));
21
-    if ($SugarAPI2->authenticated()) {
21
+    if ($SugarAPI2->authenticated()){
22 22
         echo "Authenticated!";
23 23
         print_r($SugarAPI2->getToken());
24 24
     }
25
-} catch(\SugarAPI\SDK\Exception\SDKException $ex){
25
+}catch (\SugarAPI\SDK\Exception\SDKException $ex){
26 26
     print_r($ex->getMessage());
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 require_once __DIR__.'/../vendor/autoload.php';
4 4
 
5
-try {
5
+try{
6 6
     $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Ent/7621/', array(
7 7
         'username' => 'admin',
8 8
         'password' => 'asdf'
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         'username' => 'admin',
19 19
         'password' => 'asdf'
20 20
     ));
21
-    if ($SugarAPI2->authenticated()) {
21
+    if ($SugarAPI2->authenticated()){
22 22
         echo "Authenticated!";
23 23
         print_r($SugarAPI2->getToken());
24 24
     }
Please login to merge, or discard this patch.
src/EntryPoint/Abstracts/DELETE/AbstractDeleteEntryPoint.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/EntryPoint/Abstracts/PUT/AbstractPutEntryPoint.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/EntryPoint/Abstracts/GET/AbstractGetEntryPoint.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.