Skip to content

Commit 2c01928

Browse files
committed
abandon LfmFileRepository.php
1 parent 7b68b31 commit 2c01928

File tree

4 files changed

+4
-64
lines changed

4 files changed

+4
-64
lines changed

src/Lfm.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ public function __construct(Config $config = null, Request $request = null)
2121

2222
public function getStorage($storage_path)
2323
{
24-
if ($this->config->get('lfm.driver') === 'storage') {
25-
return new LfmStorageRepository($storage_path, $this);
26-
} else {
27-
return new LfmFileRepository($storage_path, $this);
28-
}
24+
return new LfmStorageRepository($storage_path, $this);
2925
}
3026

3127
public function input($key)

src/LfmFileRepository.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/config/lfm.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@
8787
|--------------------------------------------------------------------------
8888
*/
8989

90-
'driver' => 'file',
91-
92-
'disk' => 'local',
90+
'disk' => 'public',
9391

9492
'rename_file' => false,
9593

tests/LfmTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ public function tearDown()
2222
public function testGetStorage()
2323
{
2424
$config = m::mock(Config::class);
25-
$config->shouldReceive('get')->with('lfm.driver')->once()->andReturn('file');
26-
$config->shouldReceive('get')->with('lfm.driver')->once()->andReturn('storage');
2725
$config->shouldReceive('get')->with('lfm.disk')->once()->andReturn('local');
2826

29-
$lfm1 = new Lfm($config);
30-
$lfm2 = new Lfm($config);
31-
$this->assertInstanceOf(LfmFileRepository::class, $lfm1->getStorage('foo/bar'));
32-
$this->assertInstanceOf(LfmStorageRepository::class, $lfm2->getStorage('foo/bar'));
27+
$lfm = new Lfm($config);
28+
$this->assertInstanceOf(LfmStorageRepository::class, $lfm->getStorage('foo/bar'));
3329
}
3430

3531
public function testInput()

0 commit comments

Comments
 (0)