@@ -25,7 +25,7 @@ |
||
| 25 | 25 | return cache()->remember( |
| 26 | 26 | implode('-', $keyElements), |
| 27 | 27 | 9999999999, |
| 28 | - function () use ($source, $width, $height, $htmlAttributes, $options) { |
|
| 28 | + function() use ($source, $width, $height, $htmlAttributes, $options) { |
|
| 29 | 29 | return new Image($source, $width, $height, $htmlAttributes, $options); |
| 30 | 30 | } |
| 31 | 31 | ); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $this->resizeImage($this->width, $this->height, $this->alwaysPreserveAspectRatio); |
| 43 | 43 | |
| 44 | - if (! $this->doNotCreateDerivativeImages) { |
|
| 44 | + if (!$this->doNotCreateDerivativeImages) { |
|
| 45 | 45 | $job = (new RenderDerivativeImages($this->originalPath))->onQueue('imagery'); |
| 46 | 46 | dispatch($job); |
| 47 | 47 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $height = $this->determineHeight($height, $screenHeight); |
| 57 | 57 | $width = $this->determineWidth($width, $screenWidth); |
| 58 | 58 | |
| 59 | - if (! $height && ! $width) { |
|
| 59 | + if (!$height && !$width) { |
|
| 60 | 60 | $height = $this->image->height(); |
| 61 | 61 | $width = $this->image->width(); |
| 62 | 62 | } |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | $maxHeight = $this->determineMaxHeight($height, $screenHeight, $screenWidth); |
| 65 | 65 | $maxWidth = $this->determineMaxWidth($width, $screenHeight, $screenWidth); |
| 66 | 66 | |
| 67 | - $this->image->resize($maxWidth, $maxHeight, function ($constraint) use ($alwaysPreserveAspect) { |
|
| 68 | - if ($alwaysPreserveAspect || ! $width || ! $height) { |
|
| 67 | + $this->image->resize($maxWidth, $maxHeight, function($constraint) use ($alwaysPreserveAspect) { |
|
| 68 | + if ($alwaysPreserveAspect || !$width || !$height) { |
|
| 69 | 69 | $constraint->aspectRatio(); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | //TODO: refactor to have a single return type, instead of null or int |
| 81 | 81 | protected function determineMaxHeight($height, $screenHeight, $screenWidth) |
| 82 | 82 | { |
| 83 | - if (! $screenHeight || ! $screenWidth) { |
|
| 83 | + if (!$screenHeight || !$screenWidth) { |
|
| 84 | 84 | return $height; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $maxHeight = $height ?: $this->image->height(); |
| 88 | 88 | |
| 89 | - if (! $this->overrideScreenConstraint) { |
|
| 89 | + if (!$this->overrideScreenConstraint) { |
|
| 90 | 90 | $maxHeight = $screenHeight < $maxHeight ? $screenHeight : $maxHeight; |
| 91 | 91 | |
| 92 | 92 | if ($this->screenConstraintMethod === 'cover') { |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | //TODO: refactor to have a single return type, instead of null or int |
| 106 | 106 | protected function determineMaxWidth($width, $screenHeight, $screenWidth) |
| 107 | 107 | { |
| 108 | - if (! $screenHeight || ! $screenWidth) { |
|
| 108 | + if (!$screenHeight || !$screenWidth) { |
|
| 109 | 109 | return $width; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $maxWidth = $width ?: $this->image->width(); |
| 113 | 113 | |
| 114 | - if (! $this->overrideScreenConstraint) { |
|
| 114 | + if (!$this->overrideScreenConstraint) { |
|
| 115 | 115 | $maxWidth = $screenWidth < $maxWidth ? $screenWidth : $maxWidth; |
| 116 | 116 | |
| 117 | 117 | if ($this->screenConstraintMethod === 'cover') { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $scriptUrl = mix('js/cookie.js', 'genealabs-laravel-imagery'); |
| 174 | 174 | $attributes = ''; |
| 175 | 175 | |
| 176 | - $attributes = $this->htmlAttributes->map(function ($value, $attribute) use (&$attributes) { |
|
| 176 | + $attributes = $this->htmlAttributes->map(function($value, $attribute) use (&$attributes) { |
|
| 177 | 177 | return " {$attribute}=\"{$value}\""; |
| 178 | 178 | })->implode(''); |
| 179 | 179 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | { |
| 232 | 232 | app('filesystem')->disk('public')->makeDirectory(config('genealabs-laravel-imagery.storage-folder')); |
| 233 | 233 | |
| 234 | - if (! file_exists(public_path(config('genealabs-laravel-imagery.storage-folder')))) { |
|
| 234 | + if (!file_exists(public_path(config('genealabs-laravel-imagery.storage-folder')))) { |
|
| 235 | 235 | symlink( |
| 236 | 236 | rtrim(storage_path('app/public/' . config('genealabs-laravel-imagery.storage-folder')), '/'), |
| 237 | 237 | rtrim(public_path(config('genealabs-laravel-imagery.storage-folder')), '/') |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $this->commands(Clear::class); |
| 37 | 37 | $this->commands(Publish::class); |
| 38 | - $this->app->singleton('imagery', function () { |
|
| 38 | + $this->app->singleton('imagery', function() { |
|
| 39 | 39 | return new Imagery(); |
| 40 | 40 | }); |
| 41 | 41 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | throw new Exception("Blade directive '{$directive}' is already registered."); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - app('blade.compiler')->directive($directive, function ($parameters) use ($type) { |
|
| 54 | + app('blade.compiler')->directive($directive, function($parameters) use ($type) { |
|
| 55 | 55 | $parameters = trim($parameters, "()"); |
| 56 | 56 | |
| 57 | 57 | return "<?php echo app('imagery')->conjure({$parameters})->{$type}; ?>"; |
@@ -32,11 +32,11 @@ |
||
| 32 | 32 | |
| 33 | 33 | private function delTree($folder) |
| 34 | 34 | { |
| 35 | - if (! is_dir($folder)) { |
|
| 35 | + if (!is_dir($folder)) { |
|
| 36 | 36 | return false; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $files = array_diff(scandir($folder), ['.','..']); |
|
| 39 | + $files = array_diff(scandir($folder), ['.', '..']); |
|
| 40 | 40 | |
| 41 | 41 | foreach ($files as $file) { |
| 42 | 42 | is_dir("$folder/$file") ? $this->delTree("$folder/$file") : unlink("$folder/$file"); |