@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | protected $destination = ''; |
| 35 | 35 | |
| 36 | 36 | /** @var array Uploaded file info */ |
| 37 | - protected $uploadedFileInfo = []; |
|
| 37 | + protected $uploadedFileInfo = [ ]; |
|
| 38 | 38 | |
| 39 | 39 | /** @var string Image validation rules */ |
| 40 | 40 | protected $validationRules; |
| 41 | 41 | |
| 42 | 42 | /** @var array|object Validation errors */ |
| 43 | - protected $errors = []; |
|
| 43 | + protected $errors = [ ]; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * @constructor |
@@ -219,8 +219,8 @@ discard block |
||
| 219 | 219 | return false; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - $inputFile = [$this->field => $file]; |
|
| 223 | - $rules = [$this->field => $this->validationRules]; |
|
| 222 | + $inputFile = [ $this->field => $file ]; |
|
| 223 | + $rules = [ $this->field => $this->validationRules ]; |
|
| 224 | 224 | |
| 225 | 225 | // Validate |
| 226 | 226 | $validator = Validator::make($inputFile, $rules); |
@@ -23,19 +23,19 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return string |
| 25 | 25 | */ |
| 26 | - public function image($dir, $image, $width = null, $height = null, array $options = [], array $attributes = []) |
|
| 26 | + public function image($dir, $image, $width = null, $height = null, array $options = [ ], array $attributes = [ ]) |
|
| 27 | 27 | { |
| 28 | 28 | $attributes = array_replace_recursive($this->attributes, $attributes); |
| 29 | 29 | $options = array_replace_recursive($this->options, $options); |
| 30 | 30 | |
| 31 | 31 | $path = config('laravelimage.routePath') . '/' . $dir . $image . '?' . http_build_query($options, '', '&'); |
| 32 | 32 | |
| 33 | - if ( ! empty((int) $width)) { |
|
| 34 | - $path .= '&w=' . (int) $width; |
|
| 33 | + if ( ! empty((int)$width)) { |
|
| 34 | + $path .= '&w=' . (int)$width; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if ( ! empty((int) $height)) { |
|
| 38 | - $path .= '&h=' . (int) $height; |
|
| 37 | + if ( ! empty((int)$height)) { |
|
| 38 | + $path .= '&h=' . (int)$height; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | return '<img src="' . asset($path) . '" ' . $this->buildAttributes($attributes) . ' />'; |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | return null; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $attributeMap = []; |
|
| 55 | + $attributeMap = [ ]; |
|
| 56 | 56 | foreach ($attributes as $attribute => $value) { |
| 57 | - $attributeMap[] = $attribute . '="' . $value . '"'; |
|
| 57 | + $attributeMap[ ] = $attribute . '="' . $value . '"'; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return implode($attributeMap, ' '); |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | */ |
| 77 | 77 | protected function registerBladeExtensions() |
| 78 | 78 | { |
| 79 | - $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler(); |
|
| 79 | + $blade = $this->app[ 'view' ]->getEngineResolver()->resolve('blade')->getCompiler(); |
|
| 80 | 80 | |
| 81 | 81 | $blade->directive('laravelImage', function($options) { |
| 82 | 82 | return "<?php echo \\AnkitPokhrel\\LaravelImage\\LaravelImageFacade::image($options);?>"; |