Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 107d9ee

Browse files
committed
:octocat: getProviders(): return named fields
1 parent 1bbc9c3 commit 107d9ee

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/create-docblocks.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,16 @@
3535
];
3636

3737
foreach(\chillerlan\OAuth\Providers\getProviders() as $p){
38-
[$name, $fqcn] = $p;
3938
/** @var \chillerlan\OAuth\Core\OAuthInterface $provider */
40-
$provider = new $fqcn($http, $storage, $options, $logger);
39+
$provider = new $p['fqcn']($http, $storage, $options, $logger);
4140

4241
$doc = new EndpointDocblock($provider, $provider->endpoints);
4342
$doc->create(ResponseInterface::class);
44-
# $doc->createInterface($name, ResponseInterface::class);
43+
# $doc->createInterface($p['name'], ResponseInterface::class);
4544
# $doc->createJSON();
4645

4746
$table[] =
48-
'['.$name.']('.$provider->apiDocs.') '.
47+
'['.$p['name'].']('.$provider->apiDocs.') '.
4948
'| [link]('.$provider->applicationURL.') '.
5049
'| '.(!$provider->userRevokeURL ? '' : '[link]('.$provider->userRevokeURL.')');
5150

src/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getProviders():array{
3131
continue;
3232
}
3333

34-
$providers[\hash('crc32b', $r->getShortName())] = [$r->getShortName(), $class];
34+
$providers[\hash('crc32b', $r->getShortName())] = ['name' => $r->getShortName(), 'fqcn' => $class];
3535
}
3636

3737
return $providers;

0 commit comments

Comments
 (0)