1 | <?php namespace Pizdata\OAuth2\Client\Provider; |
||
8 | class Shopify extends AbstractProvider |
||
9 | { |
||
10 | /** |
||
11 | * Production Shopify domain. |
||
12 | * |
||
13 | * @const string |
||
14 | */ |
||
15 | const BASE_SHOPIFY_DOMAIN = 'myshopify.com'; |
||
16 | |||
17 | /** |
||
18 | * The store name. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | public $store = ''; |
||
23 | |||
24 | /** |
||
25 | * @param array $options |
||
26 | * @param array $collaborators |
||
27 | * |
||
28 | * @throws \InvalidArgumentException |
||
29 | */ |
||
30 | 9 | public function __construct($options = [], array $collaborators = []) |
|
41 | |||
42 | /** |
||
43 | * Get authorization url to begin OAuth flow |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | 6 | public function getBaseAuthorizationUrl() |
|
51 | |||
52 | /** |
||
53 | * Get access token url to retrieve token |
||
54 | * |
||
55 | * @param array $params |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | 3 | public function getBaseAccessTokenUrl(array $params) |
|
63 | |||
64 | /** |
||
65 | * Get provider url to fetch user details |
||
66 | * |
||
67 | * @param AccessToken $token |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
72 | { |
||
73 | return sprintf('https://%s.%s/admin/shop.json?access_token=%s', $this->store, self::BASE_SHOPIFY_DOMAIN, $token->getToken()); |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * Get the default scopes used by this provider. |
||
78 | * |
||
79 | * @link https://help.shopify.com/api/getting-started/authentication/oauth#scopes |
||
80 | * @return array |
||
81 | */ |
||
82 | 6 | protected function getDefaultScopes() |
|
89 | |||
90 | /** |
||
91 | * Check a provider response for errors. |
||
92 | * |
||
93 | * @throws IdentityProviderException |
||
94 | * @param ResponseInterface $response |
||
95 | * @param array $data |
||
96 | * @return void |
||
97 | */ |
||
98 | protected function checkResponse(ResponseInterface $response, $data) |
||
108 | |||
109 | /** |
||
110 | * Generate a user object from a successful user details request. |
||
111 | * |
||
112 | * @param array $response |
||
113 | * @param AccessToken $token |
||
114 | * @return League\OAuth2\Client\Provider\ResourceOwnerInterface |
||
115 | */ |
||
116 | protected function createResourceOwner(array $response, AccessToken $token) |
||
122 | } |
||
123 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: