@@ -49,8 +49,8 @@ |
||
49 | 49 | */ |
50 | 50 | public function handleDocuments(XisbnClient $client, $docs) |
51 | 51 | { |
52 | - $this->info('Will check ' . count($docs) . ' documents'); |
|
53 | - Log::info('[HarvestXisbnJob] Starting job. ' . count($docs) . ' documents to be checked.'); |
|
52 | + $this->info('Will check '.count($docs).' documents'); |
|
53 | + Log::info('[HarvestXisbnJob] Starting job. '.count($docs).' documents to be checked.'); |
|
54 | 54 | |
55 | 55 | $this->output->progressStart(count($docs)); |
56 | 56 | foreach ($docs as $doc) { |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | $rec = MarcRecord::fromString($q); |
58 | 58 | |
59 | 59 | $itemMap = [ |
60 | - 'x' => 'location', // OBS: 1030310 |
|
61 | - 'y' => 'shelvinglocation', // OBS: k00475 |
|
60 | + 'x' => 'location', // OBS: 1030310 |
|
61 | + 'y' => 'shelvinglocation', // OBS: k00475 |
|
62 | 62 | 'c' => 'barcode', |
63 | 63 | 'z' => 'callcode', |
64 | 64 | 'a' => 'id', |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | try { |
194 | 194 | $doc->storeCover($biblio['cover_image']); |
195 | 195 | } catch (\ErrorException $e) { |
196 | - \Log::error('Failed to store cover: ' . $biblio['cover_image']); |
|
196 | + \Log::error('Failed to store cover: '.$biblio['cover_image']); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
@@ -208,14 +208,14 @@ discard block |
||
208 | 208 | try { |
209 | 209 | list($biblio, $holdings) = $this->parseRecord($record); |
210 | 210 | } catch (ParserException $e) { |
211 | - $this->error('Failed to parse MARC record. Error "' . $e->getMessage() . '" in: ' . $e->getFile() . ':' . $e->getLine() . "\nStack trace:\n" . $e->getTraceAsString()); |
|
211 | + $this->error('Failed to parse MARC record. Error "'.$e->getMessage().'" in: '.$e->getFile().':'.$e->getLine()."\nStack trace:\n".$e->getTraceAsString()); |
|
212 | 212 | |
213 | 213 | return; |
214 | 214 | } |
215 | 215 | |
216 | 216 | $doc = $this->importParsedRecord($biblio, $holdings); |
217 | 217 | |
218 | - \Log::debug('[Marc21Importer] Imported ' . $doc->bibsys_id . ' as ' . $doc->id); |
|
218 | + \Log::debug('[Marc21Importer] Imported '.$doc->bibsys_id.' as '.$doc->id); |
|
219 | 219 | |
220 | 220 | if (!is_null($doc)) { |
221 | 221 | Event::fire(new Marc21RecordImported($doc->id)); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function fromDump() |
104 | 104 | { |
105 | - $files = Storage::disk('local')->files('harvests/' . $this->name); |
|
105 | + $files = Storage::disk('local')->files('harvests/'.$this->name); |
|
106 | 106 | $recordsHarvested = 0; |
107 | 107 | foreach ($files as $filename) { |
108 | 108 | if (!preg_match('/.xml$/', $filename)) { |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | |
125 | 125 | public function fromNetwork() |
126 | 126 | { |
127 | - $dest_path = 'harvests/' . $this->name . '/'; |
|
127 | + $dest_path = 'harvests/'.$this->name.'/'; |
|
128 | 128 | |
129 | 129 | Storage::disk('local')->deleteDir($dest_path); |
130 | 130 | |
131 | - $latest = $dest_path . 'latest.xml'; |
|
131 | + $latest = $dest_path.'latest.xml'; |
|
132 | 132 | |
133 | 133 | $client = new OaiPmhClient($this->url, [ |
134 | 134 | 'schema' => $this->schema, |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | 'sleep-time-on-error' => $this->sleepTimeOnError, |
138 | 138 | ]); |
139 | 139 | |
140 | - $client->on('request.error', function ($msg) { |
|
140 | + $client->on('request.error', function($msg) { |
|
141 | 141 | $this->error($msg); |
142 | 142 | }); |
143 | 143 | |
144 | 144 | // Store each response to disk just in case |
145 | - $client->on('request.complete', function ($verb, $args, $body) use ($latest) { |
|
145 | + $client->on('request.complete', function($verb, $args, $body) use ($latest) { |
|
146 | 146 | Storage::disk('local')->put($latest, $body); |
147 | 147 | }); |
148 | 148 | |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | if ($this->resume != $records->getResumptionToken()) { |
167 | 167 | $this->resume = $records->getResumptionToken(); |
168 | 168 | if (is_null($this->resume)) { |
169 | - Storage::disk('local')->delete($dest_path . '/resumption_token'); |
|
169 | + Storage::disk('local')->delete($dest_path.'/resumption_token'); |
|
170 | 170 | } else { |
171 | - Storage::disk('local')->put($dest_path . '/resumption_token', $this->resume); |
|
171 | + Storage::disk('local')->put($dest_path.'/resumption_token', $this->resume); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } catch (BadRequestError $e) { |
202 | 202 | $this->error($e->getMessage()); |
203 | 203 | $this->error($e->getCode()); |
204 | - $this->error('Bad request. Attempt ' . $attempt . ' of 100. Sleeping 10 secs.'); |
|
204 | + $this->error('Bad request. Attempt '.$attempt.' of 100. Sleeping 10 secs.'); |
|
205 | 205 | if ($attempt > 100) { |
206 | 206 | throw $e; |
207 | 207 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function handle(DocumentsIndex $docIndex, Marc21Importer $importer) |
227 | 227 | { |
228 | - Log::info('[OaiPmhHarvestJob] Starting job. Requesting records from ' . ($this->start ?: '(no limit)') . ' until ' . ($this->until ?: '(no limit)') . '.'); |
|
228 | + Log::info('[OaiPmhHarvestJob] Starting job. Requesting records from '.($this->start ?: '(no limit)').' until '.($this->until ?: '(no limit)').'.'); |
|
229 | 229 | $this->docIndex = $docIndex; |
230 | 230 | $this->importer = $importer; |
231 | 231 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | } |
246 | 246 | |
247 | 247 | // $this->postProcess($this->importedDocuments); |
248 | - Log::info('[OaiPmhHarvestJob] Complete, got ' . $recordsHarvested . ' records.'); |
|
248 | + Log::info('[OaiPmhHarvestJob] Complete, got '.$recordsHarvested.' records.'); |
|
249 | 249 | |
250 | 250 | Event::fire(new OaiPmhHarvestComplete($recordsHarvested)); |
251 | 251 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $this->warnings[] = 'Offset cannot be negative.'; |
26 | 26 | } elseif ($input['offset'] > $maxPaginationDepth) { |
27 | 27 | $input['offset'] = $maxPaginationDepth; |
28 | - $this->warnings[] = 'Pagination depth is limited to ' . $maxPaginationDepth . ' results.'; |
|
28 | + $this->warnings[] = 'Pagination depth is limited to '.$maxPaginationDepth.' results.'; |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->warnings[] = 'Limit cannot be negative.'; |
37 | 37 | } elseif ($input['limit'] > $maxResultsPerRequest) { |
38 | 38 | $input['limit'] = $maxResultsPerRequest; |
39 | - $this->warnings[] = 'Limiting to max ' . $maxResultsPerRequest . ' results per request.'; |
|
39 | + $this->warnings[] = 'Limiting to max '.$maxResultsPerRequest.' results per request.'; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 |