@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | protected function commands(): void |
61 | 61 | { |
62 | - $this->load(__DIR__.'/Commands'); |
|
62 | + $this->load(__DIR__ . '/Commands'); |
|
63 | 63 | |
64 | 64 | require base_path('routes/console.php'); |
65 | 65 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function cleanString($value): string |
40 | 40 | { |
41 | - $value = (string) $value; |
|
41 | + $value = (string)$value; |
|
42 | 42 | $search = [ |
43 | 43 | "\u{0001}", // start of heading |
44 | 44 | "\u{0002}", // start of text |
@@ -100,7 +100,7 @@ |
||
100 | 100 | $routine->setConfiguration(Configuration::fromArray(session()->get(Constants::CONFIGURATION))); |
101 | 101 | $routine->setReader(FileReader::getReaderFromSession()); |
102 | 102 | $routine->start(); |
103 | - } /** @noinspection PhpRedundantCatchClauseInspection */ catch (ImportException|ErrorException|TypeError $e) { |
|
103 | + } /** @noinspection PhpRedundantCatchClauseInspection */ catch (ImportException | ErrorException | TypeError $e) { |
|
104 | 104 | // update job to error state. |
105 | 105 | ImportJobStatusManager::setJobStatus(ImportJobStatus::JOB_ERRORED); |
106 | 106 | $error = sprintf('Internal error: %s in file %s:%d', $e->getMessage(), $e->getFile(), $e->getLine()); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | protected function redirectTo($request) |
43 | 43 | { |
44 | - if (! $request->expectsJson()) { |
|
44 | + if (!$request->expectsJson()) { |
|
45 | 45 | return route('login'); |
46 | 46 | } |
47 | 47 | return null; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | $this->app->bind( |
44 | 44 | 'steam', |
45 | - static function () { |
|
45 | + static function() { |
|
46 | 46 | return new Steam; |
47 | 47 | } |
48 | 48 | ); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | // if the ID is set, at least search for the ID. |
98 | 98 | if (is_int($array['id']) && $array['id'] > 0) { |
99 | 99 | Log::debug('Find by ID field.'); |
100 | - $result = $this->findById((string) $array['id']); |
|
100 | + $result = $this->findById((string)$array['id']); |
|
101 | 101 | } |
102 | 102 | if (null !== $result) { |
103 | 103 | $return = $result->toArray(); |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | private function findById(string $value): ?Account |
175 | 175 | { |
176 | 176 | Log::debug(sprintf('Going to search account with ID "%s"', $value)); |
177 | - $uri = (string) config('csv_importer.uri'); |
|
178 | - $token = (string) config('csv_importer.access_token'); |
|
177 | + $uri = (string)config('csv_importer.uri'); |
|
178 | + $token = (string)config('csv_importer.access_token'); |
|
179 | 179 | $request = new GetSearchAccountRequest($uri, $token); |
180 | 180 | $request->setField('id'); |
181 | 181 | $request->setQuery($value); |
@@ -271,10 +271,10 @@ discard block |
||
271 | 271 | $transaction = $this->setDestination($transaction, $destination); |
272 | 272 | $transaction['type'] = $this->determineType($source['type'], $destination['type']); |
273 | 273 | |
274 | - $amount = (string) $transaction['amount']; |
|
274 | + $amount = (string)$transaction['amount']; |
|
275 | 275 | $amount = '' === $amount ? '0' : $amount; |
276 | 276 | |
277 | - if('0'===$amount) { |
|
277 | + if ('0' === $amount) { |
|
278 | 278 | Log::error('Amount is ZERO. This will give trouble further down the line.'); |
279 | 279 | } |
280 | 280 |
@@ -203,8 +203,8 @@ |
||
203 | 203 | { |
204 | 204 | $lineValues = array_values($line); |
205 | 205 | array_walk( |
206 | - $lineValues, static function ($element) { |
|
207 | - return trim(str_replace(' ', ' ', (string) $element)); |
|
206 | + $lineValues, static function($element) { |
|
207 | + return trim(str_replace(' ', ' ', (string)$element)); |
|
208 | 208 | } |
209 | 209 | ); |
210 | 210 |
@@ -165,11 +165,11 @@ |
||
165 | 165 | throw new UnexpectedValueException(sprintf('No place for role "%s"', $value->getRole())); |
166 | 166 | } |
167 | 167 | if (null === $parsedValue) { |
168 | - Log::debug(sprintf('Skip column #%d with role "%s" (in field "%s")', $columnIndex+1, $role, $transactionField)); |
|
168 | + Log::debug(sprintf('Skip column #%d with role "%s" (in field "%s")', $columnIndex + 1, $role, $transactionField)); |
|
169 | 169 | continue; |
170 | 170 | } |
171 | 171 | Log::debug( |
172 | - sprintf('Stored column #%d with value "%s" and role "%s" in field "%s"', $columnIndex+1, $this->toString($parsedValue), $role, $transactionField) |
|
172 | + sprintf('Stored column #%d with value "%s" and role "%s" in field "%s"', $columnIndex + 1, $this->toString($parsedValue), $role, $transactionField) |
|
173 | 173 | ); |
174 | 174 | |
175 | 175 | // if append, append. |
@@ -83,7 +83,7 @@ |
||
83 | 83 | } |
84 | 84 | } |
85 | 85 | // loop data, clean up data: |
86 | - foreach($data as $index => $columnInfo) { |
|
86 | + foreach ($data as $index => $columnInfo) { |
|
87 | 87 | $data[$index]['values'] = array_unique($data[$index]['values']); |
88 | 88 | asort($data[$index]['values']); |
89 | 89 | } |