Skip to content

Commit

Permalink
type hiunting
Browse files Browse the repository at this point in the history
  • Loading branch information
ksvirkou-hubspot committed Dec 17, 2021
1 parent 0772208 commit cd14454
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Factory
* @param array $clientOptions options to be send with each request
* @param bool $wrapResponse wrap request response in own Response object
*/
public function __construct(array $config = [], Client $client = null, array $clientOptions = [], $wrapResponse = true)
public function __construct(array $config = [], Client $client = null, array $clientOptions = [], bool $wrapResponse = true)
{
if (is_null($client)) {
$client = new Client($config, null, $clientOptions, $wrapResponse);
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function __construct(array $config = [], $client = null, array $clientOpt
*
* @return ResponseInterface|\SevenShores\Hubspot\Http\Response
*/
public function request($method, $endpoint, array $options = [], $query_string = null, $requires_auth = true)
public function request(string $method, string $endpoint, array $options = [], $query_string = null, bool $requires_auth = true)
{
if ($requires_auth && empty($this->key)) {
throw new InvalidArgument('You must provide a Hubspot api key or token.');
Expand Down Expand Up @@ -127,7 +127,7 @@ public function request($method, $endpoint, array $options = [], $query_string =
*
* @return string
*/
protected function generateUrl($endpoint, $query_string = null, $requires_auth = true)
protected function generateUrl(string $endpoint, $query_string = null, $requires_auth = true)
{
$url = $endpoint.'?';

Expand Down
4 changes: 1 addition & 3 deletions src/Utils/OAuth2.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ class OAuth2
* @param string $redirectURI The URL that you want the visitor redirected to after granting access to your app. For security reasons, this URL must use https.
* @param array $scopesArray a set of scopes that your app will need access to
* @param array $optionalScopesArray a set of optional scopes that your app will need access to
*
* @return string
*/
public static function getAuthUrl($clientId, $redirectURI, array $scopesArray = [], array $optionalScopesArray = [])
public static function getAuthUrl($clientId, $redirectURI, array $scopesArray = [], array $optionalScopesArray = []): string
{
return self::AUTHORIZE_URL.'?'.http_build_query([
'client_id' => $clientId,
Expand Down
4 changes: 1 addition & 3 deletions src/Utils/Webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ class Webhooks
* @param string $signature hubspot signarute
* @param string $secret the Secret of your app
* @param string $requestBody a set of scopes that your app will need access to
*
* @return bool
*/
public static function isHubspotSignatureValid($signature, $secret, $requestBody)
public static function isHubspotSignatureValid($signature, $secret, $requestBody): bool
{
return $signature == hash('sha256', $secret.$requestBody);
}
Expand Down

0 comments on commit cd14454

Please sign in to comment.