@@ -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 | } |
@@ -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 |
@@ -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) |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$auth = json_decode(file_get_contents(__DIR__ . '/../phpunit-auth.json'), true); |
|
| 4 | -$findAndReplace = json_decode(file_get_contents(__DIR__ . '/sanitize-values.json'), true); |
|
| 5 | -$fixtures = file_get_contents(__DIR__ . '/fixtures/PhpPulseVCR'); |
|
| 3 | +$auth = json_decode(file_get_contents(__DIR__.'/../phpunit-auth.json'), true); |
|
| 4 | +$findAndReplace = json_decode(file_get_contents(__DIR__.'/sanitize-values.json'), true); |
|
| 5 | +$fixtures = file_get_contents(__DIR__.'/fixtures/PhpPulseVCR'); |
|
| 6 | 6 | |
| 7 | 7 | $sanitized = str_replace($auth['apiToken'], 'YourApiKeyHere', $fixtures); |
| 8 | 8 | |
@@ -11,4 +11,4 @@ discard block |
||
| 11 | 11 | $sanitized = str_replace($key, $value, $sanitized); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -file_put_contents(__DIR__ . '/fixtures/PhpPulseVCR-sanitized', $sanitized); |
|
| 15 | 14 | \ No newline at end of file |
| 15 | +file_put_contents(__DIR__.'/fixtures/PhpPulseVCR-sanitized', $sanitized); |
|
| 16 | 16 | \ No newline at end of file |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | $url = sprintf("%s/%d/columns/%s/text.json", self::apiEndpoint(), $this->board_id, $this->column_id); |
| 57 | 57 | $postParams = array( |
| 58 | 58 | "pulse_id" => $this->pulse_id, |
| 59 | - "text" => (string)$text |
|
| 59 | + "text" => (string) $text |
|
| 60 | 60 | ); |
| 61 | 61 | |
| 62 | 62 | $result = self::sendPut($url, $postParams); |
@@ -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 | * |
@@ -233,6 +233,10 @@ discard block |
||
| 233 | 233 | // Pulse functions |
| 234 | 234 | // ================================================================================================================ |
| 235 | 235 | |
| 236 | + /** |
|
| 237 | + * @param integer $pulseID |
|
| 238 | + * @param string $newName |
|
| 239 | + */ |
|
| 236 | 240 | private static function editPulseNameCall ($pulseID, $newName) |
| 237 | 241 | { |
| 238 | 242 | $editUrl = sprintf("%s/%d.json", self::apiEndpoint(), $pulseID); |
@@ -280,6 +284,9 @@ discard block |
||
| 280 | 284 | $this->assignResults(); |
| 281 | 285 | } |
| 282 | 286 | |
| 287 | + /** |
|
| 288 | + * @param integer $pulseID |
|
| 289 | + */ |
|
| 283 | 290 | private static function archivePulseCall ($pulseID) |
| 284 | 291 | { |
| 285 | 292 | $archiveURL = sprintf("%s/%d.json", self::apiEndpoint(), $pulseID); |
@@ -319,6 +326,9 @@ discard block |
||
| 319 | 326 | $this->assignResults(); |
| 320 | 327 | } |
| 321 | 328 | |
| 329 | + /** |
|
| 330 | + * @param integer $pulseID |
|
| 331 | + */ |
|
| 322 | 332 | private static function deletePulseCall ($pulseID) |
| 323 | 333 | { |
| 324 | 334 | $deleteURL = sprintf("%s/%d.json", self::apiEndpoint(), $pulseID); |
@@ -274,7 +274,7 @@ |
||
| 274 | 274 | * @param string $title |
| 275 | 275 | * @since 0.1.0 |
| 276 | 276 | */ |
| 277 | - public function editName($title) |
|
| 277 | + public function editName ($title) |
|
| 278 | 278 | { |
| 279 | 279 | $this->jsonResponse = self::editPulseNameCall($this->getId(), $title); |
| 280 | 280 | $this->assignResults(); |