Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
Krato authored and StyleCIBot committed Jul 24, 2019
1 parent ed68dfd commit 187aaa0
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions src/Events/FileRemoved.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Infinety\Filemanager\Events;

use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Queue\SerializesModels;
use Illuminate\Filesystem\FilesystemAdapter;

class FileRemoved
{
Expand All @@ -24,7 +24,7 @@ class FileRemoved
*
* @return void
*/
public function __construct(FilesystemAdapter $storage, String $filePath)
public function __construct(FilesystemAdapter $storage, string $filePath)
{
$this->storage = $storage;
$this->filePath = $filePath;
Expand Down
4 changes: 2 additions & 2 deletions src/Events/FileUploaded.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Infinety\Filemanager\Events;

use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Queue\SerializesModels;
use Illuminate\Filesystem\FilesystemAdapter;

class FileUploaded
{
Expand All @@ -24,7 +24,7 @@ class FileUploaded
*
* @return void
*/
public function __construct(FilesystemAdapter $storage, String $filePath)
public function __construct(FilesystemAdapter $storage, string $filePath)
{
$this->storage = $storage;
$this->filePath = $filePath;
Expand Down
4 changes: 2 additions & 2 deletions src/Events/FolderRemoved.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Infinety\Filemanager\Events;

use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Queue\SerializesModels;
use Illuminate\Filesystem\FilesystemAdapter;

class FolderRemoved
{
Expand All @@ -24,7 +24,7 @@ class FolderRemoved
*
* @return void
*/
public function __construct(FilesystemAdapter $storage, String $folderPath)
public function __construct(FilesystemAdapter $storage, string $folderPath)
{
$this->storage = $storage;
$this->folderPath = $folderPath;
Expand Down
4 changes: 2 additions & 2 deletions src/Events/FolderUploaded.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Infinety\Filemanager\Events;

use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Queue\SerializesModels;
use Illuminate\Filesystem\FilesystemAdapter;

class FolderUploaded
{
Expand All @@ -24,7 +24,7 @@ class FolderUploaded
*
* @return void
*/
public function __construct(FilesystemAdapter $storage, String $folderPath)
public function __construct(FilesystemAdapter $storage, string $folderPath)
{
$this->storage = $storage;
$this->folderPath = $folderPath;
Expand Down
4 changes: 2 additions & 2 deletions src/FilemanagerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Infinety\Filemanager;

use Laravel\Nova\Nova;
use Laravel\Nova\Events\ServingNova;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Infinety\Filemanager\Http\Middleware\Authorize;
use Laravel\Nova\Events\ServingNova;
use Laravel\Nova\Nova;

class FilemanagerServiceProvider extends ServiceProvider
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/FilemanagerToolController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Infinety\Filemanager\Http\Services\FileManagerService;
use Laravel\Nova\Http\Requests\NovaRequest;
use Infinety\Filemanager\Http\Services\FileManagerService;

class FilemanagerToolController extends Controller
{
Expand Down
14 changes: 7 additions & 7 deletions src/Http/Services/FileManagerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Infinety\Filemanager\Http\Services;

use Illuminate\Contracts\Bus\Dispatcher;
use Illuminate\Http\Request;
use InvalidArgumentException;
use Illuminate\Support\Facades\Storage;
use Illuminate\Contracts\Bus\Dispatcher;
use Infinety\Filemanager\Events\FileRemoved;
use Infinety\Filemanager\Events\FileUploaded;
use Infinety\Filemanager\Events\FolderRemoved;
use Infinety\Filemanager\Events\FolderUploaded;
use Infinety\Filemanager\Exceptions\InvalidConfig;
use InvalidArgumentException;

class FileManagerService
{
Expand Down Expand Up @@ -86,7 +86,7 @@ public function ajaxGetFilesAndFolders(Request $request, $filter = false)
{
$folder = $this->cleanSlashes($request->get('folder'));

if (!$this->folderExists($folder)) {
if (! $this->folderExists($folder)) {
$folder = '/';
}

Expand All @@ -98,7 +98,7 @@ public function ajaxGetFilesAndFolders(Request $request, $filter = false)
$this->setRelativePath($folder);

$order = $request->get('sort');
if (!$order) {
if (! $order) {
$order = config('filemanager.order', 'mime');
}

Expand Down Expand Up @@ -190,7 +190,7 @@ public function uploadFile($file, $currentFolder, $visibility, $uploadingFolder
if ($this->storage->putFileAs($currentFolder, $file, $fileName)) {
$this->setVisibility($currentFolder, $fileName, $visibility);

if (!$uploadingFolder) {
if (! $uploadingFolder) {
$this->checkJobs($this->storage, $currentFolder.$fileName);
event(new FileUploaded($this->storage, $currentFolder.$fileName));
}
Expand Down Expand Up @@ -229,7 +229,7 @@ public function getFileInfo($file)
*/
public function getFileInfoAsArray($file)
{
if (!$this->storage->exists($file)) {
if (! $this->storage->exists($file)) {
return [];
}

Expand Down Expand Up @@ -299,7 +299,7 @@ public function moveFile($oldPath, $newPath)
}

/**
* Folder uploaded event
* Folder uploaded event.
*
* @param string $path
*
Expand Down
14 changes: 7 additions & 7 deletions src/Http/Services/GetFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getFiles($folder, $order, $filter = false)
*/
public function getFileData($file, $id)
{
if (!$this->isDot($file) && !$this->exceptExtensions->contains($file['extension']) && !$this->exceptFolders->contains($file['basename']) && !$this->exceptFiles->contains($file['basename']) && $this->accept($file)) {
if (! $this->isDot($file) && ! $this->exceptExtensions->contains($file['extension']) && ! $this->exceptFolders->contains($file['basename']) && ! $this->exceptFiles->contains($file['basename']) && $this->accept($file)) {
$fileInfo = [
'id' => $id,
'name' => trim($file['basename']),
Expand All @@ -82,14 +82,14 @@ public function getFileData($file, $id)
}

if ($fileInfo['mime'] == 'image') {
list($width, $height) = $this->getImageDimesions($file);
if (!$width == false) {
[$width, $height] = $this->getImageDimesions($file);
if (! $width == false) {
$fileInfo['dimensions'] = $width.'x'.$height;
}
}

if ($fileInfo['type'] == 'dir') {
if (!$this->checkShouldHideFolder($fileInfo['path'])) {
if (! $this->checkShouldHideFolder($fileInfo['path'])) {
return false;
}
}
Expand Down Expand Up @@ -386,10 +386,10 @@ public function getThumbFile($file)
public function normalizeFiles($files)
{
foreach ($files as $key => $file) {
if (!isset($file['extension'])) {
if (! isset($file['extension'])) {
$files[$key]['extension'] = null;
}
if (!isset($file['size'])) {
if (! isset($file['size'])) {
// $size = $this->storage->getSize($file['path']);
$files[$key]['size'] = null;
}
Expand Down Expand Up @@ -504,7 +504,7 @@ public function modificationDate($time)
}

/**
* Hide folders with .hide file
* Hide folders with .hide file.
* @param $oath
*/
private function checkShouldHideFolder($path)
Expand Down
14 changes: 7 additions & 7 deletions src/Http/Services/NormalizeFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Infinety\Filemanager\Http\Services;

use Carbon\Carbon;
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Collection;
use RarArchive;
use SplFileInfo;
use ZipArchive;
use SplFileInfo;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Filesystem\FilesystemAdapter;

class NormalizeFile
{
Expand All @@ -31,7 +31,7 @@ class NormalizeFile
/**
* @param string $path
*/
public function __construct(FilesystemAdapter $storage, String $path, String $storagePath)
public function __construct(FilesystemAdapter $storage, string $path, string $storagePath)
{
$this->storage = $storage;
$this->file = new SplFileInfo($path);
Expand Down Expand Up @@ -162,9 +162,9 @@ private function getDimensions($mime)
}

if (str_contains($mime, 'image')) {
list($width, $height) = getimagesize($this->storage->path($this->storagePath));
[$width, $height] = getimagesize($this->storage->path($this->storagePath));

if (!empty($width) && !empty($height)) {
if (! empty($width) && ! empty($height)) {
return $width.'x'.$height;
}
}
Expand Down

0 comments on commit 187aaa0

Please sign in to comment.