Completed
Push — master ( d70e3a...6009d8 )
by
unknown
16s queued 12s
created
src/DeepL.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,27 +12,27 @@  discard block
 block discarded – undo
12 12
     /**
13 13
      * API v1 URL
14 14
      */
15
-    const API_URL_V1               = 'https://api.deepl.com/v1/translate';
15
+    const API_URL_V1 = 'https://api.deepl.com/v1/translate';
16 16
 
17 17
     /**
18 18
      * API v2 URL
19 19
      */
20
-    const API_URL_V2               = 'https://api.deepl.com/v2/translate';
20
+    const API_URL_V2 = 'https://api.deepl.com/v2/translate';
21 21
 
22 22
     /**
23 23
      * API URL: Parameter auth_key
24 24
      */
25
-    const API_URL_AUTH_KEY         = 'auth_key=%s';
25
+    const API_URL_AUTH_KEY = 'auth_key=%s';
26 26
 
27 27
     /**
28 28
      * API URL: Parameter text
29 29
      */
30
-    const API_URL_TEXT             = 'text=%s';
30
+    const API_URL_TEXT = 'text=%s';
31 31
 
32 32
     /**
33 33
      * API URL: Parameter source_lang
34 34
      */
35
-    const API_URL_SOURCE_LANG      = 'source_lang=%s';
35
+    const API_URL_SOURCE_LANG = 'source_lang=%s';
36 36
 
37 37
     /**
38 38
      * API URL: Parameter target_lang
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
     /**
43 43
      * API URL: Parameter tag_handling
44 44
      */
45
-    const API_URL_TAG_HANDLING     = 'tag_handling=%s';
45
+    const API_URL_TAG_HANDLING = 'tag_handling=%s';
46 46
 
47 47
     /**
48 48
      * API URL: Parameter ignore_tags
49 49
      */
50
-    const API_URL_IGNORE_TAGS      = 'ignore_tags=%s';
50
+    const API_URL_IGNORE_TAGS = 'ignore_tags=%s';
51 51
 
52 52
     /**
53 53
      * DeepL HTTP error codes
@@ -239,16 +239,16 @@  discard block
 block discarded – undo
239 239
                 $url = DeepL::API_URL_V1;
240 240
         }
241 241
 
242
-        $url .= '?' . sprintf(DeepL::API_URL_AUTH_KEY, $this->authKey);
243
-        $url .= '&' . sprintf(DeepL::API_URL_SOURCE_LANG, strtolower($sourceLanguage));
244
-        $url .= '&' . sprintf(DeepL::API_URL_DESTINATION_LANG, strtolower($destinationLanguage));
242
+        $url .= '?'.sprintf(DeepL::API_URL_AUTH_KEY, $this->authKey);
243
+        $url .= '&'.sprintf(DeepL::API_URL_SOURCE_LANG, strtolower($sourceLanguage));
244
+        $url .= '&'.sprintf(DeepL::API_URL_DESTINATION_LANG, strtolower($destinationLanguage));
245 245
 
246 246
         if (!empty($tagHandling)) {
247
-            $url .= '&' . sprintf(DeepL::API_URL_TAG_HANDLING, implode(',', $tagHandling));
247
+            $url .= '&'.sprintf(DeepL::API_URL_TAG_HANDLING, implode(',', $tagHandling));
248 248
         }
249 249
 
250 250
         if (!empty($ignoreTags)) {
251
-            $url .= '&' . sprintf(DeepL::API_URL_IGNORE_TAGS, implode(',', $ignoreTags));
251
+            $url .= '&'.sprintf(DeepL::API_URL_IGNORE_TAGS, implode(',', $ignoreTags));
252 252
         }
253 253
 
254 254
         return $url;
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
         $first = true;
268 268
 
269 269
         if (!is_array($text)) {
270
-            $text = (array)$text;
270
+            $text = (array) $text;
271 271
         }
272 272
 
273 273
         foreach ($text as $textElement) {
274
-            $body .= ($first ? '' : '&') . sprintf(DeepL::API_URL_TEXT, rawurlencode($textElement));
274
+            $body .= ($first ? '' : '&').sprintf(DeepL::API_URL_TEXT, rawurlencode($textElement));
275 275
 
276 276
             if ($first) {
277 277
                 $first = false;
Please login to merge, or discard this patch.