Skip to content

Commit

Permalink
Merge pull request #302 from firefly-iii/develop
Browse files Browse the repository at this point in the history
Release v1.2.0
  • Loading branch information
JC5 authored Mar 12, 2023
2 parents f0add21 + 26d6eb6 commit c8f827a
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .ci/php-cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"friendsofphp/php-cs-fixer": "^3.12"
"friendsofphp/php-cs-fixer": "^3"
}
}
2 changes: 1 addition & 1 deletion .ci/php-cs-fixer/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Qodana
on:
workflow_dispatch:
push:
branches:
- main
- develop
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
qodana:
runs-on: ubuntu-latest
name: 'Qodana Scan'
steps:
- name: Setup PHP with no coverage driver
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
extensions: bcmath, intl
env:
update: true
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install dependencies
run: |
composer install --no-scripts
cp .env.example .env
php artisan key:generate
php artisan clear-compiled
php artisan ide-helper:generate;
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@main
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
21 changes: 13 additions & 8 deletions app/Services/CSV/Conversion/Task/Accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ private function processTransaction(array $transaction): array
if ($transaction['currency_code'] !== $source['currency_code']
&& $transaction['foreign_currency_code'] === $source['currency_code']) {
app('log')->debug('Source account accepts %s, so foreign / native numbers are switched now.');
$amount = $transaction['amount'];
$currency = $transaction['currency_code'];
$transaction['amount'] = $transaction['foreign_amount'];
$transaction['currency_code'] = $transaction['foreign_currency_code'];
$amount = $transaction['amount'] ?? '0';
$currency = $transaction['currency_code'] ?? '';
$transaction['amount'] = $transaction['foreign_amount'] ?? '0';
$transaction['currency_code'] = $transaction['foreign_currency_code'] ?? '';
$transaction['foreign_amount'] = $amount;
$transaction['foreign_currency_code'] = $currency;
}
Expand All @@ -251,10 +251,10 @@ private function processTransaction(array $transaction): array
if ($transaction['currency_code'] !== $destination['currency_code']
&& $transaction['foreign_currency_code'] === $destination['currency_code']) {
app('log')->debug('Destination account accepts %s, so foreign / native numbers are switched now.');
$amount = $transaction['amount'];
$currency = $transaction['currency_code'];
$transaction['amount'] = $transaction['foreign_amount'];
$transaction['currency_code'] = $transaction['foreign_currency_code'];
$amount = $transaction['amount'] ?? '0';
$currency = $transaction['currency_code'] ?? '';
$transaction['amount'] = $transaction['foreign_amount'] ?? '0';
$transaction['currency_code'] = $transaction['foreign_currency_code'] ?? '';
$transaction['foreign_amount'] = $amount;
$transaction['foreign_currency_code'] = $currency;
}
Expand Down Expand Up @@ -682,6 +682,11 @@ private function setDestination(array $transaction, array $source): array
*/
private function hasAllCurrencies(array $transaction): bool
{
$transaction['foreign_currency_code'] = $transaction['foreign_currency_code'] ?? '';
$transaction['currency_code'] = $transaction['currency_code'] ?? '';
$transaction['amount'] = $transaction['amount'] ?? '';
$transaction['foreign_amount'] = $transaction['foreign_amount'] ?? '';

return '' !== (string)$transaction['currency_code'] && '' !== (string)$transaction['foreign_currency_code']
&& '' !== (string)$transaction['amount']
&& '' !== (string)$transaction['foreign_amount'];
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 1.2.0 - 2023-03-13

### Fixed
- [Issue 7207](https://github.com/firefly-iii/firefly-iii/issues/7207) Missing key validation

### Changed
- This release will only work with Firefly III v6.0.3

## 1.1.0 - 2023-03-12

### Added
Expand Down
4 changes: 2 additions & 2 deletions config/importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
declare(strict_types=1);

return [
'version' => '1.1.0',
'version' => '1.2.0',
'flows' => ['nordigen', 'spectre', 'file'],
'flow_titles' => [
'file' => 'File',
Expand All @@ -43,7 +43,7 @@
'ignore_duplicate_errors' => env('IGNORE_DUPLICATE_ERRORS', false),
'namespace' => 'c40dcba2-411d-11ec-973a-0242ac130003',
'use_cache' => env('USE_CACHE', false),
'minimum_version' => '5.7.18',
'minimum_version' => '6.0.3',
'cache_api_calls' => false,
'ignored_files' => ['.gitignore'],
'tracker_site_id' => env('TRACKER_SITE_ID', ''),
Expand Down
9 changes: 9 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
profile:
name: qodana.recommended
version: "1.0"
linter: jetbrains/qodana-php:2022.3-eap
exclude:
- name: All
paths:
- .ci
- _ide_helper.php

0 comments on commit c8f827a

Please sign in to comment.