Completed
Push — master ( fcdc06...2647f7 )
by Dan Michael O.
07:17
created
app/Http/Controllers/DocumentsController.php 3 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * Display a listing of the resource.
15 15
      *
16
-     * @return Response
16
+     * @return \Illuminate\Http\JsonResponse
17 17
      */
18 18
     public function index(SearchDocumentsRequest $request, DocumentsIndex $se)
19 19
     {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param DocumentsIndex $se
66 66
      * @param int            $id
67 67
      *
68
-     * @return Response
68
+     * @return \Illuminate\Http\JsonResponse
69 69
      */
70 70
     public function show(Request $request, DocumentsIndex $se, $id)
71 71
     {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     /**
139 139
      * Show cover.
140 140
      *
141
-     * @return Response
141
+     * @return \Illuminate\Http\JsonResponse
142 142
      */
143 143
     public function cover($document_id)
144 144
     {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     /**
153 153
      * Store cover.
154 154
      *
155
-     * @return Response
155
+     * @return \Illuminate\Http\JsonResponse
156 156
      */
157 157
     public function storeCover($document_id, Request $request, DocumentsIndex $se)
158 158
     {
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
     /**
205 205
      * Store description.
206 206
      *
207
-     * @return Response
207
+     * @return \Illuminate\Http\JsonResponse
208 208
      */
209 209
     public function storeDescription($document_id, Request $request, DocumentsIndex $se)
210 210
     {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
     /**
236 236
      * Store "Cannot find cover"
237 237
      *
238
-     * @return Response
238
+     * @return \Illuminate\Http\JsonResponse
239 239
      */
240 240
     public function cannotFindCover($document_id, Request $request, DocumentsIndex $se)
241 241
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Colligator\Http\Controllers;
4 4
 
5 5
 use Carbon\Carbon;
6
-use Colligator\Cover;
7 6
 use Colligator\Document;
8 7
 use Colligator\Http\Requests\SearchDocumentsRequest;
9 8
 use Colligator\Search\DocumentsIndex;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             'event' => 'elasticsearch_request',
40 40
             'event_time' => Carbon::now(),
41 41
             'msecs' => round(($t1 - $t0) * 1000),
42
-            'data' => 'results:' . count($response['hits']['hits']),
42
+            'data' => 'results:'.count($response['hits']['hits']),
43 43
         ]);
44 44
         $hits = count($response['hits']['hits']);
45 45
         if ($response['offset'] + $hits < $out['total']) {
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
                 $cover = $cover->toArray();
205 205
             }
206 206
         } catch (\ErrorException $e) {
207
-            \Log::error('Failed to cache cover, got error: ' . $e->getMessage());
207
+            \Log::error('Failed to cache cover, got error: '.$e->getMessage());
208 208
 
209 209
             return response()->json([
210 210
                 'result' => 'error',
211
-                'error'  => 'Failed to store the cover. Please check that the URL points to a valid image file. Details: ' . $e->getMessage(),
211
+                'error'  => 'Failed to store the cover. Please check that the URL points to a valid image file. Details: '.$e->getMessage(),
212 212
             ]);
213 213
         }
214 214
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         ];
244 244
         $doc->save();
245 245
 
246
-        \Log::info('Stored new description for ' . $doc->id);
246
+        \Log::info('Stored new description for '.$doc->id);
247 247
 
248 248
         $se->indexById($doc->id);
249 249
 
@@ -268,11 +268,11 @@  discard block
 block discarded – undo
268 268
             $doc->save();
269 269
 
270 270
         } catch (\ErrorException $e) {
271
-            \Log::error('Failed to store status, got error: ' . $e->getMessage());
271
+            \Log::error('Failed to store status, got error: '.$e->getMessage());
272 272
 
273 273
             return response()->json([
274 274
                 'result' => 'error',
275
-                'error'  => 'Failed to store status. Details: ' . $e->getMessage(),
275
+                'error'  => 'Failed to store status. Details: '.$e->getMessage(),
276 276
             ]);
277 277
         }
278 278
 
Please login to merge, or discard this patch.
app/Console/Kernel.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,15 +24,15 @@
 block discarded – undo
