@@ -83,7 +83,7 @@ |
||
83 | 83 | public function withValidator(Validator $validator): void |
84 | 84 | { |
85 | 85 | $validator->after( |
86 | - function (Validator $validator) { |
|
86 | + function(Validator $validator) { |
|
87 | 87 | // validate all account info |
88 | 88 | $this->validateAmountRole($validator); |
89 | 89 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $json = file_get_contents($file); |
44 | 44 | try { |
45 | 45 | json_decode($json, true, 512, JSON_THROW_ON_ERROR); |
46 | - } catch (Exception|JsonException $e) { |
|
46 | + } catch (Exception | JsonException $e) { |
|
47 | 47 | $message = sprintf('The importer can\'t import: could not decode the JSON in the config file: %s', $e->getMessage()); |
48 | 48 | Log::error($message); |
49 | 49 |
@@ -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 |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | public function doValidate(): JsonResponse |
46 | 46 | { |
47 | 47 | $response = ['result' => 'OK', 'message' => null]; |
48 | - $uri = (string)config('csv_importer.uri'); |
|
49 | - $token = (string)config('csv_importer.access_token'); |
|
48 | + $uri = (string)config('csv_importer.uri'); |
|
49 | + $token = (string)config('csv_importer.access_token'); |
|
50 | 50 | $request = new SystemInformationRequest($uri, $token); |
51 | 51 | try { |
52 | 52 | $result = $request->get(); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | 'Your Firefly III version %s is below the minimum required version %s', |
65 | 65 | $result->version, $minimum |
66 | 66 | ); |
67 | - $response = ['result' => 'NOK', 'message' => $errorMessage]; |
|
67 | + $response = ['result' => 'NOK', 'message' => $errorMessage]; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | return response()->json($response); |
@@ -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 |