| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 3 | public function disk($name = null) |
|
| 41 | { |
||
| 42 | 3 | $name = $name ?: $this->app->config->get('filesystem.default'); |
|
| 43 | |||
| 44 | 3 | if (!isset($this->disks[$name])) { |
|
| 45 | 3 | $config = $this->app->config->get("filesystem.disks.{$name}"); |
|
| 46 | |||
| 47 | 3 | $this->disks[$name] = App::factory($config['type'], '\\think\\filesystem\\driver\\', $config); |
|
| 48 | } |
||
| 49 | |||
| 50 | 3 | return $this->disks[$name]; |
|
| 51 | } |
||
| 58 |