Completed
Push — master ( 3bcae9...2cca03 )
by Gui Xin
02:03
created
database/migrations/2017_12_05_000000_create_files_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('files', function (Blueprint $table) {
16
+        Schema::create('files', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('name');
19 19
             $table->string('path');
Please login to merge, or discard this patch.
src/Traits/WithImages.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
 
14 14
     public static function bootWithImages(): void
15 15
     {
16
-        static::deleted(function ($model) {
17
-            $model->images->each(function ($image) {
16
+        static::deleted(function($model) {
17
+            $model->images->each(function($image) {
18 18
                 $image->delete();
19 19
             });
20 20
         });
Please login to merge, or discard this patch.
src/Traits/WithFiles.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 
13 13
     public static function bootWithFiles(): void
14 14
     {
15
-        static::deleted(function ($model) {
16
-            $model->files->each(function ($file) {
15
+        static::deleted(function($model) {
16
+            $model->files->each(function($file) {
17 17
                 $file->delete();
18 18
             });
19 19
         });
Please login to merge, or discard this patch.
src/UploaderManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 {
8 8
     public static function route($enable = ['store', 'delete'], callable $callback = null): void
9 9
     {
10
-        Route::prefix('files')->group(function () use ($enable, $callback) {
10
+        Route::prefix('files')->group(function() use ($enable, $callback) {
11 11
             $namespace = '\\UniSharp\\Uploadable\\Http\\Controllers\\Api\\V1\\';
12 12
 
13 13
             if (in_array('store', $enable)) {
Please login to merge, or discard this patch.
src/Plugins/ImagePlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
                 '.' .
31 31
                 $image->extension;
32 32
 
33
-            $image->resize($width, $height, function ($constraint) {
33
+            $image->resize($width, $height, function($constraint) {
34 34
                 $constraint->aspectRatio();
35 35
                 $constraint->upsize();
36 36
             })->save($filename, 100);
Please login to merge, or discard this patch.
src/Image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     public function getThumbAttribute(): array
14 14
     {
15
-        return collect(['s', 'm', 'l'])->flip()->map(function ($_, $size) {
15
+        return collect(['s', 'm', 'l'])->flip()->map(function($_, $size) {
16 16
             return URL::to(preg_replace('/^(images\/)/', "\$1{$size}/", $this->attributes['path']));
17 17
         })->toArray();
18 18
     }
Please login to merge, or discard this patch.
src/File.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     {
17 17
         parent::boot();
18 18
 
19
-        static::deleted(function ($model) {
19
+        static::deleted(function($model) {
20 20
             Storage::delete($model->attributes['path']);
21 21
         });
22 22
     }
Please login to merge, or discard this patch.
samples/plugins/ImageWatermarkHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
         $images = $this->getImages($origin_image);
15 15
 
16
-        collect($images)->each(function ($image) use ($storage) {
16
+        collect($images)->each(function($image) use ($storage) {
17 17
             if (in_array($image->mime(), $this->supportedMime)) {
18 18
                 $watermark = $this->getWatermark($image);
19 19
                 $image->insert($watermark, 'bottom-right');
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
         $thumbs = array_keys(Config::get('uploadable.thumbs'));
30 30
 
31
-        collect($thumbs)->each(function ($size) use (&$images, $image) {
31
+        collect($thumbs)->each(function($size) use (&$images, $image) {
32 32
             $path = $this->getDirectory($image->dirname, $size) . $image->filename . '.' . $image->extension;
33 33
 
34 34
             if (file_exists($path)) {
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $watermark = Image::make(storage_path('app' . DIRECTORY_SEPARATOR . 'watermark.png'));
45 45
 
46
-        $watermark->resize($image->getWidth() / 2.5, null, function ($constraint) {
46
+        $watermark->resize($image->getWidth() / 2.5, null, function($constraint) {
47 47
             $constraint->aspectRatio();
48 48
             $constraint->upsize();
49 49
         });
Please login to merge, or discard this patch.
samples/2017_11_10_000000_create_images_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('images', function (Blueprint $table) {
16
+        Schema::create('images', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('name')->comment('file name');
19 19
             $table->string('path')->comment('file path');
Please login to merge, or discard this patch.