1 | <?php |
||
15 | class OAuthProxy |
||
16 | { |
||
17 | /** |
||
18 | * @var OAuthClientEntity |
||
19 | */ |
||
20 | protected $oauthClient; |
||
21 | |||
22 | /** |
||
23 | * @var Client |
||
24 | */ |
||
25 | protected $clientHttp; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $proxyUrl; |
||
31 | |||
32 | /** |
||
33 | * Construct |
||
34 | * |
||
35 | * @param OAuthClientEntity $oauthClient OAuth Client Entity |
||
36 | * @param Client $clientHttp Client Http |
||
37 | */ |
||
38 | 5 | public function __construct(OAuthClientEntity $oauthClient, Client $clientHttp) |
|
44 | |||
45 | /** |
||
46 | * Attempt Login Password |
||
47 | * |
||
48 | * @param string $client_id Client Id |
||
49 | * @param array $credentials Credentials |
||
50 | * |
||
51 | * @return Response |
||
52 | */ |
||
53 | 3 | public function attemptLogin($client_id, array $credentials) |
|
57 | |||
58 | /** |
||
59 | * Attempt Refresh Token |
||
60 | * |
||
61 | * @param string $client_id Client Id |
||
62 | * @param array $credentials Credentials |
||
63 | * |
||
64 | * @return Response |
||
65 | */ |
||
66 | 1 | public function attemptRefresh($client_id, array $credentials) |
|
70 | |||
71 | /** |
||
72 | * Proxy |
||
73 | * |
||
74 | * @param string $grantType String Grant Type |
||
75 | * @param string $client_id String Client Id |
||
76 | * @param array $data Array Data |
||
77 | * |
||
78 | * @return Response |
||
79 | */ |
||
80 | 4 | private function proxy($grantType, $client_id, array $data = array()) |
|
102 | |||
103 | /** |
||
104 | * Get Client Secret |
||
105 | * |
||
106 | * @param string $client_id Client Id |
||
107 | * @return string |
||
108 | */ |
||
109 | 4 | private function getClientSecret($client_id) |
|
119 | |||
120 | /** |
||
121 | * Parse Response |
||
122 | * |
||
123 | * @param ResponseInterface $guzzleResponse |
||
124 | * @return string |
||
125 | */ |
||
126 | 4 | private function parseResponse(ResponseInterface $guzzleResponse) |
|
139 | } |
||
140 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: