Completed
Push — master ( 53605b...6ae5bf )
by Raphaël
02:35
created
src/CertainApiClient.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -93,20 +93,20 @@  discard block
 block discarded – undo
93 93
      * @param string $ressourceId
94 94
      * @return string
95 95
      */
96
-    private function builPathToCall($ressourceName,$ressourcePath =null, $ressourceId = null)
96
+    private function builPathToCall($ressourceName, $ressourcePath = null, $ressourceId = null)
97 97
     {
98 98
         $ressourceAdded = '';
99
-        if(!is_null($ressourcePath) && $ressourcePath != ''){
99
+        if (!is_null($ressourcePath) && $ressourcePath != '') {
100 100
             $ressourceAdded = $ressourcePath;
101 101
         }
102 102
         
103 103
         if ($ressourceId !== null) {
104 104
             $ressourceAdded = '/'.$ressourceId;
105 105
         }
106
-        if(!is_null($ressourcePath)){
106
+        if (!is_null($ressourcePath)) {
107 107
             $this->builPath = 'accounts/'.$this->getAccountCode().$ressourceAdded;
108 108
             return  $this->builPath;
109
-        }else{
109
+        }else {
110 110
             $this->builPath = $ressourceName.'/'.$this->getAccountCode().$ressourceAdded;
111 111
             return  $this->builPath;
112 112
         }
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
      * @param string $contentType
124 124
      * @return array
125 125
      */
126
-    public function get($ressourceName, $ressourcePath =null, $ressourceId = null, $query = array(),
126
+    public function get($ressourceName, $ressourcePath = null, $ressourceId = null, $query = array(),
127 127
                         $assoc = false, $contentType = 'json')
128 128
     {
129 129
         try {
130 130
             $urlRessource = $this->builPathToCall($ressourceName, $ressourcePath, $ressourceId);
131
-            $response     = $this->getClient()->request('GET',$urlRessource,
131
+            $response     = $this->getClient()->request('GET', $urlRessource,
132 132
                 array(
133 133
                 'headers' => ['Accept' => "application/$contentType"],
134 134
                 'query' => $query
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @param string $contentType
151 151
      * @return array
152 152
      */
153
-    public function post($ressourceName, $ressourcePath =null, $ressourceId = null,
153
+    public function post($ressourceName, $ressourcePath = null, $ressourceId = null,
154 154
                          $bodyData = array(), $query = array(), $assoc = false,
155 155
                          $contentType = 'json')
156 156
     {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         }
160 160
         try {
161 161
             $urlRessource = $this->builPathToCall($ressourceName, $ressourcePath, $ressourceId);
162
-            $response     = $this->getClient()->request('POST',$urlRessource,
162
+            $response     = $this->getClient()->request('POST', $urlRessource,
163 163
                 array(
164 164
                 'headers' => ['Accept' => "application/$contentType"],
165 165
                 'json' => $bodyData,
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
      * @param string $contentType
183 183
      * @return array
184 184
      */
185
-    public function put($ressourceName, $ressourcePath =null, $ressourceId = null,
185
+    public function put($ressourceName, $ressourcePath = null, $ressourceId = null,
186 186
                          $bodyData = array(), $query = array(), $assoc = false,
187 187
                          $contentType = 'json')
188 188
     {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         }
192 192
         try {
193 193
             $urlRessource = $this->builPathToCall($ressourceName, $ressourcePath, $ressourceId);
194
-            $response     = $this->getClient()->request('PUT',$urlRessource,
194
+            $response     = $this->getClient()->request('PUT', $urlRessource,
195 195
                 array(
196 196
                 'headers' => ['Accept' => "application/$contentType"],
197 197
                 'json' => $bodyData,
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
      * @param string $contentType
213 213
      * @return array
214 214
      */
215
-    public function delete($ressourceName, $ressourcePath =null, $ressourceId = null, $assoc = false,
215
+    public function delete($ressourceName, $ressourcePath = null, $ressourceId = null, $assoc = false,
216 216
                            $contentType = 'json')
217 217
     {
218 218
         try {
219 219
             $urlRessource = $this->builPathToCall($ressourceName, $ressourcePath, $ressourceId);
220
-            $response     = $this->getClient()->request('DELETE',$urlRessource,
220
+            $response     = $this->getClient()->request('DELETE', $urlRessource,
221 221
                 array(
222 222
                 'headers' => ['Accept' => "application/$contentType"],
223 223
             ));
Please login to merge, or discard this patch.