24 24
     protected function schedule(Schedule $schedule)
25 25
     {
26 26
         $schedule->command('colligator:harvest-oaipmh samling42 --daily')
27
-                 ->dailyAt('02:00');
27
+                    ->dailyAt('02:00');
28 28
 
29 29
         // Bring subject heading usage counts up-to-date
30 30
         $schedule->command('colligator:reindex')
31
-                 ->weekly()->sundays()->at('04:00');
31
+                    ->weekly()->sundays()->at('04:00');
32 32
 
33 33
         // Check new documents for xisbn
34 34
         $schedule->command('colligator:harvest-xisbn')
35
-                 ->weekly()->saturdays()->at('04:00');
35
+                    ->weekly()->saturdays()->at('04:00');
36 36
     }
37 37
 
38 38
     /**
Please login to merge, or discard this patch.
app/Providers/CoverCacheServiceProvider.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 class CoverCacheServiceProvider extends ServiceProvider
11 11
 {
12
-	/**
12
+    /**
13 13
      * Indicates if loading of the provider is deferred.
14 14
      *
15 15
      * @var bool
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@
 block discarded – undo
23 23
      */
24 24
     public function register()
25 25
     {
26
-        $this->app->singleton(CoverCache::class, function ($app) {
26
+        $this->app->singleton(CoverCache::class, function($app) {
27 27
             $fs = \Storage::disk('s3')->getAdapter();
28 28
             $im = $this->app->make(ImageManager::class);
29 29
             $conf = new FlysystemConfig([
30 30
                 // Default: 30 days
31
-                'CacheControl' => 'max-age=' . env('IMAGE_CACHE_TIME', 3153600) . ', public',
31
+                'CacheControl' => 'max-age='.env('IMAGE_CACHE_TIME', 3153600).', public',
32 32
             ]);
33 33
             return new CoverCache($fs, $im, $conf);
34 34
         });
Please login to merge, or discard this patch.
app/CoverCache.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         if (is_null($data)) {
86 86
             $data = $this->download($sourceUrl);
87 87
             if (!$data) {
88
-                throw new \ErrorException('[CoverCache] Failed to download ' . $sourceUrl);
88
+                throw new \ErrorException('[CoverCache] Failed to download '.$sourceUrl);
89 89
             }
90 90
         }
91 91
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         $img = $this->imageManager->make($data);
95 95
         if ($maxHeight && $img->height() > $maxHeight) {
96
-            \Log::debug('[CachedImage] Resizing from ' . $img->height() . ' to ' . $maxHeight);
96
+            \Log::debug('[CachedImage] Resizing from '.$img->height().' to '.$maxHeight);
97 97
             $img->heighten($maxHeight);
98 98
             $data = strval($img->encode('jpg'));
99 99
         }
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
         }
104 104
 
105 105
 
106
-        \Log::debug('[CachedImage] Storing image as ' . $img->width() . ' x ' . $img->height() . ', ' . strlen($data) . ' bytes');
106
+        \Log::debug('[CachedImage] Storing image as '.$img->width().' x '.$img->height().', '.strlen($data).' bytes');
107 107
         if (!$this->filesystem->write($cacheKey, $data, $this->fsConfig)) {
108 108
             throw new \ErrorException('[CoverCache] Failed to upload thumb to S3');
109 109
         }
110 110
 
111
-        \Log::debug('[CachedImage] Wrote cached version as ' . $cacheKey);
111
+        \Log::debug('[CachedImage] Wrote cached version as '.$cacheKey);
112 112
 
113 113
         return new CachedImage($this, $cacheKey);
114 114
     }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     {
140 140
         $data = $this->filesystem->read($cacheKey);
141 141
         $blob = strval($data['contents']);
142
-        \Log::debug('[CachedImage] Read ' .$cacheKey . ': ' . strlen($blob) . ' bytes');
142
+        \Log::debug('[CachedImage] Read '.$cacheKey.': '.strlen($blob).' bytes');
143 143
 
144 144
         return $this->putBlob($blob, $maxHeight);
145 145
     }
Please login to merge, or discard this patch.