Completed
Branch master (e11220)
by John
02:37
created
src/authnet/AuthnetWebhooksRequest.php 1 patch
Doc Comments   +16 added lines, -15 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     /**
80 80
      * Outputs the endpoint URL and request JSON in a human readable format
81 81
      *
82
-     * @return  array   list of event types
82
+     * @return  AuthnetWebhooksResponse   list of event types
83 83
      */
84 84
     public function getEventTypes()
85 85
     {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      *
99 99
      * @throws  \JohnConde\Authnet\AuthnetInvalidParameterException
100 100
      *
101
-     * @return  array   list of event types
101
+     * @return  AuthnetWebhooksResponse   list of event types
102 102
      */
103 103
     public function createWebhooks(Array $webhooks, $webhookUrl, $status = 'active')
104 104
     {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     /**
133 133
      * List all of your webhooks
134 134
      *
135
-     * @return  array   list of event types
135
+     * @return  AuthnetWebhooksResponse   list of event types
136 136
      */
137 137
     public function getWebhooks()
138 138
     {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      *
148 148
      * @param   string   $webhookId   Webhook ID to be retrieved
149 149
      *
150
-     * @return  array   list of event types
150
+     * @return  AuthnetWebhooksResponse   list of event types
151 151
      */
152 152
     public function getWebhook($webhookId)
153 153
     {
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      *
168 168
      * @throws  \JohnConde\Authnet\AuthnetInvalidParameterException
169 169
      *
170
-     * @return  array   list of event types
170
+     * @return  AuthnetWebhooksResponse   list of event types
171 171
      */
172 172
     public function updateWebhook($webhookId, $webhookUrl, Array $eventTypes, $status = 'active')
173 173
     {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      * @param   integer   $limit    Default: 1000
204 204
      * @param   integer   $offset   Default: 0
205 205
      *
206
-     * @return  array   list of event types
206
+     * @return  AuthnetWebhooksResponse   list of event types
207 207
      */
208 208
     public function getNotificationHistory($limit = 1000, $offset = 0)
209 209
     {
@@ -242,9 +242,10 @@  discard block
 block discarded – undo
242 242
     /**
243 243
      * Make GET request via Curl
244 244
      *
245
-     * @param   object  $url
245
+     * @param   string  $url
246 246
      *
247 247
      * @throws  \JohnConde\Authnet\AuthnetCurlException
248
+     * @return string
248 249
      */
249 250
     private function get($url) {
250 251
         $this->processor->get($url);
@@ -254,10 +255,11 @@  discard block
 block discarded – undo
254 255
     /**
255 256
      * Make POST request via Curl
256 257
      *
257
-     * @param   object  $url        API endpoint
258
-     * @param   object  $request    JSON request payload
258
+     * @param   string  $url        API endpoint
259
+     * @param   string  $request    JSON request payload
259 260
      *
260 261
      * @throws  \JohnConde\Authnet\AuthnetCurlException
262
+     * @return string
261 263
      */
262 264
     private function post($url, $request) {
263 265
         $this->processor->post($url, $request);
@@ -267,10 +269,11 @@  discard block
 block discarded – undo
267 269
     /**
268 270
      * Make PUT request via Curl
269 271
      *
270
-     * @param   object  $url        API endpoint
271
-     * @param   object  $request    JSON request payload
272
+     * @param   string  $url        API endpoint
273
+     * @param   string  $request    JSON request payload
272 274
      *
273 275
      * @throws  \JohnConde\Authnet\AuthnetCurlException
276
+     * @return string
274 277
      */
275 278
     private function put($url, $request) {
276 279
         $this->processor->put($url, $request, true);
@@ -280,9 +283,7 @@  discard block
 block discarded – undo
280 283
     /**
281 284
      * Make DELETE request via Curl
282 285
      *
283
-     * @param   object  $url        API endpoint
284
-     * @param   object  $request    JSON request payload
285
-     *
286
+     * @param   string  $url        API endpoint
286 287
      * @throws  \JohnConde\Authnet\AuthnetCurlException
287 288
      */
288 289
     private function delete($url) {
@@ -293,7 +294,7 @@  discard block
 block discarded – undo
293 294
     /**
294 295
      * Sets the handler to be used to handle our API call. Mainly used for unit testing as Curl is used by default.
295 296
      *
296
-     * @param   object  $processor
297
+     * @param   \Curl\Curl  $processor
297 298
      */
298 299
     public function setProcessHandler($processor)
299 300
     {
Please login to merge, or discard this patch.
src/authnet/AuthnetWebhooksResponse.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,8 +104,7 @@
 block discarded – undo
104 104
             foreach ($this->response->eventTypes as $event) {
105 105
                 $events[] = $event;
106 106
             }
107
-        }
108
-        else {
107
+        } else {
109 108
             foreach ($this->response as $event) {
110 109
                 $events[] = $event->name;
111 110
             }
Please login to merge, or discard this patch.
src/authnet/AuthnetApiFactory.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -83,14 +83,11 @@  discard block
 block discarded – undo
83 83
     {
84 84
         if ($server === static::USE_PRODUCTION_SERVER) {
85 85
             $url = 'https://api.authorize.net/xml/v1/request.api';
86
-        }
87
-        else if ($server === static::USE_DEVELOPMENT_SERVER) {
86
+        } else if ($server === static::USE_DEVELOPMENT_SERVER) {
88 87
             $url = 'https://apitest.authorize.net/xml/v1/request.api';
89
-        }
90
-        else if ($server === static::USE_AKAMAI_SERVER) {
88
+        } else if ($server === static::USE_AKAMAI_SERVER) {
91 89
             $url = 'https://api2.authorize.net/xml/v1/request.api';
92
-        }
93
-        else {
90
+        } else {
94 91
             throw new AuthnetInvalidServerException('You did not provide a valid server.');
95 92
         }
96 93
         return $url;
@@ -129,11 +126,9 @@  discard block
 block discarded – undo
129 126
     {
130 127
         if ($server === static::USE_PRODUCTION_SERVER) {
131 128
             $url = 'https://secure2.authorize.net/gateway/transact.dll';
132
-        }
133
-        else if ($server === static::USE_DEVELOPMENT_SERVER) {
129
+        } else if ($server === static::USE_DEVELOPMENT_SERVER) {
134 130
             $url = 'https://test.authorize.net/gateway/transact.dll';
135
-        }
136
-        else {
131
+        } else {
137 132
             throw new AuthnetInvalidServerException('You did not provide a valid server.');
138 133
         }
139 134
         return $url;
@@ -184,11 +179,9 @@  discard block
 block discarded – undo
184 179
     {
185 180
         if ($server === static::USE_PRODUCTION_SERVER) {
186 181
             $url = 'https://api.authorize.net/rest/v1/';
187
-        }
188
-        else if ($server === static::USE_DEVELOPMENT_SERVER) {
182
+        } else if ($server === static::USE_DEVELOPMENT_SERVER) {
189 183
             $url = 'https://apitest.authorize.net/rest/v1/';
190
-        }
191
-        else {
184
+        } else {
192 185
             throw new AuthnetInvalidServerException('You did not provide a valid server.');
193 186
         }
194 187
         return $url;
Please login to merge, or discard this patch.