Passed
Branch main (360a64)
by Leandro
06:15
created
Category
src/MoodleRestApi.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,9 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function __construct(/*string*/ $server_url, /*string*/ $access_token, /*string*/ $return_format = MoodleRestApi::RETURN_JSON, /*bool*/ $ssl_verify = false)
54 54
     {
55
-        if (!filter_var($server_url, FILTER_VALIDATE_URL))
56
-            throw new MraException('Invalid URL!');
55
+        if (!filter_var($server_url, FILTER_VALIDATE_URL)) {
56
+                    throw new MraException('Invalid URL!');
57
+        }
57 58
 
58 59
         $urllen = strlen($server_url) - 1;
59 60
         $url = ($server_url[$urllen] == "/") ? mb_substr($server_url, 0, $urllen) : $server_url;
@@ -97,8 +98,9 @@  discard block
 block discarded – undo
97 98
      */
98 99
     public function setServerUrl(/*string*/ $server_url)/*: MoodleRestApi*/
99 100
     {
100
-        if (!filter_var($server_url, FILTER_VALIDATE_URL))
101
-            throw new MraException('Invalid URL!');
101
+        if (!filter_var($server_url, FILTER_VALIDATE_URL)) {
102
+                    throw new MraException('Invalid URL!');
103
+        }
102 104
 
103 105
         $this->server_url = $server_url;
104 106
         return $this;
Please login to merge, or discard this patch.