Skip to content

Commit 4876837

Browse files
authored
Merge pull request #1 from irfaardy/scrutinizer-patch-1
Scrutinizer Auto-Fixes
2 parents f3773d3 + 200ed1b commit 4876837

File tree

7 files changed

+47
-47
lines changed

7 files changed

+47
-47
lines changed

config/irfa/filesafe.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
return [
33

4-
'random_filename' => true,//Generate random alnum for upload filename,
4+
'random_filename' => true, //Generate random alnum for upload filename,
55

6-
'path' => 'uploaded/',//Uploaded file is located in storage/app.
6+
'path' => 'uploaded/', //Uploaded file is located in storage/app.
77

88

99

src/Facades/FileSafe.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
class FileSafe extends Facade
1010
{
11-
/**
12-
* Get the registered name of the component.
13-
*
14-
* @return string
15-
*/
16-
protected static function getFacadeAccessor()
17-
{
18-
return \Irfa\FileSafe\Func\FileSafe::class;
19-
}
11+
/**
12+
* Get the registered name of the component.
13+
*
14+
* @return string
15+
*/
16+
protected static function getFacadeAccessor()
17+
{
18+
return \Irfa\FileSafe\Func\FileSafe::class;
19+
}
2020
}

src/FileSafeServiceProvider.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@
66

77
class FileSafeServiceProvider extends ServiceProvider
88
{
9-
/**
10-
* Register services.
11-
*
12-
* @return void
13-
*/
14-
public function register()
15-
{
16-
//
17-
}
9+
/**
10+
* Register services.
11+
*
12+
* @return void
13+
*/
14+
public function register()
15+
{
16+
//
17+
}
1818

19-
/**
20-
* Bootstrap services.
21-
*
22-
* @return void
23-
*/
24-
public function boot()
25-
{
19+
/**
20+
* Bootstrap services.
21+
*
22+
* @return void
23+
*/
24+
public function boot()
25+
{
2626

27-
$this->publishes([
28-
__DIR__.'/../config/irfa/' => config_path('irfa')],'file-safe');
27+
$this->publishes([
28+
__DIR__.'/../config/irfa/' => config_path('irfa')],'file-safe');
2929

3030

31-
}
31+
}
3232
}

src/Func/File.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
class File extends CryptFile
88
{
99

10-
protected static function upload($file){
10+
protected static function upload($file) {
1111
return CryptFile::encrypt($file);
1212
}
13-
protected static function download_file($file){
13+
protected static function download_file($file) {
1414
return CryptFile::decrypt($file);
1515
}
16-
protected static function view_raw($file){
17-
return CryptFile::decrypt($file,true);
16+
protected static function view_raw($file) {
17+
return CryptFile::decrypt($file, true);
1818
}
1919

2020

src/Func/FileSafe.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@ class FileSafe extends File
77
{
88
private static $file;
99

10-
public static function file($file){
10+
public static function file($file) {
1111
self::$file = $file;
1212

1313
return new static();
1414
}
15-
public static function store($file=null){
16-
if($file == null){
15+
public static function store($file = null) {
16+
if ($file == null) {
1717
$fl = self::$file;
18-
} else{
18+
} else {
1919
$fl = $file;
2020
}
2121
self::upload($fl);
2222
}
2323

24-
public static function download($file=null){
25-
if($file == null){
24+
public static function download($file = null) {
25+
if ($file == null) {
2626
$fl = self::$file;
27-
} else{
27+
} else {
2828
$fl = $file;
2929
}
3030
return self::download_file($fl);
3131
}
3232

33-
public static function raw($file=null){
34-
if($file == null){
33+
public static function raw($file = null) {
34+
if ($file == null) {
3535
$fl = self::$file;
36-
} else{
36+
} else {
3737
$fl = $file;
3838
}
3939
return self::view_raw($fl);

src/Security/CryptFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected static function decrypt($file,$raw=false){
2929
} else{
3030

3131
return response()->streamDownload(function() use ($decryptedContent) {
32-
echo $decryptedContent;
32+
echo $decryptedContent;
3333
}, $file);
3434
}
3535
}

src/Security/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77

88
class File {
9-
protected static function store_file($randomname,$encryptedContent){
9+
protected static function store_file($randomname, $encryptedContent) {
1010
$path = config("irfa.filesafe.path");
1111
Storage::disk('local')->put($path.$randomname, $encryptedContent);
1212
}
13-
protected static function get_file($filename){
13+
protected static function get_file($filename) {
1414
$path = config("irfa.filesafe.path");
1515
return Storage::disk('local')->get($path.$filename);
1616
}

0 commit comments

Comments
 (0)