@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // register the commands: |
| 97 | 97 | //----------------------- |
| 98 | - $this->app->singleton('cdn.push', function ($app) { |
|
| 98 | + $this->app->singleton('cdn.push', function($app) { |
|
| 99 | 99 | return $app->make('Eliurkis\laravelcdn\Commands\PushCommand'); |
| 100 | 100 | }); |
| 101 | 101 | |
| 102 | 102 | $this->commands('cdn.push'); |
| 103 | 103 | |
| 104 | - $this->app->singleton('cdn.empty', function ($app) { |
|
| 104 | + $this->app->singleton('cdn.empty', function($app) { |
|
| 105 | 105 | return $app->make('Eliurkis\laravelcdn\Commands\EmptyCommand'); |
| 106 | 106 | }); |
| 107 | 107 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | //----------------- |
| 112 | 112 | |
| 113 | 113 | // Register 'CdnFacade' instance container to our CdnFacade object |
| 114 | - $this->app->singleton('CDN', function ($app) { |
|
| 114 | + $this->app->singleton('CDN', function($app) { |
|
| 115 | 115 | return $app->make('Eliurkis\laravelcdn\CdnFacade'); |
| 116 | 116 | }); |
| 117 | 117 | |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | if (is_null($manifest)) { |
| 149 | 149 | $manifest = json_decode(file_get_contents(public_path('mix-manifest.json')), true); |
| 150 | 150 | } |
| 151 | - if (isset($manifest['/' . $path])) { |
|
| 152 | - return $this->generateUrl($manifest['/' . $path], 'public/'); |
|
| 151 | + if (isset($manifest['/'.$path])) { |
|
| 152 | + return $this->generateUrl($manifest['/'.$path], 'public/'); |
|
| 153 | 153 | } |
| 154 | 154 | if (isset($manifest[$path])) { |
| 155 | 155 | return $this->generateUrl($manifest[$path], 'public/'); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $manifest = json_decode(file_get_contents(public_path('build/rev-manifest.json')), true); |
| 176 | 176 | } |
| 177 | 177 | if (isset($manifest[$path])) { |
| 178 | - return $this->generateUrl('build/' . $manifest[$path], 'public/'); |
|
| 178 | + return $this->generateUrl('build/'.$manifest[$path], 'public/'); |
|
| 179 | 179 | } |
| 180 | 180 | throw new \InvalidArgumentException("File {$path} not defined in asset manifest."); |
| 181 | 181 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | // the bucket name |
| 185 | 185 | 'Bucket' => $this->getBucket(), |
| 186 | 186 | // the path of the file on the server (CDN) |
| 187 | - 'Key' => $this->supplier['upload_folder'] . str_replace('\\', '/', $file->getPathName()), |
|
| 187 | + 'Key' => $this->supplier['upload_folder'].str_replace('\\', '/', $file->getPathName()), |
|
| 188 | 188 | // the path of the path locally |
| 189 | 189 | 'Body' => fopen($file->getRealPath(), 'r'), |
| 190 | 190 | // the permission of the file |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $filesOnAWS->put($file['Key'], $a); |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | - $assets->transform(function ($item, $key) use (&$filesOnAWS) { |
|
| 277 | + $assets->transform(function($item, $key) use (&$filesOnAWS) { |
|
| 278 | 278 | $fileOnAWS = $filesOnAWS->get(str_replace('\\', '/', $item->getPathName())); |
| 279 | 279 | |
| 280 | 280 | //select to upload files that are different in size AND last modified time. |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | } |
| 284 | 284 | }); |
| 285 | 285 | |
| 286 | - $assets = $assets->reject(function ($item) { |
|
| 286 | + $assets = $assets->reject(function($item) { |
|
| 287 | 287 | return $item === null; |
| 288 | 288 | }); |
| 289 | 289 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | if ($this->getCloudFront() === true) { |
| 370 | 370 | $url = $this->cdn_helper->parseUrl($this->getCloudFrontUrl()); |
| 371 | 371 | |
| 372 | - return $url['scheme'] . '://' . $url['host'] . '/' . $path; |
|
| 372 | + return $url['scheme'].'://'.$url['host'].'/'.$path; |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | $url = $this->cdn_helper->parseUrl($this->getUrl()); |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | $bucket = $this->getBucket(); |
| 378 | 378 | $bucket = (!empty($bucket)) ? $bucket.'.' : ''; |
| 379 | 379 | |
| 380 | - return $url['scheme'] . '://' . $bucket . $url['host'] . '/' . $path; |
|
| 380 | + return $url['scheme'].'://'.$bucket.$url['host'].'/'.$path; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | /** |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | */ |
| 406 | 406 | public function getUrl() |
| 407 | 407 | { |
| 408 | - return rtrim($this->provider_url, '/') . '/'; |
|
| 408 | + return rtrim($this->provider_url, '/').'/'; |
|
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | /** |