| Conditions | 7 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function runIntegrations() |
||
| 41 | { |
||
| 42 | $dir = glsr()->path('plugin/Integrations'); |
||
| 43 | if (!is_dir($dir)) { |
||
| 44 | return; |
||
| 45 | } |
||
| 46 | $iterator = new \DirectoryIterator($dir); |
||
| 47 | foreach ($iterator as $fileinfo) { |
||
| 48 | if (!$fileinfo->isDir() || $fileinfo->isDot()) { |
||
| 49 | continue; |
||
| 50 | } |
||
| 51 | $basename = 'GeminiLabs\SiteReviews\Integrations\\'.$fileinfo->getBasename(); |
||
| 52 | $controller = $basename.'\Controller'; |
||
| 53 | $hooks = $basename.'\Hooks'; |
||
| 54 | if (class_exists($controller) && class_exists($hooks)) { |
||
| 55 | glsr()->singleton($controller); |
||
| 56 | glsr()->singleton($hooks); |
||
| 57 | glsr($hooks)->run(); |
||
| 58 | } |
||
| 62 |