@@ -6,58 +6,58 @@ discard block |
||
6 | 6 | |
7 | 7 | class JourneyHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $journey = '/journey'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
29 | + private $journey = '/journey'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | 32 | |
33 | - protected $headers = [ |
|
33 | + protected $headers = [ |
|
34 | 34 | 'Content-Type' => 'application/json' |
35 | - ]; |
|
35 | + ]; |
|
36 | 36 | |
37 | 37 | |
38 | - /** |
|
39 | - * Construct the Learning Locker URL |
|
40 | - * |
|
41 | - * @param string|null $id |
|
42 | - * @return string |
|
43 | - */ |
|
44 | - public function url(string $id = null) { |
|
38 | + /** |
|
39 | + * Construct the Learning Locker URL |
|
40 | + * |
|
41 | + * @param string|null $id |
|
42 | + * @return string |
|
43 | + */ |
|
44 | + public function url(string $id = null) { |
|
45 | 45 | return implode('/', [trim($this->url . $this->api . $this->v2 . $this->journey, '/'), $id ?? $id]); |
46 | - } |
|
47 | - |
|
48 | - /** |
|
49 | - * Learning Locker API: Persona |
|
50 | - * |
|
51 | - * @param $id |
|
52 | - * @return PersonaHandler |
|
53 | - */ |
|
54 | - public function progress(string $id = null) |
|
55 | - { |
|
46 | + } |
|
47 | + |
|
48 | + /** |
|
49 | + * Learning Locker API: Persona |
|
50 | + * |
|
51 | + * @param $id |
|
52 | + * @return PersonaHandler |
|
53 | + */ |
|
54 | + public function progress(string $id = null) |
|
55 | + { |
|
56 | 56 | $progress = new ProgressHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
57 | 57 | if ($progress) return $progress; |
58 | 58 | |
59 | 59 | return self::progress($id ? $id : null); |
60 | - } |
|
60 | + } |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Learning Locker: Request Organisation Details |
@@ -93,13 +93,13 @@ discard block |
||
93 | 93 | * @return $response |
94 | 94 | */ |
95 | 95 | public function delete() { |
96 | - try { |
|
96 | + try { |
|
97 | 97 | $url = $this->url . $this->api . $this->v2 . $this->journey . '/' . $this->id; |
98 | 98 | $response = $this->deleteFromLearningLocker($url); |
99 | 99 | return $response; |
100 | - } catch (Exception $e) { |
|
101 | - return $e; |
|
102 | - } |
|
100 | + } catch (Exception $e) { |
|
101 | + return $e; |
|
102 | + } |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * @return string |
43 | 43 | */ |
44 | 44 | public function url(string $id = null) { |
45 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->journey, '/'), $id ?? $id]); |
|
45 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->journey, '/'), $id ?? $id ]); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -54,7 +54,9 @@ |
||
54 | 54 | public function progress(string $id = null) |
55 | 55 | { |
56 | 56 | $progress = new ProgressHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
57 | - if ($progress) return $progress; |
|
57 | + if ($progress) { |
|
58 | + return $progress; |
|
59 | + } |
|
58 | 60 | |
59 | 61 | return self::progress($id ? $id : null); |
60 | 62 | } |
@@ -6,33 +6,33 @@ |
||
6 | 6 | |
7 | 7 | class QueryHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $query = '/query'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
29 | + private $query = '/query'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | 32 | |
33 | - protected $headers = [ |
|
33 | + protected $headers = [ |
|
34 | 34 | 'content-type' => 'application/json' |
35 | - ]; |
|
35 | + ]; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Learning Locker: Request Organisation Details |
@@ -6,33 +6,33 @@ discard block |
||
6 | 6 | |
7 | 7 | class VisualisationHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $visualisation = '/visualisation'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
29 | + private $visualisation = '/visualisation'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | 32 | |
33 | - protected $headers = [ |
|
33 | + protected $headers = [ |
|
34 | 34 | 'content-type' => 'application/json' |
35 | - ]; |
|
35 | + ]; |
|
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | * @return $response |
42 | 42 | */ |
43 | 43 | public function get() { |
44 | - try { |
|
44 | + try { |
|
45 | 45 | $url = $this->url . $this->api . $this->v2 . $this->visualisation; |
46 | 46 | $response = $this->getFromLearningLocker($url); |
47 | 47 | return $response; |
48 | - } catch (Exception $e) { |
|
48 | + } catch (Exception $e) { |
|
49 | 49 | return $e; |
50 | - } |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | * @return $response |
57 | 57 | */ |
58 | 58 | public function update($data) { |
59 | - try { |
|
59 | + try { |
|
60 | 60 | $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
61 | 61 | |
62 | 62 | return $response; |
63 | - } catch (Exception $e) { |
|
63 | + } catch (Exception $e) { |
|
64 | 64 | return $e; |
65 | - } |
|
65 | + } |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | } |
@@ -6,49 +6,49 @@ |
||
6 | 6 | |
7 | 7 | class OrganisationHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $organisation = '/organisation'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
29 | + private $organisation = '/organisation'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | 32 | |
33 | - protected $headers = [ |
|
33 | + protected $headers = [ |
|
34 | 34 | 'Accept' => 'application/json', |
35 | 35 | 'Content-Type' => 'application/json' |
36 | - ]; |
|
36 | + ]; |
|
37 | 37 | |
38 | - /** |
|
39 | - * Learning Locker: Organisation Details |
|
40 | - * |
|
41 | - * @return $response |
|
42 | - */ |
|
43 | - public function get() { |
|
38 | + /** |
|
39 | + * Learning Locker: Organisation Details |
|
40 | + * |
|
41 | + * @return $response |
|
42 | + */ |
|
43 | + public function get() { |
|
44 | 44 | try { |
45 | - $url = $this->url . $this->api . $this->v2 . $this->organisation; |
|
46 | - $response = $this->getFromLearningLocker($url); |
|
47 | - return $response; |
|
45 | + $url = $this->url . $this->api . $this->v2 . $this->organisation; |
|
46 | + $response = $this->getFromLearningLocker($url); |
|
47 | + return $response; |
|
48 | 48 | } catch (Exception $e) { |
49 | - return $e; |
|
49 | + return $e; |
|
50 | + } |
|
50 | 51 | } |
51 | - } |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Learning Locker: Request Organisation Details |
@@ -6,89 +6,89 @@ discard block |
||
6 | 6 | |
7 | 7 | class PersonaHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $persona = '/persona'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
29 | + private $persona = '/persona'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | 32 | |
33 | - protected $headers = [ |
|
33 | + protected $headers = [ |
|
34 | 34 | 'Content-Type' => 'application/json' |
35 | - ]; |
|
36 | - |
|
37 | - /** |
|
38 | - * Learning Locker API: Persona Identifier |
|
39 | - * |
|
40 | - * @param string|null $id |
|
41 | - * @return IdentifierHandler |
|
42 | - */ |
|
43 | - public function identifier(string $id = null) |
|
44 | - { |
|
35 | + ]; |
|
36 | + |
|
37 | + /** |
|
38 | + * Learning Locker API: Persona Identifier |
|
39 | + * |
|
40 | + * @param string|null $id |
|
41 | + * @return IdentifierHandler |
|
42 | + */ |
|
43 | + public function identifier(string $id = null) |
|
44 | + { |
|
45 | 45 | $identifier = new IdentifierHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
46 | 46 | if ($identifier) return $identifier; |
47 | 47 | |
48 | 48 | return self::identifier($id ? $id : null); |
49 | - } |
|
50 | - |
|
51 | - /** |
|
52 | - * Learning Locker API: Persona Attributes |
|
53 | - * |
|
54 | - * @param string|null $id |
|
55 | - * @return AttributeHandler |
|
56 | - */ |
|
57 | - public function attributes(string $id = null) |
|
58 | - { |
|
49 | + } |
|
50 | + |
|
51 | + /** |
|
52 | + * Learning Locker API: Persona Attributes |
|
53 | + * |
|
54 | + * @param string|null $id |
|
55 | + * @return AttributeHandler |
|
56 | + */ |
|
57 | + public function attributes(string $id = null) |
|
58 | + { |
|
59 | 59 | $attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
60 | 60 | if ($attribute) return $attribute; |
61 | 61 | |
62 | 62 | return self::attribute($id ? $id : null); |
63 | - } |
|
64 | - |
|
65 | - /** |
|
66 | - * Learning Locker API: Persona Attributes |
|
67 | - * |
|
68 | - * @param null|integer|string $id |
|
69 | - * @return AttributeHandler |
|
70 | - */ |
|
71 | - public function attribute(string $id = null) |
|
72 | - { |
|
63 | + } |
|
64 | + |
|
65 | + /** |
|
66 | + * Learning Locker API: Persona Attributes |
|
67 | + * |
|
68 | + * @param null|integer|string $id |
|
69 | + * @return AttributeHandler |
|
70 | + */ |
|
71 | + public function attribute(string $id = null) |
|
72 | + { |
|
73 | 73 | $attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
74 | 74 | if ($attribute) return $attribute; |
75 | 75 | |
76 | 76 | return self::attribute($id ? $id : null); |
77 | - } |
|
78 | - |
|
79 | - /** |
|
80 | - * Learning Locker API: Persona |
|
81 | - * |
|
82 | - * @param $id |
|
83 | - * @return PersonaHandler |
|
84 | - */ |
|
85 | - public function import(string $id = null) |
|
86 | - { |
|
77 | + } |
|
78 | + |
|
79 | + /** |
|
80 | + * Learning Locker API: Persona |
|
81 | + * |
|
82 | + * @param $id |
|
83 | + * @return PersonaHandler |
|
84 | + */ |
|
85 | + public function import(string $id = null) |
|
86 | + { |
|
87 | 87 | $import = new ImportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
88 | 88 | if ($import) return $import; |
89 | 89 | |
90 | 90 | return self::import($id ? $id : null); |
91 | - } |
|
91 | + } |
|
92 | 92 | |
93 | 93 | |
94 | 94 | /** |
@@ -98,63 +98,63 @@ discard block |
||
98 | 98 | * @return string |
99 | 99 | */ |
100 | 100 | public function url(string $id = null) { |
101 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->persona, '/'), $id ?? $id]); |
|
101 | + return implode('/', [trim($this->url . $this->api . $this->v2 . $this->persona, '/'), $id ?? $id]); |
|
102 | 102 | } |
103 | - /** |
|
104 | - * Learning Locker: Request Persona Details |
|
105 | - * |
|
106 | - * @return $response |
|
107 | - */ |
|
108 | - public function get() { |
|
103 | + /** |
|
104 | + * Learning Locker: Request Persona Details |
|
105 | + * |
|
106 | + * @return $response |
|
107 | + */ |
|
108 | + public function get() { |
|
109 | 109 | try { |
110 | - $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
110 | + $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
111 | 111 | |
112 | - return $response; |
|
112 | + return $response; |
|
113 | 113 | } catch (Exception $e) { |
114 | - return $e; |
|
114 | + return $e; |
|
115 | 115 | } |
116 | - } |
|
117 | - |
|
118 | - /** |
|
119 | - * Learning Locker: Request Organisation Details |
|
120 | - * |
|
121 | - * @return $response |
|
122 | - */ |
|
123 | - public function update($data) { |
|
116 | + } |
|
117 | + |
|
118 | + /** |
|
119 | + * Learning Locker: Request Organisation Details |
|
120 | + * |
|
121 | + * @return $response |
|
122 | + */ |
|
123 | + public function update($data) { |
|
124 | 124 | try { |
125 | - $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
126 | - return $response; |
|
125 | + $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
126 | + return $response; |
|
127 | 127 | } catch (Exception $e) { |
128 | - return $e; |
|
128 | + return $e; |
|
129 | 129 | } |
130 | - } |
|
131 | - |
|
132 | - /** |
|
133 | - * Learning Locker: Request Organisation Details |
|
134 | - * |
|
135 | - * @return $response |
|
136 | - */ |
|
137 | - public function delete() { |
|
130 | + } |
|
131 | + |
|
132 | + /** |
|
133 | + * Learning Locker: Request Organisation Details |
|
134 | + * |
|
135 | + * @return $response |
|
136 | + */ |
|
137 | + public function delete() { |
|
138 | 138 | try { |
139 | - $response = $this->deleteFromLearningLocker($this->url($this->id)); |
|
140 | - return $response; |
|
139 | + $response = $this->deleteFromLearningLocker($this->url($this->id)); |
|
140 | + return $response; |
|
141 | 141 | } catch (Exception $e) { |
142 | - return $e; |
|
142 | + return $e; |
|
143 | 143 | } |
144 | - } |
|
145 | - |
|
146 | - /** |
|
147 | - * Learning Locker: Request Organisation Details |
|
148 | - * |
|
149 | - * @return $response |
|
150 | - */ |
|
151 | - public function create($data = null) { |
|
144 | + } |
|
145 | + |
|
146 | + /** |
|
147 | + * Learning Locker: Request Organisation Details |
|
148 | + * |
|
149 | + * @return $response |
|
150 | + */ |
|
151 | + public function create($data = null) { |
|
152 | 152 | try { |
153 | - $response = $this->postToLearningLocker($this->url(), $data); |
|
154 | - return $response; |
|
153 | + $response = $this->postToLearningLocker($this->url(), $data); |
|
154 | + return $response; |
|
155 | 155 | } catch (Exception $e) { |
156 | - return $e; |
|
156 | + return $e; |
|
157 | + } |
|
157 | 158 | } |
158 | - } |
|
159 | 159 | |
160 | 160 | } |
@@ -98,7 +98,7 @@ |
||
98 | 98 | * @return string |
99 | 99 | */ |
100 | 100 | public function url(string $id = null) { |
101 | - return implode('/', [trim($this->url . $this->api . $this->v2 . $this->persona, '/'), $id ?? $id]); |
|
101 | + return implode('/', [ trim($this->url . $this->api . $this->v2 . $this->persona, '/'), $id ?? $id ]); |
|
102 | 102 | } |
103 | 103 | /** |
104 | 104 | * Learning Locker: Request Persona Details |
@@ -43,7 +43,9 @@ discard block |
||
43 | 43 | public function identifier(string $id = null) |
44 | 44 | { |
45 | 45 | $identifier = new IdentifierHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
46 | - if ($identifier) return $identifier; |
|
46 | + if ($identifier) { |
|
47 | + return $identifier; |
|
48 | + } |
|
47 | 49 | |
48 | 50 | return self::identifier($id ? $id : null); |
49 | 51 | } |
@@ -57,7 +59,9 @@ discard block |
||
57 | 59 | public function attributes(string $id = null) |
58 | 60 | { |
59 | 61 | $attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
60 | - if ($attribute) return $attribute; |
|
62 | + if ($attribute) { |
|
63 | + return $attribute; |
|
64 | + } |
|
61 | 65 | |
62 | 66 | return self::attribute($id ? $id : null); |
63 | 67 | } |
@@ -71,7 +75,9 @@ discard block |
||
71 | 75 | public function attribute(string $id = null) |
72 | 76 | { |
73 | 77 | $attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
74 | - if ($attribute) return $attribute; |
|
78 | + if ($attribute) { |
|
79 | + return $attribute; |
|
80 | + } |
|
75 | 81 | |
76 | 82 | return self::attribute($id ? $id : null); |
77 | 83 | } |
@@ -85,7 +91,9 @@ discard block |
||
85 | 91 | public function import(string $id = null) |
86 | 92 | { |
87 | 93 | $import = new ImportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
88 | - if ($import) return $import; |
|
94 | + if ($import) { |
|
95 | + return $import; |
|
96 | + } |
|
89 | 97 | |
90 | 98 | return self::import($id ? $id : null); |
91 | 99 | } |
@@ -6,42 +6,42 @@ discard block |
||
6 | 6 | |
7 | 7 | class IdentifierHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $personaIdentifier = '/personaidentifier'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
32 | - private $upsert = '/upsert'; |
|
29 | + private $personaIdentifier = '/personaidentifier'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | + private $upsert = '/upsert'; |
|
33 | 33 | |
34 | - protected $headers = [ |
|
34 | + protected $headers = [ |
|
35 | 35 | 'Content-Type' => 'application/json', |
36 | - ]; |
|
36 | + ]; |
|
37 | 37 | |
38 | 38 | |
39 | - /** |
|
40 | - * Learning Locker: Request Persona Details |
|
41 | - * |
|
42 | - * @return $response |
|
43 | - */ |
|
44 | - public function get() { |
|
39 | + /** |
|
40 | + * Learning Locker: Request Persona Details |
|
41 | + * |
|
42 | + * @return $response |
|
43 | + */ |
|
44 | + public function get() { |
|
45 | 45 | try { |
46 | 46 | $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . '/' . $this->id ?? $this->id; |
47 | 47 | $response = $this->getFromLearningLocker($url); |
@@ -49,56 +49,56 @@ discard block |
||
49 | 49 | } catch (Exception $e) { |
50 | 50 | return $e; |
51 | 51 | } |
52 | - } |
|
53 | - |
|
54 | - /** |
|
55 | - * Learning Locker: Request Organisation Details |
|
56 | - * |
|
57 | - * @return $response |
|
58 | - */ |
|
59 | - public function update($data) { |
|
52 | + } |
|
53 | + |
|
54 | + /** |
|
55 | + * Learning Locker: Request Organisation Details |
|
56 | + * |
|
57 | + * @return $response |
|
58 | + */ |
|
59 | + public function update($data) { |
|
60 | 60 | try { |
61 | 61 | |
62 | - if (!array_key_exists('ifi', $data)) { |
|
62 | + if (!array_key_exists('ifi', $data)) { |
|
63 | 63 | $data = ['ifi' => $data]; |
64 | - } |
|
64 | + } |
|
65 | 65 | |
66 | - if (!is_null($this->id)) { |
|
66 | + if (!is_null($this->id)) { |
|
67 | 67 | $data['persona'] = $this->id; |
68 | - } |
|
68 | + } |
|
69 | 69 | |
70 | - $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . $this->upsert; |
|
71 | - $response = $this->patchToLearningLocker($url, $data); |
|
72 | - return $response; |
|
70 | + $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . $this->upsert; |
|
71 | + $response = $this->patchToLearningLocker($url, $data); |
|
72 | + return $response; |
|
73 | 73 | } catch (Exception $e) { |
74 | - return $e; |
|
74 | + return $e; |
|
75 | + } |
|
75 | 76 | } |
76 | - } |
|
77 | 77 | |
78 | 78 | |
79 | - /** |
|
80 | - * Learning Locker: Request Organisation Details |
|
81 | - * |
|
82 | - * @return $response |
|
83 | - */ |
|
84 | - public function create($data = null) { |
|
79 | + /** |
|
80 | + * Learning Locker: Request Organisation Details |
|
81 | + * |
|
82 | + * @return $response |
|
83 | + */ |
|
84 | + public function create($data = null) { |
|
85 | 85 | try { |
86 | - if (!array_key_exists('ifi', $data)) { |
|
86 | + if (!array_key_exists('ifi', $data)) { |
|
87 | 87 | $data = ['ifi' => $data]; |
88 | - } |
|
88 | + } |
|
89 | 89 | |
90 | - if (!is_null($this->id)) { |
|
90 | + if (!is_null($this->id)) { |
|
91 | 91 | $data['persona'] = $this->id; |
92 | - } |
|
92 | + } |
|
93 | 93 | |
94 | - $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . $this->upsert; |
|
95 | - $response = $this->postToLearningLocker($this->url(), $data); |
|
96 | - return $response; |
|
94 | + $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . $this->upsert; |
|
95 | + $response = $this->postToLearningLocker($this->url(), $data); |
|
96 | + return $response; |
|
97 | 97 | } catch (Exception $e) { |
98 | - \Log::info($data); |
|
99 | - \Log::info($e); |
|
100 | - return $e; |
|
98 | + \Log::info($data); |
|
99 | + \Log::info($e); |
|
100 | + return $e; |
|
101 | + } |
|
101 | 102 | } |
102 | - } |
|
103 | 103 | |
104 | 104 | } |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | try { |
61 | 61 | |
62 | 62 | if (!array_key_exists('ifi', $data)) { |
63 | - $data = ['ifi' => $data]; |
|
63 | + $data = [ 'ifi' => $data ]; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if (!is_null($this->id)) { |
67 | - $data['persona'] = $this->id; |
|
67 | + $data[ 'persona' ] = $this->id; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . $this->upsert; |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | public function create($data = null) { |
85 | 85 | try { |
86 | 86 | if (!array_key_exists('ifi', $data)) { |
87 | - $data = ['ifi' => $data]; |
|
87 | + $data = [ 'ifi' => $data ]; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | if (!is_null($this->id)) { |
91 | - $data['persona'] = $this->id; |
|
91 | + $data[ 'persona' ] = $this->id; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $url = $this->url . $this->api . $this->v2 . $this->personaIdentifier . $this->upsert; |
@@ -6,84 +6,84 @@ |
||
6 | 6 | |
7 | 7 | class AttributeHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
28 | - private $persona_attribute = '/personaattribute'; |
|
29 | - private $api = '/api'; |
|
30 | - private $v2 = '/v2'; |
|
27 | + } |
|
28 | + private $persona_attribute = '/personaattribute'; |
|
29 | + private $api = '/api'; |
|
30 | + private $v2 = '/v2'; |
|
31 | 31 | |
32 | - protected $headers = [ |
|
32 | + protected $headers = [ |
|
33 | 33 | 'Content-Type' => 'application/json', |
34 | - ]; |
|
34 | + ]; |
|
35 | 35 | |
36 | - /** |
|
37 | - * Construct the Learning Locker URL |
|
38 | - * |
|
39 | - * @param string|integer $id |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - public function url($id = null) { |
|
36 | + /** |
|
37 | + * Construct the Learning Locker URL |
|
38 | + * |
|
39 | + * @param string|integer $id |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + public function url($id = null) { |
|
43 | 43 | return trim($this->url . $this->api . $this->v2 . $this->persona_attribute, '/') . '/' . $id ?? $id; |
44 | - } |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Learning Locker: Request Persona Details |
|
48 | - * |
|
49 | - * @return $response |
|
50 | - */ |
|
51 | - public function get() { |
|
52 | - try { |
|
53 | - $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
54 | - return $response; |
|
55 | - } catch (Exception $e) { |
|
56 | - return $e; |
|
57 | - } |
|
58 | - } |
|
46 | + /** |
|
47 | + * Learning Locker: Request Persona Details |
|
48 | + * |
|
49 | + * @return $response |
|
50 | + */ |
|
51 | + public function get() { |
|
52 | + try { |
|
53 | + $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
|
54 | + return $response; |
|
55 | + } catch (Exception $e) { |
|
56 | + return $e; |
|
57 | + } |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * Learning Locker: Request Organisation Details |
|
62 | - * |
|
63 | - * @return $response |
|
64 | - */ |
|
65 | - public function update($data) { |
|
60 | + /** |
|
61 | + * Learning Locker: Request Organisation Details |
|
62 | + * |
|
63 | + * @return $response |
|
64 | + */ |
|
65 | + public function update($data) { |
|
66 | 66 | try { |
67 | - $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
68 | - return $response; |
|
67 | + $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
68 | + return $response; |
|
69 | 69 | } catch (Exception $e) { |
70 | - return $e; |
|
70 | + return $e; |
|
71 | + } |
|
71 | 72 | } |
72 | - } |
|
73 | 73 | |
74 | 74 | |
75 | - /** |
|
76 | - * Learning Locker: Request Organisation Details |
|
77 | - * |
|
78 | - * @return $response |
|
79 | - */ |
|
80 | - public function create($data = null) { |
|
75 | + /** |
|
76 | + * Learning Locker: Request Organisation Details |
|
77 | + * |
|
78 | + * @return $response |
|
79 | + */ |
|
80 | + public function create($data = null) { |
|
81 | 81 | try { |
82 | - $response = $this->postToLearningLocker($this->url(), $data); |
|
83 | - return $response; |
|
82 | + $response = $this->postToLearningLocker($this->url(), $data); |
|
83 | + return $response; |
|
84 | 84 | } catch (Exception $e) { |
85 | - return $e; |
|
85 | + return $e; |
|
86 | + } |
|
86 | 87 | } |
87 | - } |
|
88 | 88 | |
89 | 89 | } |
@@ -6,84 +6,84 @@ |
||
6 | 6 | |
7 | 7 | class AttributeHandler extends APIHandler { |
8 | 8 | |
9 | - /** |
|
10 | - * Learning Locker Conection Details |
|
11 | - * |
|
12 | - * @param string|null $id |
|
13 | - * @param string|null $key |
|
14 | - * @param string|null $secret |
|
15 | - * @param string|null $url |
|
16 | - * |
|
17 | - * @return void |
|
18 | - */ |
|
19 | - public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | - { |
|
9 | + /** |
|
10 | + * Learning Locker Conection Details |
|
11 | + * |
|
12 | + * @param string|null $id |
|
13 | + * @param string|null $key |
|
14 | + * @param string|null $secret |
|
15 | + * @param string|null $url |
|
16 | + * |
|
17 | + * @return void |
|
18 | + */ |
|
19 | + public function __construct(string $id = null, string $key = null, string $secret = null, string $url = null) |
|
20 | + { |
|
21 | 21 | $this->id = $id ? (string) $id : null; |
22 | 22 | $this->key = $key ? (string) $key : null; |
23 | 23 | $this->secret = $secret ? (string) $secret : null; |
24 | 24 | $this->url = $url ? (string) $url : null; |
25 | 25 | |
26 | 26 | parent::__construct($this->key, $this->secret, $this->url); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - private $persona_attribute = '/personaattribute'; |
|
30 | - private $api = '/api'; |
|
31 | - private $v2 = '/v2'; |
|
29 | + private $persona_attribute = '/personaattribute'; |
|
30 | + private $api = '/api'; |
|
31 | + private $v2 = '/v2'; |
|
32 | 32 | |
33 | - protected $headers = [ |
|
33 | + protected $headers = [ |
|
34 | 34 | 'Content-Type' => 'application/json', |
35 | - ]; |
|
35 | + ]; |
|
36 | 36 | |
37 | - /** |
|
38 | - * Construct the Learning Locker URL |
|
39 | - * |
|
40 | - * @param string|integer $id |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function url($id = null) { |
|
37 | + /** |
|
38 | + * Construct the Learning Locker URL |
|
39 | + * |
|
40 | + * @param string|integer $id |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function url($id = null) { |
|
44 | 44 | return trim($this->url . $this->api . $this->v2 . $this->persona_import, '/') . '/' . $id ?? $id; |
45 | - } |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * Learning Locker: Request Persona Details |
|
49 | - * |
|
50 | - * @return $response |
|
51 | - */ |
|
52 | - public function get() { |
|
47 | + /** |
|
48 | + * Learning Locker: Request Persona Details |
|
49 | + * |
|
50 | + * @return $response |
|
51 | + */ |
|
52 | + public function get() { |
|
53 | 53 | try { |
54 | 54 | $response = $this->getFromLearningLocker($this->url($this->id ?? $this->id)); |
55 | 55 | return $response; |
56 | 56 | } catch (Exception $e) { |
57 | 57 | return $e; |
58 | 58 | } |
59 | - } |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * Learning Locker: Request Organisation Details |
|
63 | - * |
|
64 | - * @return $response |
|
65 | - */ |
|
61 | + /** |
|
62 | + * Learning Locker: Request Organisation Details |
|
63 | + * |
|
64 | + * @return $response |
|
65 | + */ |
|
66 | 66 | public function update($data) { |
67 | - try { |
|
68 | - $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
69 | - return $response; |
|
70 | - } catch (Exception $e) { |
|
71 | - return $e; |
|
72 | - } |
|
67 | + try { |
|
68 | + $response = $this->patchToLearningLocker($this->url($this->id ?? $this->id), $data); |
|
69 | + return $response; |
|
70 | + } catch (Exception $e) { |
|
71 | + return $e; |
|
72 | + } |
|
73 | 73 | } |
74 | 74 | |
75 | - /** |
|
76 | - * Learning Locker: Request Organisation Details |
|
77 | - * |
|
78 | - * @return $response |
|
79 | - */ |
|
80 | - public function create($data = null) { |
|
81 | - try { |
|
82 | - $response = $this->postToLearningLocker($this->url(), $data); |
|
83 | - return $response; |
|
84 | - } catch (Exception $e) { |
|
85 | - return $e; |
|
86 | - } |
|
87 | - } |
|
75 | + /** |
|
76 | + * Learning Locker: Request Organisation Details |
|
77 | + * |
|
78 | + * @return $response |
|
79 | + */ |
|
80 | + public function create($data = null) { |
|
81 | + try { |
|
82 | + $response = $this->postToLearningLocker($this->url(), $data); |
|
83 | + return $response; |
|
84 | + } catch (Exception $e) { |
|
85 | + return $e; |
|
86 | + } |
|
87 | + } |
|
88 | 88 | |
89 | 89 | } |
@@ -22,481 +22,481 @@ |
||
22 | 22 | |
23 | 23 | class LearningLocker { |
24 | 24 | |
25 | - /** |
|
26 | - * Learning Locker Conection Details |
|
27 | - * |
|
28 | - * @param string|null $id |
|
29 | - * @param string|null $key |
|
30 | - * @param string|null $secret |
|
31 | - * @param string|null $url |
|
32 | - * |
|
33 | - * @return void |
|
34 | - */ |
|
35 | - public function __construct(string $key = null, string $secret = null, string $url = null) |
|
36 | - { |
|
25 | + /** |
|
26 | + * Learning Locker Conection Details |
|
27 | + * |
|
28 | + * @param string|null $id |
|
29 | + * @param string|null $key |
|
30 | + * @param string|null $secret |
|
31 | + * @param string|null $url |
|
32 | + * |
|
33 | + * @return void |
|
34 | + */ |
|
35 | + public function __construct(string $key = null, string $secret = null, string $url = null) |
|
36 | + { |
|
37 | 37 | $this->key = $key ? (string) $key : null; |
38 | 38 | $this->secret = $secret ? (string) $secret : null; |
39 | 39 | $this->url = $url ? (string) $url : null; |
40 | - } |
|
41 | - |
|
42 | - /** |
|
43 | - * Learning Locker API: Connection |
|
44 | - * |
|
45 | - * @param string $key |
|
46 | - * @param string $secret |
|
47 | - * @param string $url |
|
48 | - * |
|
49 | - * @return LearningLocker |
|
50 | - */ |
|
51 | - public function connect(string $key, string $secret, string $url) |
|
52 | - { |
|
40 | + } |
|
41 | + |
|
42 | + /** |
|
43 | + * Learning Locker API: Connection |
|
44 | + * |
|
45 | + * @param string $key |
|
46 | + * @param string $secret |
|
47 | + * @param string $url |
|
48 | + * |
|
49 | + * @return LearningLocker |
|
50 | + */ |
|
51 | + public function connect(string $key, string $secret, string $url) |
|
52 | + { |
|
53 | 53 | $connection = new LearningLocker($key, $secret, $url); |
54 | 54 | if ($connection) return $connection; |
55 | 55 | |
56 | 56 | return self::connect($key, $secret, $url); |
57 | - } |
|
58 | - |
|
59 | - /** |
|
60 | - * Learning Locker Clients |
|
61 | - * |
|
62 | - * @param string|null $id |
|
63 | - * @return ClientHandler |
|
64 | - */ |
|
65 | - public function clients(string $id = null) |
|
66 | - { |
|
57 | + } |
|
58 | + |
|
59 | + /** |
|
60 | + * Learning Locker Clients |
|
61 | + * |
|
62 | + * @param string|null $id |
|
63 | + * @return ClientHandler |
|
64 | + */ |
|
65 | + public function clients(string $id = null) |
|
66 | + { |
|
67 | 67 | $clients = new ClientHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
68 | 68 | if ($clients) return $clients; |
69 | 69 | |
70 | 70 | return self::clients($id ? $id : null); |
71 | - } |
|
72 | - |
|
73 | - /** |
|
74 | - * Learning Locker Client |
|
75 | - * |
|
76 | - * @param string|null $id |
|
77 | - * @return ClientHandler |
|
78 | - */ |
|
79 | - public function client(string $id = null) |
|
80 | - { |
|
71 | + } |
|
72 | + |
|
73 | + /** |
|
74 | + * Learning Locker Client |
|
75 | + * |
|
76 | + * @param string|null $id |
|
77 | + * @return ClientHandler |
|
78 | + */ |
|
79 | + public function client(string $id = null) |
|
80 | + { |
|
81 | 81 | $client = new ClientHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
82 | 82 | if ($client) return $client; |
83 | 83 | |
84 | 84 | return self::client($id ? $id : null); |
85 | - } |
|
86 | - |
|
87 | - /** |
|
88 | - * Learning Locker Users |
|
89 | - * |
|
90 | - * @param string|null $id |
|
91 | - * @return UserHandler |
|
92 | - */ |
|
93 | - public function users(string $id = null) |
|
94 | - { |
|
85 | + } |
|
86 | + |
|
87 | + /** |
|
88 | + * Learning Locker Users |
|
89 | + * |
|
90 | + * @param string|null $id |
|
91 | + * @return UserHandler |
|
92 | + */ |
|
93 | + public function users(string $id = null) |
|
94 | + { |
|
95 | 95 | $users = new UserHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
96 | 96 | if ($users) return $users; |
97 | 97 | |
98 | 98 | return self::users($id ? $id : null); |
99 | - } |
|
100 | - |
|
101 | - /** |
|
102 | - * Learning Locker User |
|
103 | - * |
|
104 | - * @param string|null $id |
|
105 | - * @return UserHandler |
|
106 | - */ |
|
107 | - public function user(string $id = null) |
|
108 | - { |
|
99 | + } |
|
100 | + |
|
101 | + /** |
|
102 | + * Learning Locker User |
|
103 | + * |
|
104 | + * @param string|null $id |
|
105 | + * @return UserHandler |
|
106 | + */ |
|
107 | + public function user(string $id = null) |
|
108 | + { |
|
109 | 109 | $user = new UserHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
110 | 110 | if ($user) return $user; |
111 | 111 | |
112 | 112 | return self::user($id ? $id : null); |
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * Learning Locker Roles |
|
117 | - * |
|
118 | - * @param string|null $id |
|
119 | - * @return RoleHandler |
|
120 | - */ |
|
121 | - public function roles(string $id = null) |
|
122 | - { |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * Learning Locker Roles |
|
117 | + * |
|
118 | + * @param string|null $id |
|
119 | + * @return RoleHandler |
|
120 | + */ |
|
121 | + public function roles(string $id = null) |
|
122 | + { |
|
123 | 123 | $roles = new RoleHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
124 | 124 | if ($roles) return $roles; |
125 | 125 | |
126 | 126 | return self::roles($id ? $id : null); |
127 | - } |
|
128 | - |
|
129 | - /** |
|
130 | - * Learning Locker Role |
|
131 | - * |
|
132 | - * @param string|null $id |
|
133 | - * @return RoleHandler |
|
134 | - */ |
|
135 | - public function role(string $id = null) |
|
136 | - { |
|
127 | + } |
|
128 | + |
|
129 | + /** |
|
130 | + * Learning Locker Role |
|
131 | + * |
|
132 | + * @param string|null $id |
|
133 | + * @return RoleHandler |
|
134 | + */ |
|
135 | + public function role(string $id = null) |
|
136 | + { |
|
137 | 137 | $role = new RoleHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
138 | 138 | if ($role) return $role; |
139 | 139 | |
140 | 140 | return self::role($id ? $id : null); |
141 | - } |
|
142 | - |
|
143 | - /** |
|
144 | - * Learning Locker Stores - (LRS) |
|
145 | - * |
|
146 | - * @param string|null $id |
|
147 | - * @return StoreHandler |
|
148 | - */ |
|
149 | - public function stores(string $id = null) |
|
150 | - { |
|
141 | + } |
|
142 | + |
|
143 | + /** |
|
144 | + * Learning Locker Stores - (LRS) |
|
145 | + * |
|
146 | + * @param string|null $id |
|
147 | + * @return StoreHandler |
|
148 | + */ |
|
149 | + public function stores(string $id = null) |
|
150 | + { |
|
151 | 151 | $stores = new StoreHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
152 | 152 | if ($stores) return $stores; |
153 | 153 | |
154 | 154 | return self::stores($id ? $id : null); |
155 | - } |
|
156 | - |
|
157 | - /** |
|
158 | - * Learning Locker Store - (LRS) |
|
159 | - * |
|
160 | - * @param string|null $id |
|
161 | - * @return StoreHandler |
|
162 | - */ |
|
163 | - public function store(string $id = null) |
|
164 | - { |
|
155 | + } |
|
156 | + |
|
157 | + /** |
|
158 | + * Learning Locker Store - (LRS) |
|
159 | + * |
|
160 | + * @param string|null $id |
|
161 | + * @return StoreHandler |
|
162 | + */ |
|
163 | + public function store(string $id = null) |
|
164 | + { |
|
165 | 165 | $store = new StoreHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
166 | 166 | if ($store) return $store; |
167 | 167 | |
168 | 168 | return self::store($id ? $id : null); |
169 | - } |
|
170 | - |
|
171 | - /** |
|
172 | - * Learning Locker Queries |
|
173 | - * |
|
174 | - * @param string|null $id |
|
175 | - * @return QueryHandler |
|
176 | - */ |
|
177 | - public function queries(string $id = null) |
|
178 | - { |
|
169 | + } |
|
170 | + |
|
171 | + /** |
|
172 | + * Learning Locker Queries |
|
173 | + * |
|
174 | + * @param string|null $id |
|
175 | + * @return QueryHandler |
|
176 | + */ |
|
177 | + public function queries(string $id = null) |
|
178 | + { |
|
179 | 179 | $queries = new QueryHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
180 | 180 | if ($queries) return $queries; |
181 | 181 | |
182 | 182 | return self::queries($id ? $id : null); |
183 | - } |
|
184 | - |
|
185 | - /** |
|
186 | - * Learning Locker Query |
|
187 | - * |
|
188 | - * @param string|null $id |
|
189 | - * @return QueryHandler |
|
190 | - */ |
|
191 | - public function query(string $id = null) |
|
192 | - { |
|
183 | + } |
|
184 | + |
|
185 | + /** |
|
186 | + * Learning Locker Query |
|
187 | + * |
|
188 | + * @param string|null $id |
|
189 | + * @return QueryHandler |
|
190 | + */ |
|
191 | + public function query(string $id = null) |
|
192 | + { |
|
193 | 193 | $query = new QueryHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
194 | 194 | if ($query) return $query; |
195 | 195 | |
196 | 196 | return self::query($id ? $id : null); |
197 | - } |
|
198 | - |
|
199 | - /** |
|
200 | - * Learning Locker Exports |
|
201 | - * |
|
202 | - * @param string|null $id |
|
203 | - * @return ExportHandler |
|
204 | - */ |
|
205 | - public function exports(string $id = null) |
|
206 | - { |
|
197 | + } |
|
198 | + |
|
199 | + /** |
|
200 | + * Learning Locker Exports |
|
201 | + * |
|
202 | + * @param string|null $id |
|
203 | + * @return ExportHandler |
|
204 | + */ |
|
205 | + public function exports(string $id = null) |
|
206 | + { |
|
207 | 207 | $exports = new ExportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
208 | 208 | if ($exports) return $exports; |
209 | 209 | |
210 | 210 | return self::exports($id ? $id : null); |
211 | - } |
|
212 | - |
|
213 | - /** |
|
214 | - * Learning Locker Export |
|
215 | - * |
|
216 | - * @param string|null $id |
|
217 | - * @return ExportHandler |
|
218 | - */ |
|
219 | - public function export(string $id = null) |
|
220 | - { |
|
211 | + } |
|
212 | + |
|
213 | + /** |
|
214 | + * Learning Locker Export |
|
215 | + * |
|
216 | + * @param string|null $id |
|
217 | + * @return ExportHandler |
|
218 | + */ |
|
219 | + public function export(string $id = null) |
|
220 | + { |
|
221 | 221 | $export = new ExportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
222 | 222 | if ($export) return $export; |
223 | 223 | |
224 | 224 | return self::export($id ? $id : null); |
225 | - } |
|
226 | - |
|
227 | - /** |
|
228 | - * Learning Locker Personas |
|
229 | - * |
|
230 | - * @param string|null $id |
|
231 | - * @return PersonaHandler |
|
232 | - */ |
|
233 | - public function personas(string $id = null) |
|
234 | - { |
|
225 | + } |
|
226 | + |
|
227 | + /** |
|
228 | + * Learning Locker Personas |
|
229 | + * |
|
230 | + * @param string|null $id |
|
231 | + * @return PersonaHandler |
|
232 | + */ |
|
233 | + public function personas(string $id = null) |
|
234 | + { |
|
235 | 235 | $personas = new PersonaHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
236 | 236 | if ($personas) return $personas; |
237 | 237 | |
238 | 238 | return self::personas($id ? $id : null); |
239 | - } |
|
240 | - |
|
241 | - /** |
|
242 | - * Learning Locker Persona |
|
243 | - * |
|
244 | - * @param string|null $id |
|
245 | - * @return PersonaHandler |
|
246 | - */ |
|
247 | - public function persona(string $id = null) |
|
248 | - { |
|
239 | + } |
|
240 | + |
|
241 | + /** |
|
242 | + * Learning Locker Persona |
|
243 | + * |
|
244 | + * @param string|null $id |
|
245 | + * @return PersonaHandler |
|
246 | + */ |
|
247 | + public function persona(string $id = null) |
|
248 | + { |
|
249 | 249 | $persona = new PersonaHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
250 | 250 | if ($persona) return $persona; |
251 | 251 | |
252 | 252 | return self::persona($id ? $id : null); |
253 | - } |
|
254 | - |
|
255 | - /** |
|
256 | - * Learning Locker Persona Attributes |
|
257 | - * |
|
258 | - * @param string|null $id |
|
259 | - * @return AttributeHandler |
|
260 | - */ |
|
261 | - public function personaAttribute(string $id = null) |
|
262 | - { |
|
253 | + } |
|
254 | + |
|
255 | + /** |
|
256 | + * Learning Locker Persona Attributes |
|
257 | + * |
|
258 | + * @param string|null $id |
|
259 | + * @return AttributeHandler |
|
260 | + */ |
|
261 | + public function personaAttribute(string $id = null) |
|
262 | + { |
|
263 | 263 | $persona_attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
264 | 264 | if ($persona_attribute) return $persona_attribute; |
265 | 265 | |
266 | 266 | return self::persona($id ? $id : null); |
267 | - } |
|
268 | - |
|
269 | - /** |
|
270 | - * Learning Locker Persona Attributes |
|
271 | - * |
|
272 | - * @param string|null $id |
|
273 | - * @return AttributeHandler |
|
274 | - */ |
|
275 | - public function personaAttributes(string $id = null) |
|
276 | - { |
|
267 | + } |
|
268 | + |
|
269 | + /** |
|
270 | + * Learning Locker Persona Attributes |
|
271 | + * |
|
272 | + * @param string|null $id |
|
273 | + * @return AttributeHandler |
|
274 | + */ |
|
275 | + public function personaAttributes(string $id = null) |
|
276 | + { |
|
277 | 277 | $persona_attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
278 | 278 | if ($persona_attribute) return $persona_attribute; |
279 | 279 | |
280 | 280 | return self::persona($id ? $id : null); |
281 | - } |
|
282 | - |
|
283 | - /** |
|
284 | - * Learning Locker Persona Attributes |
|
285 | - * |
|
286 | - * @param string|null $id |
|
287 | - * @return IdentifierHandler |
|
288 | - */ |
|
289 | - public function personaIdentifier(string $id = null) |
|
290 | - { |
|
281 | + } |
|
282 | + |
|
283 | + /** |
|
284 | + * Learning Locker Persona Attributes |
|
285 | + * |
|
286 | + * @param string|null $id |
|
287 | + * @return IdentifierHandler |
|
288 | + */ |
|
289 | + public function personaIdentifier(string $id = null) |
|
290 | + { |
|
291 | 291 | $persona_identifier = new IdentifierHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
292 | 292 | if ($persona_identifier) return $persona_identifier; |
293 | 293 | |
294 | 294 | return self::personaIdentifier($id ? $id : null); |
295 | - } |
|
296 | - |
|
297 | - /** |
|
298 | - * Learning Locker Journeys |
|
299 | - * |
|
300 | - * @param string|null $id |
|
301 | - * @return JourneyHandler |
|
302 | - */ |
|
303 | - public function journeys(string $id = null) |
|
304 | - { |
|
295 | + } |
|
296 | + |
|
297 | + /** |
|
298 | + * Learning Locker Journeys |
|
299 | + * |
|
300 | + * @param string|null $id |
|
301 | + * @return JourneyHandler |
|
302 | + */ |
|
303 | + public function journeys(string $id = null) |
|
304 | + { |
|
305 | 305 | $journeys = new JourneyHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
306 | 306 | if ($journeys) return $journeys; |
307 | 307 | |
308 | 308 | return self::journeys($id ? $id : null); |
309 | - } |
|
310 | - |
|
311 | - /** |
|
312 | - * Learning Locker Journey |
|
313 | - * |
|
314 | - * @param string|null $id |
|
315 | - * @return JourneyHandler |
|
316 | - */ |
|
317 | - public function journey(string $id = null) |
|
318 | - { |
|
309 | + } |
|
310 | + |
|
311 | + /** |
|
312 | + * Learning Locker Journey |
|
313 | + * |
|
314 | + * @param string|null $id |
|
315 | + * @return JourneyHandler |
|
316 | + */ |
|
317 | + public function journey(string $id = null) |
|
318 | + { |
|
319 | 319 | $journey = new JourneyHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
320 | 320 | if ($journey) return $journey; |
321 | 321 | |
322 | 322 | return self::journey($id ? $id : null); |
323 | - } |
|
324 | - |
|
325 | - /** |
|
326 | - * Learning Locker Journey Progress |
|
327 | - * |
|
328 | - * @param string|null $id |
|
329 | - * @return ProgressHandler |
|
330 | - */ |
|
331 | - public function journeyProgress(string $id = null) |
|
332 | - { |
|
323 | + } |
|
324 | + |
|
325 | + /** |
|
326 | + * Learning Locker Journey Progress |
|
327 | + * |
|
328 | + * @param string|null $id |
|
329 | + * @return ProgressHandler |
|
330 | + */ |
|
331 | + public function journeyProgress(string $id = null) |
|
332 | + { |
|
333 | 333 | $journey_progress = new ProgressHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
334 | 334 | if ($journey_progress) return $journey_progress; |
335 | 335 | |
336 | 336 | return self::journeyProgress($id ? $id : null); |
337 | - } |
|
338 | - |
|
339 | - /** |
|
340 | - * Learning Locker Dashboards |
|
341 | - * |
|
342 | - * @param string|null $id |
|
343 | - * @return DashboardHandler |
|
344 | - */ |
|
345 | - public function dashboards(string $id = null) |
|
346 | - { |
|
337 | + } |
|
338 | + |
|
339 | + /** |
|
340 | + * Learning Locker Dashboards |
|
341 | + * |
|
342 | + * @param string|null $id |
|
343 | + * @return DashboardHandler |
|
344 | + */ |
|
345 | + public function dashboards(string $id = null) |
|
346 | + { |
|
347 | 347 | $dashboards = new DashboardHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
348 | 348 | if ($dashboards) return $dashboards; |
349 | 349 | |
350 | 350 | return self::dashboards($id ? $id : null); |
351 | - } |
|
352 | - |
|
353 | - /** |
|
354 | - * Learning Locker Dashboard |
|
355 | - * |
|
356 | - * @param string|null $id |
|
357 | - * @return DashboardHandler |
|
358 | - */ |
|
359 | - public function dashboard(string $id = null) |
|
360 | - { |
|
351 | + } |
|
352 | + |
|
353 | + /** |
|
354 | + * Learning Locker Dashboard |
|
355 | + * |
|
356 | + * @param string|null $id |
|
357 | + * @return DashboardHandler |
|
358 | + */ |
|
359 | + public function dashboard(string $id = null) |
|
360 | + { |
|
361 | 361 | $dashboard = new DashboardHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
362 | 362 | if ($dashboard) return $dashboard; |
363 | 363 | |
364 | 364 | return self::dashboard($id ? $id : null); |
365 | - } |
|
366 | - |
|
367 | - /** |
|
368 | - * Learning Locker Downloads |
|
369 | - * |
|
370 | - * @param string|null $id |
|
371 | - * @return DownloasHandler |
|
372 | - */ |
|
373 | - public function downloads(string $id = null) |
|
374 | - { |
|
365 | + } |
|
366 | + |
|
367 | + /** |
|
368 | + * Learning Locker Downloads |
|
369 | + * |
|
370 | + * @param string|null $id |
|
371 | + * @return DownloasHandler |
|
372 | + */ |
|
373 | + public function downloads(string $id = null) |
|
374 | + { |
|
375 | 375 | $downloads = new DownloadHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
376 | 376 | if ($downloads) return $downloads; |
377 | 377 | |
378 | 378 | return self::downloads($id ? $id : null); |
379 | - } |
|
380 | - |
|
381 | - /** |
|
382 | - * Learning Locker Download |
|
383 | - * |
|
384 | - * @param string|null $id |
|
385 | - * @return DownloadHandler |
|
386 | - */ |
|
387 | - public function download(string $id = null) |
|
388 | - { |
|
379 | + } |
|
380 | + |
|
381 | + /** |
|
382 | + * Learning Locker Download |
|
383 | + * |
|
384 | + * @param string|null $id |
|
385 | + * @return DownloadHandler |
|
386 | + */ |
|
387 | + public function download(string $id = null) |
|
388 | + { |
|
389 | 389 | $download = new DownloadHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
390 | 390 | if ($download) return $download; |
391 | 391 | |
392 | 392 | return self::download($id ? $id : null); |
393 | - } |
|
394 | - |
|
395 | - /** |
|
396 | - * Learning Locker Statements |
|
397 | - * |
|
398 | - * @param string|null $id |
|
399 | - * @return StatementHandler |
|
400 | - */ |
|
401 | - public function statements(string $id = null) |
|
402 | - { |
|
393 | + } |
|
394 | + |
|
395 | + /** |
|
396 | + * Learning Locker Statements |
|
397 | + * |
|
398 | + * @param string|null $id |
|
399 | + * @return StatementHandler |
|
400 | + */ |
|
401 | + public function statements(string $id = null) |
|
402 | + { |
|
403 | 403 | $statements = new StatementHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
404 | 404 | if ($statements) return $statements; |
405 | 405 | |
406 | 406 | return self::statements($id ? $id : null); |
407 | - } |
|
408 | - |
|
409 | - /** |
|
410 | - * Learning Locker Statement |
|
411 | - * |
|
412 | - * @param string|null $id |
|
413 | - * @return StatementHandler |
|
414 | - */ |
|
415 | - public function statement(string $id = null) |
|
416 | - { |
|
407 | + } |
|
408 | + |
|
409 | + /** |
|
410 | + * Learning Locker Statement |
|
411 | + * |
|
412 | + * @param string|null $id |
|
413 | + * @return StatementHandler |
|
414 | + */ |
|
415 | + public function statement(string $id = null) |
|
416 | + { |
|
417 | 417 | $statement = new StatementHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
418 | 418 | if ($statement) return $statement; |
419 | 419 | |
420 | 420 | return self::statement($id ? $id : null); |
421 | - } |
|
422 | - |
|
423 | - /** |
|
424 | - * Learning Locker Statement Forwarding |
|
425 | - * |
|
426 | - * @param string|null $id |
|
427 | - * @return StatementHandler |
|
428 | - */ |
|
429 | - public function statementForwarding(string $id = null) |
|
430 | - { |
|
421 | + } |
|
422 | + |
|
423 | + /** |
|
424 | + * Learning Locker Statement Forwarding |
|
425 | + * |
|
426 | + * @param string|null $id |
|
427 | + * @return StatementHandler |
|
428 | + */ |
|
429 | + public function statementForwarding(string $id = null) |
|
430 | + { |
|
431 | 431 | $statement_forwarding = new ForwardingHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
432 | 432 | if ($statement_forwarding) return $statement_forwarding; |
433 | 433 | |
434 | 434 | return self::statementForwarding($id ? $id : null); |
435 | - } |
|
436 | - |
|
437 | - /** |
|
438 | - * Learning Locker Organisation |
|
439 | - * |
|
440 | - * @param string|null $id |
|
441 | - * @return OrganisationHandler |
|
442 | - */ |
|
443 | - public function organisations(string $id = null) |
|
444 | - { |
|
435 | + } |
|
436 | + |
|
437 | + /** |
|
438 | + * Learning Locker Organisation |
|
439 | + * |
|
440 | + * @param string|null $id |
|
441 | + * @return OrganisationHandler |
|
442 | + */ |
|
443 | + public function organisations(string $id = null) |
|
444 | + { |
|
445 | 445 | $organisation = new OrganisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
446 | 446 | if ($organisation) return $organisation; |
447 | 447 | |
448 | 448 | return self::organisation($id ? $id : null); |
449 | - } |
|
450 | - |
|
451 | - /** |
|
452 | - * Learning Locker Organisation |
|
453 | - * |
|
454 | - * @param string|null $id |
|
455 | - * @return OrganisationHandler |
|
456 | - */ |
|
457 | - public function organisation(string $id = null) |
|
458 | - { |
|
449 | + } |
|
450 | + |
|
451 | + /** |
|
452 | + * Learning Locker Organisation |
|
453 | + * |
|
454 | + * @param string|null $id |
|
455 | + * @return OrganisationHandler |
|
456 | + */ |
|
457 | + public function organisation(string $id = null) |
|
458 | + { |
|
459 | 459 | $organisation = new OrganisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
460 | 460 | if ($organisation) return $organisation; |
461 | 461 | |
462 | 462 | return self::organisation($id ? $id : null); |
463 | - } |
|
464 | - |
|
465 | - /** |
|
466 | - * Learning Locker Visualisations |
|
467 | - * |
|
468 | - * @param string|null $id |
|
469 | - * @return VisualisationHandler |
|
470 | - */ |
|
471 | - public function visualisations(string $id = null) |
|
472 | - { |
|
463 | + } |
|
464 | + |
|
465 | + /** |
|
466 | + * Learning Locker Visualisations |
|
467 | + * |
|
468 | + * @param string|null $id |
|
469 | + * @return VisualisationHandler |
|
470 | + */ |
|
471 | + public function visualisations(string $id = null) |
|
472 | + { |
|
473 | 473 | $visualisations = new VisualisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
474 | 474 | if ($visualisations) return $visualisations; |
475 | 475 | |
476 | 476 | return self::visualisations($id ? $id : null); |
477 | - } |
|
478 | - |
|
479 | - /** |
|
480 | - * Learning Locker Visualisation |
|
481 | - * |
|
482 | - * @param string|null $id |
|
483 | - * @return VisualisationHandler |
|
484 | - */ |
|
485 | - public function visualisation(string $id = null) |
|
486 | - { |
|
477 | + } |
|
478 | + |
|
479 | + /** |
|
480 | + * Learning Locker Visualisation |
|
481 | + * |
|
482 | + * @param string|null $id |
|
483 | + * @return VisualisationHandler |
|
484 | + */ |
|
485 | + public function visualisation(string $id = null) |
|
486 | + { |
|
487 | 487 | $visualisation = new VisualisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
488 | 488 | if ($visualisation) return $visualisation; |
489 | 489 | |
490 | 490 | return self::visualisation($id ? $id : null); |
491 | - } |
|
492 | - |
|
493 | - /** |
|
494 | - * Learning Locker API: Routes |
|
495 | - * |
|
496 | - * @param string|null $type |
|
497 | - */ |
|
498 | - public function routes(string $type = null) |
|
499 | - { |
|
491 | + } |
|
492 | + |
|
493 | + /** |
|
494 | + * Learning Locker API: Routes |
|
495 | + * |
|
496 | + * @param string|null $type |
|
497 | + */ |
|
498 | + public function routes(string $type = null) |
|
499 | + { |
|
500 | 500 | require __DIR__.'/../routes/laralocker.php'; |
501 | - } |
|
501 | + } |
|
502 | 502 | } |
@@ -497,6 +497,6 @@ |
||
497 | 497 | */ |
498 | 498 | public function routes(string $type = null) |
499 | 499 | { |
500 | - require __DIR__.'/../routes/laralocker.php'; |
|
500 | + require __DIR__ . '/../routes/laralocker.php'; |
|
501 | 501 | } |
502 | 502 | } |
@@ -51,7 +51,9 @@ discard block |
||
51 | 51 | public function connect(string $key, string $secret, string $url) |
52 | 52 | { |
53 | 53 | $connection = new LearningLocker($key, $secret, $url); |
54 | - if ($connection) return $connection; |
|
54 | + if ($connection) { |
|
55 | + return $connection; |
|
56 | + } |
|
55 | 57 | |
56 | 58 | return self::connect($key, $secret, $url); |
57 | 59 | } |
@@ -65,7 +67,9 @@ discard block |
||
65 | 67 | public function clients(string $id = null) |
66 | 68 | { |
67 | 69 | $clients = new ClientHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
68 | - if ($clients) return $clients; |
|
70 | + if ($clients) { |
|
71 | + return $clients; |
|
72 | + } |
|
69 | 73 | |
70 | 74 | return self::clients($id ? $id : null); |
71 | 75 | } |
@@ -79,7 +83,9 @@ discard block |
||
79 | 83 | public function client(string $id = null) |
80 | 84 | { |
81 | 85 | $client = new ClientHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
82 | - if ($client) return $client; |
|
86 | + if ($client) { |
|
87 | + return $client; |
|
88 | + } |
|
83 | 89 | |
84 | 90 | return self::client($id ? $id : null); |
85 | 91 | } |
@@ -93,7 +99,9 @@ discard block |
||
93 | 99 | public function users(string $id = null) |
94 | 100 | { |
95 | 101 | $users = new UserHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
96 | - if ($users) return $users; |
|
102 | + if ($users) { |
|
103 | + return $users; |
|
104 | + } |
|
97 | 105 | |
98 | 106 | return self::users($id ? $id : null); |
99 | 107 | } |
@@ -107,7 +115,9 @@ discard block |
||
107 | 115 | public function user(string $id = null) |
108 | 116 | { |
109 | 117 | $user = new UserHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
110 | - if ($user) return $user; |
|
118 | + if ($user) { |
|
119 | + return $user; |
|
120 | + } |
|
111 | 121 | |
112 | 122 | return self::user($id ? $id : null); |
113 | 123 | } |
@@ -121,7 +131,9 @@ discard block |
||
121 | 131 | public function roles(string $id = null) |
122 | 132 | { |
123 | 133 | $roles = new RoleHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
124 | - if ($roles) return $roles; |
|
134 | + if ($roles) { |
|
135 | + return $roles; |
|
136 | + } |
|
125 | 137 | |
126 | 138 | return self::roles($id ? $id : null); |
127 | 139 | } |
@@ -135,7 +147,9 @@ discard block |
||
135 | 147 | public function role(string $id = null) |
136 | 148 | { |
137 | 149 | $role = new RoleHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
138 | - if ($role) return $role; |
|
150 | + if ($role) { |
|
151 | + return $role; |
|
152 | + } |
|
139 | 153 | |
140 | 154 | return self::role($id ? $id : null); |
141 | 155 | } |
@@ -149,7 +163,9 @@ discard block |
||
149 | 163 | public function stores(string $id = null) |
150 | 164 | { |
151 | 165 | $stores = new StoreHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
152 | - if ($stores) return $stores; |
|
166 | + if ($stores) { |
|
167 | + return $stores; |
|
168 | + } |
|
153 | 169 | |
154 | 170 | return self::stores($id ? $id : null); |
155 | 171 | } |
@@ -163,7 +179,9 @@ discard block |
||
163 | 179 | public function store(string $id = null) |
164 | 180 | { |
165 | 181 | $store = new StoreHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
166 | - if ($store) return $store; |
|
182 | + if ($store) { |
|
183 | + return $store; |
|
184 | + } |
|
167 | 185 | |
168 | 186 | return self::store($id ? $id : null); |
169 | 187 | } |
@@ -177,7 +195,9 @@ discard block |
||
177 | 195 | public function queries(string $id = null) |
178 | 196 | { |
179 | 197 | $queries = new QueryHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
180 | - if ($queries) return $queries; |
|
198 | + if ($queries) { |
|
199 | + return $queries; |
|
200 | + } |
|
181 | 201 | |
182 | 202 | return self::queries($id ? $id : null); |
183 | 203 | } |
@@ -191,7 +211,9 @@ discard block |
||
191 | 211 | public function query(string $id = null) |
192 | 212 | { |
193 | 213 | $query = new QueryHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
194 | - if ($query) return $query; |
|
214 | + if ($query) { |
|
215 | + return $query; |
|
216 | + } |
|
195 | 217 | |
196 | 218 | return self::query($id ? $id : null); |
197 | 219 | } |
@@ -205,7 +227,9 @@ discard block |
||
205 | 227 | public function exports(string $id = null) |
206 | 228 | { |
207 | 229 | $exports = new ExportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
208 | - if ($exports) return $exports; |
|
230 | + if ($exports) { |
|
231 | + return $exports; |
|
232 | + } |
|
209 | 233 | |
210 | 234 | return self::exports($id ? $id : null); |
211 | 235 | } |
@@ -219,7 +243,9 @@ discard block |
||
219 | 243 | public function export(string $id = null) |
220 | 244 | { |
221 | 245 | $export = new ExportHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
222 | - if ($export) return $export; |
|
246 | + if ($export) { |
|
247 | + return $export; |
|
248 | + } |
|
223 | 249 | |
224 | 250 | return self::export($id ? $id : null); |
225 | 251 | } |
@@ -233,7 +259,9 @@ discard block |
||
233 | 259 | public function personas(string $id = null) |
234 | 260 | { |
235 | 261 | $personas = new PersonaHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
236 | - if ($personas) return $personas; |
|
262 | + if ($personas) { |
|
263 | + return $personas; |
|
264 | + } |
|
237 | 265 | |
238 | 266 | return self::personas($id ? $id : null); |
239 | 267 | } |
@@ -247,7 +275,9 @@ discard block |
||
247 | 275 | public function persona(string $id = null) |
248 | 276 | { |
249 | 277 | $persona = new PersonaHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
250 | - if ($persona) return $persona; |
|
278 | + if ($persona) { |
|
279 | + return $persona; |
|
280 | + } |
|
251 | 281 | |
252 | 282 | return self::persona($id ? $id : null); |
253 | 283 | } |
@@ -261,7 +291,9 @@ discard block |
||
261 | 291 | public function personaAttribute(string $id = null) |
262 | 292 | { |
263 | 293 | $persona_attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
264 | - if ($persona_attribute) return $persona_attribute; |
|
294 | + if ($persona_attribute) { |
|
295 | + return $persona_attribute; |
|
296 | + } |
|
265 | 297 | |
266 | 298 | return self::persona($id ? $id : null); |
267 | 299 | } |
@@ -275,7 +307,9 @@ discard block |
||
275 | 307 | public function personaAttributes(string $id = null) |
276 | 308 | { |
277 | 309 | $persona_attribute = new AttributeHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
278 | - if ($persona_attribute) return $persona_attribute; |
|
310 | + if ($persona_attribute) { |
|
311 | + return $persona_attribute; |
|
312 | + } |
|
279 | 313 | |
280 | 314 | return self::persona($id ? $id : null); |
281 | 315 | } |
@@ -289,7 +323,9 @@ discard block |
||
289 | 323 | public function personaIdentifier(string $id = null) |
290 | 324 | { |
291 | 325 | $persona_identifier = new IdentifierHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
292 | - if ($persona_identifier) return $persona_identifier; |
|
326 | + if ($persona_identifier) { |
|
327 | + return $persona_identifier; |
|
328 | + } |
|
293 | 329 | |
294 | 330 | return self::personaIdentifier($id ? $id : null); |
295 | 331 | } |
@@ -303,7 +339,9 @@ discard block |
||
303 | 339 | public function journeys(string $id = null) |
304 | 340 | { |
305 | 341 | $journeys = new JourneyHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
306 | - if ($journeys) return $journeys; |
|
342 | + if ($journeys) { |
|
343 | + return $journeys; |
|
344 | + } |
|
307 | 345 | |
308 | 346 | return self::journeys($id ? $id : null); |
309 | 347 | } |
@@ -317,7 +355,9 @@ discard block |
||
317 | 355 | public function journey(string $id = null) |
318 | 356 | { |
319 | 357 | $journey = new JourneyHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
320 | - if ($journey) return $journey; |
|
358 | + if ($journey) { |
|
359 | + return $journey; |
|
360 | + } |
|
321 | 361 | |
322 | 362 | return self::journey($id ? $id : null); |
323 | 363 | } |
@@ -331,7 +371,9 @@ discard block |
||
331 | 371 | public function journeyProgress(string $id = null) |
332 | 372 | { |
333 | 373 | $journey_progress = new ProgressHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
334 | - if ($journey_progress) return $journey_progress; |
|
374 | + if ($journey_progress) { |
|
375 | + return $journey_progress; |
|
376 | + } |
|
335 | 377 | |
336 | 378 | return self::journeyProgress($id ? $id : null); |
337 | 379 | } |
@@ -345,7 +387,9 @@ discard block |
||
345 | 387 | public function dashboards(string $id = null) |
346 | 388 | { |
347 | 389 | $dashboards = new DashboardHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
348 | - if ($dashboards) return $dashboards; |
|
390 | + if ($dashboards) { |
|
391 | + return $dashboards; |
|
392 | + } |
|
349 | 393 | |
350 | 394 | return self::dashboards($id ? $id : null); |
351 | 395 | } |
@@ -359,7 +403,9 @@ discard block |
||
359 | 403 | public function dashboard(string $id = null) |
360 | 404 | { |
361 | 405 | $dashboard = new DashboardHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
362 | - if ($dashboard) return $dashboard; |
|
406 | + if ($dashboard) { |
|
407 | + return $dashboard; |
|
408 | + } |
|
363 | 409 | |
364 | 410 | return self::dashboard($id ? $id : null); |
365 | 411 | } |
@@ -373,7 +419,9 @@ discard block |
||
373 | 419 | public function downloads(string $id = null) |
374 | 420 | { |
375 | 421 | $downloads = new DownloadHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
376 | - if ($downloads) return $downloads; |
|
422 | + if ($downloads) { |
|
423 | + return $downloads; |
|
424 | + } |
|
377 | 425 | |
378 | 426 | return self::downloads($id ? $id : null); |
379 | 427 | } |
@@ -387,7 +435,9 @@ discard block |
||
387 | 435 | public function download(string $id = null) |
388 | 436 | { |
389 | 437 | $download = new DownloadHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
390 | - if ($download) return $download; |
|
438 | + if ($download) { |
|
439 | + return $download; |
|
440 | + } |
|
391 | 441 | |
392 | 442 | return self::download($id ? $id : null); |
393 | 443 | } |
@@ -401,7 +451,9 @@ discard block |
||
401 | 451 | public function statements(string $id = null) |
402 | 452 | { |
403 | 453 | $statements = new StatementHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
404 | - if ($statements) return $statements; |
|
454 | + if ($statements) { |
|
455 | + return $statements; |
|
456 | + } |
|
405 | 457 | |
406 | 458 | return self::statements($id ? $id : null); |
407 | 459 | } |
@@ -415,7 +467,9 @@ discard block |
||
415 | 467 | public function statement(string $id = null) |
416 | 468 | { |
417 | 469 | $statement = new StatementHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
418 | - if ($statement) return $statement; |
|
470 | + if ($statement) { |
|
471 | + return $statement; |
|
472 | + } |
|
419 | 473 | |
420 | 474 | return self::statement($id ? $id : null); |
421 | 475 | } |
@@ -429,7 +483,9 @@ discard block |
||
429 | 483 | public function statementForwarding(string $id = null) |
430 | 484 | { |
431 | 485 | $statement_forwarding = new ForwardingHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
432 | - if ($statement_forwarding) return $statement_forwarding; |
|
486 | + if ($statement_forwarding) { |
|
487 | + return $statement_forwarding; |
|
488 | + } |
|
433 | 489 | |
434 | 490 | return self::statementForwarding($id ? $id : null); |
435 | 491 | } |
@@ -443,7 +499,9 @@ discard block |
||
443 | 499 | public function organisations(string $id = null) |
444 | 500 | { |
445 | 501 | $organisation = new OrganisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
446 | - if ($organisation) return $organisation; |
|
502 | + if ($organisation) { |
|
503 | + return $organisation; |
|
504 | + } |
|
447 | 505 | |
448 | 506 | return self::organisation($id ? $id : null); |
449 | 507 | } |
@@ -457,7 +515,9 @@ discard block |
||
457 | 515 | public function organisation(string $id = null) |
458 | 516 | { |
459 | 517 | $organisation = new OrganisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
460 | - if ($organisation) return $organisation; |
|
518 | + if ($organisation) { |
|
519 | + return $organisation; |
|
520 | + } |
|
461 | 521 | |
462 | 522 | return self::organisation($id ? $id : null); |
463 | 523 | } |
@@ -471,7 +531,9 @@ discard block |
||
471 | 531 | public function visualisations(string $id = null) |
472 | 532 | { |
473 | 533 | $visualisations = new VisualisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
474 | - if ($visualisations) return $visualisations; |
|
534 | + if ($visualisations) { |
|
535 | + return $visualisations; |
|
536 | + } |
|
475 | 537 | |
476 | 538 | return self::visualisations($id ? $id : null); |
477 | 539 | } |
@@ -485,7 +547,9 @@ discard block |
||
485 | 547 | public function visualisation(string $id = null) |
486 | 548 | { |
487 | 549 | $visualisation = new VisualisationHandler($id ? $id : null, $this->key, $this->secret, $this->url); |
488 | - if ($visualisation) return $visualisation; |
|
550 | + if ($visualisation) { |
|
551 | + return $visualisation; |
|
552 | + } |
|
489 | 553 | |
490 | 554 | return self::visualisation($id ? $id : null); |
491 | 555 | } |