@@ -30,7 +30,7 @@ |
||
30 | 30 | { |
31 | 31 | $this->mergeConfigFrom(__DIR__.'/../config/asset-cdn.php', 'asset-cdn'); |
32 | 32 | |
33 | - $this->app->singleton(Finder::class, function ($app) { |
|
33 | + $this->app->singleton(Finder::class, function($app) { |
|
34 | 34 | return new Finder(new Config($app->make('config'), $app->make('path.public'))); |
35 | 35 | }); |
36 | 36 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $config->get('asset-cdn.filesystem.options') |
65 | 65 | ); |
66 | 66 | |
67 | - if (! $bool) { |
|
67 | + if (!$bool) { |
|
68 | 68 | $this->error("Problem uploading: {$file->getRelativePathname()}"); |
69 | 69 | } else { |
70 | 70 | $this->info("Successfully uploaded: {$file->getRelativePathname()}"); |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | */ |
88 | 88 | private function filesToSync(array $filesOnCdn, array $localFiles): array |
89 | 89 | { |
90 | - $array = array_filter($localFiles, function (SplFileInfo $localFile) use ($filesOnCdn) { |
|
90 | + $array = array_filter($localFiles, function(SplFileInfo $localFile) use ($filesOnCdn) { |
|
91 | 91 | $localFilePathname = $localFile->getRelativePathname(); |
92 | - if (! in_array($localFilePathname, $filesOnCdn)) { |
|
92 | + if (!in_array($localFilePathname, $filesOnCdn)) { |
|
93 | 93 | return true; |
94 | 94 | } |
95 | 95 | |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | { |
129 | 129 | $localFiles = $this->mapToPathname($localFiles); |
130 | 130 | |
131 | - $array = array_filter($filesOnCdn, function (string $fileOnCdn) use ($localFiles) { |
|
132 | - return ! in_array($fileOnCdn, $localFiles); |
|
131 | + $array = array_filter($filesOnCdn, function(string $fileOnCdn) use ($localFiles) { |
|
132 | + return !in_array($fileOnCdn, $localFiles); |
|
133 | 133 | }); |
134 | 134 | |
135 | 135 | return array_values($array); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $config->get('asset-cdn.filesystem.options') |
47 | 47 | ); |
48 | 48 | |
49 | - if (! $bool) { |
|
49 | + if (!$bool) { |
|
50 | 50 | $this->error("Problem uploading: {$file->getRelativePathname()}"); |
51 | 51 | } else { |
52 | 52 | $this->info("Successfully uploaded: {$file->getRelativePathname()}"); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | protected function mapToPathname(array $files): array |
21 | 21 | { |
22 | - return array_map(function (SplFileInfo $file) { |
|
22 | + return array_map(function(SplFileInfo $file) { |
|
23 | 23 | return $file->getRelativePathname(); |
24 | 24 | }, $files); |
25 | 25 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use Illuminate\Support\Str; |
4 | 4 | use Illuminate\Support\HtmlString; |
5 | 5 | |
6 | -if (! function_exists('mix_cdn')) { |
|
6 | +if (!function_exists('mix_cdn')) { |
|
7 | 7 | /** |
8 | 8 | * Get the path to a versioned Mix file. |
9 | 9 | * |
@@ -15,24 +15,24 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function mix_cdn($path, $manifestDirectory = '') |
17 | 17 | { |
18 | - if (! config('asset-cdn.use_cdn')) { |
|
18 | + if (!config('asset-cdn.use_cdn')) { |
|
19 | 19 | return mix($path, $manifestDirectory); |
20 | 20 | } |
21 | 21 | |
22 | 22 | static $manifests = []; |
23 | 23 | |
24 | - if (! Str::startsWith($path, '/')) { |
|
24 | + if (!Str::startsWith($path, '/')) { |
|
25 | 25 | $path = "/{$path}"; |
26 | 26 | } |
27 | 27 | |
28 | - if ($manifestDirectory && ! Str::startsWith($manifestDirectory, '/')) { |
|
28 | + if ($manifestDirectory && !Str::startsWith($manifestDirectory, '/')) { |
|
29 | 29 | $manifestDirectory = "/{$manifestDirectory}"; |
30 | 30 | } |
31 | 31 | |
32 | 32 | $manifestPath = public_path($manifestDirectory.'/mix-manifest.json'); |
33 | 33 | |
34 | - if (! isset($manifests[$manifestPath])) { |
|
35 | - if (! file_exists($manifestPath)) { |
|
34 | + if (!isset($manifests[$manifestPath])) { |
|
35 | + if (!file_exists($manifestPath)) { |
|
36 | 36 | throw new Exception('The Mix manifest does not exist.'); |
37 | 37 | } |
38 | 38 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | $manifest = $manifests[$manifestPath]; |
43 | 43 | |
44 | - if (! isset($manifest[$path])) { |
|
44 | + if (!isset($manifest[$path])) { |
|
45 | 45 | throw new Exception("Unable to locate Mix file: {$path}."); |
46 | 46 | } |
47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | -if (! function_exists('asset_cdn')) { |
|
56 | +if (!function_exists('asset_cdn')) { |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Generate an asset path for the application. |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | function asset_cdn($path) |
65 | 65 | { |
66 | - if (! config('asset-cdn.use_cdn')) { |
|
66 | + if (!config('asset-cdn.use_cdn')) { |
|
67 | 67 | return asset($path); |
68 | 68 | } |
69 | 69 |
@@ -160,7 +160,7 @@ |
||
160 | 160 | private function mergeFileInfos(array $includedPaths, array $includedNames): array |
161 | 161 | { |
162 | 162 | return collect(array_merge($includedPaths, $includedNames)) |
163 | - ->unique(function (SplFileInfo $file) { |
|
163 | + ->unique(function(SplFileInfo $file) { |
|
164 | 164 | return $file->getPathname(); |
165 | 165 | }) |
166 | 166 | ->values() |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | private function paths(string $type): array |
83 | 83 | { |
84 | 84 | return array_map( |
85 | - function ($path) { |
|
85 | + function($path) { |
|
86 | 86 | return $this->cleanPath($path).'/'; |
87 | 87 | }, |
88 | 88 | $this->config[$type]['paths'] |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | private function files(string $type): array |
93 | 93 | { |
94 | 94 | return array_map( |
95 | - function ($path) { |
|
95 | + function($path) { |
|
96 | 96 | return $this->cleanPath($path); |
97 | 97 | }, |
98 | 98 | $this->config[$type]['files'] |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | private function extensions(string $type): array |
103 | 103 | { |
104 | 104 | return array_map( |
105 | - function ($extension) { |
|
105 | + function($extension) { |
|
106 | 106 | return '*'.$this->start($extension, '.'); |
107 | 107 | }, |
108 | 108 | $this->config[$type]['extensions'] |