@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Generate a SECRETS_FILE from user input. |
22 | 22 | * |
23 | - * @param scalar $step optional Where are we in the SECRETS_FILE creation workflow? (defaults to SECRETS_NEEDED_STEP -- the beginning) |
|
23 | + * @param integer $step optional Where are we in the SECRETS_FILE creation workflow? (defaults to SECRETS_NEEDED_STEP -- the beginning) |
|
24 | 24 | * |
25 | 25 | * @throws CanvasAPIviaLTI_Installer_Exception If form submission does not contain all required MySQL credentals (host, username, password and database) |
26 | 26 | * @throws CanvasAPIviaLTI_Installer_Exception If SECRETS_FILE cannot be created |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | /** |
262 | 262 | * Obtain a Canvas API token, if needed. |
263 | 263 | * |
264 | - * @param scalar $step optional Where are we in the API token negotiation workflow? (defaults to API_DECISION_NEEDED_STEP -- the beginning) |
|
264 | + * @param integer $step optional Where are we in the API token negotiation workflow? (defaults to API_DECISION_NEEDED_STEP -- the beginning) |
|
265 | 265 | * @param boolean $skip optional Skip this step (defaults to FALSE) |
266 | 266 | * |
267 | 267 | * @throws CanvasAPIviaLTI_Installer_Exception If $step is not a pre-defined *_STEP constant |
@@ -26,6 +26,9 @@ discard block |
||
26 | 26 | private $abstract = null; |
27 | 27 | private $description = null; |
28 | 28 | |
29 | + /** |
|
30 | + * @param \mysqli $sql |
|
31 | + */ |
|
29 | 32 | public function __construct($sql, $path) { |
30 | 33 | |
31 | 34 | if ($sql instanceof \mysqli) { |
@@ -98,6 +101,9 @@ discard block |
||
98 | 101 | } |
99 | 102 | } |
100 | 103 | |
104 | + /** |
|
105 | + * @param string $manifest |
|
106 | + */ |
|
101 | 107 | private function parseManifest($manifest) { |
102 | 108 | $xml = simplexml_load_string(file_get_contents($manifest)); |
103 | 109 | if ($xml === false) { |
@@ -111,6 +117,9 @@ discard block |
||
111 | 117 | $this->parseManifestComponents($xml->components); |
112 | 118 | } |
113 | 119 | |
120 | + /** |
|
121 | + * @param \SimpleXMLElement $xml |
|
122 | + */ |
|
114 | 123 | private function parseManifestMetadata($xml) { |
115 | 124 | $this->required('id', $this->sql->real_escape_string($xml->id)); |
116 | 125 | $this->required('name', $xml->name); |
@@ -247,6 +256,9 @@ discard block |
||
247 | 256 | $this->parseManifestCanvas($components->canvas); |
248 | 257 | } |
249 | 258 | |
259 | + /** |
|
260 | + * @param string $field |
|
261 | + */ |
|
250 | 262 | private function required($field, $value) { |
251 | 263 | if (!empty($value)) { |
252 | 264 | $this->$field = (string) $value; |
@@ -258,6 +270,9 @@ discard block |
||
258 | 270 | } |
259 | 271 | } |
260 | 272 | |
273 | + /** |
|
274 | + * @param string $field |
|
275 | + */ |
|
261 | 276 | private function optional($field, $value) { |
262 | 277 | if (isset($value)) { |
263 | 278 | $this->$field = (string) $value; |
@@ -360,6 +375,9 @@ discard block |
||
360 | 375 | } |
361 | 376 | } |
362 | 377 | |
378 | + /** |
|
379 | + * @param string $table |
|
380 | + */ |
|
363 | 381 | private function clearDb($table, $id, $idKey = 'canvashack') { |
364 | 382 | if (!$this->sql->query(" |
365 | 383 | DELETE FROM `$table` |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * @return string|boolean The API access token for this user, or FALSE if no token has been acquired |
|
94 | + * @return string|false The API access token for this user, or FALSE if no token has been acquired |
|
95 | 95 | **/ |
96 | 96 | public function getToken() { |
97 | 97 | if ($this->token) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
136 | - * @return string|boolean The URL of the API for which the user's API token is valid, or FALSE if no token has been acquired |
|
136 | + * @return string|false The URL of the API for which the user's API token is valid, or FALSE if no token has been acquired |
|
137 | 137 | **/ |
138 | 138 | function getAPIUrl() { |
139 | 139 | if ($this->apiUrl) { |