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