@@ -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)); |
@@ -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 | } |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | $field = 'genres'; |
86 | 86 | $entity = Genre::where('term', '=', $labels['nb'])->where('vocabulary', '=', 'noubomn')->first(); |
87 | 87 | if (is_null($entity)) { |
88 | - $this->error('[ImportOntosaur] Entity not found: "' . $labels['nb'] . '"'); |
|
88 | + $this->error('[ImportOntosaur] Entity not found: "'.$labels['nb'].'"'); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | if (!is_null($entity)) { |
92 | 92 | $node['local_id'] = $entity->id; |
93 | 93 | $node['documents'] = action('DocumentsController@index', [ |
94 | - 'q' => $field . '.noubomn.id:' . $entity->id, |
|
94 | + 'q' => $field.'.noubomn.id:'.$entity->id, |
|
95 | 95 | ]); |
96 | 96 | // Can be used e.g. to determine bubble size in a visualization |
97 | 97 | $node['document_count'] = $entity->documents()->count(); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | if (count($topNodes) != 1) { |
148 | - throw new \Exception('Found ' . count($topNodes) . ' topnodes rather than 1: ' . implode(', ', $topNodes)); |
|
148 | + throw new \Exception('Found '.count($topNodes).' topnodes rather than 1: '.implode(', ', $topNodes)); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | return [$nodes, $links, $topNodes[0]]; |
@@ -167,6 +167,6 @@ discard block |
||
167 | 167 | $saur->links = $links; |
168 | 168 | $saur->topnode = $topnode; |
169 | 169 | $saur->save(); |
170 | - $this->info('[ImportOntosaur] Completed. Have ' . count($nodes) . ' nodes, ' . count($links) . ' links.'); |
|
170 | + $this->info('[ImportOntosaur] Completed. Have '.count($nodes).' nodes, '.count($links).' links.'); |
|
171 | 171 | } |
172 | 172 | } |
@@ -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) { |
@@ -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 |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Colligator; |
4 | 4 | |
5 | 5 | use Scriptotek\GoogleBooks\GoogleBooks; |
6 | -use Scriptotek\GoogleBooks\Exceptions\UsageRateExceeded; |
|
7 | 6 | |
8 | 7 | class GoogleBooksService implements EnrichmentService |
9 | 8 | { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | foreach ($isbns as $isbn) { |
21 | 21 | $volume = $this->books->volumes->byIsbn($isbn); |
22 | - \Log::debug('[GoogleBooksService] - ' . $isbn . ': ' . (is_null($volume) ? 'not found' : 'found')); |
|
22 | + \Log::debug('[GoogleBooksService] - '.$isbn.': '.(is_null($volume) ? 'not found' : 'found')); |
|
23 | 23 | if (!is_null($volume)) { |
24 | 24 | return $volume; |
25 | 25 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function enrich(Document $doc) |
31 | 31 | { |
32 | - \Log::debug('[GoogleBooksService] Checking document ' . $doc->id); |
|
32 | + \Log::debug('[GoogleBooksService] Checking document '.$doc->id); |
|
33 | 33 | |
34 | 34 | $volume = $this->get($doc->bibliographic['isbns']); |
35 | 35 | |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | if ($volume) { |
48 | 48 | $cover_url = $volume->getCover(); |
49 | 49 | if (!is_null($cover_url) && is_null($doc->cover)) { |
50 | - \Log::debug('[GoogleBooksService] Setting new cover to document #' . $doc->id); |
|
50 | + \Log::debug('[GoogleBooksService] Setting new cover to document #'.$doc->id); |
|
51 | 51 | try { |
52 | 52 | $doc->storeCover($cover_url); |
53 | 53 | } catch (\ErrorException $e) { |
54 | - \Log::error('[GoogleBooksService] Failed to store cover: ' . $cover_url . "\n" . $e->getMessage()); |
|
54 | + \Log::error('[GoogleBooksService] Failed to store cover: '.$cover_url."\n".$e->getMessage()); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | public function handleDocuments(EnrichmentService $service, $docs) |
73 | 73 | { |
74 | - \Log::info('[EnrichDocuments] Starting job. ' . count($docs) . ' documents to be checked using the "' . $service::$serviceName . '" service.'); |
|
74 | + \Log::info('[EnrichDocuments] Starting job. '.count($docs).' documents to be checked using the "'.$service::$serviceName.'" service.'); |
|
75 | 75 | |
76 | 76 | // $this->output->progressStart(count($docs)); |
77 | 77 | foreach ($docs as $doc) { |
@@ -107,22 +107,22 @@ discard block |
||
107 | 107 | $collectionId = intval($this->option('collection')); |
108 | 108 | |
109 | 109 | if (!isset($this->services[$serviceName])) { |
110 | - $this->error('Service "' . $serviceName . '" is not defined. Available servies: "' . implode('", "', array_keys($this->services)) . '".'); |
|
110 | + $this->error('Service "'.$serviceName.'" is not defined. Available servies: "'.implode('", "', array_keys($this->services)).'".'); |
|
111 | 111 | return; |
112 | 112 | } |
113 | 113 | |
114 | 114 | if ($verbose) { |
115 | - \DB::listen(function ($query, $bindings) { |
|
116 | - $this->comment('Query: ' . $query . '. Bindings: ' . implode(', ', $bindings)); |
|
115 | + \DB::listen(function($query, $bindings) { |
|
116 | + $this->comment('Query: '.$query.'. Bindings: '.implode(', ', $bindings)); |
|
117 | 117 | }); |
118 | 118 | } |
119 | 119 | |
120 | - $collectionHelp = ($collectionId > 0) ? ' in collection ' . $collectionId : ''; |
|
120 | + $collectionHelp = ($collectionId > 0) ? ' in collection '.$collectionId : ''; |
|
121 | 121 | |
122 | 122 | $docs = $this->getDocumentsToBeChecked($serviceName, $force, $collectionId); |
123 | 123 | |
124 | 124 | if (!count($docs)) { |
125 | - $this->info('No new documents' . $collectionHelp . '. Exiting.'); |
|
125 | + $this->info('No new documents'.$collectionHelp.'. Exiting.'); |
|
126 | 126 | \Log::info('[EnrichDocuments] No new documents to be checked.'); |
127 | 127 | return; |
128 | 128 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /* |
20 | 20 | * Authenticate the user's personal channel... |
21 | 21 | */ |
22 | - Broadcast::channel('Colligator.User.{userId}', function ($user, $userId) { |
|
22 | + Broadcast::channel('Colligator.User.{userId}', function($user, $userId) { |
|
23 | 23 | return (int) $user->id === (int) $userId; |
24 | 24 | }); |
25 | 25 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | Route::group([ |
42 | 42 | 'middleware' => 'web', |
43 | 43 | 'namespace' => $this->namespace, |
44 | - ], function () { |
|
44 | + ], function() { |
|
45 | 45 | require base_path('routes/web.php'); |
46 | 46 | }); |
47 | 47 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'middleware' => 'api', |
59 | 59 | 'namespace' => $this->namespace, |
60 | 60 | // 'prefix' => 'api', |
61 | - ], function () { |
|
61 | + ], function() { |
|
62 | 62 | require base_path('routes/api.php'); |
63 | 63 | }); |
64 | 64 | } |