| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 30 | public function create($service, array $params = []) : ServiceProvider |
||
| 31 | { |
||
| 32 | $backend = strtolower($this->config()->get('backend')); |
||
| 33 | $gtwClass = sprintf('PhpTek\Verifiable\Backend\%s\Gateway', ucfirst($backend)); |
||
| 34 | $srvClass = sprintf('PhpTek\Verifiable\Backend\%s\Service', ucfirst($backend)); |
||
| 35 | |||
| 36 | if (!class_exists($gtwClass) || !class_exists($srvClass)) { |
||
| 37 | throw new VerifiableBackendException(sprintf('No backend named %s was found', $srvClass)); |
||
| 38 | } |
||
| 39 | |||
| 40 | return Injector::inst()->create($srvClass); |
||
| 41 | } |
||
| 43 |