|
14 | 14 | use chillerlan\OAuth\Core\{ClientCredentials, OAuth1Interface, OAuth2Interface}; |
15 | 15 | use Psr\Http\Message\ResponseInterface; |
16 | 16 |
|
| 17 | +use function chillerlan\OAuth\Providers\getProviders; |
| 18 | +use function file_get_contents, file_put_contents, implode, str_replace, strpos, substr; |
| 19 | + |
| 20 | +use const PHP_EOL; |
| 21 | + |
17 | 22 | $ENVVAR = ''; |
18 | 23 |
|
19 | 24 | require_once __DIR__.'/provider-example-common.php'; |
|
30 | 35 | '----------|----------|---------------|-------|--------------------', |
31 | 36 | ]; |
32 | 37 |
|
33 | | -foreach(\chillerlan\OAuth\Providers\getProviders() as $p){ |
| 38 | +foreach(getProviders() as $p){ |
34 | 39 | /** @var \chillerlan\OAuth\Core\OAuthInterface $provider */ |
35 | 40 | $provider = new $p['fqcn']($http, $storage, $options, $logger); |
36 | 41 |
|
|
50 | 55 | $oauth = '-'; |
51 | 56 | } |
52 | 57 |
|
53 | | - $table[] = |
54 | | - '['.$p['name'].']('.$provider->apiDocs.') '. |
55 | | - '| [link]('.$provider->applicationURL.') '. |
56 | | - '| '.(!$provider->userRevokeURL ? '' : '[link]('.$provider->userRevokeURL.')'). |
57 | | - '| '.$oauth. |
58 | | - '| '.($provider instanceof ClientCredentials ? '✓' : '') |
59 | | - ; |
| 58 | + $table[] |
| 59 | + = '['.$p['name'].']('.$provider->apiDocs.') '. |
| 60 | + '| [link]('.$provider->applicationURL.') '. |
| 61 | + '| '.(!$provider->userRevokeURL ? '' : '[link]('.$provider->userRevokeURL.')'). |
| 62 | + '| '.$oauth. |
| 63 | + '| '.($provider instanceof ClientCredentials ? '✓' : ''); |
60 | 64 |
|
61 | 65 | } |
62 | 66 |
|
63 | 67 | $file = __DIR__.'/../README.md'; |
64 | | -$readme = \file_get_contents($file); |
65 | | -$start = \strpos($readme, '<!--A-->')+8; |
66 | | -$end = \strpos($readme, '<!--O-->'); |
| 68 | +$readme = file_get_contents($file); |
| 69 | +$start = strpos($readme, '<!--A-->') + 8; |
| 70 | +$end = strpos($readme, '<!--O-->'); |
67 | 71 |
|
68 | | -\file_put_contents($file, \str_replace(\substr($readme, $start, $end-$start), \PHP_EOL.\implode(\PHP_EOL, $table).\PHP_EOL, $readme)); |
| 72 | +file_put_contents($file, str_replace(substr($readme, $start, $end - $start), PHP_EOL.implode(PHP_EOL, $table).PHP_EOL, $readme)); |
0 commit comments