| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Arcanedev\Support; |
||
| 22 | protected function createDriver($driver) |
||
| 23 | { |
||
| 24 | $method = 'create'.Str::studly($driver).'Driver'; |
||
| 25 | |||
| 26 | // We'll check to see if a creator method exists for the given driver. If not we |
||
| 27 | // will check for a custom driver creator, which allows developers to create |
||
| 28 | // drivers using their own customized driver creator Closure to create it. |
||
| 29 | if (isset($this->customCreators[$driver])) |
||
| 30 | return $this->callCustomCreator($driver); |
||
| 31 | elseif (method_exists($this, $method)) |
||
| 32 | return $this->$method(); |
||
| 33 | |||
| 34 | throw new InvalidArgumentException("Driver [$driver] not supported."); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |