Completed
Push — master ( 54cf98...f40b13 )
by Dan Michael O.
14:46
created
app/Cover.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     public function invalidateCache()
79 79
     {
80 80
         if (!is_null($this->width) && !is_null($this->height)) {
81
-            \Log::debug('[Cover] Invalidating cache. Old version was ' . $this->width . ' x ' . $this->height);
81
+            \Log::debug('[Cover] Invalidating cache. Old version was '.$this->width.' x '.$this->height);
82 82
         }
83 83
         $this->width = null;
84 84
         $this->height = null;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             $orig = \CoverCache::putBlob($blob);
134 134
 
135 135
         } else {
136
-            \Log::debug('[Cover] Add to cache from url: ' . $this->url);
136
+            \Log::debug('[Cover] Add to cache from url: '.$this->url);
137 137
             $orig = \CoverCache::putUrl($this->url);
138 138
         }
139 139
 
Please login to merge, or discard this patch.
app/CachedImage.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -14,6 +14,9 @@
 block discarded – undo
14 14
     public $cacheKey;
15 15
     protected $_metadata;
16 16
 
17
+    /**
18
+     * @param string|null $url
19
+     */
17 20
     public function __construct($url, $maxHeight = 0, AdapterInterface $filesystem = null, ImageManager $imageManager = null)
18 21
     {
19 22
         $this->sourceUrl = $url;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         $this->imageManager = $imageManager ?: app('Intervention\Image\ImageManager');
23 23
         $maxAge = 3153600; // 30 days
24 24
         $this->fsConfig = new FlysystemConfig([
25
-            'CacheControl' => 'max-age=' . $maxAge . ', public',
25
+            'CacheControl' => 'max-age='.$maxAge.', public',
26 26
         ]);
27 27
     }
28 28
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         if (is_null($data)) {
93 93
             $data = $this->download();
94 94
             if (!$data) {
95
-                throw new \ErrorException('[CoverCache] Failed to download ' . $this->sourceUrl);
95
+                throw new \ErrorException('[CoverCache] Failed to download '.$this->sourceUrl);
96 96
             }
97 97
         }
98 98
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
         $img = $this->imageManager->make($data);
102 102
         if ($this->maxHeight && $img->height() > $this->maxHeight) {
103
-            \Log::debug('[CachedImage] Resizing from ' . $img->height() . ' to ' . $this->maxHeight);
103
+            \Log::debug('[CachedImage] Resizing from '.$img->height().' to '.$this->maxHeight);
104 104
             $img->heighten($this->maxHeight);
105 105
             $data = strval($img->encode('jpg'));
106 106
         }
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 
112 112
         $this->setMetadata($data, $img);
113 113
 
114
-        \Log::debug('[CachedImage] Storing image as ' . $img->width() . ' x ' . $img->height() . ', ' . strlen($data) . ' bytes');
114
+        \Log::debug('[CachedImage] Storing image as '.$img->width().' x '.$img->height().', '.strlen($data).' bytes');
115 115
         if (!$this->filesystem->write($this->cacheKey, $data, $this->fsConfig)) {
116 116
             throw new \ErrorException('[CoverCache] Failed to upload thumb to S3');
117 117
         }
118 118
 
119
-        \Log::debug('[CachedImage] Wrote cached version as ' . $this->cacheKey);
119
+        \Log::debug('[CachedImage] Wrote cached version as '.$this->cacheKey);
120 120
 
121 121
         return $this;
122 122
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     {
135 135
         $data = $this->filesystem->read($this->cacheKey);
136 136
         $blob = strval($data['contents']);
137
-        \Log::debug('[CachedImage] Read ' .$this->cacheKey . ': ' . strlen($blob) . ' bytes');
137
+        \Log::debug('[CachedImage] Read '.$this->cacheKey.': '.strlen($blob).' bytes');
138 138
 
139 139
         return \CoverCache::putBlob($blob, $maxHeight);
140 140
     }
Please login to merge, or discard this patch.
app/Jobs/OaiPmhHarvest.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,6 @@
 block discarded – undo
7 7
 use Log;
8 8
 use Phpoaipmh\Client;
9 9
 use Phpoaipmh\Endpoint;
10
-use Scriptotek\OaiPmh\ListRecordsResponse;
11
-use Storage;
12 10
 
13 11
 class OaiPmhHarvest extends Job
14 12
 {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function handle()
109 109
     {
110
-        Log::info('[OaiPmhHarvest] Starting job. Requesting records from ' . ($this->start ?: '(no limit)') . ' until ' . ($this->until ?: '(no limit)') . '.');
110
+        Log::info('[OaiPmhHarvest] Starting job. Requesting records from '.($this->start ?: '(no limit)').' until '.($this->until ?: '(no limit)').'.');
111 111
 
112 112
         // For timing
113 113
         $this->startTime = $this->batchTime = microtime(true) - 1;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
         $recordsHarvested = $this->fromNetwork();
123 123
 
124
-        Log::info('[OaiPmhHarvest] Harvest complete, got ' . $recordsHarvested . ' records.');
124
+        Log::info('[OaiPmhHarvest] Harvest complete, got '.$recordsHarvested.' records.');
125 125
     }
126 126
 
127 127
     /**
Please login to merge, or discard this patch.
app/Console/Commands/OaiPmhHarvest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $this->comment('Available configurations:');
48 48
         $config = \Config::get('oaipmh.harvests', null);
49 49
         foreach (array_keys($config) as $key) {
50
-            $this->comment(' - ' . $key);
50
+            $this->comment(' - '.$key);
51 51
         }
52 52
     }
53 53
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
             return false;
60 60
         }
61
-        $harvestConfig = \Config::get('oaipmh.harvests.' . $this->argument('name'), null);
61
+        $harvestConfig = \Config::get('oaipmh.harvests.'.$this->argument('name'), null);
62 62
         if (is_null($harvestConfig)) {
63 63
             $this->error('Unknown configuration specified.');
64 64
             $this->listConfigurations();
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
         }
101 101
 
102 102
         $harvestName = $this->argument('name');
103
-        $harvestConfig = \Config::get('oaipmh.harvests.' . $harvestName, null);
103
+        $harvestConfig = \Config::get('oaipmh.harvests.'.$harvestName, null);
104 104
 
105 105
         $this->comment(sprintf('Dispatching new harvest job'));
106 106
 
107
-        $this->comment(' - Repo: ' . $harvestConfig['url']);
108
-        $this->comment(' - Schema: ' . $harvestConfig['schema']);
109
-        $this->comment(' - Set: ' . $harvestConfig['set']);
107
+        $this->comment(' - Repo: '.$harvestConfig['url']);
108
+        $this->comment(' - Schema: '.$harvestConfig['schema']);
109
+        $this->comment(' - Set: '.$harvestConfig['set']);
110 110
 
111 111
         foreach (['from', 'until', 'resume', 'daily'] as $key) {
112 112
             if (!is_null($this->option($key))) {
Please login to merge, or discard this patch.