Passed
Push — main ( 46fad3...57b898 )
by Leandro
01:28
created
src/MoodleRestApi.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,9 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function __construct(/*string*/ $server_url, /*string*/ $access_token, /*string*/ $return_format = MoodleRestApi::RETURN_ARRAY, /*bool*/ $ssl_verify = false)
59 59
     {
60
-        if (!filter_var($server_url, FILTER_VALIDATE_URL))
61
-            throw new MraException('Invalid URL!');
60
+        if (!filter_var($server_url, FILTER_VALIDATE_URL)) {
61
+                    throw new MraException('Invalid URL!');
62
+        }
62 63
 
63 64
         $urllen = strlen($server_url) - 1;
64 65
         $url = ($server_url[$urllen] == "/") ? mb_substr($server_url, 0, $urllen) : $server_url;
@@ -102,8 +103,9 @@  discard block
 block discarded – undo
102 103
      */
103 104
     public function setServerUrl(/*string*/ $server_url)/*: MoodleRestApi*/
104 105
     {
105
-        if (!filter_var($server_url, FILTER_VALIDATE_URL))
106
-            throw new MraException('Invalid URL!');
106
+        if (!filter_var($server_url, FILTER_VALIDATE_URL)) {
107
+                    throw new MraException('Invalid URL!');
108
+        }
107 109
 
108 110
         $this->server_url = $server_url;
109 111
         return $this;
Please login to merge, or discard this patch.