@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | public function scrape(Crawler $crawler) |
58 | 58 | { |
59 | - $texts = $crawler->filter('#accordion > *')->each(function (Crawler $node) { |
|
59 | + $texts = $crawler->filter('#accordion > *')->each(function(Crawler $node) { |
|
60 | 60 | return $node->text(); |
61 | 61 | }); |
62 | 62 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | public function scrape(Crawler $crawler) |
15 | 15 | { |
16 | - $texts = $crawler->filter('.productPageBody > p')->each(function (Crawler $node) { |
|
16 | + $texts = $crawler->filter('.productPageBody > p')->each(function(Crawler $node) { |
|
17 | 17 | return $node->text(); |
18 | 18 | }); |
19 | 19 | $text = implode('\n\n', $texts); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | public function scrape(Crawler $crawler) |
15 | 15 | { |
16 | - $texts = $crawler->filter('.book-details > div')->each(function (Crawler $node) { |
|
16 | + $texts = $crawler->filter('.book-details > div')->each(function(Crawler $node) { |
|
17 | 17 | if (strpos($node->attr('class'), 'row') === false) { |
18 | 18 | return $node->text(); |
19 | 19 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function toArray() |
31 | 31 | { |
32 | - $body = $this->doc->bibliographic; // PHP makes a copy for us |
|
32 | + $body = $this->doc->bibliographic; // PHP makes a copy for us |
|
33 | 33 | |
34 | 34 | $body['id'] = $this->doc->id; |
35 | 35 | $body['bibsys_id'] = $this->doc->bibsys_id; |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | 'AA' => 'audio', |
11 | 11 | 'AA BA' => 'audio book', |
12 | 12 | 'BA' => 'book', |
13 | - 'BA DA' => 'ebook', // Yes, we DO actually get these |
|
13 | + 'BA DA' => 'ebook', // Yes, we DO actually get these |
|
14 | 14 | 'BB' => 'hardcover', |
15 | - 'BB BC' => 'book', // ... and these |
|
16 | - 'BB DA' => 'ebook', // ... and these |
|
15 | + 'BB BC' => 'book', // ... and these |
|
16 | + 'BB DA' => 'ebook', // ... and these |
|
17 | 17 | 'BC' => 'paperback', |
18 | - 'BC DA' => 'ebook', // ... and these |
|
18 | + 'BC DA' => 'ebook', // ... and these |
|
19 | 19 | 'DA' => 'digital', |
20 | 20 | 'FA' => 'film/transp.', |
21 | 21 | 'MA' => 'microform', |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | if (isset($this->formats[$formStr])) { |
50 | 50 | return $this->formats[$formStr]; |
51 | 51 | } |
52 | - $formStr = implode(' ', array_map(function ($el) { |
|
52 | + $formStr = implode(' ', array_map(function($el) { |
|
53 | 53 | return $this->formats[$el]; |
54 | 54 | }, $forms)); |
55 | 55 | \Log::warning(sprintf('Unknown form: %s', $formStr)); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | /** |
10 | 10 | * Display a listing of the resource. |
11 | 11 | * |
12 | - * @return Response |
|
12 | + * @return \Illuminate\Http\JsonResponse |
|
13 | 13 | */ |
14 | 14 | public function index() |
15 | 15 | { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param int $id |
23 | 23 | * |
24 | - * @return Response |
|
24 | + * @return \Illuminate\Http\JsonResponse |
|
25 | 25 | */ |
26 | 26 | public function show($id) |
27 | 27 | { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->comment('Available configurations:'); |
70 | 70 | $config = \Config::get('oaipmh.harvests', null); |
71 | 71 | foreach (array_keys($config) as $key) { |
72 | - $this->comment(' - ' . $key); |
|
72 | + $this->comment(' - '.$key); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | return false; |
82 | 82 | } |
83 | - $harvestConfig = \Config::get('oaipmh.harvests.' . $this->argument('name'), null); |
|
83 | + $harvestConfig = \Config::get('oaipmh.harvests.'.$this->argument('name'), null); |
|
84 | 84 | if (is_null($harvestConfig)) { |
85 | 85 | $this->error('Unknown configuration specified.'); |
86 | 86 | $this->listConfigurations(); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | $harvestName = $this->argument('name'); |
132 | - $harvestConfig = \Config::get('oaipmh.harvests.' . $harvestName, null); |
|
132 | + $harvestConfig = \Config::get('oaipmh.harvests.'.$harvestName, null); |
|
133 | 133 | |
134 | 134 | $this->comment(''); |
135 | 135 | $this->info(sprintf('[%s] Starting harvest "%s"', |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | if ($this->option('from-dump')) { |
141 | 141 | $this->comment(' - From local dump'); |
142 | 142 | } else { |
143 | - $this->comment(' - Repo: ' . $harvestConfig['url']); |
|
144 | - $this->comment(' - Schema: ' . $harvestConfig['schema']); |
|
145 | - $this->comment(' - Set: ' . $harvestConfig['set']); |
|
143 | + $this->comment(' - Repo: '.$harvestConfig['url']); |
|
144 | + $this->comment(' - Schema: '.$harvestConfig['schema']); |
|
145 | + $this->comment(' - Set: '.$harvestConfig['set']); |
|
146 | 146 | |
147 | 147 | foreach (['from', 'until', 'resume', 'daily'] as $key) { |
148 | 148 | if (!is_null($this->option($key))) { |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | // For timing |
155 | 155 | $this->startTime = $this->batchTime = microtime(true) - 1; |
156 | 156 | |
157 | - \Event::listen('Colligator\Events\OaiPmhHarvestStatus', function ($event) { |
|
157 | + \Event::listen('Colligator\Events\OaiPmhHarvestStatus', function($event) { |
|
158 | 158 | $this->status($event->harvested, $event->position); |
159 | 159 | }); |
160 | 160 | |
161 | - \Event::listen('Colligator\Events\OaiPmhHarvestComplete', function ($event) { |
|
161 | + \Event::listen('Colligator\Events\OaiPmhHarvestComplete', function($event) { |
|
162 | 162 | $this->info(sprintf('[%s] Harvest complete, got %d records in %d seconds', |
163 | 163 | strftime('%Y-%m-%d %H:%M:%S'), |
164 | 164 | $event->count, |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | )); |
167 | 167 | }); |
168 | 168 | |
169 | - \Event::listen('Colligator\Events\JobError', function ($event) { |
|
170 | - \Log::error('[OaiPmhHarvest] ' . $event->msg); |
|
169 | + \Event::listen('Colligator\Events\JobError', function($event) { |
|
170 | + \Log::error('[OaiPmhHarvest] '.$event->msg); |
|
171 | 171 | $this->error($event->msg); |
172 | 172 | }); |
173 | 173 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $name = $this->argument('name'); |
58 | 58 | $parser = new MarcParser(); |
59 | 59 | |
60 | - $files = Storage::disk('local')->files('harvests/' . $name); |
|
60 | + $files = Storage::disk('local')->files('harvests/'.$name); |
|
61 | 61 | |
62 | 62 | $info = [ |
63 | 63 | 'count' => 0, |
@@ -101,29 +101,29 @@ discard block |
||
101 | 101 | if ($localHoldingsCount > 10) { |
102 | 102 | $localHoldingsCount = 10; |
103 | 103 | } |
104 | - $info['holdings_count'][$holdingsCount] = array_get($info, 'holdings_count.' . $holdingsCount, 0) + 1; |
|
105 | - $info['local_holdings_count'][$localHoldingsCount] = array_get($info, 'local_holdings_count.' . $localHoldingsCount, 0) + 1; |
|
104 | + $info['holdings_count'][$holdingsCount] = array_get($info, 'holdings_count.'.$holdingsCount, 0) + 1; |
|
105 | + $info['local_holdings_count'][$localHoldingsCount] = array_get($info, 'local_holdings_count.'.$localHoldingsCount, 0) + 1; |
|
106 | 106 | |
107 | 107 | if (is_null($biblio)) { |
108 | 108 | $this->error('No bibliographic records!'); |
109 | 109 | } else { |
110 | 110 | $c = count($biblio->isbns); |
111 | - $info['isbn_count'][$c] = array_get($info, 'isbn_count.' . $c, 0) + 1; |
|
111 | + $info['isbn_count'][$c] = array_get($info, 'isbn_count.'.$c, 0) + 1; |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | } catch (InvalidXMLException $e) { |
115 | - $this->error('Invalid XML found! Skipping file: ' . $filename); |
|
115 | + $this->error('Invalid XML found! Skipping file: '.$filename); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | $this->output->progressFinish(); |
119 | 119 | |
120 | - $this->comment('Antall dokumenter: ' . $info['count']); |
|
120 | + $this->comment('Antall dokumenter: '.$info['count']); |
|
121 | 121 | |
122 | 122 | $keys = array_keys($info['isbn_count']); |
123 | 123 | sort($keys); |
124 | 124 | $this->comment('Antall ISBN-numre per dokument:'); |
125 | 125 | foreach ($keys as $key) { |
126 | - $this->comment(' - ' . $key . ': ' . $info['isbn_count'][$key]); |
|
126 | + $this->comment(' - '.$key.': '.$info['isbn_count'][$key]); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | $keys = array_keys($info['local_holdings_count']); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | if ($key == 10) { |
135 | 135 | $key = '>= 10'; |
136 | 136 | } |
137 | - $this->comment(' - ' . $key . ': ' . $val); |
|
137 | + $this->comment(' - '.$key.': '.$val); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | //$docIndex->dropVersion(); |
41 | 41 | $oldVersion = $docIndex->getCurrentVersion(); |
42 | 42 | $newVersion = $oldVersion + 1; |
43 | - $this->comment(' Old version: ' . $oldVersion . ', new version: ' . $newVersion); |
|
43 | + $this->comment(' Old version: '.$oldVersion.', new version: '.$newVersion); |
|
44 | 44 | |
45 | 45 | if ($docIndex->versionExists($newVersion)) { |
46 | 46 | $this->comment(' New version already existed, probably from a crashed job. Removing.'); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $docCount = Document::count(); |
59 | 59 | $this->output->progressStart($docCount); |
60 | 60 | |
61 | - Document::with('subjects', 'genres', 'cover')->chunk(1000, function ($docs) use ($docIndex, $newVersion) { |
|
61 | + Document::with('subjects', 'genres', 'cover')->chunk(1000, function($docs) use ($docIndex, $newVersion) { |
|
62 | 62 | foreach ($docs as $doc) { |
63 | 63 | $docIndex->index($doc, $newVersion); |
64 | 64 | $this->output->progressAdvance(); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $docIndex->dropVersion($oldVersion); |
74 | 74 | |
75 | 75 | $dt = microtime(true) - $t0; |
76 | - $this->info(' Completed in ' . round($dt) . ' seconds.'); |
|
77 | - \Log::info('[ReindexJob] Completed in ' . round($dt) . ' seconds.'); |
|
76 | + $this->info(' Completed in '.round($dt).' seconds.'); |
|
77 | + \Log::info('[ReindexJob] Completed in '.round($dt).' seconds.'); |
|
78 | 78 | } |
79 | 79 | } |