From 7632561e194bd5181d070b3fa6e6bd70230979f6 Mon Sep 17 00:00:00 2001 From: Stream Date: Sun, 31 Oct 2021 03:01:17 +0800 Subject: [PATCH] style: fix with psr2 --- src/LfmItem.php | 3 ++- tests/LfmItemTest.php | 4 +++- tests/LfmPathTest.php | 12 +++++++++--- tests/LfmUploadValidatorTest.php | 3 ++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/LfmItem.php b/src/LfmItem.php index de0c0979..e7f48747 100644 --- a/src/LfmItem.php +++ b/src/LfmItem.php @@ -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) diff --git a/tests/LfmItemTest.php b/tests/LfmItemTest.php index 0c37532e..48aa33aa 100644 --- a/tests/LfmItemTest.php +++ b/tests/LfmItemTest.php @@ -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() diff --git a/tests/LfmPathTest.php b/tests/LfmPathTest.php index b358f121..11cfc150 100644 --- a/tests/LfmPathTest.php +++ b/tests/LfmPathTest.php @@ -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); @@ -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); @@ -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); diff --git a/tests/LfmUploadValidatorTest.php b/tests/LfmUploadValidatorTest.php index 2a762280..c863c3e3 100644 --- a/tests/LfmUploadValidatorTest.php +++ b/tests/LfmUploadValidatorTest.php @@ -13,7 +13,8 @@ use UniSharp\LaravelFilemanager\LfmPath; use UniSharp\LaravelFilemanager\LfmUploadValidator; -function trans() { +function trans() +{ // leave empty }