@@ -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, ' '); |