| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 58 | public static function makePersistentDataStore($store = null) |
|
| 23 | { |
||
| 24 | 58 | if (is_null($store) || $store === 'session') { |
|
| 25 | 58 | return new SessionPersistentDataStore(); |
|
| 26 | } |
||
| 27 | |||
| 28 | if ($store instanceof PersistentDataStoreInterface) { |
||
| 29 | return $store; |
||
| 30 | } |
||
| 31 | |||
| 32 | throw new InvalidArgumentException('The persistent data store must be set to null, "session" or be an instance of use \Dropbox\Store\PersistentDataStoreInterface'); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |