| Conditions | 2 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function register () { |
||
| 38 | $this->app->singleton(self::NAME, function(Application $app) { |
||
| 39 | $config = $app['config'][self::NAME]; |
||
| 40 | $pool = null; |
||
| 41 | if ($config['cache']) { |
||
| 42 | $pool = new SimpleCachePool(Cache::store()); |
||
| 43 | $pool->setTtl($config['cache_ttl']); |
||
| 44 | } |
||
| 45 | $api = new Api($config['token'], $pool); |
||
| 46 | $api->setLog(Log::getFacadeRoot()); |
||
| 47 | return $api; |
||
| 48 | }); |
||
| 50 | } |