Test Setup Failed
Pull Request — master (#37)
by Abdelouahab
04:33
created
src/LearningLocker/Statements/StatementInterface.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
 use TinCan\LanguageMap;
12 12
 
13 13
 interface StatementInterface {
14
-  function getAuthCredentials();
15
-  function send( Agent $agent, $verb, $object, Carbon $timestamp=null, Context $context, Result $result );
16
-  function makeStatement( Agent $agent, Verb $verb, $object, Carbon $timestamp, Context $context, Result $result );
14
+    function getAuthCredentials();
15
+    function send( Agent $agent, $verb, $object, Carbon $timestamp=null, Context $context, Result $result );
16
+    function makeStatement( Agent $agent, Verb $verb, $object, Carbon $timestamp, Context $context, Result $result );
17 17
 
18
-  function getVerb($id, $display);
18
+    function getVerb($id, $display);
19 19
 
20
-  function getVersion();
21
-  function setVersion($version);
20
+    function getVersion();
21
+    function setVersion($version);
22 22
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 
13 13
 interface StatementInterface {
14 14
   function getAuthCredentials();
15
-  function send( Agent $agent, $verb, $object, Carbon $timestamp=null, Context $context, Result $result );
16
-  function makeStatement( Agent $agent, Verb $verb, $object, Carbon $timestamp, Context $context, Result $result );
15
+  function send(Agent $agent, $verb, $object, Carbon $timestamp = null, Context $context, Result $result);
16
+  function makeStatement(Agent $agent, Verb $verb, $object, Carbon $timestamp, Context $context, Result $result);
17 17
 
18 18
   function getVerb($id, $display);
19 19
 
Please login to merge, or discard this patch.
src/LearningLocker/API/APIHandler.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
                 'auth' => $this->auth(),
19 19
                 'headers' => $this->headers()
20 20
             ]);
21
-            if ( $response->getStatusCode() === 404 )
21
+            if ($response->getStatusCode() === 404)
22 22
                 throw new ClientException(404);
23 23
 
24 24
             return $response->getBody()->getContents();
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                 'headers' => $this->headers(),
37 37
                 'body' => $data
38 38
             ]);
39
-            if ( $response->getStatusCode() === 404 )
39
+            if ($response->getStatusCode() === 404)
40 40
                 throw new ClientException(404);
41 41
 
42 42
             return $response->getBody()->getContents();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 'auth' => $this->auth(),
53 53
                 'headers' => $this->headers()
54 54
             ]);
55
-            if ( $response->getStatusCode() === 404 )
55
+            if ($response->getStatusCode() === 404)
56 56
                 throw new ClientException(404);
57 57
 
58 58
             return $response->getBody()->getContents();
@@ -76,22 +76,22 @@  discard block
 block discarded – undo
76 76
         }
77 77
     }
78 78
 
79
-    public function select($selected = [], $response)
79
+    public function select($selected = [ ], $response)
80 80
     {
81
-        if (!is_array($selected) || !$response)  {
82
-            $error = [ "error" => "Select must be an array."];
81
+        if (!is_array($selected) || !$response) {
82
+            $error = [ "error" => "Select must be an array." ];
83 83
             return json_encode($error);
84 84
         }
85 85
 
86 86
         if ($selected) {
87 87
             $response = (array) json_decode($response);
88
-            $items = [];
88
+            $items = [ ];
89 89
 
90
-            foreach($selected as $select) {
90
+            foreach ($selected as $select) {
91 91
                 $search = array_key_exists($select, $response);
92 92
 
93 93
                 if ($search === true) {
94
-                    $items[$select] = $response[$select];
94
+                    $items[ $select ] = $response[ $select ];
95 95
                 }
96 96
             }
97 97
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                 return true;
118 118
             }
119 119
 
120
-            if ( $response->getStatusCode() === 404 )
120
+            if ($response->getStatusCode() === 404)
121 121
                 throw new ClientException(404);
122 122
 
123 123
             return $response->getBody()->getContents();
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
18 18
                 'auth' => $this->auth(),
19 19
                 'headers' => $this->headers()
20 20
             ]);
21
-            if ( $response->getStatusCode() === 404 )
22
-                throw new ClientException(404);
21
+            if ( $response->getStatusCode() === 404 ) {
22
+                            throw new ClientException(404);
23
+            }
23 24
 
24 25
             return $response->getBody()->getContents();
25 26
         } catch (ClientException $e) {
@@ -36,8 +37,9 @@  discard block
 block discarded – undo
36 37
                 'headers' => $this->headers(),
37 38
                 'body' => $data
38 39
             ]);
39
-            if ( $response->getStatusCode() === 404 )
40
-                throw new ClientException(404);
40
+            if ( $response->getStatusCode() === 404 ) {
41
+                            throw new ClientException(404);
42
+            }
41 43
 
42 44
             return $response->getBody()->getContents();
43 45
         } catch (ClientException $e) {
@@ -52,8 +54,9 @@  discard block
 block discarded – undo
52 54
                 'auth' => $this->auth(),
53 55
                 'headers' => $this->headers()
54 56
             ]);
55
-            if ( $response->getStatusCode() === 404 )
56
-                throw new ClientException(404);
57
+            if ( $response->getStatusCode() === 404 ) {
58
+                            throw new ClientException(404);
59
+            }
57 60
 
58 61
             return $response->getBody()->getContents();
59 62
         } catch (ClientException $e) {
@@ -117,8 +120,9 @@  discard block
 block discarded – undo
117 120
                 return true;
118 121
             }
119 122
 
120
-            if ( $response->getStatusCode() === 404 )
121
-                throw new ClientException(404);
123
+            if ( $response->getStatusCode() === 404 ) {
124
+                            throw new ClientException(404);
125
+            }
122 126
 
123 127
             return $response->getBody()->getContents();
124 128
         } catch (ClientException $e) {
Please login to merge, or discard this patch.
src/LearningLocker/API.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,68 +11,68 @@
 block discarded – undo
11 11
 use Exception;
12 12
 
13 13
 class API extends Connection {
14
-  protected $org;
15
-  protected $organisationApi;
16
-  protected $clientApi;
17
-  protected $statementForwardApi;
18
-  protected $queryApi;
14
+    protected $org;
15
+    protected $organisationApi;
16
+    protected $clientApi;
17
+    protected $statementForwardApi;
18
+    protected $queryApi;
19 19
 
20 20
 
21
-  /**
22
-   * Organisations Facade
23
-   *
24
-   * @param null
25
-   * @return Organisation
26
-   */
27
-  public function organisation() {
21
+    /**
22
+     * Organisations Facade
23
+     *
24
+     * @param null
25
+     * @return Organisation
26
+     */
27
+    public function organisation() {
28 28
     if ($this->organisationApi) {
29
-      return $this->organisationApi;
29
+        return $this->organisationApi;
30 30
     }
31 31
     $this->organisationApi = new Organisation($this->org, $this->settings);
32 32
     return $this->organisation();
33
-  }
33
+    }
34 34
 
35
-  public function client()
36
-  {
35
+    public function client()
36
+    {
37 37
     if ($this->clientApi) {
38
-      return $this->clientApi;
38
+        return $this->clientApi;
39 39
     }
40 40
     $this->clientApi = new Client($this->org, $this->settings);
41 41
     return $this->client();
42
-  }
42
+    }
43 43
 
44
-  public function statementForward()
45
-  {
44
+    public function statementForward()
45
+    {
46 46
     if ($this->statementForwardApi) {
47
-      return $this->statementForwardApi;
47
+        return $this->statementForwardApi;
48 48
     }
49 49
     $this->statementForwardApi = new StatementForward($this->org, $this->settings);
50 50
     return $this->statementForward();
51
-  }
51
+    }
52 52
 
53
-  public function query()
54
-  {
53
+    public function query()
54
+    {
55 55
     if ($this->queryApi) {
56
-      return $this->queryApi;
56
+        return $this->queryApi;
57 57
     }
58 58
     $this->queryApi = new Query($this->org, $this->settings);
59 59
     return $this->query();
60
-  }
60
+    }
61 61
 
62
-  public function isDomainAvailable($domain) {
62
+    public function isDomainAvailable($domain) {
63 63
     try {
64
-      $url = trim($domain, '/') . '/api';
65
-      $request = $this->getClient()->get($url, ['timeout' => 1]);
66
-      if(!$request) {
64
+        $url = trim($domain, '/') . '/api';
65
+        $request = $this->getClient()->get($url, ['timeout' => 1]);
66
+        if(!$request) {
67 67
         return false;
68
-      }
69
-      if($request->getStatusCode() === 200) {
68
+        }
69
+        if($request->getStatusCode() === 200) {
70 70
         return true;
71
-      }
71
+        }
72 72
     } catch (Exception $e) {
73
-      return false;
73
+        return false;
74 74
     }
75 75
     return false;
76
-  }
76
+    }
77 77
 
78 78
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,11 +62,11 @@
 block discarded – undo
62 62
   public function isDomainAvailable($domain) {
63 63
     try {
64 64
       $url = trim($domain, '/') . '/api';
65
-      $request = $this->getClient()->get($url, ['timeout' => 1]);
66
-      if(!$request) {
65
+      $request = $this->getClient()->get($url, [ 'timeout' => 1 ]);
66
+      if (!$request) {
67 67
         return false;
68 68
       }
69
-      if($request->getStatusCode() === 200) {
69
+      if ($request->getStatusCode() === 200) {
70 70
         return true;
71 71
       }
72 72
     } catch (Exception $e) {
Please login to merge, or discard this patch.
src/LearningLocker/Downloads/DownloadHandler.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     private $v2 = '/v2';
13 13
 
14 14
     protected $headers = [
15
-      'content-type' => 'application/json'
15
+        'content-type' => 'application/json'
16 16
     ];
17 17
 
18 18
     /**
Please login to merge, or discard this patch.
src/LearningLocker/Downloads/DownloadInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 namespace Ijeffro\Laralocker\LearningLocker\Downloads;
4 4
 
5 5
 interface DownloadInterface {
6
-  function get();
6
+    function get();
7 7
 }
Please login to merge, or discard this patch.
src/LearningLocker/Users/UserInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 namespace Ijeffro\Laralocker\LearningLocker\Users;
4 4
 
5 5
 interface UserInterface {
6
-  function get();
6
+    function get();
7 7
 }
Please login to merge, or discard this patch.
src/LearningLocker/Roles/RoleInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 namespace Ijeffro\Laralocker\LearningLocker\Roles;
4 4
 
5 5
 interface RoleInterface {
6
-  function get();
6
+    function get();
7 7
 }
Please login to merge, or discard this patch.
src/LearningLocker/Organisation/Organisation.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -5,68 +5,68 @@
 block discarded – undo
5 5
 
6 6
 class Organisation extends Connection {
7 7
 
8
-  private $organisation = '/organisation';
9
-  private $api = '/api';
10
-  private $v2 = '/v2';
8
+    private $organisation = '/organisation';
9
+    private $api = '/api';
10
+    private $v2 = '/v2';
11 11
 
12
-  private $headers = [
12
+    private $headers = [
13 13
     'content-type' => 'application/json'
14
-  ];
14
+    ];
15 15
 
16
-  /**
17
-   * Get the Learning Locker Statement Forward by ID.
18
-   *
19
-   * @param   $id
20
-   * @return  $response
21
-   */
22
-  public function get() {
16
+    /**
17
+     * Get the Learning Locker Statement Forward by ID.
18
+     *
19
+     * @param   $id
20
+     * @return  $response
21
+     */
22
+    public function get() {
23 23
     try {
24
-      $url = $this->endpoint . $this->api . $this->v2 . $this->organisation;
25
-      $request = $this->getClient()->get($url, [
24
+        $url = $this->endpoint . $this->api . $this->v2 . $this->organisation;
25
+        $request = $this->getClient()->get($url, [
26 26
         'auth' => $this->getAuth(),
27 27
         'headers' => [
28
-          'content-type' => 'application/json'
28
+            'content-type' => 'application/json'
29 29
         ],
30
-      ]);
31
-      $response = $request->json();
32
-      return $response;
30
+        ]);
31
+        $response = $request->json();
32
+        return $response;
33 33
     } catch (Exception $e) {
34
-      return false;
34
+        return false;
35
+    }
35 36
     }
36
-  }
37 37
 
38
-  /**
39
-   * Get the Learning Locker Organisation Name.
40
-   *
41
-   * @param   $org
42
-   * @return  $response, false
43
-   */
44
-  public function id() {
38
+    /**
39
+     * Get the Learning Locker Organisation Name.
40
+     *
41
+     * @param   $org
42
+     * @return  $response, false
43
+     */
44
+    public function id() {
45 45
     $response = $this->get();
46 46
     if($response) {
47
-      $id = $response[0]['_id'];
48
-      $setSetting = LLService::create($this->org, LLService::LL_ID)->setSetting(LLService::ORGANISATION_ID, $id);
49
-      return $id;
47
+        $id = $response[0]['_id'];
48
+        $setSetting = LLService::create($this->org, LLService::LL_ID)->setSetting(LLService::ORGANISATION_ID, $id);
49
+        return $id;
50 50
     }
51 51
     return false;
52
-  }
52
+    }
53 53
 
54
-  /**
55
-   * Get the Learning Locker Organisation Name.
56
-   *
57
-   * @param   $org
58
-   * @return  $response, false
59
-   */
60
-  public function name()
61
-  {
54
+    /**
55
+     * Get the Learning Locker Organisation Name.
56
+     *
57
+     * @param   $org
58
+     * @return  $response, false
59
+     */
60
+    public function name()
61
+    {
62 62
     $response = $this->get();
63 63
     if($response) {
64
-      $name = $response[0]['name'];
65
-      $setSetting = LLService::create($this->org, LLService::LL_ID)->setSetting(LLService::ORGANISATION, $name);
66
-      return $name;
64
+        $name = $response[0]['name'];
65
+        $setSetting = LLService::create($this->org, LLService::LL_ID)->setSetting(LLService::ORGANISATION, $name);
66
+        return $name;
67 67
     }
68 68
     return false;
69 69
 
70
-  }
70
+    }
71 71
 
72 72
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
    */
44 44
   public function id() {
45 45
     $response = $this->get();
46
-    if($response) {
47
-      $id = $response[0]['_id'];
46
+    if ($response) {
47
+      $id = $response[ 0 ][ '_id' ];
48 48
       $setSetting = LLService::create($this->org, LLService::LL_ID)->setSetting(LLService::ORGANISATION_ID, $id);
49 49
       return $id;
50 50
     }
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
   public function name()
61 61
   {
62 62
     $response = $this->get();
63
-    if($response) {
64
-      $name = $response[0]['name'];
63
+    if ($response) {
64
+      $name = $response[ 0 ][ 'name' ];
65 65
       $setSetting = LLService::create($this->org, LLService::LL_ID)->setSetting(LLService::ORGANISATION, $name);
66 66
       return $name;
67 67
     }
Please login to merge, or discard this patch.
src/LearningLocker/Organisation/OrganisationInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 namespace Ijeffro\Laralocker\LearningLocker\Organisation;
4 4
 
5 5
 interface OrganisationInterface {
6
-  function get();
6
+    function get();
7 7
 }
Please login to merge, or discard this patch.