@@ -44,13 +44,13 @@ |
||
| 44 | 44 | $response = response($result); |
| 45 | 45 | $name = sprintf('import_config_%s.json', date('Y-m-d')); |
| 46 | 46 | $response->header('Content-disposition', 'attachment; filename=' . $name) |
| 47 | - ->header('Content-Type', 'application/json') |
|
| 48 | - ->header('Content-Description', 'File Transfer') |
|
| 49 | - ->header('Connection', 'Keep-Alive') |
|
| 50 | - ->header('Expires', '0') |
|
| 51 | - ->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') |
|
| 52 | - ->header('Pragma', 'public') |
|
| 53 | - ->header('Content-Length', strlen($result)); |
|
| 47 | + ->header('Content-Type', 'application/json') |
|
| 48 | + ->header('Content-Description', 'File Transfer') |
|
| 49 | + ->header('Connection', 'Keep-Alive') |
|
| 50 | + ->header('Expires', '0') |
|
| 51 | + ->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') |
|
| 52 | + ->header('Pragma', 'public') |
|
| 53 | + ->header('Content-Length', strlen($result)); |
|
| 54 | 54 | |
| 55 | 55 | return $response; |
| 56 | 56 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | protected static function processTransactionDetails(array $row): array |
| 79 | 79 | { |
| 80 | - if(isset($row[9])) { |
|
| 80 | + if (isset($row[9])) { |
|
| 81 | 81 | $transactionDetails = $row[9]; |
| 82 | 82 | $row[11] = self::opposingAccountName($transactionDetails); |
| 83 | 83 | $row[12] = self::opposingAccountIban($transactionDetails); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | private static function convertStructuredDescriptionToProperFormat(string $description): string |
| 131 | 131 | { |
| 132 | 132 | preg_match('/^\*\*\*(\d{3}\/\d{4}\/\d{5})\*\*\*$/', $description, $matches); |
| 133 | - if(isset($matches[1])) { |
|
| 133 | + if (isset($matches[1])) { |
|
| 134 | 134 | return '+++' . $matches[1] . '+++'; |
| 135 | 135 | } |
| 136 | 136 | return $description; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | private static function parseInformationFromTransactionDetails(string $transactionDetails, string $regex): string |
| 146 | 146 | { |
| 147 | - if(isset($transactionDetails)) { |
|
| 147 | + if (isset($transactionDetails)) { |
|
| 148 | 148 | preg_match($regex, $transactionDetails, $matches); |
| 149 | 149 | if (isset($matches[1])) { |
| 150 | 150 | return trim($matches[1]); |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | throw new ImportException('Could not load the users currency preference.'); |
| 132 | 132 | } |
| 133 | 133 | $code = $response->getPreference()->data ?? 'EUR'; |
| 134 | - $currencyRequest = new GetCurrencyRequest($uri,$token); |
|
| 134 | + $currencyRequest = new GetCurrencyRequest($uri, $token); |
|
| 135 | 135 | $currencyRequest->setCode($code); |
| 136 | 136 | try { |
| 137 | 137 | /** @var GetCurrencyResponse $result */ |
@@ -35,8 +35,8 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | private function haveAccess(): bool |
| 37 | 37 | { |
| 38 | - $uri = (string)config('csv_importer.uri'); |
|
| 39 | - $token = (string)config('csv_importer.access_token'); |
|
| 38 | + $uri = (string)config('csv_importer.uri'); |
|
| 39 | + $token = (string)config('csv_importer.access_token'); |
|
| 40 | 40 | $request = new SystemInformationRequest($uri, $token); |
| 41 | 41 | try { |
| 42 | 42 | $request->get(); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function __construct(Repository $config) |
| 57 | 57 | { |
| 58 | - $trustedProxies = (string) config('csv_importer.trusted_proxies'); |
|
| 58 | + $trustedProxies = (string)config('csv_importer.trusted_proxies'); |
|
| 59 | 59 | $this->proxies = explode(',', $trustedProxies); |
| 60 | 60 | if ('**' === $trustedProxies) { |
| 61 | 61 | $this->proxies = '**'; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | // get columns from file |
| 105 | 105 | $content = StorageService::getContent(session()->get(Constants::UPLOAD_CSV_FILE)); |
| 106 | - $delimiter = (string) config(sprintf('csv_importer.delimiters.%s', $configuration->getDelimiter())); |
|
| 106 | + $delimiter = (string)config(sprintf('csv_importer.delimiters.%s', $configuration->getDelimiter())); |
|
| 107 | 107 | $data = MapperService::getMapData($content, $delimiter, $configuration->isHeaders(), $configuration->getSpecifics(), $data); |
| 108 | 108 | |
| 109 | 109 | return view('import.map.index', compact('mainTitle', 'subTitle', 'roles', 'data')); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $values = !is_array($values) ? [] : $values; |
| 122 | 122 | $mapping = !is_array($mapping) ? [] : $mapping; |
| 123 | 123 | $data = []; |
| 124 | - $configuration = Configuration::fromArray(session()->get(Constants::CONFIGURATION)); |
|
| 124 | + $configuration = Configuration::fromArray(session()->get(Constants::CONFIGURATION)); |
|
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | |
@@ -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 | } |