| Conditions | 6 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | function getProviders():array{ |
||
| 18 | $providers = []; |
||
| 19 | |||
| 20 | /** @var \SplFileInfo $e */ |
||
| 21 | foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS)) as $e){ |
||
| 22 | |||
| 23 | if($e->getExtension() !== 'php' || \realpath($e->getPath()) === __DIR__){ |
||
| 24 | continue; |
||
| 25 | } |
||
| 26 | |||
| 27 | $class = __NAMESPACE__.\str_replace('/', '\\', \substr($e->getPathname(), \strlen(__DIR__), -4)); |
||
| 28 | $r = new ReflectionClass($class); |
||
| 29 | |||
| 30 | if(!$r->implementsInterface(OAuthInterface::class) || $r->isAbstract()){ |
||
| 31 | continue; |
||
| 32 | } |
||
| 33 | |||
| 34 | $providers[\hash('crc32b', $r->getShortName())] = [$r->getShortName(), $class]; |
||
| 35 | } |
||
| 36 | |||
| 37 | return $providers; |
||
| 38 | } |
||
| 41 |