Skip to content

Commit

Permalink
Merge pull request #252 from HubSpot/feature/fixRequestOnPhp7.3
Browse files Browse the repository at this point in the history
Fix request on php7.3 and cs fix
  • Loading branch information
ksvirkou-hubspot authored Jun 8, 2023
2 parents 6fed8cb + eb3cf73 commit ac47b9a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
3 changes: 0 additions & 3 deletions lib/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
*/
class Factory
{
/**
* @param array $config
*/
public static function create(ClientInterface $client = null, Config $config = null): Discovery
{
return new Discovery($client ?: new Client(), $config ?: new Config());
Expand Down
27 changes: 20 additions & 7 deletions lib/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,27 @@

class Request
{
protected array $options = [];
protected string $baseUrl = 'https://api.hubapi.com';
/** @var array */
protected $options = [];

/** @var string */
protected $baseUrl = 'https://api.hubapi.com';
protected $body;
protected Config $config;
protected bool $defaultJson = true;
protected string $url;
protected string $method;
protected array $headers = [];

/** @var Config */
protected $config;

/** @var bool */
protected $defaultJson = true;

/** @var string */
protected $url;

/** @var string */
protected $method;

/** @var array */
protected $headers = [];

public function __construct(Config $config, array $options = [])
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Utils/OAuth2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function buildAuthorizationUrl()
['contacts', 'timeline'],
['scope1', 'scope2']
);

$this->assertSame(
'https://app.hubspot.com/oauth/authorize?client_id=clientid&redirect_uri=http%3A%2F%2Flocalhost&scope=contacts%20timeline&optional_scope=scope1%20scope2',
$authUrl
Expand All @@ -34,6 +35,7 @@ public function buildAuthorizationUrlWithEmptyOptionalScope()
'http://localhost',
['contacts', 'timeline']
);

$this->assertSame(
'https://app.hubspot.com/oauth/authorize?client_id=clientid&redirect_uri=http%3A%2F%2Flocalhost&scope=contacts%20timeline',
$authUrl
Expand Down

0 comments on commit ac47b9a

Please sign in to comment.