@@ -27,16 +27,16 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | $paths = [ |
30 | - 'local' => $server.'/storage/', |
|
30 | + 'local' => $server . '/storage/', |
|
31 | 31 | 'production' => 'https://cloudfrontstaff/', |
32 | 32 | ]; |
33 | 33 | |
34 | - $path = $paths[App::environment()]; |
|
34 | + $path = $paths[ App::environment() ]; |
|
35 | 35 | |
36 | - return (object) [ |
|
37 | - '_50' => $path.$folder.'/50-50/'.$imageName, |
|
38 | - '_100' => $path.$folder.'/100-100/'.$imageName, |
|
39 | - 'original' => $path.$folder.'/original/'.$imageName, |
|
36 | + return (object)[ |
|
37 | + '_50' => $path . $folder . '/50-50/' . $imageName, |
|
38 | + '_100' => $path . $folder . '/100-100/' . $imageName, |
|
39 | + 'original' => $path . $folder . '/original/' . $imageName, |
|
40 | 40 | ]; |
41 | 41 | } |
42 | 42 | |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | $protocol = 'https://'; |
54 | 54 | } |
55 | 55 | |
56 | - return (object) [ |
|
57 | - '_50' => $protocol.$_SERVER['HTTP_HOST'].'/images/logo-50.png', |
|
58 | - '_100' => $protocol.$_SERVER['HTTP_HOST'].'/images/logo-100.png', |
|
59 | - 'original' => $protocol.$_SERVER['HTTP_HOST'].'/images/logo-original.png', |
|
56 | + return (object)[ |
|
57 | + '_50' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-50.png', |
|
58 | + '_100' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-100.png', |
|
59 | + 'original' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-original.png', |
|
60 | 60 | ]; |
61 | 61 | } |
62 | 62 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public static function getImage(string $folder, ?Image $image, ?string $server = null) |
73 | 73 | { |
74 | - if (! $server) { |
|
74 | + if (!$server) { |
|
75 | 75 | $server = config('faithgen-sdk.ministries-server'); |
76 | 76 | } |
77 | 77 |
@@ -8,29 +8,29 @@ discard block |
||
8 | 8 | |
9 | 9 | trait FileTraits |
10 | 10 | { |
11 | - private $dimensions = [0, 50, 100]; |
|
11 | + private $dimensions = [ 0, 50, 100 ]; |
|
12 | 12 | |
13 | 13 | public function getFileName(string $path) |
14 | 14 | { |
15 | 15 | $pieces = explode('/', $path); |
16 | 16 | |
17 | - return $pieces[count($pieces) - 1]; |
|
17 | + return $pieces[ count($pieces) - 1 ]; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function getImage(string $dir, string $imageName, int $dimen = 0) |
21 | 21 | { |
22 | 22 | if ($dimen) { |
23 | - $dimen = $dimen.'-'.$dimen.'/'; |
|
23 | + $dimen = $dimen . '-' . $dimen . '/'; |
|
24 | 24 | } else { |
25 | 25 | $dimen = 'original/'; |
26 | 26 | } |
27 | 27 | |
28 | - return storage_path('app/public/'.$dir.'/'.$dimen.$imageName); |
|
28 | + return storage_path('app/public/' . $dir . '/' . $dimen . $imageName); |
|
29 | 29 | } |
30 | 30 | |
31 | - public function getImages(string $dir, string $fileName, $dimensions = []) |
|
31 | + public function getImages(string $dir, string $fileName, $dimensions = [ ]) |
|
32 | 32 | { |
33 | - if (! count($dimensions)) { |
|
33 | + if (!count($dimensions)) { |
|
34 | 34 | $dimensions = $this->dimensions; |
35 | 35 | } |
36 | 36 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | public function deleteFiles($model) |
43 | 43 | { |
44 | - $images = []; |
|
44 | + $images = [ ]; |
|
45 | 45 | foreach ($model->getImageDimensions() as $imageDimension) { |
46 | 46 | if (is_string($model->getFileName())) { |
47 | 47 | array_push($images, $this->getImage($model->filesDir(), $model->getFileName(), $imageDimension)); |