@@ -69,6 +69,9 @@ |
||
69 | 69 | $this->deletedObject = true; |
70 | 70 | } |
71 | 71 | |
72 | + /** |
|
73 | + * @param string $field |
|
74 | + */ |
|
72 | 75 | private function editField ($field, $value) |
73 | 76 | { |
74 | 77 | $this->checkInvalid(); |
@@ -233,7 +233,7 @@ |
||
233 | 233 | * |
234 | 234 | * @throws \allejo\DaPulse\Exceptions\CurlException If cURL is misconfigured or encounters an error |
235 | 235 | * |
236 | - * @return mixed |
|
236 | + * @return string |
|
237 | 237 | */ |
238 | 238 | private function executeCurl () |
239 | 239 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function __construct ($url, $urlParams) |
58 | 58 | { |
59 | - $this->url = $url . "?" . self::formatParameters($urlParams); |
|
59 | + $this->url = $url."?".self::formatParameters($urlParams); |
|
60 | 60 | $this->cURL = curl_init(); |
61 | 61 | |
62 | 62 | $this->configureCurl(); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | curl_setopt_array($this->cURL, array( |
91 | 91 | CURLOPT_HTTPAUTH => CURLAUTH_BASIC, |
92 | - CURLOPT_USERPWD => $username . ":" . $password |
|
92 | + CURLOPT_USERPWD => $username.":".$password |
|
93 | 93 | )); |
94 | 94 | } |
95 | 95 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | continue; |
310 | 310 | } |
311 | 311 | |
312 | - $parameters[] = rawurlencode($key) . "=" . rawurlencode($value); |
|
312 | + $parameters[] = rawurlencode($key)."=".rawurlencode($value); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | return implode("&", $parameters); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | return (isset($this->apiToken)); |
26 | 26 | } |
27 | 27 | |
28 | - public function getApiToken() |
|
28 | + public function getApiToken () |
|
29 | 29 | { |
30 | 30 | return $this->apiToken; |
31 | 31 | } |
@@ -337,7 +337,7 @@ |
||
337 | 337 | * |
338 | 338 | * @return PulseUpdate |
339 | 339 | */ |
340 | - public static function createUpdate ($user, $pulse, $text, $announceToAll = NULL) |
|
340 | + public static function createUpdate ($user, $pulse, $text, $announceToAll = null) |
|
341 | 341 | { |
342 | 342 | if ($user instanceof PulseUser) |
343 | 343 | { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * |
299 | 299 | * @since 0.3.0 Previously was available as 'getHasAssets()' |
300 | 300 | * |
301 | - * @return bool |
|
301 | + * @return string |
|
302 | 302 | */ |
303 | 303 | public function hasAssets () |
304 | 304 | { |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | * @api |
410 | 410 | * |
411 | 411 | * @param int|PulseUser $user The author of this post |
412 | - * @param int|Pulse $pulse The Pulse to whom this update will belong to |
|
412 | + * @param integer $pulse The Pulse to whom this update will belong to |
|
413 | 413 | * @param string $text The content of the update |
414 | 414 | * @param null|bool $announceToAll Whether or not to announce this update to everyone's wall |
415 | 415 | * |
@@ -175,7 +175,7 @@ |
||
175 | 175 | * |
176 | 176 | * @param null|string $title The new title of the note |
177 | 177 | * @param null|string $content The new content of the note |
178 | - * @param null|int|PulseUser $userId The new author of the note |
|
178 | + * @param string $userId The new author of the note |
|
179 | 179 | * @param null|bool $createUpdate Whether to create an update or not |
180 | 180 | * |
181 | 181 | * @since 0.1.0 |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * |
186 | 186 | * @return $this |
187 | 187 | */ |
188 | - public function editNote ($title = NULL, $content = NULL, $userId = NULL, $createUpdate = NULL) |
|
188 | + public function editNote ($title = null, $content = null, $userId = null, $createUpdate = null) |
|
189 | 189 | { |
190 | 190 | $this->checkInvalid(); |
191 | 191 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function editContent ($content) |
255 | 255 | { |
256 | - return $this->editNote(NULL, $content); |
|
256 | + return $this->editNote(null, $content); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | */ |
274 | 274 | public function editAuthor ($userId) |
275 | 275 | { |
276 | - return $this->editNote(NULL, NULL, $userId); |
|
276 | + return $this->editNote(null, null, $userId); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | */ |
406 | 406 | final protected static function sendDelete ($url, $getParams = array()) |
407 | 407 | { |
408 | - return self::sendRequest("DELETE", $url, NULL, $getParams); |
|
408 | + return self::sendRequest("DELETE", $url, null, $getParams); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * |
457 | 457 | * @return string The base URL to call |
458 | 458 | */ |
459 | - final protected static function apiEndpoint ($apiPrefix = NULL) |
|
459 | + final protected static function apiEndpoint ($apiPrefix = null) |
|
460 | 460 | { |
461 | 461 | $apiSection = isset($apiPrefix) ? $apiPrefix : static::API_PREFIX; |
462 | 462 |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | if (is_null($idOrArray)) |
108 | 108 | { |
109 | - throw new \InvalidArgumentException("You may not initialize " . $staticClass . " with null."); |
|
109 | + throw new \InvalidArgumentException("You may not initialize ".$staticClass." with null."); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | if (!is_array($idOrArray)) |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | if ($this->arrayConstructionOnly && !is_array($idOrArray)) |
118 | 118 | { |
119 | - throw new \InvalidArgumentException("A " . $staticClass . " cannot be fetched from an ID."); |
|
119 | + throw new \InvalidArgumentException("A ".$staticClass." cannot be fetched from an ID."); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | $this->jsonResponse = (is_array($idOrArray)) ? $idOrArray : $this::sendGet($urlEndPoint); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * {@inheritdoc} |
130 | 130 | */ |
131 | - public function jsonSerialize() |
|
131 | + public function jsonSerialize () |
|
132 | 132 | { |
133 | 133 | return $this->jsonResponse; |
134 | 134 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | { |
273 | 273 | if (self::lazyCastNeeded($target, $objectType)) |
274 | 274 | { |
275 | - $object = ($objectType[0] == "\\") ? $objectType : self::OBJ_NAMESPACE . $objectType; |
|
275 | + $object = ($objectType[0] == "\\") ? $objectType : self::OBJ_NAMESPACE.$objectType; |
|
276 | 276 | $target = new $object($target); |
277 | 277 | } |
278 | 278 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | */ |
307 | 307 | final protected static function lazyCastNeeded ($target, $objectType) |
308 | 308 | { |
309 | - $objectDefinition = ($objectType[0] === "\\") ? $objectType : self::OBJ_NAMESPACE . $objectType; |
|
309 | + $objectDefinition = ($objectType[0] === "\\") ? $objectType : self::OBJ_NAMESPACE.$objectType; |
|
310 | 310 | |
311 | 311 | return !($target instanceof $objectDefinition); |
312 | 312 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | */ |
344 | 344 | final protected static function castArrayToObjectArray ($className, $objects) |
345 | 345 | { |
346 | - $class = self::OBJ_NAMESPACE . $className; |
|
346 | + $class = self::OBJ_NAMESPACE.$className; |
|
347 | 347 | $array = array(); |
348 | 348 | |
349 | 349 | foreach ($objects as $post) |
@@ -289,7 +289,9 @@ |
||
289 | 289 | */ |
290 | 290 | final protected static function lazyCastNeededOnArray ($objectType, $array) |
291 | 291 | { |
292 | - if (is_array($array) && count($array) == 0) { return false; } |
|
292 | + if (is_array($array) && count($array) == 0) |
|
293 | + { |
|
294 | +return false; } |
|
293 | 295 | |
294 | 296 | $firstItem = $array[0]; |
295 | 297 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | * |
59 | 59 | * @since 0.1.0 |
60 | 60 | */ |
61 | - public function addSubscriber ($userId, $asAdmin = NULL) |
|
61 | + public function addSubscriber ($userId, $asAdmin = null) |
|
62 | 62 | { |
63 | 63 | if ($userId instanceof PulseUser) |
64 | 64 | { |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $this->deletedObject = true; |
255 | 255 | } |
256 | 256 | |
257 | - public function duplicatePulse ($groupId = NULL, $ownerId = NULL) |
|
257 | + public function duplicatePulse ($groupId = null, $ownerId = null) |
|
258 | 258 | { |
259 | 259 | $url = sprintf("%s/%s/pulses/%s/duplicate.json", self::apiEndpoint("boards"), $this->getBoardId(), $this->getId()); |
260 | 260 | $postParams = array(); |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | * @since 0.1.0 |
499 | 499 | * @return PulseNote |
500 | 500 | */ |
501 | - public function addNote ($title, $content, $ownersOnly = false, $userId = NULL, $createUpdate = false) |
|
501 | + public function addNote ($title, $content, $ownersOnly = false, $userId = null, $createUpdate = false) |
|
502 | 502 | { |
503 | 503 | $url = sprintf($this->urlSyntax, self::apiEndpoint(), $this->id, "notes"); |
504 | 504 | $postParams = array( |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | * |
565 | 565 | * @since 0.1.0 |
566 | 566 | */ |
567 | - public function createUpdate ($user, $text, $announceToAll = NULL) |
|
567 | + public function createUpdate ($user, $text, $announceToAll = null) |
|
568 | 568 | { |
569 | 569 | PulseUpdate::createUpdate($user, $this->getId(), $text, $announceToAll); |
570 | 570 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @param string $title |
245 | 245 | * @since 0.1.0 |
246 | 246 | */ |
247 | - public function editName($title) |
|
247 | + public function editName ($title) |
|
248 | 248 | { |
249 | 249 | $editUrl = sprintf("%s/%d.json", self::apiEndpoint(), $this->getId()); |
250 | 250 | $postParams = array( |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * @api |
264 | 264 | * @since 0.1.0 |
265 | 265 | */ |
266 | - public function archivePulse() |
|
266 | + public function archivePulse () |
|
267 | 267 | { |
268 | 268 | $archiveURL = sprintf("%s/%d.json", self::apiEndpoint(), $this->getId()); |
269 | 269 | $getParams = array( |
@@ -418,7 +418,6 @@ |
||
418 | 418 | * @param string $columnId The ID of the column to access. This is typically a slugified version of the column name |
419 | 419 | * |
420 | 420 | * @since 0.1.0 |
421 | - |
|
422 | 421 | * @throws ColumnNotFoundException The specified column ID does not exist for this Pulse |
423 | 422 | * @throws InvalidColumnException The specified column is not a "text" type column |
424 | 423 | * @throws InvalidObjectException The specified column exists but modification of its value is unsupported either |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * |
292 | 292 | * @return PulseGroup[] |
293 | 293 | */ |
294 | - public function getGroups ($showArchived = NULL) |
|
294 | + public function getGroups ($showArchived = null) |
|
295 | 295 | { |
296 | 296 | $url = sprintf("%s/%d/groups.json", self::apiEndpoint(), $this->getId()); |
297 | 297 | $params = array(); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | * |
382 | 382 | * @return \allejo\DaPulse\Pulse |
383 | 383 | */ |
384 | - public function createPulse ($name, $owner, $groupId = NULL, $updateText = NULL, $announceToAll = NULL) |
|
384 | + public function createPulse ($name, $owner, $groupId = null, $updateText = null, $announceToAll = null) |
|
385 | 385 | { |
386 | 386 | if ($owner instanceof PulseUser) |
387 | 387 | { |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | $this->deletedObject = true; |
429 | 429 | } |
430 | 430 | |
431 | - public static function createBoard ($name, $userId, $description = NULL) |
|
431 | + public static function createBoard ($name, $userId, $description = null) |
|
432 | 432 | { |
433 | 433 | $url = sprintf("%s.json", self::apiEndpoint()); |
434 | 434 | $postParams = array( |