Skip to content

Commit

Permalink
style: fix with psr2
Browse files Browse the repository at this point in the history
  • Loading branch information
streamtw committed Oct 30, 2021
1 parent b115dca commit 7632561
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/LfmItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public function __construct(LfmPath $lfm, Lfm $helper, $isDirectory = false)
$this->lfm = $lfm->thumb(false);
$this->helper = $helper;
$this->isDirectory = $isDirectory;
$this->columns = $helper->config('item_columns')??['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'];
$this->columns = $helper->config('item_columns') ?:
['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'];
}

public function __get($var_name)
Expand Down
4 changes: 3 additions & 1 deletion tests/LfmItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function setUp()

$this->lfm_path = m::mock(LfmPath::class);
$this->lfm_path->shouldReceive('thumb')->andReturn($this->lfm_path);
$this->lfm->shouldReceive('config')->with('item_columns')->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
$this->lfm->shouldReceive('config')
->with('item_columns')
->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
}

public function tearDown()
Expand Down
12 changes: 9 additions & 3 deletions tests/LfmPathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ public function testFolders()
$helper->shouldReceive('getThumbFolderName')->andReturn('thumbs');
$helper->shouldReceive('isRunningOnWindows')->andReturn(false);
$helper->shouldReceive('ds')->andReturn('/');
$helper->shouldReceive('config')->with('item_columns')->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
$helper->shouldReceive('config')
->with('item_columns')
->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);

$path = new LfmPath($helper);

Expand All @@ -146,7 +148,9 @@ public function testFiles()
$helper->shouldReceive('getNameFromPath')->andReturn('bar');
$helper->shouldReceive('isRunningOnWindows')->andReturn(false);
$helper->shouldReceive('ds')->andReturn('/');
$helper->shouldReceive('config')->with('item_columns')->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
$helper->shouldReceive('config')
->with('item_columns')
->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);

$path = new LfmPath($helper);

Expand All @@ -158,7 +162,9 @@ public function testPretty()
$helper = m::mock(Lfm::class);
$helper->shouldReceive('getNameFromPath')->andReturn('bar');
$helper->shouldReceive('isRunningOnWindows')->andReturn(false);
$helper->shouldReceive('config')->with('item_columns')->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
$helper->shouldReceive('config')
->with('item_columns')
->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);

$path = new LfmPath($helper);

Expand Down
3 changes: 2 additions & 1 deletion tests/LfmUploadValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
use UniSharp\LaravelFilemanager\LfmPath;
use UniSharp\LaravelFilemanager\LfmUploadValidator;

function trans() {
function trans()
{
// leave empty
}

Expand Down

0 comments on commit 7632561

Please sign in to comment.