| @@ -214,6 +214,7 @@ discard block | ||
| 214 | 214 | * Set the HTTP method for this request. | 
| 215 | 215 | * | 
| 216 | 216 | * @param string | 
| 217 | + * @param string|null $method | |
| 217 | 218 | * | 
| 218 | 219 | * @return FacebookRequest | 
| 219 | 220 | */ | 
| @@ -252,6 +253,7 @@ discard block | ||
| 252 | 253 | * Set the endpoint for this request. | 
| 253 | 254 | * | 
| 254 | 255 | * @param string | 
| 256 | + * @param string|null $endpoint | |
| 255 | 257 | * | 
| 256 | 258 | * @return FacebookRequest | 
| 257 | 259 | * | 
| @@ -511,7 +511,7 @@ discard block | ||
| 511 | 511 | $graphVersion = FacebookUrlManipulator::forceSlashPrefix($this->graphVersion); | 
| 512 | 512 | $endpoint = FacebookUrlManipulator::forceSlashPrefix($this->getEndpoint()); | 
| 513 | 513 | |
| 514 | - $url = $graphVersion . $endpoint; | |
| 514 | + $url = $graphVersion.$endpoint; | |
| 515 | 515 | |
| 516 | 516 |          if ($this->getMethod() !== 'POST') { | 
| 517 | 517 | $params = $this->getParams(); | 
| @@ -529,7 +529,7 @@ discard block | ||
| 529 | 529 | public static function getDefaultHeaders() | 
| 530 | 530 |      { | 
| 531 | 531 | return [ | 
| 532 | - 'User-Agent' => 'fb-php-' . Facebook::VERSION, | |
| 532 | + 'User-Agent' => 'fb-php-'.Facebook::VERSION, | |
| 533 | 533 | 'Accept-Encoding' => '*', | 
| 534 | 534 | ]; | 
| 535 | 535 | } | 
| @@ -213,7 +213,7 @@ | ||
| 213 | 213 | /** | 
| 214 | 214 | * Returns the exception that was thrown for this request. | 
| 215 | 215 | * | 
| 216 | - * @return FacebookSDKException|null | |
| 216 | + * @return FacebookSDKException | |
| 217 | 217 | */ | 
| 218 | 218 | public function getThrownException() | 
| 219 | 219 |      { | 
| @@ -156,7 +156,7 @@ | ||
| 156 | 156 | * @param string $endpoint The endpoint to POST to. | 
| 157 | 157 | * @param array $params The params to send with the request. | 
| 158 | 158 | * | 
| 159 | - * @return array | |
| 159 | + * @return FacebookFile | |
| 160 | 160 | */ | 
| 161 | 161 | private function sendUploadRequest($endpoint, $params = []) | 
| 162 | 162 |      { | 
| @@ -25,7 +25,6 @@ | ||
| 25 | 25 | |
| 26 | 26 | use Facebook\Http\GraphRawResponse; | 
| 27 | 27 | use Facebook\Exceptions\FacebookSDKException; | 
| 28 | - | |
| 29 | 28 | use GuzzleHttp\Client; | 
| 30 | 29 | use GuzzleHttp\Message\ResponseInterface; | 
| 31 | 30 | use GuzzleHttp\Ring\Exception\RingException; | 
| @@ -56,7 +56,7 @@ discard block | ||
| 56 | 56 | 'body' => $body, | 
| 57 | 57 | 'timeout' => $timeOut, | 
| 58 | 58 | 'connect_timeout' => 10, | 
| 59 | - 'verify' => __DIR__ . '/certs/DigiCertHighAssuranceEVRootCA.pem', | |
| 59 | + 'verify' => __DIR__.'/certs/DigiCertHighAssuranceEVRootCA.pem', | |
| 60 | 60 | ]; | 
| 61 | 61 | $request = $this->guzzleClient->createRequest($method, $url, $options); | 
| 62 | 62 | |
| @@ -89,7 +89,7 @@ discard block | ||
| 89 | 89 | $headers = $response->getHeaders(); | 
| 90 | 90 | $rawHeaders = []; | 
| 91 | 91 |          foreach ($headers as $name => $values) { | 
| 92 | -            $rawHeaders[] = $name . ": " . implode(", ", $values); | |
| 92 | +            $rawHeaders[] = $name.": ".implode(", ", $values); | |
| 93 | 93 | } | 
| 94 | 94 | |
| 95 | 95 |          return implode("\r\n", $rawHeaders); | 
| @@ -69,7 +69,7 @@ discard block | ||
| 69 | 69 | /** | 
| 70 | 70 | * Returns the raw signed request data. | 
| 71 | 71 | * | 
| 72 | - * @return string|null | |
| 72 | + * @return string | |
| 73 | 73 | */ | 
| 74 | 74 | public function getRawSignedRequest() | 
| 75 | 75 |      { | 
| @@ -90,7 +90,7 @@ discard block | ||
| 90 | 90 | * Returns a property from the signed request data if available. | 
| 91 | 91 | * | 
| 92 | 92 | * @param string $key | 
| 93 | - * @param mixed|null $default | |
| 93 | + * @param integer $default | |
| 94 | 94 | * | 
| 95 | 95 | * @return mixed|null | 
| 96 | 96 | */ | 
| @@ -139,7 +139,7 @@ | ||
| 139 | 139 | $hashedSig = $this->hashSignature($encodedPayload); | 
| 140 | 140 | $encodedSig = $this->base64UrlEncode($hashedSig); | 
| 141 | 141 | |
| 142 | - return $encodedSig . '.' . $encodedPayload; | |
| 142 | + return $encodedSig.'.'.$encodedPayload; | |
| 143 | 143 | } | 
| 144 | 144 | |
| 145 | 145 | /** | 
| @@ -34,7 +34,7 @@ | ||
| 34 | 34 | * Remove params from a URL. | 
| 35 | 35 | * | 
| 36 | 36 | * @param string $url The URL to filter. | 
| 37 | - * @param array $paramsToFilter The params to filter from the URL. | |
| 37 | + * @param string[] $paramsToFilter The params to filter from the URL. | |
| 38 | 38 | * | 
| 39 | 39 | * @return string The URL with the params removed. | 
| 40 | 40 | */ | 
| @@ -53,17 +53,17 @@ discard block | ||
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 |              if (count($params) > 0) { | 
| 56 | - $query = '?' . http_build_query($params, null, '&'); | |
| 56 | + $query = '?'.http_build_query($params, null, '&'); | |
| 57 | 57 | } | 
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | - $scheme = isset($parts['scheme']) ? $parts['scheme'] . '://' : ''; | |
| 60 | + $scheme = isset($parts['scheme']) ? $parts['scheme'].'://' : ''; | |
| 61 | 61 | $host = isset($parts['host']) ? $parts['host'] : ''; | 
| 62 | - $port = isset($parts['port']) ? ':' . $parts['port'] : ''; | |
| 62 | + $port = isset($parts['port']) ? ':'.$parts['port'] : ''; | |
| 63 | 63 | $path = isset($parts['path']) ? $parts['path'] : ''; | 
| 64 | - $fragment = isset($parts['fragment']) ? '#' . $parts['fragment'] : ''; | |
| 64 | + $fragment = isset($parts['fragment']) ? '#'.$parts['fragment'] : ''; | |
| 65 | 65 | |
| 66 | - return $scheme . $host . $port . $path . $query . $fragment; | |
| 66 | + return $scheme.$host.$port.$path.$query.$fragment; | |
| 67 | 67 | } | 
| 68 | 68 | |
| 69 | 69 | /** | 
| @@ -81,7 +81,7 @@ discard block | ||
| 81 | 81 | } | 
| 82 | 82 | |
| 83 | 83 |          if (strpos($url, '?') === false) { | 
| 84 | - return $url . '?' . http_build_query($newParams, null, '&'); | |
| 84 | + return $url.'?'.http_build_query($newParams, null, '&'); | |
| 85 | 85 | } | 
| 86 | 86 | |
| 87 | 87 |          list($path, $query) = explode('?', $url, 2); | 
| @@ -94,7 +94,7 @@ discard block | ||
| 94 | 94 | // Sort for a predicable order | 
| 95 | 95 | ksort($newParams); | 
| 96 | 96 | |
| 97 | - return $path . '?' . http_build_query($newParams, null, '&'); | |
| 97 | + return $path.'?'.http_build_query($newParams, null, '&'); | |
| 98 | 98 | } | 
| 99 | 99 | |
| 100 | 100 | /** | 
| @@ -150,7 +150,7 @@ discard block | ||
| 150 | 150 | return $string; | 
| 151 | 151 | } | 
| 152 | 152 | |
| 153 | - return strpos($string, '/') === 0 ? $string : '/' . $string; | |
| 153 | + return strpos($string, '/') === 0 ? $string : '/'.$string; | |
| 154 | 154 | } | 
| 155 | 155 | |
| 156 | 156 | /** | 
| @@ -162,6 +162,6 @@ discard block | ||
| 162 | 162 | */ | 
| 163 | 163 | public static function baseGraphUrlEndpoint($urlToTrim) | 
| 164 | 164 |      { | 
| 165 | -        return '/' . preg_replace('/^https:\/\/.+\.facebook\.com(\/v.+?)?\//', '', $urlToTrim); | |
| 165 | +        return '/'.preg_replace('/^https:\/\/.+\.facebook\.com(\/v.+?)?\//', '', $urlToTrim); | |
| 166 | 166 | } | 
| 167 | 167 | } | 
| @@ -55,7 +55,7 @@ discard block | ||
| 55 | 55 | public function __construct($headers, $body, $httpStatusCode = null) | 
| 56 | 56 |      { | 
| 57 | 57 |          if (is_numeric($httpStatusCode)) { | 
| 58 | - $this->httpResponseCode = (int)$httpStatusCode; | |
| 58 | + $this->httpResponseCode = (int) $httpStatusCode; | |
| 59 | 59 | } | 
| 60 | 60 | |
| 61 | 61 |          if (is_array($headers)) { | 
| @@ -105,7 +105,7 @@ discard block | ||
| 105 | 105 | public function setHttpResponseCodeFromHeader($rawResponseHeader) | 
| 106 | 106 |      { | 
| 107 | 107 |          preg_match('|HTTP/\d\.\d\s+(\d+)\s+.*|', $rawResponseHeader, $match); | 
| 108 | - $this->httpResponseCode = (int)$match[1]; | |
| 108 | + $this->httpResponseCode = (int) $match[1]; | |
| 109 | 109 | } | 
| 110 | 110 | |
| 111 | 111 | /** | 
| @@ -128,7 +128,7 @@ | ||
| 128 | 128 | */ | 
| 129 | 129 | public function asArray() | 
| 130 | 130 |      { | 
| 131 | -        return array_map(function ($value) { | |
| 131 | +        return array_map(function($value) { | |
| 132 | 132 | return $value instanceof Collection ? $value->asArray() : $value; | 
| 133 | 133 | }, $this->items); | 
| 134 | 134 | } | 
| @@ -84,7 +84,7 @@ | ||
| 84 | 84 |      { | 
| 85 | 85 | $items = $this->asArray(); | 
| 86 | 86 | |
| 87 | -        return array_map(function ($v) { | |
| 87 | +        return array_map(function($v) { | |
| 88 | 88 |              if ($v instanceof \DateTime) { | 
| 89 | 89 | return $v->format(\DateTime::ISO8601); | 
| 90 | 90 | } |