Skip to content

Commit 69c0c34

Browse files
authored
Normalize all getAuthUrl and getTokenUrl methods (#1281)
1 parent cec0ac4 commit 69c0c34

File tree

229 files changed

+532
-2156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+532
-2156
lines changed

src/Acclaim/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,12 @@ class Provider extends AbstractProvider
1010
{
1111
public const IDENTIFIER = 'ACCLAIM';
1212

13-
/**
14-
* {@inheritdoc}
15-
*/
16-
protected function getAuthUrl($state)
13+
protected function getAuthUrl($state): string
1714
{
1815
return $this->buildAuthUrlFromBase('https://api.youracclaim.com/oauth/authorize', $state);
1916
}
2017

21-
/**
22-
* {@inheritdoc}
23-
*/
24-
protected function getTokenUrl()
18+
protected function getTokenUrl(): string
2519
{
2620
return 'https://api.youracclaim.com/oauth/token';
2721
}

src/Admitad/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,12 @@ class Provider extends AbstractProvider
1414

1515
protected $scopeSeparator = ' ';
1616

17-
/**
18-
* {@inheritdoc}
19-
*/
20-
protected function getAuthUrl($state)
17+
protected function getAuthUrl($state): string
2118
{
2219
return $this->buildAuthUrlFromBase('https://api.admitad.com/authorize/', $state);
2320
}
2421

25-
/**
26-
* {@inheritdoc}
27-
*/
28-
protected function getTokenUrl()
22+
protected function getTokenUrl(): string
2923
{
3024
return 'https://api.admitad.com/token/';
3125
}

src/Aikido/Provider.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ class Provider extends AbstractProvider
1010
{
1111
public const IDENTIFIER = 'AIKIDO';
1212

13-
/**
14-
* {@inheritdoc}
15-
*/
1613
protected function getAuthUrl($state): string
1714
{
1815
return $this->buildAuthUrlFromBase('https://app.aikido.dev/oauth/authorize', $state);
1916
}
2017

21-
/**
22-
* {@inheritdoc}
23-
*/
2418
protected function getTokenUrl(): string
2519
{
2620
return 'https://app.aikido.dev/api/oauth/token';

src/Amazon/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,12 @@ class Provider extends AbstractProvider
1212

1313
protected $scopes = ['profile'];
1414

15-
/**
16-
* {@inheritdoc}
17-
*/
18-
protected function getAuthUrl($state)
15+
protected function getAuthUrl($state): string
1916
{
2017
return $this->buildAuthUrlFromBase('https://www.amazon.com/ap/oa', $state);
2118
}
2219

23-
/**
24-
* {@inheritdoc}
25-
*/
26-
protected function getTokenUrl()
20+
protected function getTokenUrl(): string
2721
{
2822
return 'https://api.amazon.com/auth/o2/token';
2923
}

src/AmoCRM/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,12 @@ public function getTld()
4444
return $tld;
4545
}
4646

47-
/**
48-
* {@inheritDoc}
49-
*/
50-
protected function getAuthUrl($state)
47+
protected function getAuthUrl($state): string
5148
{
5249
return $this->buildAuthUrlFromBase("{$this->getBaseUrl()}/oauth", $state);
5350
}
5451

55-
/**
56-
* {@inheritDoc}
57-
*/
58-
protected function getTokenUrl()
52+
protected function getTokenUrl(): string
5953
{
6054
$domain = $this->request->get('referer');
6155

src/AngelList/Provider.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,12 @@ class Provider extends AbstractProvider
1010
{
1111
public const IDENTIFIER = 'ANGELLIST';
1212

13-
/**
14-
* {@inheritdoc}
15-
*/
16-
protected function getAuthUrl($state)
13+
protected function getAuthUrl($state): string
1714
{
18-
return $this->buildAuthUrlFromBase(
19-
'https://angel.co/api/oauth/authorize',
20-
$state
21-
);
15+
return $this->buildAuthUrlFromBase('https://angel.co/api/oauth/authorize', $state);
2216
}
2317

24-
/**
25-
* {@inheritdoc}
26-
*/
27-
protected function getTokenUrl()
18+
protected function getTokenUrl(): string
2819
{
2920
return 'https://angel.co/api/oauth/token';
3021
}

src/AppNet/Provider.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,12 @@ class Provider extends AbstractProvider
1010
{
1111
public const IDENTIFIER = 'APPNET';
1212

13-
/**
14-
* {@inheritdoc}
15-
*/
16-
protected function getAuthUrl($state)
13+
protected function getAuthUrl($state): string
1714
{
18-
return $this->buildAuthUrlFromBase(
19-
'https://account.app.net/oauth/authorize',
20-
$state
21-
);
15+
return $this->buildAuthUrlFromBase('https://account.app.net/oauth/authorize', $state);
2216
}
2317

24-
/**
25-
* {@inheritdoc}
26-
*/
27-
protected function getTokenUrl()
18+
protected function getTokenUrl(): string
2819
{
2920
return 'https://account.app.net/oauth/access_token';
3021
}

src/Apple/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,12 @@ class Provider extends AbstractProvider
3838

3939
protected $scopeSeparator = ' ';
4040

41-
/**
42-
* {@inheritdoc}
43-
*/
44-
protected function getAuthUrl($state)
41+
protected function getAuthUrl($state): string
4542
{
4643
return $this->buildAuthUrlFromBase(self::URL.'/auth/authorize', $state);
4744
}
4845

49-
/**
50-
* {@inheritdoc}
51-
*/
52-
protected function getTokenUrl()
46+
protected function getTokenUrl(): string
5347
{
5448
return self::URL.'/auth/token';
5549
}

src/ArcGIS/Provider.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,12 @@ protected function getBaseUrl()
1818
return 'https://'.$this->getServerHost().$port.$subdirectory;
1919
}
2020

21-
/**
22-
* {@inheritdoc}
23-
*/
24-
protected function getAuthUrl($state)
21+
protected function getAuthUrl($state): string
2522
{
26-
return $this->buildAuthUrlFromBase(
27-
$this->getBaseUrl().'/sharing/rest/oauth2/authorize',
28-
$state
29-
);
23+
return $this->buildAuthUrlFromBase($this->getBaseUrl().'/sharing/rest/oauth2/authorize', $state);
3024
}
3125

32-
/**
33-
* {@inheritdoc}
34-
*/
35-
protected function getTokenUrl()
26+
protected function getTokenUrl(): string
3627
{
3728
return $this->getBaseUrl().'/sharing/rest/oauth2/token';
3829
}

src/Asana/Provider.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,12 @@ class Provider extends AbstractProvider
1010
{
1111
public const IDENTIFIER = 'ASANA';
1212

13-
/**
14-
* {@inheritdoc}
15-
*/
16-
protected function getAuthUrl($state)
13+
protected function getAuthUrl($state): string
1714
{
18-
return $this->buildAuthUrlFromBase(
19-
'https://app.asana.com/-/oauth_authorize',
20-
$state
21-
);
15+
return $this->buildAuthUrlFromBase('https://app.asana.com/-/oauth_authorize', $state);
2216
}
2317

24-
/**
25-
* {@inheritdoc}
26-
*/
27-
protected function getTokenUrl()
18+
protected function getTokenUrl(): string
2819
{
2920
return 'https://app.asana.com/-/oauth_token';
3021
}

src/Atlassian/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@ class Provider extends AbstractProvider
2222

2323
protected $scopeSeparator = ' ';
2424

25-
/**
26-
* {@inheritdoc}
27-
*/
28-
protected function getAuthUrl($state)
25+
protected function getAuthUrl($state): string
2926
{
3027
return $this->buildAuthUrlFromBase('https://auth.atlassian.com/authorize', $state);
3128
}
3229

33-
/**
34-
* {@inheritdoc}
35-
*/
36-
protected function getTokenUrl()
30+
protected function getTokenUrl(): string
3731
{
3832
return 'https://auth.atlassian.com/oauth/token';
3933
}

src/Auth0/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,12 @@ public static function additionalConfigKeys(): array
2929
return ['base_url'];
3030
}
3131

32-
/**
33-
* {@inheritdoc}
34-
*/
35-
protected function getAuthUrl($state)
32+
protected function getAuthUrl($state): string
3633
{
3734
return $this->buildAuthUrlFromBase($this->getAuth0Url().'/authorize', $state);
3835
}
3936

40-
/**
41-
* {@inheritdoc}
42-
*/
43-
protected function getTokenUrl()
37+
protected function getTokenUrl(): string
4438
{
4539
return $this->getAuth0Url().'/oauth/token';
4640
}

src/Authentik/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,12 @@ protected function getBaseUrl()
2828
return rtrim($baseurl, '/');
2929
}
3030

31-
/**
32-
* {@inheritdoc}
33-
*/
34-
protected function getAuthUrl($state)
31+
protected function getAuthUrl($state): string
3532
{
3633
return $this->buildAuthUrlFromBase($this->getBaseUrl().'/application/o/authorize/', $state);
3734
}
3835

39-
/**
40-
* {@inheritdoc}
41-
*/
42-
protected function getTokenUrl()
36+
protected function getTokenUrl(): string
4337
{
4438
return $this->getBaseUrl().'/application/o/token/';
4539
}

src/AutodeskAPS/Provider.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ class Provider extends AbstractProvider
1212

1313
protected $scopeSeparator = ' ';
1414

15-
/**
16-
* {@inheritdoc}
17-
*/
1815
protected function getAuthUrl($state): string
1916
{
2017
return
@@ -24,9 +21,6 @@ protected function getAuthUrl($state): string
2421
);
2522
}
2623

27-
/**
28-
* {@inheritdoc}
29-
*/
3024
protected function getTokenUrl(): string
3125
{
3226
return 'https://developer.api.autodesk.com/authentication/v2/token';

src/Azure/Provider.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ class Provider extends AbstractProvider
2020

2121
protected $scopes = ['User.Read'];
2222

23-
/**
24-
* {@inheritdoc}
25-
*/
26-
protected function getAuthUrl($state)
23+
protected function getAuthUrl($state): string
2724
{
2825
return $this->buildAuthUrlFromBase($this->getBaseUrl().'/oauth2/v2.0/authorize', $state);
2926
}
@@ -44,10 +41,7 @@ public function getLogoutUrl(?string $redirectUri = null)
4441
$logoutUrl.'?'.http_build_query(['post_logout_redirect_uri' => $redirectUri], '', '&', $this->encodingType);
4542
}
4643

47-
/**
48-
* {@inheritdoc}
49-
*/
50-
protected function getTokenUrl()
44+
protected function getTokenUrl(): string
5145
{
5246
return $this->getBaseUrl().'/oauth2/v2.0/token';
5347
}

src/AzureADB2C/Provider.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,12 @@ private function getJWTKeys()
108108
return json_decode((string) $response->getBody(), true);
109109
}
110110

111-
/**
112-
* {@inheritdoc}
113-
*/
114-
protected function getAuthUrl($state)
111+
protected function getAuthUrl($state): string
115112
{
116-
return $this->buildAuthUrlFromBase(
117-
$this->getOpenIdConfiguration()->authorization_endpoint,
118-
$state
119-
);
113+
return $this->buildAuthUrlFromBase($this->getOpenIdConfiguration()->authorization_endpoint, $state);
120114
}
121115

122-
/**
123-
* {@inheritdoc}
124-
*/
125-
protected function getTokenUrl()
116+
protected function getTokenUrl(): string
126117
{
127118
return $this->getOpenIdConfiguration()->token_endpoint;
128119
}

src/Battlenet/Provider.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,16 @@ class Provider extends AbstractProvider
1414

1515
protected static $region;
1616

17-
/**
18-
* {@inheritdoc}
19-
*/
20-
protected function getAuthUrl($state)
17+
protected function getAuthUrl($state): string
2118
{
22-
$url = $this->isChina() ? 'https://www.battlenet.com.cn/oauth/authorize' : 'https://'.$this->getRegion().'.battle.net/oauth/authorize';
19+
$url = $this->isChina() ?
20+
'https://www.battlenet.com.cn/oauth/authorize' :
21+
'https://'.$this->getRegion().'.battle.net/oauth/authorize';
2322

2423
return $this->buildAuthUrlFromBase($url, $state);
2524
}
2625

27-
/**
28-
* {@inheritdoc}
29-
*/
30-
protected function getTokenUrl()
26+
protected function getTokenUrl(): string
3127
{
3228
if ($this->isChina()) {
3329
return 'https://www.battlenet.com.cn/oauth/token';

0 commit comments

Comments
 (0)