From dac4f23d51a77ad6abc28837219fbc1a4422262f Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 10:28:45 +0100 Subject: [PATCH 001/258] Expand debug page. --- .github/ISSUE_TEMPLATE.md | 2 ++ app/Http/Controllers/HomeController.php | 34 ++++++++++++++++++++----- resources/views/debug.twig | 24 ++++++++++++++--- 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 63fa12e078..5d8fff3583 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -7,3 +7,5 @@ I am running Firefly III version x.x.x (please include if this problem also exists on the demo site) #### Other important details (log files, system info): + +Please visit the /debug page to get extra debug information. \ No newline at end of file diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 0d6b882d65..1b7d02b3b6 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -35,6 +35,7 @@ use Illuminate\Http\Request; use Illuminate\Routing\Route; use Illuminate\Support\Collection; use Log; +use Monolog\Handler\RotatingFileHandler; use Preferences; use Route as RouteFacade; use Session; @@ -88,15 +89,36 @@ class HomeController extends Controller Session::put('end', $end); } - public function displayDebug() + /** + * + */ + public function displayDebug(Request $request) { - $phpVersion = PHP_VERSION; - $now = Carbon::create()->format('Y-m-d H:i:s e'); - $extensions = join(', ', get_loaded_extensions()); - $drivers = join(', ', DB::availableDrivers()); + $phpVersion = PHP_VERSION; + $phpOs = php_uname(); + $interface = php_sapi_name(); + $now = Carbon::create()->format('Y-m-d H:i:s e'); + $extensions = join(', ', get_loaded_extensions()); + $drivers = join(', ', DB::availableDrivers()); $currentDriver = DB::getDriverName(); + $userAgent = $request->header('user-agent'); - return view('debug', compact('phpVersion', 'extensions', 'carbon', 'now', 'drivers','currentDriver')); + // get latest log file: + $logger = Log::getMonolog(); + $handlers = $logger->getHandlers(); + $logContent = ''; + foreach ($handlers as $handler) { + if ($handler instanceof RotatingFileHandler) { + $logFile = $handler->getUrl(); + if (!is_null($logFile)) { + $logContent = file_get_contents($logFile); + } + } + } + // last few lines + $logContent = 'Truncated from this point <----|'.substr($logContent, -4096); + + return view('debug', compact('phpVersion', 'extensions', 'carbon', 'now', 'drivers', 'currentDriver', 'userAgent', 'phpOs', 'interface', 'logContent')); } diff --git a/resources/views/debug.twig b/resources/views/debug.twig index 8b548cd753..00c269af81 100644 --- a/resources/views/debug.twig +++ b/resources/views/debug.twig @@ -4,22 +4,40 @@ -

- Please copy and paste the content of this textbox into a (new) Github issue. Don't change anything, don't add enters or something. +

+ If you are running into problems, you can use the information in this box as debug information. Please copy-and-paste into a new + or existing Github issue. It will generate a beautiful table that can + be used to quickly diagnose your problem.

- + + +

+ You may also share the content of the box below. You can also copy-and-paste this into a new + or existing Github issue. However, the content of this + box may contain private information such as account names, transaction details or email addresses. +

+ + \ No newline at end of file From 8c707f891864282bc4bbeb927b8c106302f4c561 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:00:15 +0100 Subject: [PATCH 002/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index e7afb2d94c..a7ff8bcd37 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -720,11 +720,11 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'piggyBanks' => 'Sparschweine', 'bills' => 'Rechnungen', 'withdrawal' => 'Ausgabe', - 'deposit' => 'Einzahlung', + 'deposit' => 'Einnahme', 'account' => 'Konto', 'transfer' => 'Überweisung', 'Withdrawal' => 'Ausgabe', - 'Deposit' => 'Einzahlung', + 'Deposit' => 'Einnahme', 'Transfer' => 'Überweisung', 'bill' => 'Rechnung', 'yes' => 'Ja', @@ -971,7 +971,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'journals_error_linked' => 'These transactions are already linked.', 'journal_links' => 'Transaction links', 'this_withdrawal' => 'This withdrawal', - 'this_deposit' => 'This deposit', + 'this_deposit' => 'Diese Einnahme', 'this_transfer' => 'This transfer', 'overview_for_link' => 'Overview for link type ":name"', 'source_transaction' => 'Source transaction', @@ -1085,8 +1085,8 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'no_transactions_create_withdrawal' => 'Eine neue Ausgabe erstellen', 'no_transactions_title_deposit' => 'Let\'s create some income!', 'no_transactions_intro_deposit' => 'You have no recorded income yet. You should create income entries to start managing your finances.', - 'no_transactions_imperative_deposit' => 'Have you received some money? Then you should write it down:', - 'no_transactions_create_deposit' => 'Create a deposit', + 'no_transactions_imperative_deposit' => 'Haben Sie Geld erhalten? Dann sollten Sie es aufschreiben:', + 'no_transactions_create_deposit' => 'Eine Einnahme erstellen', 'no_transactions_title_transfers' => 'Let\'s create a transfer!', 'no_transactions_intro_transfers' => 'You have no transfers yet. When you move money between asset accounts, it is recorded as a transfer.', 'no_transactions_imperative_transfers' => 'Have you moved some money around? Then you should write it down:', From 39679f89cda55f2d366257e2fe1ea8136c7e60ef Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:11:10 +0100 Subject: [PATCH 003/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index a7ff8bcd37..78013fac7d 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -144,10 +144,10 @@ return [ // repeat frequencies: 'repeat_freq_yearly' => 'Jährlich', - 'repeat_freq_half-year' => 'every half-year', - 'repeat_freq_quarterly' => 'quarterly', + 'repeat_freq_half-year' => 'halbjährlich', + 'repeat_freq_quarterly' => 'vierteljährlich', 'repeat_freq_monthly' => 'monatlich', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'wöchentlich', 'weekly' => 'wöchentlich', 'quarterly' => 'vierteljährlich', 'half-year' => 'halbjährlich', @@ -694,7 +694,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'bills_to_pay' => 'Unbezahlte Rechnungen', 'per_day' => 'Pro Tag', 'left_to_spend_per_day' => 'Left to spend per day', - 'bills_paid' => 'Bills paid', + 'bills_paid' => 'Rechnungen bezahlt', // menu and titles, should be recycled as often as possible: 'currency' => 'Währung', @@ -975,7 +975,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'this_transfer' => 'This transfer', 'overview_for_link' => 'Overview for link type ":name"', 'source_transaction' => 'Source transaction', - 'link_description' => 'Link description', + 'link_description' => 'Linkbeschreibung', 'destination_transaction' => 'Destination transaction', 'delete_journal_link' => 'Delete the link between :source and :destination', 'deleted_link' => 'Deleted link', From 2d7a83ca34285ff984ad67157781f6940edd56d6 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:20:29 +0100 Subject: [PATCH 004/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 78013fac7d..0752575c1b 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -129,7 +129,7 @@ return [ 'transfer_exchange_rate_instructions' => 'Das Quellkonto "@source_name" akzeptiert nur Transaktionen in @source_currency. Das Zielkonto "@dest_name" akzeptiert nur Transaktionen in @dest_currency. Sie müssen den Betrag in beiden Währungen korrekt angeben.', 'transaction_data' => 'Transaktionsdaten', 'invalid_server_configuration' => 'Ungültige Serverkonfiguration', - 'invalid_locale_settings' => 'Firefly III is unable to format monetary amounts because your server is missing the required packages. There are instructions how to do this.', + 'invalid_locale_settings' => 'Firefly III kann keine Geldbeträge formatieren, da auf Ihrem Server die erforderlichen Pakete fehlen. Es gibt eine Anleitung, wie dies behoben werden kann.', // search 'search' => 'Suche', @@ -450,10 +450,10 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'regenerate_access_token' => 'Zugangs-Token neu erstellen', 'token_regenerated' => 'Ein neuer Zugangs-Token wurde generiert', 'change_your_email' => 'E-Mail Adresse ändern', - 'email_verification' => 'An email message will be sent to your old AND new email address. For security purposes, you will not be able to login until you verify your new email address. If you are unsure if your Firefly III installation is capable of sending email, please do not use this feature. If you are an administrator, you can test this in the Administration.', + 'email_verification' => 'Eine E-Mail-Nachricht wird an Ihre alte UND neue E-Mail-Adresse gesendet. Aus Sicherheitsgründen können Sie sich erst anmelden, wenn Sie Ihre neue E-Mail-Adresse bestätigt haben. Wenn Sie sich nicht sicher sind, ob Ihre Firefly III-Installation E-Mails versenden kann, verwenden Sie bitte diese Funktion nicht. Wenn Sie Administrator sind, können Sie dies in der Administration testen.', 'email_changed_logout' => 'Sie müssen Ihre E-Mail-Adresse bestätigen, um sich anmelden zu können.', - 'login_with_new_email' => 'You can now login with your new email address.', - 'login_with_old_email' => 'You can now login with your old email address again.', + 'login_with_new_email' => 'Sie können sich jetzt mit Ihrer neuen E-Mail-Adresse anmelden.', + 'login_with_old_email' => 'Sie können sich jetzt wieder mit Ihrer alten E-Mail-Adresse anmelden.', // attachments @@ -556,9 +556,9 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'update_budget' => 'Budget aktualisieren', 'update_budget_amount_range' => 'Aktualisiere (erwarteten) verfügbaren Betrag zwischen :start und :end', 'budget_period_navigator' => 'Zeitraum-navigator', - 'info_on_available_amount' => 'What do I have available?', + 'info_on_available_amount' => 'Was habe ich verfügbar?', 'available_amount_indication' => 'Use these amounts to get an indication of what your total budget could be.', - 'suggested' => 'Suggested', + 'suggested' => 'Vorgeschlagen', 'average_between' => 'Average between :start and :end', @@ -966,7 +966,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'transaction' => 'Transaction', 'comments' => 'Comments', 'to_link_not_found' => 'If the transaction you want to link to is not listed, simply enter its ID.', - 'invalid_link_selection' => 'Cannot link these transactions', + 'invalid_link_selection' => 'Diese Transaktionen können nicht verknüpft werden', 'journals_linked' => 'Transactions are linked.', 'journals_error_linked' => 'These transactions are already linked.', 'journal_links' => 'Transaction links', From 186729470421020839f61c8dc751412fd0dd38a9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:20:30 +0100 Subject: [PATCH 005/258] New translations form.php (German) --- resources/lang/de_DE/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/form.php b/resources/lang/de_DE/form.php index 8d8c9157f2..06e54348e2 100644 --- a/resources/lang/de_DE/form.php +++ b/resources/lang/de_DE/form.php @@ -69,7 +69,7 @@ return [ 'native_amount' => 'Nativer Betrag', 'new_email_address' => 'Neue E-Mail-Adresse', 'verification' => 'Bestätigung', - 'api_key' => 'API key', + 'api_key' => 'API-Schlüssel', 'source_account_asset' => 'Quellkonto (Bestandskonto)', 'destination_account_expense' => 'Zielkonto (Unkostenkonto)', From 8c75f9af149019184f7f612f0973cac495ac5dd2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:31:55 +0100 Subject: [PATCH 006/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 0752575c1b..2f81895506 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -435,13 +435,13 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'password_changed' => 'Passwort geändert!', 'should_change' => 'Ziel ist es, ihr Passwort zu ändern.', 'invalid_password' => 'Ungültiges Passwort!', - 'what_is_pw_security' => 'Was ist "Kennwort Sicherheit überprüfen"?', + 'what_is_pw_security' => 'Was ist "Passwortsicherheit überprüfen"?', 'secure_pw_title' => 'So wählen Sie ein sicheres Passwort aus', 'secure_pw_history' => 'Im August 2017 veröffentlichte die bekannte Sicherheitsforscherin Troy Hunt eine Liste von 306 Millionen gestohlenen Passwörtern. Diese Passwörter wurden während der Einbrüche bei Firmen wie LinkedIn, Adobe und NeoPets (und vielen mehr) gestohlen.', - 'secure_pw_check_box' => 'By checking the box, Firefly III will send the SHA1 hash of your password to the website of Troy Hunt to see if it is on the list. This will stop you from using unsafe passwords as is recommended in the latest NIST Special Publication on this subject.', + 'secure_pw_check_box' => 'Wenn Sie das Kontrollkästchen aktivieren, wird Firefly III den SHA1-Hash Ihres Passworts an die Website von Troy Hunt senden, um zu sehen, ob es auf der Liste steht. Dies verhindert, dass Sie unsichere Passwörter verwenden, was in der aktuellen NIST-Sonderveröffentlichung zu diesem Thema empfohlen wird.', 'secure_pw_sha1' => 'Aber ich dachte, dass SHA1 schon geknackt wurde?', - 'secure_pw_hash_speed' => 'Yes, but not in this context. As you can read on the website detailing how they broke SHA1, it is now slightly easier to find a "collision": another string that results in the same SHA1-hash. It now only takes 10,000 years using a single-GPU machine.', - 'secure_pw_hash_security' => 'This collision would not be equal to your password, nor would it be useful on (a site like) Firefly III. This application does not use SHA1 for password verification. So it is safe to check this box. Your password is hashed and sent over HTTPS.', + 'secure_pw_hash_speed' => 'Ja, aber nicht in diesem Zusammenhang. Wie Sie auf auf der Website, die erklärt, wie SHA1 gebrochen wurde, lesen können, ist es jetzt etwas leichter, eine "Kollision" zu finden: eine andere Zeichenfolge, die zu demselben SHA1-Hash führt. Es dauert nur mehr 10.000 Jahre mit einer Single-GPU-Maschine.', + 'secure_pw_hash_security' => 'Diese Kollision wäre nicht gleich Ihrem Passwort, noch wäre es nützlich auf (einer Seite wie) Firefly III. Diese Anwendung verwendet SHA1 nicht zur Passwortüberprüfung. Es ist also sicher, dieses Kästchen zu aktivieren. Ihr Passwort wird gehasht und über HTTPS übertragen.', 'secure_pw_should' => 'Soll ich die Box ankreuzen?', 'secure_pw_long_password' => 'Wenn du gerade ein langes, Single-Use-Passwort für Firefly III mit einem Kennwortgenerator generiert hast: Nein.', 'secure_pw_short' => 'Wenn Sie gerade das Passwort eingegeben haben, welches Sie immer verwenden: Bitte ja.', @@ -826,8 +826,8 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'account_role_sharedAsset' => 'Shared asset account', 'account_role_savingAsset' => 'Sparkonto', 'account_role_ccAsset' => 'Kreditkarte', - 'budget_chart_click' => 'Please click on a budget name in the table above to see a chart.', - 'category_chart_click' => 'Please click on a category name in the table above to see a chart.', + 'budget_chart_click' => 'Klicken Sie auf einen Budgetnamen in der obigen Tabelle, um ein Diagramm anzuzeigen.', + 'category_chart_click' => 'Klicken Sie auf einen Kategorienamen in der obigen Tabelle, um ein Diagramm zu sehen.', // charts: @@ -871,7 +871,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'add_money_to_piggy_title' => 'Geld dem Sparschwein ":name" hinzufügen', 'remove_money_from_piggy_title' => 'Geld dem Sparschwein ":name" entnehmen', 'add' => 'Hinzufügen', - 'no_money_for_piggy' => 'You have no money to put in this piggy bank.', + 'no_money_for_piggy' => 'Sie haben kein Geld, welches Sie in dieses Sparschwein geben können.', 'remove' => 'Entfernen', 'max_amount_add' => 'Der maximale Betrag, den Sie hinzufügen können ist', @@ -962,9 +962,9 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'link_transaction' => 'Link transaction', 'link_to_other_transaction' => 'Link this transaction to another transaction', 'select_transaction_to_link' => 'Select a transaction to link this transaction to', - 'this_transaction' => 'This transaction', + 'this_transaction' => 'Diese Transaktion', 'transaction' => 'Transaction', - 'comments' => 'Comments', + 'comments' => 'Kommentare', 'to_link_not_found' => 'If the transaction you want to link to is not listed, simply enter its ID.', 'invalid_link_selection' => 'Diese Transaktionen können nicht verknüpft werden', 'journals_linked' => 'Transactions are linked.', From 7ba2f3243d088147fc57629c4f5f47c74c9d9062 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:31:57 +0100 Subject: [PATCH 007/258] New translations form.php (German) --- resources/lang/de_DE/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/form.php b/resources/lang/de_DE/form.php index 06e54348e2..b031baf696 100644 --- a/resources/lang/de_DE/form.php +++ b/resources/lang/de_DE/form.php @@ -33,7 +33,7 @@ return [ 'journal_source_account_name' => 'Kreditor (Quelle)', 'journal_source_account_id' => 'Girokonto (Quelle)', 'BIC' => 'BIC', - 'verify_password' => 'Überprüfen Sie die Kennwortsicherheit', + 'verify_password' => 'Passwortsicherheit überprüfen', 'source_account' => 'Quellkonto', 'destination_account' => 'Zielkonto', 'journal_destination_account_id' => 'Girokonto (Ziel)', From d3b5300fc9e8ffc24e5f07ded08e8e293ee008de Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:40:12 +0100 Subject: [PATCH 008/258] New translations validation.php (German) --- resources/lang/de_DE/validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/validation.php b/resources/lang/de_DE/validation.php index f9e52e740e..57cd037ca6 100644 --- a/resources/lang/de_DE/validation.php +++ b/resources/lang/de_DE/validation.php @@ -89,5 +89,5 @@ return [ 'in_array' => ':attribute existiert nicht in :other.', 'present' => 'Das :attribute Feld muss vorhanden sein.', 'amount_zero' => 'Der Gesamtbetrag darf nicht Null sein', - 'secure_password' => 'Das ist kein sicheres Passwort. Bitte versuche es erneut. Weitere Informationen finden Sie unter https://goo.gl/NCh2tN', + 'secure_password' => 'Das ist kein sicheres Passwort. Bitte versuchen Sie es erneut. Weitere Informationen finden Sie unter https://goo.gl/NCh2tN', ]; From a636e88f25dc8028cf50f977f23f5b971cf103e1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:40:14 +0100 Subject: [PATCH 009/258] New translations intro.php (German) --- resources/lang/de_DE/intro.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lang/de_DE/intro.php b/resources/lang/de_DE/intro.php index 7c470ca97f..c4c638bc43 100644 --- a/resources/lang/de_DE/intro.php +++ b/resources/lang/de_DE/intro.php @@ -71,11 +71,11 @@ return [ 'piggy-banks_index_accountStatus' => 'In dieser Tabelle wird der Status der Anlagenkonten aufgeführt, die mindestens mit einem Sparschwein verbunden sind.', // create piggy - 'piggy-banks_create_name' => 'Was ist Ihr Ziel? Eine neue Couch, eine Kamera, Geld für Notfälle?', + 'piggy-banks_create_name' => 'Worauf sparen Sie? Eine neue Couch, eine Kamera, Geld für Notfälle?', 'piggy-banks_create_date' => 'Sie können ein Zieldatum oder einen Termin für Ihr Sparschwein festlegen.', // show piggy - 'piggy-banks_show_piggyChart' => 'Diese Grafik zeigt die Historie dieses Sparschweins.', + 'piggy-banks_show_piggyChart' => 'Dieses Diagramm zeigt den Verlauf dieses Sparschweins.', 'piggy-banks_show_piggyDetails' => 'Einige Details über Ihr Sparschwein', 'piggy-banks_show_piggyEvents' => 'Hinzufügungen oder Entfernungen sind hier ebenfalls aufgeführt.', @@ -105,7 +105,7 @@ return [ 'rules_index_outro' => 'Be sure to check out the help pages using the (?) icon in the top right!', // create rule: - 'rules_create_mandatory' => 'Choose a descriptive title, and set when the rule should be fired.', + 'rules_create_mandatory' => 'Wählen Sie einen aussagekräftigen Titel und legen Sie fest, wann die Regel ausgelöst werden soll.', 'rules_create_ruletriggerholder' => 'Add as many triggers as you like, but remember that ALL triggers must match before any actions are fired.', 'rules_create_test_rule_triggers' => 'Use this button to see which transactions would match your rule.', 'rules_create_actions' => 'Legen Sie so viele Aktionen fest, wie Sie möchten.', From 607f960b6b1af6b63f41b678f41ace0ce7702822 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:50:10 +0100 Subject: [PATCH 010/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 2f81895506..9d826794b4 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -71,7 +71,7 @@ return [ 'destination_accounts' => 'Zielkonto', 'user_id_is' => 'Ihre Benutzerkennung ist :user', 'field_supports_markdown' => 'Diese Feld unterstützt Abschlag .', - 'need_more_help' => 'Wenn du Hilfe beim Bedienen von Firefly III brauchst, erstelle ein Ticket auf Github.', + 'need_more_help' => 'Wenn Sie Hilfe beim Bedienen von Firefly III brauchen, erstellen Sie ein Ticket auf Github.', 'reenable_intro_text' => 'Sie können auch die Einführung wieder aktivieren.', 'intro_boxes_after_refresh' => 'Die Einführungsfelder werden wieder angezeigt, wenn Sie die Seite aktualisieren.', 'show_all_no_filter' => 'Alle Transaktionen anzeigen, ohne diese nach Datum zu gruppieren.', @@ -443,7 +443,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'secure_pw_hash_speed' => 'Ja, aber nicht in diesem Zusammenhang. Wie Sie auf auf der Website, die erklärt, wie SHA1 gebrochen wurde, lesen können, ist es jetzt etwas leichter, eine "Kollision" zu finden: eine andere Zeichenfolge, die zu demselben SHA1-Hash führt. Es dauert nur mehr 10.000 Jahre mit einer Single-GPU-Maschine.', 'secure_pw_hash_security' => 'Diese Kollision wäre nicht gleich Ihrem Passwort, noch wäre es nützlich auf (einer Seite wie) Firefly III. Diese Anwendung verwendet SHA1 nicht zur Passwortüberprüfung. Es ist also sicher, dieses Kästchen zu aktivieren. Ihr Passwort wird gehasht und über HTTPS übertragen.', 'secure_pw_should' => 'Soll ich die Box ankreuzen?', - 'secure_pw_long_password' => 'Wenn du gerade ein langes, Single-Use-Passwort für Firefly III mit einem Kennwortgenerator generiert hast: Nein.', + 'secure_pw_long_password' => 'Wenn Sie gerade ein langes, Single-Use-Passwort für Firefly III mit einem Kennwortgenerator generiert haben: Nein.', 'secure_pw_short' => 'Wenn Sie gerade das Passwort eingegeben haben, welches Sie immer verwenden: Bitte ja.', 'personal_access_token' => 'Persönlicher Zugangs-Token', 'explain_access_token' => 'You need this token to perform command line options, such as importing or exporting data. Without it, such sensitive commands will not work. Do not share your access token. Nobody will ask you for this token, not even me. If you fear you lost this, or when you\'re paranoid, regenerate this token using the button.', @@ -677,11 +677,11 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', // new user: 'welcome' => 'Willkommen bei Firefly!', - 'submit' => 'Bestätigen', + 'submit' => 'Absenden', 'getting_started' => 'Erste Schritte', - 'to_get_started' => 'It is good to see you have successfully installed Firefly III. To get started with this tool please enter your bank\'s name and the balance of your main checking account. Do not worry yet if you have multiple accounts. You can add those later. It\'s just that Firefly III needs something to start with.', + 'to_get_started' => 'Es ist schön, dass Sie Firefly III erfolgreich installiert haben. Um mit diesem Tool zu beginnen, geben Sie bitte den Namen Ihrer Bank und das Guthaben Ihres Hauptkontos ein. Machen Sie sich keine Sorgen, wenn Sie mehrere Konten haben. Sie können diese später hinzufügen. Dies ist nur der Anfang.', 'savings_balance_text' => 'Firefly III will automatically create a savings account for you. By default, there will be no money in your savings account, but if you tell Firefly III the balance it will be stored as such.', - 'finish_up_new_user' => 'That\'s it! You can continue by pressing Submit. You will be taken to the index of Firefly III.', + 'finish_up_new_user' => 'Das war\'s! Sie können fortfahren, indem Sie Absenden drücken. Sie werden zur Startseite von Firefly III gebracht.', 'stored_new_accounts_new_user' => 'Yay! Ihre neuen Konten wurden gespeichert.', // home page: @@ -1047,7 +1047,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'import_status_fatal_more' => 'If the error is a time-out, the import will have stopped half-way. For some server configurations, it is merely the server that stopped while the import keeps running in the background. To verify this, check out the log files. If the problem persists, consider importing over the command line instead.', 'import_status_finished_title' => 'Importassistent abgeschlossen', 'import_status_finished_text' => 'Der Importassistenten hat Ihre Datei importiert.', - 'import_status_finished_job' => 'The transactions imported can be found in tag :tag.', + 'import_status_finished_job' => 'Die importierten Transaktionen finden Sie im Tag : tag.', 'import_status_job_running' => 'Der Import läuft...', 'import_with_key' => 'Import with key \':key\'', From 787470d629627210de1dc290e6789db8155bb1c5 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:50:11 +0100 Subject: [PATCH 011/258] New translations form.php (German) --- resources/lang/de_DE/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/form.php b/resources/lang/de_DE/form.php index b031baf696..93e9bc1bed 100644 --- a/resources/lang/de_DE/form.php +++ b/resources/lang/de_DE/form.php @@ -147,7 +147,7 @@ return [ 'journal_areYouSure' => 'Sind Sie sicher, dass Sie die Überweisung mit dem Namen ":description" löschen möchten?', 'mass_journal_are_you_sure' => 'Sind Sie sicher, dass Sie diese Überweisung löschen möchten?', 'tag_areYouSure' => 'Sind Sie sicher, dass Sie den Tag ":name" löschen möchten?', - 'journal_link_areYouSure' => 'Bist du sicher, dass du die Verknüpfung zwischen :source und :destination löschen möchtest?', + 'journal_link_areYouSure' => 'Sind Sie sicher, dass Sie die Verknüpfung zwischen :source und :destination löschen möchten?', 'linkType_areYouSure' => 'Are you sure you want to delete the link type ":name" (":inward" / ":outward")?', 'permDeleteWarning' => 'Das Löschen von Dingen in Firefly ist dauerhaft und kann nicht rückgängig gemacht werden.', 'mass_make_selection' => 'Sie können das Löschen von Elementen verhindern, indem Sie die Checkbox entfernen.', From 4c6b4074f507ee36d118828ee69435c29534666a Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 11:50:12 +0100 Subject: [PATCH 012/258] New translations intro.php (German) --- resources/lang/de_DE/intro.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/intro.php b/resources/lang/de_DE/intro.php index c4c638bc43..f33b354a15 100644 --- a/resources/lang/de_DE/intro.php +++ b/resources/lang/de_DE/intro.php @@ -68,7 +68,7 @@ return [ // piggy banks index: 'piggy-banks_index_saved' => 'Dieses Feld zeigt Ihnen, wie viel Sie in jedem Sparschwein gespart haben.', 'piggy-banks_index_button' => 'Neben diesem Fortschrittsbalken befinden sich zwei Buttons (+ und -), um Geld von jedem Sparschwein hinzuzufügen oder zu entfernen.', - 'piggy-banks_index_accountStatus' => 'In dieser Tabelle wird der Status der Anlagenkonten aufgeführt, die mindestens mit einem Sparschwein verbunden sind.', + 'piggy-banks_index_accountStatus' => 'In dieser Tabelle wird der Status der Anlagenkonten aufgeführt, die mit mindestens einem Sparschwein verbunden sind.', // create piggy 'piggy-banks_create_name' => 'Worauf sparen Sie? Eine neue Couch, eine Kamera, Geld für Notfälle?', From d3bec76ebd46167347c3b03fd5f19eaf89fd8a23 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:00:14 +0100 Subject: [PATCH 013/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 9d826794b4..f5662b9b81 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -1001,7 +1001,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'split_this_transfer' => 'Diese Überweisung aufteilen', 'cannot_edit_multiple_source' => 'You cannot edit splitted transaction #:id with description ":description" because it contains multiple source accounts.', 'cannot_edit_multiple_dest' => 'You cannot edit splitted transaction #:id with description ":description" because it contains multiple destination accounts.', - 'cannot_edit_opening_balance' => 'You cannot edit the opening balance of an account.', + 'cannot_edit_opening_balance' => 'Sie können die Eröffnungsbilanz eines Kontos nicht bearbeiten.', 'no_edit_multiple_left' => 'You have selected no valid transactions to edit.', 'cannot_convert_split_journal' => 'Cannot convert a split transaction', @@ -1028,23 +1028,23 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'import_config_bread_crumb' => 'Set up your import file', // import status page: - 'import_status_bread_crumb' => 'Import status', - 'import_status_sub_title' => 'Import status', - 'import_status_wait_title' => 'Please hold...', - 'import_status_wait_text' => 'This box will disappear in a moment.', + 'import_status_bread_crumb' => 'Importstatus', + 'import_status_sub_title' => 'Importstatus', + 'import_status_wait_title' => 'Bitte warten...', + 'import_status_wait_text' => 'Diese Box wird gleich verschwinden.', 'import_status_ready_title' => 'Der Import ist startbereit', - 'import_status_ready_text' => 'The import is ready to start. All the configuration you needed to do has been done. Please download the configuration file. It will help you with the import should it not go as planned. To actually run the import, you can either execute the following command in your console, or run the web-based import. Depending on your configuration, the console import will give you more feedback.', - 'import_status_ready_config' => 'Download configuration', - 'import_status_ready_start' => 'Start the import', - 'import_status_ready_share' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', - 'import_status_running_title' => 'The import is running', - 'import_status_running_placeholder' => 'Please hold for an update...', + 'import_status_ready_text' => 'Der Import ist bereit zu starten. Alle Einstellungen wurden von Ihnen erledigt. Bitte laden Sie die Konfigurationsdatei herunter. Diese wird Ihnen beim Import helfen, sollte dieser nicht wie gewünscht verlaufen. Um den Import tatsächlich zu starten führen Sie den folgenden Befehl in der Konsole aus oder nutzen Sie den Web-basierten Import. Abhängig von ihrer Konfiguration wird Ihnen der Konsolenimport mehr Rückmeldungen geben.', + 'import_status_ready_config' => 'Konfigurationsdatei herunterladen', + 'import_status_ready_start' => 'Starte den Import', + 'import_status_ready_share' => 'Bitte denken Sie darüber nach ihre Konfiguration herunterzuladen und in der Sammlung an Import-Einstellungen zu teilen. Dieses erlaubt es anderen Nutzern von Firefly III ihre Daten einfacher zu importieren.', + 'import_status_running_title' => 'Der Import läuft', + 'import_status_running_placeholder' => 'Bitte warten Sie auf eine Aktualisierung...', 'import_status_errors_title' => 'Fehler beim Import', - 'import_status_errors_single' => 'An error has occured during the import. It does not appear to be fatal.', - 'import_status_errors_multi' => 'Some errors occured during the import. These do not appear to be fatal.', + 'import_status_errors_single' => 'Beim Import ist ein Fehler aufgetreten. Dieser scheint aber nicht schwerwiegend zu sein.', + 'import_status_errors_multi' => 'Beim Import sind einige Fehler aufgetreten. Diese scheinen aber nicht schwerwiegend zu sein.', 'import_status_fatal_title' => 'Ein schwerwiegender Fehler ist aufgetreten', - 'import_status_fatal_text' => 'A fatal error occurred, which the import-routine cannot recover from. Please see the explanation in red below.', - 'import_status_fatal_more' => 'If the error is a time-out, the import will have stopped half-way. For some server configurations, it is merely the server that stopped while the import keeps running in the background. To verify this, check out the log files. If the problem persists, consider importing over the command line instead.', + 'import_status_fatal_text' => 'Es ist ein schwerwiegender Fehler aufgetreten und die Importroutine kann nicht fortgeführt werden. Bitte sehen Sie sich die Erklärung in rot unten an.', + 'import_status_fatal_more' => 'Wenn der Fehler eine Zeitüberschreitung ist, wird der Import mittendrin gestoppt. Bei einigen Serverkonfigurationen wird lediglich der Server gestoppt, während der Import im Hintergrund ausgeführt wird. Um dies zu überprüfen, überprüfen Sie die Protokolldateien. Wenn das Problem weiterhin besteht, sollten Sie stattdessen den Import über die Befehlszeile in Erwägung ziehen.', 'import_status_finished_title' => 'Importassistent abgeschlossen', 'import_status_finished_text' => 'Der Importassistenten hat Ihre Datei importiert.', 'import_status_finished_job' => 'Die importierten Transaktionen finden Sie im Tag : tag.', From 566aa66c8b69239f93e66bd0161d24a51cbcd608 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:00:21 +0100 Subject: [PATCH 014/258] New translations form.php (German) --- resources/lang/de_DE/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/form.php b/resources/lang/de_DE/form.php index 93e9bc1bed..bd9c84dc0b 100644 --- a/resources/lang/de_DE/form.php +++ b/resources/lang/de_DE/form.php @@ -63,7 +63,7 @@ return [ 'expense_account' => 'Debitor (Ausgabe)', 'revenue_account' => 'Kreditor (Einnahme)', 'decimal_places' => 'Nachkommastellen', - 'exchange_rate_instruction' => 'Ausländische Währungen', + 'exchange_rate_instruction' => 'Fremdwährungen', 'source_amount' => 'Betrag (Quelle)', 'destination_amount' => 'Betrag (Ziel)', 'native_amount' => 'Nativer Betrag', From 8d9aa9392e4c081e2145636337c46ebf57d5dc42 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:00:23 +0100 Subject: [PATCH 015/258] New translations intro.php (German) --- resources/lang/de_DE/intro.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/intro.php b/resources/lang/de_DE/intro.php index f33b354a15..23654c5eb6 100644 --- a/resources/lang/de_DE/intro.php +++ b/resources/lang/de_DE/intro.php @@ -20,7 +20,7 @@ return [ // create account: 'accounts_create_iban' => 'Geben Sie Ihren Konten eine gültige IBAN. Dies könnte einen Datenimport in Zukunft sehr einfach machen.', - 'accounts_create_asset_opening_balance' => 'Anlagekonten können ein "Eröffnungsguthaben" haben, welches den Beginn der Historie dieses Kontos in Firefly angibt.', + 'accounts_create_asset_opening_balance' => 'Anlagekonten können eine "Eröffnungsbilanz" haben, welche den Beginn der Historie dieses Kontos in Firefly angibt.', 'accounts_create_asset_currency' => 'Firefly III unterstützt mehrere Währungen. Anlagenkonten haben eine Hauptwährung, die Sie hier einstellen müssen.', 'accounts_create_asset_virtual' => 'Es kann manchmal helfen, Ihrem Konto ein virtuelles Gleichgewicht zu geben: eine zusätzliche Menge, die dem tatsächlichen Kontostand immer hinzugefügt oder daraus entfernt wird.', From 129ba5ed30f0a30363ae9695ea837c3b293458f4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:10:14 +0100 Subject: [PATCH 016/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index f5662b9b81..07823f63f6 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -867,7 +867,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'sum_of_piggy_banks' => 'Summe der Sparschweine', 'saved_so_far' => 'Gespart', 'left_to_save' => 'Zu Sparen', - 'suggested_amount' => 'Suggested monthly amount to save', + 'suggested_amount' => 'Empfohlener monatliche Sparbetrag', 'add_money_to_piggy_title' => 'Geld dem Sparschwein ":name" hinzufügen', 'remove_money_from_piggy_title' => 'Geld dem Sparschwein ":name" entnehmen', 'add' => 'Hinzufügen', @@ -1068,14 +1068,14 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'no_accounts_imperative_revenue' => 'Revenue accounts are created automatically when you create transactions, but you can create one manually too, if you want. Let\'s create one now:', 'no_accounts_create_revenue' => 'Create a revenue account', 'no_budgets_title_default' => 'Let\'s create a budget', - 'no_budgets_intro_default' => 'You have no budgets yet. Budgets are used to organise your expenses into logical groups, which you can give a soft-cap to limit your expenses.', + 'no_budgets_intro_default' => 'Sie haben noch keine Budgets. Budgets werden verwendet, um Ihre Ausgaben in logischen Gruppen zu organisieren, die Sie mit einem Limit versehen können, um Ihre Ausgaben zu begrenzen.', 'no_budgets_imperative_default' => 'Budgets are the basic tools of financial management. Let\'s create one now:', 'no_budgets_create_default' => 'Ein Budget erstellen', - 'no_categories_title_default' => 'Lassen Sie uns eine Kategorie erstellen!', + 'no_categories_title_default' => 'Erstellen wir eine Kategorie!', 'no_categories_intro_default' => 'You have no categories yet. Categories are used to fine tune your transactions and label them with their designated category.', 'no_categories_imperative_default' => 'Categories are created automatically when you create transactions, but you can create one manually too. Let\'s create one now:', 'no_categories_create_default' => 'Eine Kategorie erstellen', - 'no_tags_title_default' => 'Lassen Sie uns ein Tag erstellen!', + 'no_tags_title_default' => 'Erstellen wir einen Tag!', 'no_tags_intro_default' => 'You have no tags yet. Tags are used to fine tune your transactions and label them with specific keywords.', 'no_tags_imperative_default' => 'Tags are created automatically when you create transactions, but you can create one manually too. Let\'s create one now:', 'no_tags_create_default' => 'Ein neues Tag erstellen', @@ -1096,8 +1096,8 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'no_piggies_imperative_default' => 'Do you have things you\'re saving money for? Create a piggy bank and keep track:', 'no_piggies_create_default' => 'Create a new piggy bank', 'no_bills_title_default' => 'Let\'s create a bill!', - 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent of insurance.', - 'no_bills_imperative_default' => 'Do you have such regular bills? Create a bill and keep track of your payments:', + 'no_bills_intro_default' => 'Du hast noch keine Rechnungen. Sie können Rechnungen erstellen, um die laufenden Ausgaben, wie zum Beispiel Ihre Versicherungs oder Miete, nachzuverfolgen.', + 'no_bills_imperative_default' => 'Haben Sie regelmäßige Rechnungen? Erstellen Sie eine Rechnung und verfolgen Sie Ihre Zahlungen:', 'no_bills_create_default' => 'Eine Rechnung erstellen', From 77a6e81f1fcc89634cc6ff8da491dd098c7cee8a Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:30:12 +0100 Subject: [PATCH 017/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 07823f63f6..f9cab33574 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -85,10 +85,10 @@ return [ 'sum_of_income' => 'Summe von Einnahmen', 'spent_in_specific_budget' => 'Ausgegeben in Budget ":budget"', 'sum_of_expenses_in_budget' => 'Vollkommen ausgegeben in Budget ":budget"', - 'left_in_budget_limit' => 'Übrig zum ausgeben aufgrund der Budgetierung', - 'current_period' => 'Aktuelle Periode', - 'show_the_current_period_and_overview' => 'Zeigen Sie die aktuelle Periode und die Übersicht', - 'pref_languages_locale' => 'Damit eine andere Sprache als Englisch richtig funktioniert muss Ihr Betriebssystem mit den korrekten Gebietsschema-Informationen ausgestattet werden. Wenn diese nicht vorhanden sind, können die Währungsdaten, Terminen und Mengen falsch formatiert.', + 'left_in_budget_limit' => 'Übrig zum Ausgeben aufgrund der Budgetierung', + 'current_period' => 'Aktueller Zeitraum', + 'show_the_current_period_and_overview' => 'Zeigen Sie den aktuellen Zeitraum und die Übersicht', + 'pref_languages_locale' => 'Damit eine andere Sprache als Englisch richtig funktioniert muss Ihr Betriebssystem mit den korrekten Gebietsschema-Informationen ausgestattet werden. Wenn diese nicht vorhanden sind, können die Währungsdaten, Termine und Mengen falsch formatiert.', 'budget_in_period' => 'Alle Transaktionen für Haushalt :name zwischen :start und :end', 'chart_budget_in_period' => 'Diagramm für alle Transaktionen des Haushalts ":name" zwischen :start und :end', 'chart_account_in_period' => 'Diagramm für alle Transaktionen des Kontos ":name" zwischen :start und :end', @@ -904,7 +904,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'transaction_journal_information' => 'Transaktionsinformationen', 'transaction_journal_meta' => 'Metainformationen', 'total_amount' => 'Gesamtbetrag', - 'number_of_decimals' => 'Anzahl der Dezimalstellen', + 'number_of_decimals' => 'Anzahl der Nachkommastellen', // administration 'administration' => 'Administration', @@ -1052,7 +1052,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'import_with_key' => 'Import with key \':key\'', // sandstorm.io errors and messages: - 'sandstorm_not_available' => 'This function is not available when you are using Firefly III within a Sandstorm.io environment.', + 'sandstorm_not_available' => 'Diese Funktion ist nicht verfügbar, wenn Sie Firefly III in einer Sandstorm.io-Umgebung verwenden.', // empty lists? no objects? instructions: 'no_accounts_title_asset' => 'Let\'s create an asset account!', @@ -1080,21 +1080,21 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'no_tags_imperative_default' => 'Tags are created automatically when you create transactions, but you can create one manually too. Let\'s create one now:', 'no_tags_create_default' => 'Ein neues Tag erstellen', 'no_transactions_title_withdrawal' => 'Let\'s create an expense!', - 'no_transactions_intro_withdrawal' => 'You have no expenses yet. You should create expenses to start managing your finances.', - 'no_transactions_imperative_withdrawal' => 'Have you spent some money? Then you should write it down:', + 'no_transactions_intro_withdrawal' => 'Sie haben noch keine Ausgaben verbucht. Sie sollten Ausgabenseinträge erstellen, um Ihre Finanzen zu verwalten.', + 'no_transactions_imperative_withdrawal' => 'Haben Sie Geld ausgegeben? Dann sollten Sie es aufschreiben:', 'no_transactions_create_withdrawal' => 'Eine neue Ausgabe erstellen', 'no_transactions_title_deposit' => 'Let\'s create some income!', - 'no_transactions_intro_deposit' => 'You have no recorded income yet. You should create income entries to start managing your finances.', + 'no_transactions_intro_deposit' => 'Sie haben noch keine Einnahmen verbucht. Sie sollten Einkommenseinträge erstellen, um Ihre Finanzen zu verwalten.', 'no_transactions_imperative_deposit' => 'Haben Sie Geld erhalten? Dann sollten Sie es aufschreiben:', 'no_transactions_create_deposit' => 'Eine Einnahme erstellen', 'no_transactions_title_transfers' => 'Let\'s create a transfer!', - 'no_transactions_intro_transfers' => 'You have no transfers yet. When you move money between asset accounts, it is recorded as a transfer.', - 'no_transactions_imperative_transfers' => 'Have you moved some money around? Then you should write it down:', + 'no_transactions_intro_transfers' => 'Sie haben noch keine Transfers. Wenn Sie Geld zwischen Ihren Konten bewegen, wird es als Überweisung erfasst.', + 'no_transactions_imperative_transfers' => 'Haben Sie Geld überwiesen? Dann sollten Sie es aufschreiben:', 'no_transactions_create_transfers' => 'Eine Überweisung erstellen', 'no_piggies_title_default' => 'Let\'s create a piggy bank!', - 'no_piggies_intro_default' => 'You have no piggy banks yet. You can create piggy banks to divide your savings and keep track of what you\'re saving up for.', - 'no_piggies_imperative_default' => 'Do you have things you\'re saving money for? Create a piggy bank and keep track:', - 'no_piggies_create_default' => 'Create a new piggy bank', + 'no_piggies_intro_default' => 'Sie haben noch keine Sparscheine. Sie können Sparschweine erstellen, um Ihre Ersparnisse zu teilen und den Überblick darüber zu behalten, wofür Sie sparen.', + 'no_piggies_imperative_default' => 'Haben Sie Dinge, auf die Sie sparen? Erstellen Sie eine Sparschwein und behalten Sie den Überblick:', + 'no_piggies_create_default' => 'Ein neues Sparschwein erstellen', 'no_bills_title_default' => 'Let\'s create a bill!', 'no_bills_intro_default' => 'Du hast noch keine Rechnungen. Sie können Rechnungen erstellen, um die laufenden Ausgaben, wie zum Beispiel Ihre Versicherungs oder Miete, nachzuverfolgen.', 'no_bills_imperative_default' => 'Haben Sie regelmäßige Rechnungen? Erstellen Sie eine Rechnung und verfolgen Sie Ihre Zahlungen:', From 15eeba43817d2749fc80e27e31c4f1c5632c8721 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:30:13 +0100 Subject: [PATCH 018/258] New translations demo.php (German) --- resources/lang/de_DE/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/demo.php b/resources/lang/de_DE/demo.php index 19d4a1bbf5..cb891a4263 100644 --- a/resources/lang/de_DE/demo.php +++ b/resources/lang/de_DE/demo.php @@ -16,7 +16,7 @@ return [ 'accounts-index' => 'Vermögenskonten sind Ihre persönlichen Bank-Konten. Aufwandskonten sind Konten, denen Sie Geld zahlen, z. B. Läden und Freunde. Einnahmekonten sind Konten von denen Sie Geld erhalten, z. B. Ihr Arbeitgeber und andere Einkommensquellen. Auf dieser Seite können Sie diese bearbeiten oder entfernen.', 'budgets-index' => 'Diese Seite zeigt Ihnen einen Überblick über Ihre Budgets. Die obere Leiste zeigt den Betrag, der zur Verfügung steht. Dieser kann für einen Zeitraum angepasst werden, indem Sie auf den Betrag auf der rechten Seite klicken. Wie viel bisher ausgegeben wurde wird darunter angezeigt. Darunter sind die Aufwendungen pro Haushalt und wie viel dafür veranschlagt ist.', 'reports-index-start' => 'Firefly III unterstützt vier Berichtarten. Mehr Informationen hierzu können durch ein Klick auf das Symbol in der oberen rechten Ecke aufgerufen werden.', - 'reports-index-examples' => 'Achten Sie darauf, diese Beispiele anzusehen: eine monatliche Finanzübersicht, eine jährliche Finanzübersicht und eine Haushaltsübersicht.', + 'reports-index-examples' => 'Sehen Sie sich auch diese Beispiele an: eine monatliche Finanzübersicht, eine jährliche Finanzübersicht und eine Haushaltsübersicht.', 'currencies-index' => 'Firefly III unterstützt mehrere Währungen. Obwohl es den Euro standardmäßig nutzt, ist es möglich US-Dollar oder viele andere Währungen zu verwenden. Wie Sie sehen können, ist eine kleine Auswahl an Währungen aufgenommen worden, aber Sie können Ihre eigenen hinzufügen. Die Standardwährung zu ändern, wird die Währung der vorhandenen Buchungen jedoch nicht ändern: Firefly III unterstützt die Verwendung mehrerer Währungen zur gleichen Zeit.', 'transactions-index' => 'Diese Aufwendungen, Einzahlungen und Überweisungen sind nicht besonders einfallsreich. Sie wurden automatisch generiert.', 'piggy-banks-index' => 'Wie Sie sehen können, gibt es drei Sparschweine. Benutzen die Plus- und Minusknöpfe um die Menge des Geldes in den Sparschweinen zu beeinflussen. Klicken Sie auf den Namen des Sparschweins um Details einzusehen.', From 99c9b719e7500eaa851dd3f5a7021ee4d10db687 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:50:12 +0100 Subject: [PATCH 019/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index f9cab33574..0b0e517636 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -623,8 +623,8 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'no_transactions_account' => 'Es gibt keine Transaktionen (in dieser Zeit) für Girokonto ":name".', 'no_data_for_chart' => 'Es gibt derzeit (noch) nicht genügend Informationen, um dieses Diagramm zu generieren.', 'select_more_than_one_account' => 'Bitte mehr als ein Konto wählen', - 'select_more_than_one_category' => 'Bitte mehr als eine Kategorie wählen', - 'select_more_than_one_budget' => 'Bitte mehr als ein Budget wählen', + 'select_more_than_one_category' => 'Bitte wählen Sie mehr als eine Kategorie aus', + 'select_more_than_one_budget' => 'Bitte wählen Sie mehr als einen Budget aus', 'select_more_than_one_tag' => 'Bitte wählen Sie mehr als einen Tag aus', 'account_default_currency' => 'Wenn Sie eine andere Währung auswählen, werden neue Transaktionen von diesem Konto standardmäßig diese Währung ausgewählt haben.', @@ -929,7 +929,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'configuration_updated' => 'Die Konfiguration wurde aktualisiert', 'setting_is_demo_site' => 'Demonstrationsseite', 'setting_is_demo_site_explain' => 'Wenn sie diese Option auswählen, wird sich diese Installation wie eine Demonstrationsseite verhalten, was ungewollte Auswirkungen haben kann.', - 'block_code_bounced' => 'Email message(s) bounced', + 'block_code_bounced' => 'E-Mail-Nachricht(en) wurden abgewiesen', 'block_code_expired' => 'Demo-Konto abgelaufen', 'no_block_code' => 'Kein Grund für Block oder Benutzer nicht blockiert', 'block_code_email_changed' => 'Der Benutzer hat die neue E-Mail-Adresse noch nicht bestätigt', From bc1982fb7b0373372976a9734bb8e8ec17d8bb2e Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:50:15 +0100 Subject: [PATCH 020/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index f1c3209bea..e5ec2149cb 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -144,10 +144,10 @@ return [ // repeat frequencies: 'repeat_freq_yearly' => 'rocznie', - 'repeat_freq_half-year' => 'every half-year', - 'repeat_freq_quarterly' => 'quarterly', + 'repeat_freq_half-year' => 'co pół roku', + 'repeat_freq_quarterly' => 'kwartalnie', 'repeat_freq_monthly' => 'miesięcznie', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'tygodniowo', 'weekly' => 'tygodniowo', 'quarterly' => 'kwartalnie', 'half-year' => 'co pół roku', @@ -825,8 +825,8 @@ return [ 'account_role_sharedAsset' => 'Współdzielone konto aktywów', 'account_role_savingAsset' => 'Konto oszczędnościowe', 'account_role_ccAsset' => 'Karta kredytowa', - 'budget_chart_click' => 'Please click on a budget name in the table above to see a chart.', - 'category_chart_click' => 'Please click on a category name in the table above to see a chart.', + 'budget_chart_click' => 'Kliknij na nazwę budżetu w tabeli powyżej, aby zobaczyć wykres.', + 'category_chart_click' => 'Kliknij na nazwę kategorii w tabeli powyżej, aby zobaczyć wykres.', // charts: From 214f65183180eeb2d62dc2cc6360a05c8bb483a2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 12:50:17 +0100 Subject: [PATCH 021/258] New translations validation.php (German) --- resources/lang/de_DE/validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/validation.php b/resources/lang/de_DE/validation.php index 57cd037ca6..2633ffb165 100644 --- a/resources/lang/de_DE/validation.php +++ b/resources/lang/de_DE/validation.php @@ -14,7 +14,7 @@ declare(strict_types=1); return [ 'iban' => 'Dies ist keine gültige IBAN.', 'unique_account_number_for_user' => 'Es sieht so aus, als ob diese Kontonummer bereits verwendet würde.', - 'deleted_user' => 'Aufgrund von Sicherheitsbeschränkungen ist eine Registrierung dieser Email-Adresse nicht zugelassen.', + 'deleted_user' => 'Aufgrund von Sicherheitsbeschränkungen ist eine Registrierung mit dieser E-Mail-Adresse nicht zugelassen.', 'rule_trigger_value' => 'Dieser Wert ist für den ausgewählten Trigger ungültig.', 'rule_action_value' => 'Dieser Wert ist für die gewählte Aktion ungültig.', 'file_already_attached' => 'Die hochgeladene Datei ":name" ist diesem Objekt bereits angehängt.', From 75f38d20dfbb08adaf582d8470bb79c199ab9a18 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:00:16 +0100 Subject: [PATCH 022/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 0b0e517636..3aa68268e1 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -620,9 +620,9 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'stored_new_account' => 'Neues Konto ":name" gespeichert!', 'updated_account' => 'Konto ":name" aktualisiert', 'credit_card_options' => 'Kreditkartenoptionen', - 'no_transactions_account' => 'Es gibt keine Transaktionen (in dieser Zeit) für Girokonto ":name".', + 'no_transactions_account' => 'Es gibt keine Transaktionen (in diesem Zeitraum) für das Girokonto ":name".', 'no_data_for_chart' => 'Es gibt derzeit (noch) nicht genügend Informationen, um dieses Diagramm zu generieren.', - 'select_more_than_one_account' => 'Bitte mehr als ein Konto wählen', + 'select_more_than_one_account' => 'Bitte wählen Sie mehr als einen Konto aus', 'select_more_than_one_category' => 'Bitte wählen Sie mehr als eine Kategorie aus', 'select_more_than_one_budget' => 'Bitte wählen Sie mehr als einen Budget aus', 'select_more_than_one_tag' => 'Bitte wählen Sie mehr als einen Tag aus', From 810d2a3d8712949ae4c77694908781b2a7338e35 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:40:11 +0100 Subject: [PATCH 023/258] Fix language issues reported by Findus23 --- resources/lang/en_US/demo.php | 2 +- resources/lang/en_US/firefly.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/en_US/demo.php b/resources/lang/en_US/demo.php index 5c99a55718..c35b020f4a 100644 --- a/resources/lang/en_US/demo.php +++ b/resources/lang/en_US/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III supports multiple currencies. Although it defaults to the Euro it can be set to the US Dollar and many other currencies. As you can see a small selection of currencies has been included but you can add your own if you wish to. Changing the default currency will not change the currency of existing transactions however: Firefly III supports the use of multiple currencies at the same time.', 'transactions-index' => 'These expenses, deposits and transfers are not particularly imaginative. They have been generated automatically.', 'piggy-banks-index' => 'As you can see, there are three piggy banks. Use the plus and minus buttons to influence the amount of money in each piggy bank. Click the name of the piggy bank to see the administration for each piggy bank.', - 'import-index' => 'Of course, any CSV file can be imported into Firefly III ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Because of security concerns, your upload has been replaced with a local file.', 'import-configure-configuration' => 'The configuration you see below is correct for the local file.', ]; diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 49daf7d145..e45adb82b0 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -1095,7 +1095,7 @@ return [ 'no_piggies_imperative_default' => 'Do you have things you\'re saving money for? Create a piggy bank and keep track:', 'no_piggies_create_default' => 'Create a new piggy bank', 'no_bills_title_default' => 'Let\'s create a bill!', - 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent of insurance.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => 'Do you have such regular bills? Create a bill and keep track of your payments:', 'no_bills_create_default' => 'Create a bill', From db0b1d1fa2806a40a39f21d40222968f51da627f Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:11 +0100 Subject: [PATCH 024/258] New translations demo.php (Portuguese, Brazilian) --- resources/lang/pt_BR/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/pt_BR/demo.php b/resources/lang/pt_BR/demo.php index 749f6d09b1..83d5bdac9f 100644 --- a/resources/lang/pt_BR/demo.php +++ b/resources/lang/pt_BR/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III oferece suporte a várias moedas. Embora o padrão seja o Euro, ela pode ser definida para o dólar americano e muitas outras moedas. Como você pode ver uma pequena seleção de moedas foi incluída, mas você pode adicionar suas próprias se desejar. No entanto, alterar a moeda padrão não vai mudar a moeda de transações existentes: Firefly III suporta o uso de várias moedas ao mesmo tempo.', 'transactions-index' => 'Estas despesas, depósitos e transferências não são fantasiosas. Elas foram geradas automaticamente.', 'piggy-banks-index' => 'Como você pode ver, existem três cofrinhos. Use o sinal de mais e menos botões para influenciar a quantidade de dinheiro em cada cofrinho. Clique no nome do cofrinho para ver a administração de cada cofrinho.', - 'import-index' => 'Claro, qualquer arquivo .CSV pode ser importado em Firefly III ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Por questões de segurança, seu upload foi substituído por um arquivo local.', 'import-configure-configuration' => 'A configuração que você vê abaixo é a correta para o arquivo local.', ]; From 2dad5fb066d88d6a94a0a033a7d5395212ae9f7c Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:16 +0100 Subject: [PATCH 025/258] New translations firefly.php (Russian) --- resources/lang/ru_RU/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index 7dcf9afe4d..eb7b567ad0 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -1095,7 +1095,7 @@ return [ 'no_piggies_imperative_default' => 'Do you have things you\'re saving money for? Create a piggy bank and keep track:', 'no_piggies_create_default' => 'Create a new piggy bank', 'no_bills_title_default' => 'Let\'s create a bill!', - 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent of insurance.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => 'Do you have such regular bills? Create a bill and keep track of your payments:', 'no_bills_create_default' => 'Create a bill', From 7031cbcd295d931cb9159cdff2efa312ec4349b7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:18 +0100 Subject: [PATCH 026/258] New translations demo.php (Spanish) --- resources/lang/es_ES/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/es_ES/demo.php b/resources/lang/es_ES/demo.php index dfb4fc04c7..62a8b022e8 100644 --- a/resources/lang/es_ES/demo.php +++ b/resources/lang/es_ES/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III admite múltiples monedas. A pesar de que la moneda por defecto es el Euro, se puede seleccionar el Dólar de EE.UU, y muchas otras monedas. Como se puede ver se ha incluido una pequeña selección de monedas, pero puedes agregar tu propia moneda si lo deseas. Sin embargo, cambiar la moneda predeterminada no cambiará la moneda de las transacciones existentes: Firefly III admite el uso de varias monedas al mismo tiempo.', 'transactions-index' => 'Estos gastos, depósitos y transferencias no son particularmente imaginativos. Se han generado automáticamente.', 'piggy-banks-index' => 'Como puede ver, hay tres alcancías. Utilice los botones más y menos para influir en la cantidad de dinero en cada alcancía. Haga clic en el nombre de la alcancía para ver la administración de cada una.', - 'import-index' => 'Por supuesto, cualquier archivo CSV puede ser importado en Firefly III', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Debido a problemas de seguridad, su subida se ha sustituido por un archivo local.', 'import-configure-configuration' => 'La configuración que ves a continuación es correcta para el archivo local.', ]; From a73adaaba9d87b77b439b114f30072e4531d60ea Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:19 +0100 Subject: [PATCH 027/258] New translations demo.php (Slovenian) --- resources/lang/sl_SI/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/sl_SI/demo.php b/resources/lang/sl_SI/demo.php index dca94a9aa7..a3df49a192 100644 --- a/resources/lang/sl_SI/demo.php +++ b/resources/lang/sl_SI/demo.php @@ -21,7 +21,7 @@ Konti prihodkov so računi iz katerih dobivate denar, kot npr. vaš delodajalec, 'currencies-index' => 'Firefly III supports multiple currencies. Although it defaults to the Euro it can be set to the US Dollar and many other currencies. As you can see a small selection of currencies has been included but you can add your own if you wish to. Changing the default currency will not change the currency of existing transactions however: Firefly III supports the use of multiple currencies at the same time.', 'transactions-index' => 'These expenses, deposits and transfers are not particularly imaginative. They have been generated automatically.', 'piggy-banks-index' => 'As you can see, there are three piggy banks. Use the plus and minus buttons to influence the amount of money in each piggy bank. Click the name of the piggy bank to see the administration for each piggy bank.', - 'import-index' => 'Of course, any CSV file can be imported into Firefly III ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Because of security concerns, your upload has been replaced with a local file.', 'import-configure-configuration' => 'The configuration you see below is correct for the local file.', ]; From 5ac5206253fc40c7682ceec0ee94434e7f87af4e Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:20 +0100 Subject: [PATCH 028/258] New translations demo.php (Polish) --- resources/lang/pl_PL/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/pl_PL/demo.php b/resources/lang/pl_PL/demo.php index 0ffd1b88bf..094bff01a7 100644 --- a/resources/lang/pl_PL/demo.php +++ b/resources/lang/pl_PL/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III supports multiple currencies. Although it defaults to the Euro it can be set to the US Dollar and many other currencies. As you can see a small selection of currencies has been included but you can add your own if you wish to. Changing the default currency will not change the currency of existing transactions however: Firefly III supports the use of multiple currencies at the same time.', 'transactions-index' => 'These expenses, deposits and transfers are not particularly imaginative. They have been generated automatically.', 'piggy-banks-index' => 'As you can see, there are three piggy banks. Use the plus and minus buttons to influence the amount of money in each piggy bank. Click the name of the piggy bank to see the administration for each piggy bank.', - 'import-index' => 'Of course, any CSV file can be imported into Firefly III ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Because of security concerns, your upload has been replaced with a local file.', 'import-configure-configuration' => 'Konfiguracja, która widzisz poniżej jest prawidłowa dla lokalnego pliku.', ]; From c8240ea54ff4fa77cd914b54514cb32772038a8f Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:21 +0100 Subject: [PATCH 029/258] New translations demo.php (Russian) --- resources/lang/ru_RU/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/ru_RU/demo.php b/resources/lang/ru_RU/demo.php index 57e9277cdb..53cc86a59b 100644 --- a/resources/lang/ru_RU/demo.php +++ b/resources/lang/ru_RU/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III supports multiple currencies. Although it defaults to the Euro it can be set to the US Dollar and many other currencies. As you can see a small selection of currencies has been included but you can add your own if you wish to. Changing the default currency will not change the currency of existing transactions however: Firefly III supports the use of multiple currencies at the same time.', 'transactions-index' => 'These expenses, deposits and transfers are not particularly imaginative. They have been generated automatically.', 'piggy-banks-index' => 'As you can see, there are three piggy banks. Use the plus and minus buttons to influence the amount of money in each piggy bank. Click the name of the piggy bank to see the administration for each piggy bank.', - 'import-index' => 'Of course, any CSV file can be imported into Firefly III ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Because of security concerns, your upload has been replaced with a local file.', 'import-configure-configuration' => 'The configuration you see below is correct for the local file.', ]; From 8bcebee767365dfb47ca16fa47a58594585d6865 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:22 +0100 Subject: [PATCH 030/258] New translations demo.php (German) --- resources/lang/de_DE/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/demo.php b/resources/lang/de_DE/demo.php index cb891a4263..a94b8e79a0 100644 --- a/resources/lang/de_DE/demo.php +++ b/resources/lang/de_DE/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III unterstützt mehrere Währungen. Obwohl es den Euro standardmäßig nutzt, ist es möglich US-Dollar oder viele andere Währungen zu verwenden. Wie Sie sehen können, ist eine kleine Auswahl an Währungen aufgenommen worden, aber Sie können Ihre eigenen hinzufügen. Die Standardwährung zu ändern, wird die Währung der vorhandenen Buchungen jedoch nicht ändern: Firefly III unterstützt die Verwendung mehrerer Währungen zur gleichen Zeit.', 'transactions-index' => 'Diese Aufwendungen, Einzahlungen und Überweisungen sind nicht besonders einfallsreich. Sie wurden automatisch generiert.', 'piggy-banks-index' => 'Wie Sie sehen können, gibt es drei Sparschweine. Benutzen die Plus- und Minusknöpfe um die Menge des Geldes in den Sparschweinen zu beeinflussen. Klicken Sie auf den Namen des Sparschweins um Details einzusehen.', - 'import-index' => 'Natürlich kann jede CSV-Datei in Firefly III importiert werden ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Aufgrund von Sicherheitsbedenken wurde der Upload mit einer lokalen Datei ersetzt.', 'import-configure-configuration' => 'Die unten stehende Konfiguration für die lokale Datei ist korrekt.', ]; From 9da16f2b7821e02027c694d1d5d617f05a6f507b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:24 +0100 Subject: [PATCH 031/258] New translations demo.php (French) --- resources/lang/fr_FR/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/fr_FR/demo.php b/resources/lang/fr_FR/demo.php index fbb7aaa450..f430753085 100644 --- a/resources/lang/fr_FR/demo.php +++ b/resources/lang/fr_FR/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III prend en charge plusieurs devises. Bien que l\'Euro soit la devise par défaut, cette dernière peut être changée pour le Dollar américain et de nombreuses autres devises. Comme vous pouvez le remarquer une petite sélection des monnaies a été incluse, mais vous pouvez ajouter vos propres devises si vous le souhaitez. Gardez à l\'esprit que la modification de la devise par défaut ne modifie pas la monnaie des transactions existantes : Firefly III prend en charge l’utilisation de plusieurs devises en même temps.', 'transactions-index' => 'Ces dépenses, dépôts et transferts ne sont pas particulièrement imaginatifs. Ils ont été générés automatiquement.', 'piggy-banks-index' => 'Comme vous pouvez le voir, il y a trois tirelires. Utilisez les boutons plus et moins pour influer sur le montant d’argent dans chaque tirelire. Cliquez sur le nom de la tirelire pour voir l’administration pour chaque tirelire.', - 'import-index' => 'Bien sûr, n’importe quel fichier CSV peut être importé dans Firefly III ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Pour des raisons de sécurité, votre téléchargement a été remplacé par un fichier local.', 'import-configure-configuration' => 'La configuration que vous voyez ci-dessous est correcte pour le fichier local.', ]; From 6d9a562d0f15ce743ec279160f396f708d2e98d7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:25 +0100 Subject: [PATCH 032/258] New translations demo.php (Dutch) --- resources/lang/nl_NL/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/nl_NL/demo.php b/resources/lang/nl_NL/demo.php index 01aa680497..3bf4a46081 100644 --- a/resources/lang/nl_NL/demo.php +++ b/resources/lang/nl_NL/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly ondersteunt meerdere valuta\'s. Hoewel het standaard de Euro is kan je ook kiezen voor de US dollar of een van de vele anderen. Er is een kleine selectie valuta meegeleverd maar je kan je eigen valuta toevoegen. Het veranderen van de standaardvaluta verandert de bestaande transacties niet: Firefly III ondersteunt het gebruik van meerdere valuta op hetzelfde moment.', 'transactions-index' => 'Deze uitgaven, inkomsten en overschrijvingen zijn niet heel fantasierijk. Ze zijn automatisch gegenereerd.', 'piggy-banks-index' => 'Zoals je kan zien zijn er drie spaarpotjes. Gebruik de plus- en minknoppen om het bedrag in de spaarpotjes te veranderen. Klik op de naam van het spaarpotje om er de geschiedenis van te zien.', - 'import-index' => 'Uiteraard kan je elk CSV bestand importeren in Firefly III ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Uit veiligheidsoverwegingen is je upload vervangen door een lokaal bestand.', 'import-configure-configuration' => 'Deze configuratie is correct voor het lokale bestand.', ]; From c2ee12466cdd878ff11535ecff9281b11fd0d323 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:32 +0100 Subject: [PATCH 033/258] New translations demo.php (Indonesian) --- resources/lang/id_ID/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/id_ID/demo.php b/resources/lang/id_ID/demo.php index 5c99a55718..c35b020f4a 100644 --- a/resources/lang/id_ID/demo.php +++ b/resources/lang/id_ID/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III supports multiple currencies. Although it defaults to the Euro it can be set to the US Dollar and many other currencies. As you can see a small selection of currencies has been included but you can add your own if you wish to. Changing the default currency will not change the currency of existing transactions however: Firefly III supports the use of multiple currencies at the same time.', 'transactions-index' => 'These expenses, deposits and transfers are not particularly imaginative. They have been generated automatically.', 'piggy-banks-index' => 'As you can see, there are three piggy banks. Use the plus and minus buttons to influence the amount of money in each piggy bank. Click the name of the piggy bank to see the administration for each piggy bank.', - 'import-index' => 'Of course, any CSV file can be imported into Firefly III ', + 'import-index' => 'Of course, any CSV file can be imported into Firefly III', 'import-configure-security' => 'Because of security concerns, your upload has been replaced with a local file.', 'import-configure-configuration' => 'The configuration you see below is correct for the local file.', ]; From df9bb13df13b9dc4059dd88f23a3282e4167e216 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:37 +0100 Subject: [PATCH 034/258] New translations firefly.php (Indonesian) --- resources/lang/id_ID/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index 49daf7d145..e45adb82b0 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -1095,7 +1095,7 @@ return [ 'no_piggies_imperative_default' => 'Do you have things you\'re saving money for? Create a piggy bank and keep track:', 'no_piggies_create_default' => 'Create a new piggy bank', 'no_bills_title_default' => 'Let\'s create a bill!', - 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent of insurance.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => 'Do you have such regular bills? Create a bill and keep track of your payments:', 'no_bills_create_default' => 'Create a bill', From 1a147ecdd502c380577e9cf2b248bda8433b7482 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:41:57 +0100 Subject: [PATCH 035/258] New translations firefly.php (French) --- resources/lang/fr_FR/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index 8f249119da..b23678675a 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -1096,7 +1096,7 @@ return [ 'no_piggies_imperative_default' => 'Avez-vous des choses pour lesquelles vous économisez de l\'argent ? Créer une tirelire et suivez-là :', 'no_piggies_create_default' => 'Créer une nouvelle tirelire', 'no_bills_title_default' => 'Nous allons créer une facture !', - 'no_bills_intro_default' => 'Vous n\'avez pas encore de factures. Vous pouvez créer des factures pour suivre les dépenses ordinaires, comme votre loyer d\'assurance.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => 'Avez-vous des factures régulières ? Créez une facture et suivez vos paiements :', 'no_bills_create_default' => 'Créer une facture', From cbc3326d4bd787e26c61f14ee2399571e9695f2d Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:42:05 +0100 Subject: [PATCH 036/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 3aa68268e1..754cd688a3 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -1096,7 +1096,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'no_piggies_imperative_default' => 'Haben Sie Dinge, auf die Sie sparen? Erstellen Sie eine Sparschwein und behalten Sie den Überblick:', 'no_piggies_create_default' => 'Ein neues Sparschwein erstellen', 'no_bills_title_default' => 'Let\'s create a bill!', - 'no_bills_intro_default' => 'Du hast noch keine Rechnungen. Sie können Rechnungen erstellen, um die laufenden Ausgaben, wie zum Beispiel Ihre Versicherungs oder Miete, nachzuverfolgen.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => 'Haben Sie regelmäßige Rechnungen? Erstellen Sie eine Rechnung und verfolgen Sie Ihre Zahlungen:', 'no_bills_create_default' => 'Eine Rechnung erstellen', From 359d366e6e7aefddb9663c16014b08d1fc7ef021 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:42:13 +0100 Subject: [PATCH 037/258] New translations firefly.php (Spanish) --- resources/lang/es_ES/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index fe8a9cc315..a145e026f0 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -1095,7 +1095,7 @@ return [ 'no_piggies_imperative_default' => 'Do you have things you\'re saving money for? Create a piggy bank and keep track:', 'no_piggies_create_default' => 'Create a new piggy bank', 'no_bills_title_default' => '¡Vamos a crear una factura!', - 'no_bills_intro_default' => 'Aún no tienes facturas. Puedes crear facturas para realizar un seguimiento de los gastos periódicos, como el alquiler o un seguro.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => '¿Tienes facturas periódicas? Crea una factura y haz un seguimiento de tus pagos:', 'no_bills_create_default' => 'Crear una factura', From 1fcad87de6c71f199dd2cf440702ea3454fb0aa3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:42:17 +0100 Subject: [PATCH 038/258] New translations firefly.php (Slovenian) --- resources/lang/sl_SI/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index 22124ba713..032dd3b376 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -1095,7 +1095,7 @@ return [ 'no_piggies_imperative_default' => 'Do you have things you\'re saving money for? Create a piggy bank and keep track:', 'no_piggies_create_default' => 'Create a new piggy bank', 'no_bills_title_default' => 'Let\'s create a bill!', - 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent of insurance.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => 'Do you have such regular bills? Create a bill and keep track of your payments:', 'no_bills_create_default' => 'Create a bill', From d6f93d3c13c87e578e645635a3f10e8a1d3ff829 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:42:22 +0100 Subject: [PATCH 039/258] New translations firefly.php (Portuguese, Brazilian) --- resources/lang/pt_BR/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 7dffb37a40..1bdc9e0c24 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -1095,7 +1095,7 @@ return [ 'no_piggies_imperative_default' => 'Do you have things you\'re saving money for? Create a piggy bank and keep track:', 'no_piggies_create_default' => 'Create a new piggy bank', 'no_bills_title_default' => 'Let\'s create a bill!', - 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent of insurance.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => 'Do you have such regular bills? Create a bill and keep track of your payments:', 'no_bills_create_default' => 'Create a bill', From ba57852513cd7eacb549a56fcd15b15d51e279d9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:42:26 +0100 Subject: [PATCH 040/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index e5ec2149cb..c784d4ff71 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -1095,7 +1095,7 @@ return [ 'no_piggies_imperative_default' => 'Oszczędzasz pieniądze na coś? Utwórz skarbonkę i śledź:', 'no_piggies_create_default' => 'Utwórz nową skarbonkę', 'no_bills_title_default' => 'Stwórzmy rachunek!', - 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent of insurance.', + 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', 'no_bills_imperative_default' => 'Do you have such regular bills? Create a bill and keep track of your payments:', 'no_bills_create_default' => 'Utwórz rachunek', From ca5249d8394616226c076fbbfbde1559b6b35f3b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:48:52 +0100 Subject: [PATCH 041/258] Fix #976 --- resources/lang/en_US/firefly.php | 3 ++- resources/views/transactions/single/create.twig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index e45adb82b0..4096eff434 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Transaction data', 'invalid_server_configuration' => 'Invalid server configuration', 'invalid_locale_settings' => 'Firefly III is unable to format monetary amounts because your server is missing the required packages. There are instructions how to do this.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Search', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'every half-year', 'repeat_freq_quarterly' => 'quarterly', 'repeat_freq_monthly' => 'monthly', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'weekly', 'weekly' => 'weekly', 'quarterly' => 'quarterly', 'half-year' => 'every half year', diff --git a/resources/views/transactions/single/create.twig b/resources/views/transactions/single/create.twig index 59f509529d..3d6b24ec9a 100644 --- a/resources/views/transactions/single/create.twig +++ b/resources/views/transactions/single/create.twig @@ -17,7 +17,7 @@
- +
From b333af769efde520afec0bc0be78443c1410d3bb Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:49:30 +0100 Subject: [PATCH 042/258] New translations firefly.php (Russian) --- resources/lang/ru_RU/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index eb7b567ad0..0c3dc61380 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Данные транзакции', 'invalid_server_configuration' => 'Invalid server configuration', 'invalid_locale_settings' => 'Firefly III is unable to format monetary amounts because your server is missing the required packages. There are instructions how to do this.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Поиск', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'every half-year', 'repeat_freq_quarterly' => 'quarterly', 'repeat_freq_monthly' => 'ежемесячно', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'weekly', 'weekly' => 'еженедельно', 'quarterly' => 'раз в квартал', 'half-year' => 'раз в полгода', From fc9479e517829d9d79269d9b97b4ffcb53220020 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:49:45 +0100 Subject: [PATCH 043/258] New translations firefly.php (Indonesian) --- resources/lang/id_ID/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index e45adb82b0..4096eff434 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Transaction data', 'invalid_server_configuration' => 'Invalid server configuration', 'invalid_locale_settings' => 'Firefly III is unable to format monetary amounts because your server is missing the required packages. There are instructions how to do this.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Search', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'every half-year', 'repeat_freq_quarterly' => 'quarterly', 'repeat_freq_monthly' => 'monthly', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'weekly', 'weekly' => 'weekly', 'quarterly' => 'quarterly', 'half-year' => 'every half year', From bf884175a7813b064a6ace9b4647f14b473b16d3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:49:59 +0100 Subject: [PATCH 044/258] New translations firefly.php (Dutch) --- resources/lang/nl_NL/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index 94444918ed..ad22b4a863 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Transactiegegevens', 'invalid_server_configuration' => 'Ongeldige serverconfiguratie', 'invalid_locale_settings' => 'Firefly III kan geldbedragen niet goed weergeven omdat je server de vereiste software mist. Er zijn instructies hoe dit te doen.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Zoeken', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'elk half jaar', 'repeat_freq_quarterly' => 'elk kwartaal', 'repeat_freq_monthly' => 'maandelijks', - 'repeat_freq_weekly' => 'wekelijks', + 'repeat_freq_weekly' => 'wekelijks', 'weekly' => 'wekelijks', 'quarterly' => 'elk kwartaal', 'half-year' => 'elk half jaar', From ea7bd15c3dfdbcf0756a57023f2f3c5695e3995b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:50:11 +0100 Subject: [PATCH 045/258] New translations firefly.php (French) --- resources/lang/fr_FR/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index b23678675a..fcbc9c636f 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Données de transaction', 'invalid_server_configuration' => 'Configuration de serveur invalide', 'invalid_locale_settings' => 'Firefly III ne parvient pas à formater les montants monétaires car il manque des paquets logiciels sur votre serveur. Voici des insctructions sur comment procéder.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Rechercher', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'every half-year', 'repeat_freq_quarterly' => 'quarterly', 'repeat_freq_monthly' => 'mensuel', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'weekly', 'weekly' => 'hebdomadaire', 'quarterly' => 'trimestriel', 'half-year' => 'semestriel', From 5019946c65e2333984e1fc1c96d3c96e2de5ac02 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:50:24 +0100 Subject: [PATCH 046/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 754cd688a3..d5de68d30b 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Transaktionsdaten', 'invalid_server_configuration' => 'Ungültige Serverkonfiguration', 'invalid_locale_settings' => 'Firefly III kann keine Geldbeträge formatieren, da auf Ihrem Server die erforderlichen Pakete fehlen. Es gibt eine Anleitung, wie dies behoben werden kann.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Suche', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'halbjährlich', 'repeat_freq_quarterly' => 'vierteljährlich', 'repeat_freq_monthly' => 'monatlich', - 'repeat_freq_weekly' => 'wöchentlich', + 'repeat_freq_weekly' => 'wöchentlich', 'weekly' => 'wöchentlich', 'quarterly' => 'vierteljährlich', 'half-year' => 'halbjährlich', From 69e315814493ef4c6d99029774933461a19e44f1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:50:38 +0100 Subject: [PATCH 047/258] New translations firefly.php (Spanish) --- resources/lang/es_ES/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index a145e026f0..05ba7d8c9a 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Transaction data', 'invalid_server_configuration' => 'Invalid server configuration', 'invalid_locale_settings' => 'Firefly III is unable to format monetary amounts because your server is missing the required packages. There are instructions how to do this.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Buscar', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'every half-year', 'repeat_freq_quarterly' => 'quarterly', 'repeat_freq_monthly' => 'monthly', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'weekly', 'weekly' => 'weekly', 'quarterly' => 'quarterly', 'half-year' => 'every half year', From 10a2b2075e187a11eab67c97fee215e376f8cddc Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:50:42 +0100 Subject: [PATCH 048/258] New translations firefly.php (Slovenian) --- resources/lang/sl_SI/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index 032dd3b376..1e972ec687 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Transaction data', 'invalid_server_configuration' => 'Invalid server configuration', 'invalid_locale_settings' => 'Firefly III is unable to format monetary amounts because your server is missing the required packages. There are instructions how to do this.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Search', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'every half-year', 'repeat_freq_quarterly' => 'quarterly', 'repeat_freq_monthly' => 'monthly', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'weekly', 'weekly' => 'weekly', 'quarterly' => 'quarterly', 'half-year' => 'every half year', From 0c206c9a0faafc362c7ca0b61f86dde786267730 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:50:47 +0100 Subject: [PATCH 049/258] New translations firefly.php (Portuguese, Brazilian) --- resources/lang/pt_BR/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 1bdc9e0c24..339e892afc 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Transaction data', 'invalid_server_configuration' => 'Invalid server configuration', 'invalid_locale_settings' => 'Firefly III is unable to format monetary amounts because your server is missing the required packages. There are instructions how to do this.', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Pesquisa', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'every half-year', 'repeat_freq_quarterly' => 'quarterly', 'repeat_freq_monthly' => 'mensal', - 'repeat_freq_weekly' => 'weekly', + 'repeat_freq_weekly' => 'weekly', 'weekly' => 'semanal', 'quarterly' => 'trimestral', 'half-year' => 'metade de cada ano', From 80fd0fa4194343ab7b557f48f0b0041fa5bb065d Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 13:50:51 +0100 Subject: [PATCH 050/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index c784d4ff71..4385a8faf5 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -130,6 +130,7 @@ return [ 'transaction_data' => 'Dane transakcji', 'invalid_server_configuration' => 'Nieprawidłowa konfiguracja serwera', 'invalid_locale_settings' => 'Firefly III nie może sformatować kwot, ponieważ brakuje wymaganych pakietów na Twoim serwerze. Sprawdźinstrukcje jak je zainstalować (po angielsku).', + 'quickswitch' => 'Quickswitch', // search 'search' => 'Szukaj', @@ -147,7 +148,7 @@ return [ 'repeat_freq_half-year' => 'co pół roku', 'repeat_freq_quarterly' => 'kwartalnie', 'repeat_freq_monthly' => 'miesięcznie', - 'repeat_freq_weekly' => 'tygodniowo', + 'repeat_freq_weekly' => 'tygodniowo', 'weekly' => 'tygodniowo', 'quarterly' => 'kwartalnie', 'half-year' => 'co pół roku', From 5dc9e165537b984d6114dafd0601e4f6ae1f8214 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 14:10:35 +0100 Subject: [PATCH 051/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index 4385a8faf5..81e727da59 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -130,7 +130,7 @@ return [ 'transaction_data' => 'Dane transakcji', 'invalid_server_configuration' => 'Nieprawidłowa konfiguracja serwera', 'invalid_locale_settings' => 'Firefly III nie może sformatować kwot, ponieważ brakuje wymaganych pakietów na Twoim serwerze. Sprawdźinstrukcje jak je zainstalować (po angielsku).', - 'quickswitch' => 'Quickswitch', + 'quickswitch' => 'Szybki przełącznik', // search 'search' => 'Szukaj', From c74e65b3911a5f3827f9020535bc9d8dac9d53e0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 14:21:02 +0100 Subject: [PATCH 052/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index d5de68d30b..b040a68124 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -130,7 +130,7 @@ return [ 'transaction_data' => 'Transaktionsdaten', 'invalid_server_configuration' => 'Ungültige Serverkonfiguration', 'invalid_locale_settings' => 'Firefly III kann keine Geldbeträge formatieren, da auf Ihrem Server die erforderlichen Pakete fehlen. Es gibt eine Anleitung, wie dies behoben werden kann.', - 'quickswitch' => 'Quickswitch', + 'quickswitch' => 'Schnellauswahl', // search 'search' => 'Suche', @@ -1097,7 +1097,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'no_piggies_imperative_default' => 'Haben Sie Dinge, auf die Sie sparen? Erstellen Sie eine Sparschwein und behalten Sie den Überblick:', 'no_piggies_create_default' => 'Ein neues Sparschwein erstellen', 'no_bills_title_default' => 'Let\'s create a bill!', - 'no_bills_intro_default' => 'You have no bills yet. You can create bills to keep track of regular expenses, like your rent or insurance.', + 'no_bills_intro_default' => 'Du hast noch keine Rechnungen. Sie können Rechnungen erstellen, um die laufenden Ausgaben, wie zum Beispiel Ihre Versicherung oder Miete, nachzuverfolgen.', 'no_bills_imperative_default' => 'Haben Sie regelmäßige Rechnungen? Erstellen Sie eine Rechnung und verfolgen Sie Ihre Zahlungen:', 'no_bills_create_default' => 'Eine Rechnung erstellen', From b907f998d9133091c1d264e557013eb72df7081e Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 14:21:03 +0100 Subject: [PATCH 053/258] New translations demo.php (German) --- resources/lang/de_DE/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/demo.php b/resources/lang/de_DE/demo.php index a94b8e79a0..eec5193c40 100644 --- a/resources/lang/de_DE/demo.php +++ b/resources/lang/de_DE/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly III unterstützt mehrere Währungen. Obwohl es den Euro standardmäßig nutzt, ist es möglich US-Dollar oder viele andere Währungen zu verwenden. Wie Sie sehen können, ist eine kleine Auswahl an Währungen aufgenommen worden, aber Sie können Ihre eigenen hinzufügen. Die Standardwährung zu ändern, wird die Währung der vorhandenen Buchungen jedoch nicht ändern: Firefly III unterstützt die Verwendung mehrerer Währungen zur gleichen Zeit.', 'transactions-index' => 'Diese Aufwendungen, Einzahlungen und Überweisungen sind nicht besonders einfallsreich. Sie wurden automatisch generiert.', 'piggy-banks-index' => 'Wie Sie sehen können, gibt es drei Sparschweine. Benutzen die Plus- und Minusknöpfe um die Menge des Geldes in den Sparschweinen zu beeinflussen. Klicken Sie auf den Namen des Sparschweins um Details einzusehen.', - 'import-index' => 'Of course, any CSV file can be imported into Firefly III', + 'import-index' => 'Natürlich kann jede CSV-Datei in Firefly III importiert werden', 'import-configure-security' => 'Aufgrund von Sicherheitsbedenken wurde der Upload mit einer lokalen Datei ersetzt.', 'import-configure-configuration' => 'Die unten stehende Konfiguration für die lokale Datei ist korrekt.', ]; From 62998f8d694bc67c8f90cdc8cfb26bb2b034f15b Mon Sep 17 00:00:00 2001 From: koziolek Date: Fri, 3 Nov 2017 14:53:00 +0100 Subject: [PATCH 054/258] Translate hard-coded strings. --- resources/lang/en_US/firefly.php | 8 ++++++++ resources/views/admin/users/show.twig | 14 +++++++------- resources/views/bills/index.twig | 2 +- resources/views/form/location.twig | 3 +-- resources/views/import/bank/form.twig | 4 ++-- resources/views/import/index.twig | 2 +- resources/views/layout/default.twig | 4 ++-- resources/views/list/bills.twig | 2 +- resources/views/list/piggy-bank-events.twig | 2 +- resources/views/rules/index.twig | 2 +- resources/views/transactions/mass/edit.twig | 4 ++-- resources/views/transactions/show.twig | 6 +++--- 12 files changed, 30 insertions(+), 23 deletions(-) diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 4096eff434..0b277062a0 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Without date', 'result' => 'Result', 'sums_apply_to_range' => 'All sums apply to the selected range', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Right click or long press to set the tag\'s location.', 'clear_location' => 'Clear location', @@ -587,6 +588,7 @@ return [ 'not_expected_period' => 'Not expected this period', 'bill_is_active' => 'Bill is active', 'bill_will_automatch' => 'Bill will automatically linked to matching transactions', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Details for asset account ":name"', 'details_for_expense' => 'Details for expense account ":name"', @@ -615,6 +617,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', @@ -665,6 +668,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', + 'no_budget' => 'none', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', @@ -700,7 +704,9 @@ return [ 'currency' => 'Currency', 'preferences' => 'Preferences', 'logout' => 'Logout', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Search...', + 'version' => 'Version', 'dashboard' => 'Dashboard', 'currencies' => 'Currencies', 'accounts' => 'Accounts', @@ -926,6 +932,7 @@ return [ 'budgets_with_limits' => 'budget(s) with configured amount', 'rule_or_rules' => 'rule(s)', 'rulegroup_or_groups' => 'rule group(s)', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'The configuration has been updated', 'setting_is_demo_site' => 'Demo site', 'setting_is_demo_site_explain' => 'If you check this box, this installation will behave as if it is the demo site, which can have weird side effects.', @@ -1013,6 +1020,7 @@ return [ 'import_index_title' => 'Import data into Firefly III', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Welcome to Firefly\'s import routine. There are a few ways of importing data into Firefly III, displayed here as buttons.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'This routine will help you import files from your bank into Firefly III. Please check out the help pages in the top right corner.', 'import_index_file' => 'Select your file', 'import_index_config' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', diff --git a/resources/views/admin/users/show.twig b/resources/views/admin/users/show.twig index 2922ed89ff..b627f4c2f0 100644 --- a/resources/views/admin/users/show.twig +++ b/resources/views/admin/users/show.twig @@ -32,9 +32,9 @@ {{ trans('list.is_admin') }} {% if information.is_admin %} - Yes + {{ 'yes'|_ }} {% else %} - No + {{ 'no'|_ }} {% endif %} @@ -42,9 +42,9 @@ {{ trans('list.has_two_factor') }} {% if information.has_2fa %} - Yes + {{ 'yes'|_ }} {% else %} - No + {{ 'no'|_ }} {% endif %} @@ -52,7 +52,7 @@ {{ trans('list.is_blocked') }} {% if information.blocked %} - Yes: + {{ 'yes'|_ }}: {% if information.blocked_code == "" %} ~ @@ -61,7 +61,7 @@ {% endif %} {% else %} - No + {{ 'no'|_ }} {% endif %} @@ -122,7 +122,7 @@ {{ trans('list.tags_count') }} - {{ information.tags }} tags + {{ information.tags }} {{ 'tag_or_tags'|_ }} diff --git a/resources/views/bills/index.twig b/resources/views/bills/index.twig index ef136db47f..dcb8603898 100644 --- a/resources/views/bills/index.twig +++ b/resources/views/bills/index.twig @@ -19,7 +19,7 @@
diff --git a/resources/views/form/location.twig b/resources/views/form/location.twig index e4f8b91cae..1f791a31a3 100644 --- a/resources/views/form/location.twig +++ b/resources/views/form/location.twig @@ -3,8 +3,7 @@
{% if env('MAPBOX_API_KEY','') == '' %}

- To use map, get an API key from Mapbox. - Open your .env file en enter this code after MAPBOX_API_KEY=. + {{ trans('mapbox_api_key')|raw }}

{% else %}
diff --git a/resources/views/import/bank/form.twig b/resources/views/import/bank/form.twig index 17bd9ac029..212c481abd 100644 --- a/resources/views/import/bank/form.twig +++ b/resources/views/import/bank/form.twig @@ -25,8 +25,8 @@ - - + + diff --git a/resources/views/import/index.twig b/resources/views/import/index.twig index 1c10f69481..8e2876dc52 100644 --- a/resources/views/import/index.twig +++ b/resources/views/import/index.twig @@ -25,7 +25,7 @@ {# file import #} - Import a (CSV) file + {{ 'import_general_index_csv_file'|_ }} {# bunq import #} {# diff --git a/resources/views/layout/default.twig b/resources/views/layout/default.twig index 9413b94dfc..1c900ad955 100644 --- a/resources/views/layout/default.twig +++ b/resources/views/layout/default.twig @@ -58,7 +58,7 @@ diff --git a/resources/views/list/piggy-bank-events.twig b/resources/views/list/piggy-bank-events.twig index df71625b69..89b20f1710 100644 --- a/resources/views/list/piggy-bank-events.twig +++ b/resources/views/list/piggy-bank-events.twig @@ -1,7 +1,7 @@
AccountCurrent balance{{ 'list.account'|_ }}{{ 'list.currentBalance'|_ }}
{% if showPiggyBank %} - + {% endif %} diff --git a/resources/views/rules/index.twig b/resources/views/rules/index.twig index e564d22f84..217d342bab 100644 --- a/resources/views/rules/index.twig +++ b/resources/views/rules/index.twig @@ -119,7 +119,7 @@ {% if rule.active %} {{ rule.title }} {% else %} - {{ rule.title }} (inactive) + {{ rule.title }} ({{ 'inactive'|_|lower }}) {% endif %} {% if rule.stop_processing %} diff --git a/resources/views/transactions/mass/edit.twig b/resources/views/transactions/mass/edit.twig index 67aa4df0c8..8b3f253050 100644 --- a/resources/views/transactions/mass/edit.twig +++ b/resources/views/transactions/mass/edit.twig @@ -108,9 +108,9 @@ - + {% endfor %} diff --git a/resources/views/list/journals-tiny.twig b/resources/views/list/journals-tiny.twig index ed6ee40b30..04fc8b9147 100644 --- a/resources/views/list/journals-tiny.twig +++ b/resources/views/list/journals-tiny.twig @@ -7,14 +7,10 @@ href="{{ route('transactions.show',transaction.journal_id) }}" {% endif %} > - {{ transaction|typeIconTransaction }} - {% if transaction.transaction_description|length > 0 %} - {{ transaction.transaction_description }} ({{ transaction.description }}) - {% else %} - {{ transaction.description }} - {% endif %} + {{ transaction|transactionIcon }} + {{ transaction|transactionDescription }} - {{ transactionAmount(transaction) }} + {{ transaction|transactionAmount }} {% endfor %} diff --git a/resources/views/list/journals.twig b/resources/views/list/journals.twig index 6b22a76739..4b202354a2 100644 --- a/resources/views/list/journals.twig +++ b/resources/views/list/journals.twig @@ -27,80 +27,8 @@ - {% for transaction in journals %} - - {# input buttons #} - - - {# icon #} - - - {# description #} - - - - - - - - {% if not hideBudgets %} - - {% endif %} - - - {% if not hideCategories %} - - {% endif %} - - - {% if not hideBills %} - - {% endif %} - + {% for transaction in transactions %} + {% include 'partials.transaction-row' %} {% endfor %}
Piggy bank{{ trans('list.piggy_bank') }}{{ trans('list.date') }} {{ trans('list.amount') }} {% if journal.transaction_type_type == 'Withdrawal' %} {% if transaction.source_account_type == 'Cash account' %} - (cash) + ({{ 'cash'|_ }}) {% else %} {{ transaction.source_account_name }} {% endif %} @@ -401,7 +401,7 @@ {% if transaction.destination_account_type == 'Cash account' %} - (cash) + ({{ 'cash'|_ }}) {% else %} {{ transaction.destination_account_name }} {% endif %} @@ -478,7 +478,7 @@ From 0bc7e244ecefff44830cac8092f39468bbbbc53c Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:50:57 +0100 Subject: [PATCH 055/258] New translations firefly.php (Russian) --- resources/lang/ru_RU/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index 0c3dc61380..235708e7c7 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Without date', 'result' => 'Result', 'sums_apply_to_range' => 'All sums apply to the selected range', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Right click or long press to set the tag\'s location.', 'clear_location' => 'Clear location', @@ -587,6 +588,7 @@ return [ 'not_expected_period' => 'Not expected this period', 'bill_is_active' => 'Bill is active', 'bill_will_automatch' => 'Bill will automatically linked to matching transactions', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Details for asset account ":name"', 'details_for_expense' => 'Details for expense account ":name"', @@ -615,6 +617,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', @@ -665,6 +668,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', + 'no_budget' => 'none', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', @@ -700,7 +704,9 @@ return [ 'currency' => 'Валюта', 'preferences' => 'Настройки', 'logout' => 'Выход', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Поиск...', + 'version' => 'Version', 'dashboard' => 'Сводка', 'currencies' => 'Валюты', 'accounts' => 'Счета', @@ -926,6 +932,7 @@ return [ 'budgets_with_limits' => 'budget(s) with configured amount', 'rule_or_rules' => 'rule(s)', 'rulegroup_or_groups' => 'rule group(s)', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'The configuration has been updated', 'setting_is_demo_site' => 'Demo site', 'setting_is_demo_site_explain' => 'If you check this box, this installation will behave as if it is the demo site, which can have weird side effects.', @@ -1013,6 +1020,7 @@ return [ 'import_index_title' => 'Импорт данных в Firefly III', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Welcome to Firefly\'s import routine. There are a few ways of importing data into Firefly III, displayed here as buttons.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'This routine will help you import files from your bank into Firefly III. Please check out the help pages in the top right corner.', 'import_index_file' => 'Select your file', 'import_index_config' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', From 7ac041f036e4be65f141b95a75c78869322c4c0d Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:51:22 +0100 Subject: [PATCH 056/258] New translations firefly.php (Indonesian) --- resources/lang/id_ID/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index 4096eff434..0b277062a0 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Without date', 'result' => 'Result', 'sums_apply_to_range' => 'All sums apply to the selected range', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Right click or long press to set the tag\'s location.', 'clear_location' => 'Clear location', @@ -587,6 +588,7 @@ return [ 'not_expected_period' => 'Not expected this period', 'bill_is_active' => 'Bill is active', 'bill_will_automatch' => 'Bill will automatically linked to matching transactions', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Details for asset account ":name"', 'details_for_expense' => 'Details for expense account ":name"', @@ -615,6 +617,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', @@ -665,6 +668,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', + 'no_budget' => 'none', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', @@ -700,7 +704,9 @@ return [ 'currency' => 'Currency', 'preferences' => 'Preferences', 'logout' => 'Logout', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Search...', + 'version' => 'Version', 'dashboard' => 'Dashboard', 'currencies' => 'Currencies', 'accounts' => 'Accounts', @@ -926,6 +932,7 @@ return [ 'budgets_with_limits' => 'budget(s) with configured amount', 'rule_or_rules' => 'rule(s)', 'rulegroup_or_groups' => 'rule group(s)', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'The configuration has been updated', 'setting_is_demo_site' => 'Demo site', 'setting_is_demo_site_explain' => 'If you check this box, this installation will behave as if it is the demo site, which can have weird side effects.', @@ -1013,6 +1020,7 @@ return [ 'import_index_title' => 'Import data into Firefly III', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Welcome to Firefly\'s import routine. There are a few ways of importing data into Firefly III, displayed here as buttons.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'This routine will help you import files from your bank into Firefly III. Please check out the help pages in the top right corner.', 'import_index_file' => 'Select your file', 'import_index_config' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', From 65a3b2d74ca4de40fdaea8b33838ad159fe07a44 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:51:37 +0100 Subject: [PATCH 057/258] New translations firefly.php (French) --- resources/lang/fr_FR/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index fcbc9c636f..cd2942a629 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Sans date', 'result' => 'Résultat', 'sums_apply_to_range' => 'Toutes les sommes s\'appliquent à l\'ensemble sélectionné', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Faites un clic droit ou appuyez longuement sur pour définir l\'emplacement de l\'étiquette.', 'clear_location' => 'Effacer la localisation', @@ -588,6 +589,7 @@ return [ 'not_expected_period' => 'Cette période n\'est pas prévu', 'bill_is_active' => 'Facture en cours', 'bill_will_automatch' => 'La facture sera automatiquement liée aux transactions correspondantes', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Détails pour le compte d’actif ":name"', 'details_for_expense' => 'Détail du compte de dépenses ":name"', @@ -616,6 +618,7 @@ return [ 'revenue_accounts' => 'Comptes de recettes', 'cash_accounts' => 'Comptes de trésorerie', 'Cash account' => 'Compte de trésorerie', + 'cash' => 'cash', 'account_type' => 'Type de compte', 'save_transactions_by_moving' => 'Enregistrer ces opération(s) en les déplaçant vers un autre compte :', 'stored_new_account' => 'Nouveau compte ":name" créé !', @@ -666,6 +669,7 @@ return [ 'mass_delete_journals' => 'Supprimer un certain nombre de transactions', 'mass_edit_journals' => 'Modifier un certain nombre d’opérations', 'cannot_edit_other_fields' => 'Vous ne peut pas modifier en masse d\'autres champs que ceux ici, car il n’y a pas de place pour tous les montrer. S’il vous plaît suivez le lien et modifiez les par un par un, si vous devez modifier ces champs.', + 'no_budget' => 'none', 'perm-delete-many' => 'Supprimer de nombreux éléments en une seule fois peut être très problématique. Soyez prudent.', 'mass_deleted_transactions_success' => 'Montant des opérations supprimées : :amount.', 'mass_edited_transactions_success' => 'Montant des opérations mises à jour : :amount', @@ -701,7 +705,9 @@ return [ 'currency' => 'Devise', 'preferences' => 'Préférences', 'logout' => 'Se déconnecter', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Rechercher...', + 'version' => 'Version', 'dashboard' => 'Tableau de Bord', 'currencies' => 'Devises', 'accounts' => 'Comptes', @@ -927,6 +933,7 @@ return [ 'budgets_with_limits' => 'budget(s) avec montant configuré', 'rule_or_rules' => 'règle(s)', 'rulegroup_or_groups' => 'groupe(s) de règles', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'La configuration a été mise à jour', 'setting_is_demo_site' => 'Site de démonstration', 'setting_is_demo_site_explain' => 'Si vous cochez cette case, cette installation se comportera comme si c\'était le site de démonstration, ce qui peut engendrer des effets secondaires étranges.', @@ -1014,6 +1021,7 @@ return [ 'import_index_title' => 'Importer des données dans Firefly III', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Bienvenue dans la routine d\'importation de Firefly. Il existe différentes façons d\'importer des données dans Firefly III, affichées ici sous forme de boutons.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'Cette routine vous aidera à importer des fichiers de votre banque dans Firefly III. Consultez les pages d\'aide en haut à droite.', 'import_index_file' => 'Sélectionnez votre fichier', 'import_index_config' => 'Si vous avez précédemment importé des données dans Firefly III, vous pouvez avoir un fichier de configuration qui définira les valeurs de configuration. Pour certaines banques, les autres utilisateurs ont bien voulu fournir leur fichier configuration.', From 29f3c40cbebbb5ecec46835123db3d9ed792422b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:51:44 +0100 Subject: [PATCH 058/258] New translations firefly.php (Dutch) --- resources/lang/nl_NL/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index ad22b4a863..25c9d1cc5a 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Zonder datum', 'result' => 'Resultaat', 'sums_apply_to_range' => 'Alle sommen gelden voor het geselecteerde bereik', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Klik met de rechtermuisknop of druk lang om de locatie van de tag in te stellen.', 'clear_location' => 'Wis locatie', @@ -587,6 +588,7 @@ return [ 'not_expected_period' => 'Niet verwacht deze periode', 'bill_is_active' => 'Contract is actief', 'bill_will_automatch' => 'Waar van toepassing wordt dit contract automatisch gekoppeld aan transacties', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Overzicht voor betaalrekening ":name"', 'details_for_expense' => 'Overzicht voor crediteur ":name"', @@ -615,6 +617,7 @@ return [ 'revenue_accounts' => 'Debiteuren', 'cash_accounts' => 'Contant geldrekeningen', 'Cash account' => 'Contant geldrekening', + 'cash' => 'cash', 'account_type' => 'Rekeningtype', 'save_transactions_by_moving' => 'Bewaar deze transacties door ze aan een andere rekening te koppelen:', 'stored_new_account' => 'Nieuwe rekening ":name" opgeslagen!', @@ -665,6 +668,7 @@ return [ 'mass_delete_journals' => 'Verwijder een aantal transacties', 'mass_edit_journals' => 'Wijzig een aantal transacties', 'cannot_edit_other_fields' => 'Je kan andere velden dan de velden die je hier ziet niet groepsgewijs wijzigen. Er is geen ruimte om ze te laten zien. Als je deze velden toch wilt wijzigen, volg dan de link naast de transactie en wijzig ze stuk voor stuk.', + 'no_budget' => 'none', 'perm-delete-many' => 'Veel items in één keer verwijderen kan zeer storend zijn. Wees voorzichtig.', 'mass_deleted_transactions_success' => 'Verwijder :amount transactie(s).', 'mass_edited_transactions_success' => 'Wijzig :amount transactie(s)', @@ -700,7 +704,9 @@ return [ 'currency' => 'Valuta', 'preferences' => 'Voorkeuren', 'logout' => 'Uitloggen', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Zoeken...', + 'version' => 'Version', 'dashboard' => 'Dashboard', 'currencies' => 'Valuta', 'accounts' => 'Rekeningen', @@ -926,6 +932,7 @@ return [ 'budgets_with_limits' => 'budget(ten) met een ingesteld bedrag', 'rule_or_rules' => 'regel(s)', 'rulegroup_or_groups' => 'regelgroep(en)', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'De configuratie is bijgewerkt', 'setting_is_demo_site' => 'Demo website', 'setting_is_demo_site_explain' => 'Als je dit aanzet doet jouw installatie alsof het een demo-site is, en dat kan problemen opleveren.', @@ -1013,6 +1020,7 @@ return [ 'import_index_title' => 'Gegevens importeren in Firefly III', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Dit is de import-routine van Firefly. Er zijn verschillende manieren om gegevens te importeren in Firefly III, hier als knoppen weergegeven.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'Deze pagina\'s helpen je bestanden van je bank te importeren in Firefly III. Gebruik de hulp-pagina\'s linksboven voor meer informatie.', 'import_index_file' => 'Selecteer je bestand', 'import_index_config' => 'Als je eerder gegevens hebt geïmporteerd in Firefly III, heb je wellicht een configuratiebestand, dat een aantal zaken alvast voor je kan instellen. Voor bepaalde banken hebben andere gebruikers uit de liefde van hun hart het benodigde configuratiebestand gedeeld.', From 41ca02b2dd56f0767fb33e19540dc47abc78a2ab Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:51:49 +0100 Subject: [PATCH 059/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index b040a68124..449a96e5f6 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Ohne Datum', 'result' => 'Ergebnis', 'sums_apply_to_range' => 'All sums apply to the selected range', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Right click or long press to set the tag\'s location.', 'clear_location' => 'Clear location', @@ -588,6 +589,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'not_expected_period' => 'Diesen Zeitraum nicht erwartet', 'bill_is_active' => 'Rechnung ist aktiv', 'bill_will_automatch' => 'Rechnung wird automatisch mit passenden Transaktionen verknüpft', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Details für Girokonto ":name"', 'details_for_expense' => 'Details für Debitor ":name"', @@ -616,6 +618,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'revenue_accounts' => 'Schuldner', 'cash_accounts' => 'Bargeldkonten', 'Cash account' => 'Bargeldkonto', + 'cash' => 'cash', 'account_type' => 'Kontotyp', 'save_transactions_by_moving' => 'Speichern Sie diese Transaktion(en), indem Sie sie auf ein anderes Konto verschieben:', 'stored_new_account' => 'Neues Konto ":name" gespeichert!', @@ -666,6 +669,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'mass_delete_journals' => 'Löschen Sie eine Reihe von Überweisungen', 'mass_edit_journals' => 'Bearbeiten Sie eine Reihe von Überweisungen', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', + 'no_budget' => 'none', 'perm-delete-many' => 'Das Löschen von mehreren Elementen auf einmal kann sich störend auswirken. Bitte seien Sie vorsichtig.', 'mass_deleted_transactions_success' => ':amount Überweisung(en) gelöscht.', 'mass_edited_transactions_success' => ':amount Überweisung(en) aktualisiert', @@ -701,7 +705,9 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'currency' => 'Währung', 'preferences' => 'Einstellungen', 'logout' => 'Abmelden', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Suchen...', + 'version' => 'Version', 'dashboard' => 'Übersicht', 'currencies' => 'Währungen', 'accounts' => 'Konten', @@ -927,6 +933,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'budgets_with_limits' => 'Budget(s) mit konfigurierten Betrag', 'rule_or_rules' => 'Regel(n)', 'rulegroup_or_groups' => 'Regelgruppe(n)', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'Die Konfiguration wurde aktualisiert', 'setting_is_demo_site' => 'Demonstrationsseite', 'setting_is_demo_site_explain' => 'Wenn sie diese Option auswählen, wird sich diese Installation wie eine Demonstrationsseite verhalten, was ungewollte Auswirkungen haben kann.', @@ -1014,6 +1021,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'import_index_title' => 'Daten in Firefly III importieren', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Willkommen beim Importassistenten von Firefly. Es gibt einige Möglichkeiten, Daten in Firefly III zu importieren, die hier als Schaltflächen angezeigt werden.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'Dieser Assistent hilft Ihnen, Dateien von Ihrer Bank in Firefly III zu importieren. Bitte sehen Sie sich die Hilfeseiten in der oberen rechten Ecke an.', 'import_index_file' => 'Datei auswählen', 'import_index_config' => 'Wenn Sie bereits zuvor Daten in Firefly III importiert haben, haben Sie eventuell eine Kofigurationsdatei, welche einige Einstellungen für Sie voreinstellt. Für einige Banken haben andere Nutzer freundlicherweise bereits ihre Konfigurationsdatei zur Verfügung gestellt.', From 00bc8cc81ee3b1f492d832198e132e6cdcbca2e7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:51:59 +0100 Subject: [PATCH 060/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index 81e727da59..b383e356d1 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Bez daty', 'result' => 'Wynik', 'sums_apply_to_range' => 'Wszystkie sumy mają zastosowanie do wybranego zakresu', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Kliknij prawym przyciskiem myszy lub naciśnij i przytrzymaj aby ustawić lokalizację taga.', 'clear_location' => 'Wyczyść lokalizację', @@ -587,6 +588,7 @@ return [ 'not_expected_period' => 'Nie oczekiwany w tym okresie', 'bill_is_active' => 'Rachunek jest aktywny', 'bill_will_automatch' => 'Rachunek będzie automatycznie powiązany z pasującymi transakcjami', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Szczegóły konta aktywów ":name"', 'details_for_expense' => 'Szczegóły konta wydatków ":name"', @@ -615,6 +617,7 @@ return [ 'revenue_accounts' => 'Konta przychodów', 'cash_accounts' => 'Konta gotówkowe', 'Cash account' => 'Konto gotówkowe', + 'cash' => 'cash', 'account_type' => 'Typ konta', 'save_transactions_by_moving' => 'Zapisz te transakcje, przenosząc je do innego konta:', 'stored_new_account' => 'Nowe konto ":name" zostało zapisane!', @@ -665,6 +668,7 @@ return [ 'mass_delete_journals' => 'Usuń wiele transakcji', 'mass_edit_journals' => 'Modyfikuj wiele transakcji', 'cannot_edit_other_fields' => 'Nie możesz masowo modyfikować innych pól niż te tutaj, ponieważ nie ma miejsca, aby je pokazać. Proszę użyć ikony edycji i edytować je jedno po drugim, jeśli chcesz edytować te pola.', + 'no_budget' => 'none', 'perm-delete-many' => 'Usuwanie wielu elementów jednocześnie może być bardzo destrukcyjne. Proszę zachować ostrożność.', 'mass_deleted_transactions_success' => 'Usunięto :amount transakcję(i).', 'mass_edited_transactions_success' => 'Zaktualizowano :amount transakcję(i)', @@ -700,7 +704,9 @@ return [ 'currency' => 'Waluta', 'preferences' => 'Preferencje', 'logout' => 'Wyloguj', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Szukaj...', + 'version' => 'Version', 'dashboard' => 'Kokpit', 'currencies' => 'Waluty', 'accounts' => 'Konta', @@ -926,6 +932,7 @@ return [ 'budgets_with_limits' => 'budżet(y) z określoną kwotą', 'rule_or_rules' => 'reguła(y)', 'rulegroup_or_groups' => 'grupa(y) reguł', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'Konfiguracja została zaktualizowana', 'setting_is_demo_site' => 'Strona demonstracyjna', 'setting_is_demo_site_explain' => 'Jeśli zaznaczysz to pole, ta instalacja będzie zachowywać się jak witryna demonstracyjna, co może mieć dziwne efekty uboczne.', @@ -1013,6 +1020,7 @@ return [ 'import_index_title' => 'Importuj dane do Firefly III', 'import_index_sub_title' => 'Indeks', 'import_general_index_intro' => 'Witamy w procedurze importu Firefly III. Istnieje kilka sposobów importowania danych do Firefly III.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'Ta procedura pomoże Ci zaimportować pliki z Twojego banku do Firefly III. Proszę sprawdzić stronę pomocy w prawym górnym rogu.', 'import_index_file' => 'Wybierz swój plik', 'import_index_config' => 'Jeśli wcześniej importowałeś dane do Firefly III, może posiadać plik konfiguracji, który wstępnie ustawi wartości parametrów konfiguracyjnych dla Ciebie. Dla niektórych banków, inni użytkownicy uprzejmie dostarczyli swoje pliki konfiguracji.', From c2adfc23d38484a1d949d9858de1bc635240d8b7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:52:11 +0100 Subject: [PATCH 061/258] New translations firefly.php (Spanish) --- resources/lang/es_ES/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index 05ba7d8c9a..009f1c5c13 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Without date', 'result' => 'Result', 'sums_apply_to_range' => 'All sums apply to the selected range', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Right click or long press to set the tag\'s location.', 'clear_location' => 'Clear location', @@ -587,6 +588,7 @@ return [ 'not_expected_period' => 'Not expected this period', 'bill_is_active' => 'Bill is active', 'bill_will_automatch' => 'Bill will automatically linked to matching transactions', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Details for asset account ":name"', 'details_for_expense' => 'Details for expense account ":name"', @@ -615,6 +617,7 @@ return [ 'revenue_accounts' => 'Cuentas de ingresos', 'cash_accounts' => 'Cuentas de efectivo', 'Cash account' => 'Cash account', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', @@ -665,6 +668,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', + 'no_budget' => 'none', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', @@ -700,7 +704,9 @@ return [ 'currency' => 'Currency', 'preferences' => 'Preferencias', 'logout' => 'Cerrar sesión', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Buscar...', + 'version' => 'Version', 'dashboard' => 'Panel de control', 'currencies' => 'Divisas', 'accounts' => 'Cuentas', @@ -926,6 +932,7 @@ return [ 'budgets_with_limits' => 'presupuesto(s) con el importe configurado', 'rule_or_rules' => 'regla(s)', 'rulegroup_or_groups' => 'rule group(s)', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'The configuration has been updated', 'setting_is_demo_site' => 'Demo site', 'setting_is_demo_site_explain' => 'If you check this box, this installation will behave as if it is the demo site, which can have weird side effects.', @@ -1013,6 +1020,7 @@ return [ 'import_index_title' => 'Importar datos a Firefly III', 'import_index_sub_title' => 'Índice', 'import_general_index_intro' => 'Welcome to Firefly\'s import routine. There are a few ways of importing data into Firefly III, displayed here as buttons.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'This routine will help you import files from your bank into Firefly III. Please check out the help pages in the top right corner.', 'import_index_file' => 'Select your file', 'import_index_config' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', From 75680aa3f75b62993df6ed856255ab040122c3c9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:52:16 +0100 Subject: [PATCH 062/258] New translations firefly.php (Slovenian) --- resources/lang/sl_SI/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index 1e972ec687..0981cee1f1 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Without date', 'result' => 'Result', 'sums_apply_to_range' => 'All sums apply to the selected range', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Right click or long press to set the tag\'s location.', 'clear_location' => 'Clear location', @@ -587,6 +588,7 @@ return [ 'not_expected_period' => 'Not expected this period', 'bill_is_active' => 'Bill is active', 'bill_will_automatch' => 'Bill will automatically linked to matching transactions', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'podrobnosti za premoženjski račun ":name"', 'details_for_expense' => 'podrobnosti stroškovnega konta ":name"', @@ -615,6 +617,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', @@ -665,6 +668,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', + 'no_budget' => 'none', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', @@ -700,7 +704,9 @@ return [ 'currency' => 'Currency', 'preferences' => 'Preferences', 'logout' => 'Logout', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Search...', + 'version' => 'Version', 'dashboard' => 'Dashboard', 'currencies' => 'Currencies', 'accounts' => 'Accounts', @@ -926,6 +932,7 @@ return [ 'budgets_with_limits' => 'budget(s) with configured amount', 'rule_or_rules' => 'rule(s)', 'rulegroup_or_groups' => 'rule group(s)', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'The configuration has been updated', 'setting_is_demo_site' => 'Demo site', 'setting_is_demo_site_explain' => 'If you check this box, this installation will behave as if it is the demo site, which can have weird side effects.', @@ -1013,6 +1020,7 @@ return [ 'import_index_title' => 'Import data into Firefly III', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Welcome to Firefly\'s import routine. There are a few ways of importing data into Firefly III, displayed here as buttons.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'This routine will help you import files from your bank into Firefly III. Please check out the help pages in the top right corner.', 'import_index_file' => 'Select your file', 'import_index_config' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', From 6a1265564b33a2cfb68260e3388323fb0d9c1a4b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 15:52:21 +0100 Subject: [PATCH 063/258] New translations firefly.php (Portuguese, Brazilian) --- resources/lang/pt_BR/firefly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 339e892afc..2a48a12ee8 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -355,6 +355,7 @@ return [ 'without_date' => 'Without date', 'result' => 'Result', 'sums_apply_to_range' => 'All sums apply to the selected range', + 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', 'press_tag_location' => 'Right click or long press to set the tag\'s location.', 'clear_location' => 'Clear location', @@ -587,6 +588,7 @@ return [ 'not_expected_period' => 'Não esperado neste período', 'bill_is_active' => 'Bill is active', 'bill_will_automatch' => 'Bill will automatically linked to matching transactions', + 'skips_over' => 'skips over', // accounts: 'details_for_asset' => 'Detalhes para a conta de ativo ":name"', 'details_for_expense' => 'Detalhes para a conta de despesas ":name"', @@ -615,6 +617,7 @@ return [ 'revenue_accounts' => 'Contas de receitas', 'cash_accounts' => 'Contas Correntes', 'Cash account' => 'Conta Corrente', + 'cash' => 'cash', 'account_type' => 'Tipo de conta', 'save_transactions_by_moving' => 'Salve essas transações, movendo-os para outra conta:', 'stored_new_account' => 'Nova conta ":name" armazenado!', @@ -665,6 +668,7 @@ return [ 'mass_delete_journals' => 'Excluir um número de transacções', 'mass_edit_journals' => 'Editar um número de transacções', 'cannot_edit_other_fields' => 'Você não pode editar em massa outros campos que não esse aqui, porque não há espaço para mostrá-los. Por favor siga o link e editá-los por um por um, se você precisar editar esses campos.', + 'no_budget' => 'none', 'perm-delete-many' => 'Exclusão de muitos itens de uma só vez pode ser muito perturbador. Por favor, seja cauteloso.', 'mass_deleted_transactions_success' => 'Excluído :amount de transação(ões).', 'mass_edited_transactions_success' => 'Atualizado :amount de transação(ões)', @@ -700,7 +704,9 @@ return [ 'currency' => 'Moeda', 'preferences' => 'Preferências', 'logout' => 'Desconectar', + 'toggleNavigation' => 'Toggle navigation', 'searchPlaceholder' => 'Pesquisar...', + 'version' => 'Version', 'dashboard' => 'Painel de Controle', 'currencies' => 'Moedas', 'accounts' => 'Contas', @@ -926,6 +932,7 @@ return [ 'budgets_with_limits' => 'budget(s) com quantidade configurada', 'rule_or_rules' => 'regra(s)', 'rulegroup_or_groups' => 'grupo(s) de regra', + 'tag_or_tags' => 'tag(s)', 'configuration_updated' => 'A configuração foi atualizada', 'setting_is_demo_site' => 'Site demo', 'setting_is_demo_site_explain' => 'If you check this box, this installation will behave as if it is the demo site, which can have weird side effects.', @@ -1013,6 +1020,7 @@ return [ 'import_index_title' => 'Import data into Firefly III', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Welcome to Firefly\'s import routine. There are a few ways of importing data into Firefly III, displayed here as buttons.', + 'import_general_index_csv_file' => 'Import a (CSV) file', 'import_index_intro' => 'This routine will help you import files from your bank into Firefly III. Please check out the help pages in the top right corner.', 'import_index_file' => 'Select your file', 'import_index_config' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', From ac801c8b86d977ef44490e64b7f194b5663db433 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 16:04:17 +0100 Subject: [PATCH 064/258] Update models. --- app/Models/Account.php | 8 +++----- app/Models/AccountMeta.php | 5 ++--- app/Models/AccountType.php | 9 ++------- app/Models/Attachment.php | 8 +++----- app/Models/AvailableBudget.php | 8 +++----- app/Models/Bill.php | 8 +++----- app/Models/Budget.php | 11 ++++++----- app/Models/BudgetLimit.php | 6 +++--- app/Models/Category.php | 8 +++----- app/Models/Configuration.php | 6 ++---- app/Models/CurrencyExchangeRate.php | 3 ++- app/Models/ExportJob.php | 6 ++---- app/Models/ImportJob.php | 6 ++---- app/Models/LimitRepetition.php | 8 +++++--- app/Models/LinkType.php | 6 +++--- app/Models/Note.php | 8 ++++---- app/Models/PiggyBank.php | 11 +++++++---- app/Models/PiggyBankEvent.php | 9 +++++---- app/Models/PiggyBankRepetition.php | 10 ++++++---- app/Models/Preference.php | 7 ++++--- app/Models/Role.php | 6 +++--- app/Models/Rule.php | 8 +++----- app/Models/RuleAction.php | 6 ++---- app/Models/RuleGroup.php | 9 +++------ app/Models/RuleTrigger.php | 6 ++---- app/Models/Tag.php | 15 +++++++++------ app/Models/Transaction.php | 7 +++---- app/Models/TransactionCurrency.php | 10 ++++++---- app/Models/TransactionJournal.php | 8 ++++---- app/Models/TransactionJournalMeta.php | 13 +++++++------ app/Models/TransactionType.php | 8 +++----- 31 files changed, 115 insertions(+), 132 deletions(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index 3848ac32f2..a4bd0ddb8a 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -53,15 +53,13 @@ class Account extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'active' => 'boolean', 'encrypted' => 'boolean', ]; /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; - /** @var array */ protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban']; /** @var array */ protected $hidden = ['encrypted']; diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index a4b454ab20..02dfedbe3d 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -41,11 +41,10 @@ class AccountMeta extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; /** @var array */ - protected $dates = ['created_at', 'updated_at']; protected $fillable = ['account_id', 'name', 'data']; protected $table = 'account_meta'; diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 5ec636bfbd..6e2a93de3c 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -50,15 +50,10 @@ class AccountType extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at']; - - // - /** * @return HasMany */ diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index a26d618644..e11a7cb3df 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -46,14 +46,12 @@ class Attachment extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'uploaded' => 'boolean', ]; /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; - /** @var array */ protected $fillable = ['attachable_id', 'attachable_type', 'user_id', 'md5', 'filename', 'mime', 'title', 'notes', 'description', 'size', 'uploaded']; /** diff --git a/app/Models/AvailableBudget.php b/app/Models/AvailableBudget.php index 7a37df2f07..b8c26bae47 100644 --- a/app/Models/AvailableBudget.php +++ b/app/Models/AvailableBudget.php @@ -43,15 +43,13 @@ class AvailableBudget extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'start_date' => 'date', 'end_date' => 'date', ]; /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; - /** @var array */ protected $fillable = ['user_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date']; /** diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 6c52a3a86b..f681a0915c 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -47,9 +47,9 @@ class Bill extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'date' => 'date', 'skip' => 'int', 'automatch' => 'boolean', @@ -57,8 +57,6 @@ class Bill extends Model 'name_encrypted' => 'boolean', 'match_encrypted' => 'boolean', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; protected $fillable = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',]; diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 1044d66125..b0680f3b85 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -47,16 +47,17 @@ class Budget extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'active' => 'boolean', 'encrypted' => 'boolean', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; + /** @var array */ protected $fillable = ['user_id', 'name', 'active']; + /** @var array */ protected $hidden = ['encrypted']; + /** @var array */ protected $rules = ['name' => 'required|between:1,200',]; /** diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index fa0384857f..71eb68378e 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -41,14 +41,14 @@ class BudgetLimit extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', 'start_date' => 'date', 'end_date' => 'date', 'repeats' => 'boolean', ]; /** @var array */ - protected $dates = ['created_at', 'updated_at', 'start_date', 'end_date']; + protected $dates = ['start_date', 'end_date']; /** * @param $value diff --git a/app/Models/Category.php b/app/Models/Category.php index cd44b771e6..a52fc76532 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -46,14 +46,12 @@ class Category extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'encrypted' => 'boolean', ]; /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; - /** @var array */ protected $fillable = ['user_id', 'name']; /** @var array */ protected $hidden = ['encrypted']; diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index c9f9edbf77..f00654ec0f 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -42,11 +42,9 @@ class Configuration extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; protected $table = 'configuration'; /** diff --git a/app/Models/CurrencyExchangeRate.php b/app/Models/CurrencyExchangeRate.php index c953a8cca1..37a94593e0 100644 --- a/app/Models/CurrencyExchangeRate.php +++ b/app/Models/CurrencyExchangeRate.php @@ -36,7 +36,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; class CurrencyExchangeRate extends Model { - protected $dates = ['created_at', 'updated_at', 'date']; + /** @var array */ + protected $dates = ['date']; /** * @return BelongsTo diff --git a/app/Models/ExportJob.php b/app/Models/ExportJob.php index dc14d88805..2d223402f0 100644 --- a/app/Models/ExportJob.php +++ b/app/Models/ExportJob.php @@ -39,11 +39,9 @@ class ExportJob extends Model /** @var array */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at']; /** * @param $value diff --git a/app/Models/ImportJob.php b/app/Models/ImportJob.php index 6e866aefda..c8c5c7079a 100644 --- a/app/Models/ImportJob.php +++ b/app/Models/ImportJob.php @@ -44,11 +44,9 @@ class ImportJob extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at']; protected $validStatus = [ diff --git a/app/Models/LimitRepetition.php b/app/Models/LimitRepetition.php index dfaaebd903..f2c541cedb 100644 --- a/app/Models/LimitRepetition.php +++ b/app/Models/LimitRepetition.php @@ -43,12 +43,14 @@ class LimitRepetition extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', 'startdate' => 'date', 'enddate' => 'date', ]; - protected $dates = ['created_at', 'updated_at', 'startdate', 'enddate']; + /** @var array */ + protected $dates = ['startdate', 'enddate']; + /** @var array */ protected $hidden = ['amount_encrypted']; /** diff --git a/app/Models/LinkType.php b/app/Models/LinkType.php index be70f06f4c..7fe9faef47 100644 --- a/app/Models/LinkType.php +++ b/app/Models/LinkType.php @@ -42,9 +42,9 @@ class LinkType extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'editable' => 'boolean', ]; diff --git a/app/Models/Note.php b/app/Models/Note.php index aa1665c671..f1c2202fa9 100644 --- a/app/Models/Note.php +++ b/app/Models/Note.php @@ -40,11 +40,11 @@ class Note extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', ]; - protected $dates = ['created_at', 'updated_at', 'deleted_at']; + /** @var array */ protected $fillable = ['title', 'text']; /** diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index 9a81a08118..3325f2c282 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -47,17 +47,20 @@ class PiggyBank extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'startdate' => 'date', 'targetdate' => 'date', 'order' => 'int', 'active' => 'boolean', 'encrypted' => 'boolean', ]; - protected $dates = ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate']; + /** @var array */ + protected $dates = ['startdate', 'targetdate']; + /** @var array */ protected $fillable = ['name', 'account_id', 'order', 'targetamount', 'startdate', 'targetdate']; + /** @var array */ protected $hidden = ['targetamount_encrypted', 'encrypted']; /** diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 41e27d4296..13088c60c3 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -40,11 +40,12 @@ class PiggyBankEvent extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'date' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'date' => 'datetime', ]; - protected $dates = ['created_at', 'updated_at', 'date']; + /** @var array */ + protected $dates = ['date']; protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount']; protected $hidden = ['amount_encrypted']; diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index 9484e631c2..6073e3c108 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -42,13 +42,15 @@ class PiggyBankRepetition extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'startdate' => 'date', 'targetdate' => 'date', ]; - protected $dates = ['created_at', 'updated_at', 'startdate', 'targetdate']; + /** @var array */ + protected $dates = ['startdate', 'targetdate']; + /** @var array */ protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount']; /** diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 6c984085a3..9d66c0ac85 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -45,10 +45,11 @@ class Preference extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; - protected $dates = ['created_at', 'updated_at']; + + /** @var array */ protected $fillable = ['user_id', 'data', 'name', 'data']; /** diff --git a/app/Models/Role.php b/app/Models/Role.php index 1d4da87723..c117329c6a 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -41,10 +41,10 @@ class Role extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; - protected $dates = ['created_at', 'updated_at']; + /** * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany diff --git a/app/Models/Rule.php b/app/Models/Rule.php index bb67df6f68..8a777698b7 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -43,15 +43,13 @@ class Rule extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'active' => 'boolean', 'order' => 'int', 'stop_processing' => 'boolean', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; /** * @param Rule $value diff --git a/app/Models/RuleAction.php b/app/Models/RuleAction.php index 800357db85..c26359ab62 100644 --- a/app/Models/RuleAction.php +++ b/app/Models/RuleAction.php @@ -39,14 +39,12 @@ class RuleAction extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', 'active' => 'boolean', 'order' => 'int', 'stop_processing' => 'boolean', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at']; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index 2eabf6bb5d..e2d13773ec 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -42,15 +42,12 @@ class RuleGroup extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'active' => 'boolean', 'order' => 'int', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at', 'deleted_at']; - protected $fillable = ['user_id', 'order', 'title', 'description', 'active']; diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php index d9af8d38ab..629b283ee1 100644 --- a/app/Models/RuleTrigger.php +++ b/app/Models/RuleTrigger.php @@ -39,14 +39,12 @@ class RuleTrigger extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', 'active' => 'boolean', 'order' => 'int', 'stop_processing' => 'boolean', ]; - /** @var array */ - protected $dates = ['created_at', 'updated_at']; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo diff --git a/app/Models/Tag.php b/app/Models/Tag.php index a5174e594a..93b31b4d75 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -44,17 +44,20 @@ class Tag extends Model * @var array */ protected $casts - = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'date' => 'date', 'zoomLevel' => 'int', ]; - protected $dates = ['created_at', 'updated_at', 'date', 'deleted_at']; + /** @var array */ + protected $dates = ['date']; + /** @var array */ protected $fillable = ['user_id', 'tag', 'date', 'description', 'longitude', 'latitude', 'zoomLevel', 'tagMode']; - protected $rules = ['tag' => 'required|between:1,200',]; + /** @var array */ + protected $rules = ['tag' => 'required|between:1,200',]; /** diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index fa0c0c5a08..217f3484fa 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -87,14 +87,13 @@ class Transaction extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'identifier' => 'int', 'encrypted' => 'boolean', // model does not have these fields though 'bill_name_encrypted' => 'boolean', ]; - protected $dates = ['created_at', 'updated_at', 'deleted_at']; protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount', 'identifier', 'transaction_currency_id', 'foreign_currency_id', 'foreign_amount']; diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index 8fe217cb8d..3b4c0eb607 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -44,12 +44,14 @@ class TransactionCurrency extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'decimal_places' => 'int', ]; - protected $dates = ['created_at', 'updated_at', 'deleted_at', 'date']; + /** @var array */ + protected $dates = ['date']; + /** @var array */ protected $fillable = ['name', 'code', 'symbol', 'decimal_places']; /** diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index f67b25aec7..b6df84bbd7 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -53,9 +53,9 @@ class TransactionJournal extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', 'date' => 'date', 'interest_date' => 'date', 'book_date' => 'date', @@ -66,7 +66,7 @@ class TransactionJournal extends Model 'completed' => 'boolean', ]; /** @var array */ - protected $dates = ['created_at', 'updated_at', 'date', 'deleted_at', 'interest_date', 'book_date', 'process_date']; + protected $dates = ['date','interest_date', 'book_date', 'process_date']; /** @var array */ protected $fillable = ['user_id', 'transaction_type_id', 'bill_id', 'interest_date', 'book_date', 'process_date', diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index 11a23eff31..e23cf76edb 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -42,14 +42,15 @@ class TransactionJournalMeta extends Model * @var array */ protected $casts - = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', ]; - protected $dates = ['created_at', 'updated_at', 'deleted_at']; + /** @var array */ protected $fillable = ['transaction_journal_id', 'name', 'data', 'hash']; - protected $table = 'journal_meta'; + /** @var string */ + protected $table = 'journal_meta'; /** * @param $value diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index a7ebd80beb..1df75796aa 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -48,13 +48,11 @@ class TransactionType extends Model */ protected $casts = [ - 'created_at' => 'date', - 'updated_at' => 'date', - 'deleted_at' => 'date', + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'deleted_at' => 'datetime', ]; - protected $dates = ['created_at', 'updated_at', 'deleted_at']; - /** * @param string $type * From c6434991d32a69ea4656b432eaf6ab1a1a7999ff Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 16:32:48 +0100 Subject: [PATCH 065/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index b383e356d1..768cff497f 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -355,7 +355,7 @@ return [ 'without_date' => 'Bez daty', 'result' => 'Wynik', 'sums_apply_to_range' => 'Wszystkie sumy mają zastosowanie do wybranego zakresu', - 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', + 'mapbox_api_key' => 'Aby użyć mapy, pobierz klucz API z Mapbox. Otwórz plik .env i wprowadź ten kod po MAPBOX_API_KEY=.', 'press_tag_location' => 'Kliknij prawym przyciskiem myszy lub naciśnij i przytrzymaj aby ustawić lokalizację taga.', 'clear_location' => 'Wyczyść lokalizację', @@ -588,7 +588,7 @@ return [ 'not_expected_period' => 'Nie oczekiwany w tym okresie', 'bill_is_active' => 'Rachunek jest aktywny', 'bill_will_automatch' => 'Rachunek będzie automatycznie powiązany z pasującymi transakcjami', - 'skips_over' => 'skips over', + 'skips_over' => 'pomija', // accounts: 'details_for_asset' => 'Szczegóły konta aktywów ":name"', 'details_for_expense' => 'Szczegóły konta wydatków ":name"', @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Konta przychodów', 'cash_accounts' => 'Konta gotówkowe', 'Cash account' => 'Konto gotówkowe', - 'cash' => 'cash', + 'cash' => 'gotówka', 'account_type' => 'Typ konta', 'save_transactions_by_moving' => 'Zapisz te transakcje, przenosząc je do innego konta:', 'stored_new_account' => 'Nowe konto ":name" zostało zapisane!', @@ -668,7 +668,7 @@ return [ 'mass_delete_journals' => 'Usuń wiele transakcji', 'mass_edit_journals' => 'Modyfikuj wiele transakcji', 'cannot_edit_other_fields' => 'Nie możesz masowo modyfikować innych pól niż te tutaj, ponieważ nie ma miejsca, aby je pokazać. Proszę użyć ikony edycji i edytować je jedno po drugim, jeśli chcesz edytować te pola.', - 'no_budget' => 'none', + 'no_budget' => 'żaden', 'perm-delete-many' => 'Usuwanie wielu elementów jednocześnie może być bardzo destrukcyjne. Proszę zachować ostrożność.', 'mass_deleted_transactions_success' => 'Usunięto :amount transakcję(i).', 'mass_edited_transactions_success' => 'Zaktualizowano :amount transakcję(i)', @@ -704,9 +704,9 @@ return [ 'currency' => 'Waluta', 'preferences' => 'Preferencje', 'logout' => 'Wyloguj', - 'toggleNavigation' => 'Toggle navigation', + 'toggleNavigation' => 'Przełącz nawigację', 'searchPlaceholder' => 'Szukaj...', - 'version' => 'Version', + 'version' => 'Wersja', 'dashboard' => 'Kokpit', 'currencies' => 'Waluty', 'accounts' => 'Konta', @@ -932,7 +932,7 @@ return [ 'budgets_with_limits' => 'budżet(y) z określoną kwotą', 'rule_or_rules' => 'reguła(y)', 'rulegroup_or_groups' => 'grupa(y) reguł', - 'tag_or_tags' => 'tag(s)', + 'tag_or_tags' => 'tag(ów)', 'configuration_updated' => 'Konfiguracja została zaktualizowana', 'setting_is_demo_site' => 'Strona demonstracyjna', 'setting_is_demo_site_explain' => 'Jeśli zaznaczysz to pole, ta instalacja będzie zachowywać się jak witryna demonstracyjna, co może mieć dziwne efekty uboczne.', @@ -1020,7 +1020,7 @@ return [ 'import_index_title' => 'Importuj dane do Firefly III', 'import_index_sub_title' => 'Indeks', 'import_general_index_intro' => 'Witamy w procedurze importu Firefly III. Istnieje kilka sposobów importowania danych do Firefly III.', - 'import_general_index_csv_file' => 'Import a (CSV) file', + 'import_general_index_csv_file' => 'Importuj plik CSV', 'import_index_intro' => 'Ta procedura pomoże Ci zaimportować pliki z Twojego banku do Firefly III. Proszę sprawdzić stronę pomocy w prawym górnym rogu.', 'import_index_file' => 'Wybierz swój plik', 'import_index_config' => 'Jeśli wcześniej importowałeś dane do Firefly III, może posiadać plik konfiguracji, który wstępnie ustawi wartości parametrów konfiguracyjnych dla Ciebie. Dla niektórych banków, inni użytkownicy uprzejmie dostarczyli swoje pliki konfiguracji.', From 25268fabb354e60f7e6c6d31abede108acc65a7f Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 20:20:18 +0100 Subject: [PATCH 066/258] New translations firefly.php (Dutch) --- resources/lang/nl_NL/firefly.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index 25c9d1cc5a..e40bf6b39b 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -355,7 +355,7 @@ return [ 'without_date' => 'Zonder datum', 'result' => 'Resultaat', 'sums_apply_to_range' => 'Alle sommen gelden voor het geselecteerde bereik', - 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', + 'mapbox_api_key' => 'Om de kaart te gebruiken regel je een API-key bij Mapbox. Open je .env-bestand en zet deze achter MAPBOX_API_KEY=.', 'press_tag_location' => 'Klik met de rechtermuisknop of druk lang om de locatie van de tag in te stellen.', 'clear_location' => 'Wis locatie', @@ -588,7 +588,7 @@ return [ 'not_expected_period' => 'Niet verwacht deze periode', 'bill_is_active' => 'Contract is actief', 'bill_will_automatch' => 'Waar van toepassing wordt dit contract automatisch gekoppeld aan transacties', - 'skips_over' => 'skips over', + 'skips_over' => 'slaat over', // accounts: 'details_for_asset' => 'Overzicht voor betaalrekening ":name"', 'details_for_expense' => 'Overzicht voor crediteur ":name"', @@ -668,7 +668,7 @@ return [ 'mass_delete_journals' => 'Verwijder een aantal transacties', 'mass_edit_journals' => 'Wijzig een aantal transacties', 'cannot_edit_other_fields' => 'Je kan andere velden dan de velden die je hier ziet niet groepsgewijs wijzigen. Er is geen ruimte om ze te laten zien. Als je deze velden toch wilt wijzigen, volg dan de link naast de transactie en wijzig ze stuk voor stuk.', - 'no_budget' => 'none', + 'no_budget' => 'geen', 'perm-delete-many' => 'Veel items in één keer verwijderen kan zeer storend zijn. Wees voorzichtig.', 'mass_deleted_transactions_success' => 'Verwijder :amount transactie(s).', 'mass_edited_transactions_success' => 'Wijzig :amount transactie(s)', @@ -704,9 +704,9 @@ return [ 'currency' => 'Valuta', 'preferences' => 'Voorkeuren', 'logout' => 'Uitloggen', - 'toggleNavigation' => 'Toggle navigation', + 'toggleNavigation' => 'Navigatie aan of uit', 'searchPlaceholder' => 'Zoeken...', - 'version' => 'Version', + 'version' => 'Versie', 'dashboard' => 'Dashboard', 'currencies' => 'Valuta', 'accounts' => 'Rekeningen', @@ -1020,7 +1020,7 @@ return [ 'import_index_title' => 'Gegevens importeren in Firefly III', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Dit is de import-routine van Firefly. Er zijn verschillende manieren om gegevens te importeren in Firefly III, hier als knoppen weergegeven.', - 'import_general_index_csv_file' => 'Import a (CSV) file', + 'import_general_index_csv_file' => 'Importeer een (CSV) bestand', 'import_index_intro' => 'Deze pagina\'s helpen je bestanden van je bank te importeren in Firefly III. Gebruik de hulp-pagina\'s linksboven voor meer informatie.', 'import_index_file' => 'Selecteer je bestand', 'import_index_config' => 'Als je eerder gegevens hebt geïmporteerd in Firefly III, heb je wellicht een configuratiebestand, dat een aantal zaken alvast voor je kan instellen. Voor bepaalde banken hebben andere gebruikers uit de liefde van hun hart het benodigde configuratiebestand gedeeld.', From 7db233d0e8f8482d8eeae0878e4e3b6a72775180 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 20:20:20 +0100 Subject: [PATCH 067/258] New translations demo.php (Dutch) --- resources/lang/nl_NL/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/nl_NL/demo.php b/resources/lang/nl_NL/demo.php index 3bf4a46081..631ff2236e 100644 --- a/resources/lang/nl_NL/demo.php +++ b/resources/lang/nl_NL/demo.php @@ -20,7 +20,7 @@ return [ 'currencies-index' => 'Firefly ondersteunt meerdere valuta\'s. Hoewel het standaard de Euro is kan je ook kiezen voor de US dollar of een van de vele anderen. Er is een kleine selectie valuta meegeleverd maar je kan je eigen valuta toevoegen. Het veranderen van de standaardvaluta verandert de bestaande transacties niet: Firefly III ondersteunt het gebruik van meerdere valuta op hetzelfde moment.', 'transactions-index' => 'Deze uitgaven, inkomsten en overschrijvingen zijn niet heel fantasierijk. Ze zijn automatisch gegenereerd.', 'piggy-banks-index' => 'Zoals je kan zien zijn er drie spaarpotjes. Gebruik de plus- en minknoppen om het bedrag in de spaarpotjes te veranderen. Klik op de naam van het spaarpotje om er de geschiedenis van te zien.', - 'import-index' => 'Of course, any CSV file can be imported into Firefly III', + 'import-index' => 'Uiteraard kan je elk CSV bestand importeren in Firefly III', 'import-configure-security' => 'Uit veiligheidsoverwegingen is je upload vervangen door een lokaal bestand.', 'import-configure-configuration' => 'Deze configuratie is correct voor het lokale bestand.', ]; From 8cb42d1114edc19e89e8027a3b75546509a6e23e Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Nov 2017 21:32:29 +0100 Subject: [PATCH 068/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 449a96e5f6..a798404c4f 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -355,7 +355,7 @@ return [ 'without_date' => 'Ohne Datum', 'result' => 'Ergebnis', 'sums_apply_to_range' => 'All sums apply to the selected range', - 'mapbox_api_key' => 'To use map, get an API key from Mapbox. Open your .env file en enter this code after MAPBOX_API_KEY=.', + 'mapbox_api_key' => 'Um die Karte zu verwenden, besorgen Sie sich einen API-Schlüssel von Mapbox. Öffnen Sie Ihre .env Datei und geben Sie diesen Code unter MAPBOX_API_KEY= ein.', 'press_tag_location' => 'Right click or long press to set the tag\'s location.', 'clear_location' => 'Clear location', @@ -705,7 +705,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'currency' => 'Währung', 'preferences' => 'Einstellungen', 'logout' => 'Abmelden', - 'toggleNavigation' => 'Toggle navigation', + 'toggleNavigation' => 'Navigation umschalten', 'searchPlaceholder' => 'Suchen...', 'version' => 'Version', 'dashboard' => 'Übersicht', @@ -933,7 +933,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'budgets_with_limits' => 'Budget(s) mit konfigurierten Betrag', 'rule_or_rules' => 'Regel(n)', 'rulegroup_or_groups' => 'Regelgruppe(n)', - 'tag_or_tags' => 'tag(s)', + 'tag_or_tags' => 'Tag(s)', 'configuration_updated' => 'Die Konfiguration wurde aktualisiert', 'setting_is_demo_site' => 'Demonstrationsseite', 'setting_is_demo_site_explain' => 'Wenn sie diese Option auswählen, wird sich diese Installation wie eine Demonstrationsseite verhalten, was ungewollte Auswirkungen haben kann.', @@ -1021,7 +1021,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'import_index_title' => 'Daten in Firefly III importieren', 'import_index_sub_title' => 'Index', 'import_general_index_intro' => 'Willkommen beim Importassistenten von Firefly. Es gibt einige Möglichkeiten, Daten in Firefly III zu importieren, die hier als Schaltflächen angezeigt werden.', - 'import_general_index_csv_file' => 'Import a (CSV) file', + 'import_general_index_csv_file' => 'Importiere eine (CSV) Datei', 'import_index_intro' => 'Dieser Assistent hilft Ihnen, Dateien von Ihrer Bank in Firefly III zu importieren. Bitte sehen Sie sich die Hilfeseiten in der oberen rechten Ecke an.', 'import_index_file' => 'Datei auswählen', 'import_index_config' => 'Wenn Sie bereits zuvor Daten in Firefly III importiert haben, haben Sie eventuell eine Kofigurationsdatei, welche einige Einstellungen für Sie voreinstellt. Für einige Banken haben andere Nutzer freundlicherweise bereits ihre Konfigurationsdatei zur Verfügung gestellt.', From b4dc70244aafc1d686259293331c82a05ab88570 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 06:23:52 +0100 Subject: [PATCH 069/258] Fix for #980 --- resources/views/json/piggy-banks.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/views/json/piggy-banks.twig b/resources/views/json/piggy-banks.twig index 2e0e9214c0..71c9b93a5d 100644 --- a/resources/views/json/piggy-banks.twig +++ b/resources/views/json/piggy-banks.twig @@ -8,8 +8,9 @@ {{ entry.name }}
- {{ entry.amount|formatAmountPlain }} + {% if entry.percentage >=20 %}{{ entry.amount|formatAmountPlain }}{% endif %}
+ {% if entry.percentage < 20 %} {{ entry.amount|formatAmountPlain }}{% endif %}
{% endfor %} From bb46d034cd0d0e0f815f3a408cbf3ffbee562c85 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:10:21 +0100 Subject: [PATCH 070/258] Various cleanup in transaction and journal display code. --- app/Helpers/Collector/JournalCollector.php | 1 + .../Controllers/TransactionController.php | 6 +- app/Providers/FireflyServiceProvider.php | 4 + app/Repositories/Journal/JournalTasker.php | 5 +- app/Support/Amount.php | 136 ----- app/Support/CacheProperties.php | 22 +- app/Support/ExpandedForm.php | 4 +- app/Support/SingleCacheProperties.php | 47 ++ app/Support/Twig/AmountFormat.php | 42 -- app/Support/Twig/Extension/Transaction.php | 487 ++++++++++++++++++ .../Twig/Extension/TransactionJournal.php | 92 ++++ app/Support/Twig/Journal.php | 3 +- .../Twig/Loader/TransactionJournalLoader.php | 57 ++ app/Support/Twig/Loader/TransactionLoader.php | 57 ++ app/Support/Twig/Transaction.php | 237 +-------- resources/lang/en_US/firefly.php | 2 +- resources/views/admin/link/show.twig | 5 +- resources/views/list/journals-tiny.twig | 10 +- resources/views/list/journals.twig | 76 +-- resources/views/partials/transaction-row.twig | 65 +++ resources/views/popup/list/journals.twig | 31 +- .../reports/partials/journals-audit.twig | 12 +- resources/views/search/search.twig | 14 +- resources/views/transactions/mass-delete.twig | 3 +- resources/views/transactions/show.twig | 10 +- 25 files changed, 885 insertions(+), 543 deletions(-) create mode 100644 app/Support/SingleCacheProperties.php create mode 100644 app/Support/Twig/Extension/Transaction.php create mode 100644 app/Support/Twig/Extension/TransactionJournal.php create mode 100644 app/Support/Twig/Loader/TransactionJournalLoader.php create mode 100644 app/Support/Twig/Loader/TransactionLoader.php create mode 100644 resources/views/partials/transaction-row.twig diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php index a228f15ec0..fb71210ad1 100644 --- a/app/Helpers/Collector/JournalCollector.php +++ b/app/Helpers/Collector/JournalCollector.php @@ -73,6 +73,7 @@ class JournalCollector implements JournalCollectorInterface 'transaction_journals.encrypted', 'transaction_types.type as transaction_type_type', 'transaction_journals.bill_id', + 'transaction_journals.updated_at', 'bills.name as bill_name', 'bills.name_encrypted as bill_name_encrypted', diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 92af78ac40..9343a6324e 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -125,11 +125,11 @@ class TransactionController extends Controller $collector = app(JournalCollectorInterface::class); $collector->setAllAssetAccounts()->setRange($start, $end)->setTypes($types)->setLimit($pageSize)->setPage($page)->withOpposingAccount(); $collector->removeFilter(InternalTransferFilter::class); - $journals = $collector->getPaginatedJournals(); - $journals->setPath($path); + $transactions = $collector->getPaginatedJournals(); + $transactions->setPath($path); - return view('transactions.index', compact('subTitle', 'what', 'subTitleIcon', 'journals', 'periods', 'start', 'end', 'moment')); + return view('transactions.index', compact('subTitle', 'what', 'subTitleIcon', 'transactions', 'periods', 'start', 'end', 'moment')); } diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index d43a129fa0..aa1b81bd6d 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -56,6 +56,8 @@ use FireflyIII\Support\Steam; use FireflyIII\Support\Twig\AmountFormat; use FireflyIII\Support\Twig\General; use FireflyIII\Support\Twig\Journal; +use FireflyIII\Support\Twig\Loader\TransactionJournalLoader; +use FireflyIII\Support\Twig\Loader\TransactionLoader; use FireflyIII\Support\Twig\PiggyBank; use FireflyIII\Support\Twig\Rule; use FireflyIII\Support\Twig\Transaction; @@ -83,6 +85,8 @@ class FireflyServiceProvider extends ServiceProvider ); $config = app('config'); Twig::addExtension(new Functions($config)); + Twig::addRuntimeLoader(new TransactionLoader); + Twig::addRuntimeLoader(new TransactionJournalLoader); Twig::addExtension(new PiggyBank); Twig::addExtension(new General); Twig::addExtension(new Journal); diff --git a/app/Repositories/Journal/JournalTasker.php b/app/Repositories/Journal/JournalTasker.php index 0d150e8912..469deb95b2 100644 --- a/app/Repositories/Journal/JournalTasker.php +++ b/app/Repositories/Journal/JournalTasker.php @@ -123,7 +123,8 @@ class JournalTasker implements JournalTaskerInterface ] ); - $transactions = []; + $transactions = []; + $transactionType = $journal->transactionType->type; /** @var Transaction $entry */ foreach ($set as $entry) { @@ -132,6 +133,8 @@ class JournalTasker implements JournalTaskerInterface $budget = $entry->budgets->first(); $category = $entry->categories->first(); $transaction = [ + 'journal_type' => $transactionType, + 'updated_at' => $journal->updated_at, 'source_id' => $entry->id, 'source_amount' => $entry->amount, 'foreign_source_amount' => $entry->foreign_amount, diff --git a/app/Support/Amount.php b/app/Support/Amount.php index bd60a13666..493184c3f9 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -267,140 +267,4 @@ class Amount ]; } - /** - * @param TransactionJournal $journal - * @param bool $coloured - * - * @return string - */ - public function journalAmount(TransactionJournal $journal, bool $coloured = true): string - { - $amounts = []; - $transactions = $journal->transactions()->where('amount', '>', 0)->get(); - /** @var TransactionModel $transaction */ - foreach ($transactions as $transaction) { - // model some fields to fit "transactionAmount()": - $transaction->transaction_amount = $transaction->amount; - $transaction->transaction_foreign_amount = $transaction->foreign_amount; - $transaction->transaction_type_type = $journal->transactionType->type; - $transaction->transaction_currency_symbol = $transaction->transactionCurrency->symbol; - $transaction->transaction_currency_dp = $transaction->transactionCurrency->decimal_places; - if (!is_null($transaction->foreign_currency_id)) { - $transaction->foreign_currency_symbol = $transaction->foreignCurrency->symbol; - $transaction->foreign_currency_dp = $transaction->foreignCurrency->decimal_places; - } - - $amounts[] = $this->transactionAmount($transaction, $coloured); - } - - return join(' / ', $amounts); - - } - - /** - * @param TransactionJournal $journal - * @param bool $coloured - * - * @return string - */ - public function journalTotalAmount(TransactionJournal $journal, bool $coloured = true): string - { - $transactions = $journal->transactions()->where('amount', '>', 0)->get(); - $totals = []; - $type = $journal->transactionType->type; - /** @var TransactionModel $transaction */ - foreach ($transactions as $transaction) { - // model some fields to fit "transactionAmount()": - $currencyId = $transaction->transaction_currency_id; - - if (!isset($totals[$currencyId])) { - $totals[$currencyId] = [ - 'amount' => '0', - 'symbol' => $transaction->transactionCurrency->symbol, - 'dp' => $transaction->transactionCurrency->decimal_places, - ]; - } - $totals[$currencyId]['amount'] = bcadd($transaction->amount, $totals[$currencyId]['amount']); - - if (!is_null($transaction->foreign_currency_id)) { - $foreignId = $transaction->foreign_currency_id; - if (!isset($totals[$foreignId])) { - $totals[$foreignId] = [ - 'amount' => '0', - 'symbol' => $transaction->foreignCurrency->symbol, - 'dp' => $transaction->foreignCurrency->decimal_places, - ]; - } - $totals[$foreignId]['amount'] = bcadd($transaction->foreign_amount, $totals[$foreignId]['amount']); - } - } - $array = []; - foreach ($totals as $total) { - $currency = new TransactionCurrency; - $currency->symbol = $total['symbol']; - $currency->decimal_places = $total['dp']; - if ($type === TransactionType::WITHDRAWAL) { - $total['amount'] = bcmul($total['amount'], '-1'); - } - $array[] = $this->formatAnything($currency, $total['amount']); - } - - return join(' / ', $array); - - } - - /** - * This formats a transaction, IF that transaction has been "collected" using the JournalCollector. - * - * @param TransactionModel $transaction - * @param bool $coloured - * - * @return string - */ - public function transactionAmount(TransactionModel $transaction, bool $coloured = true): string - { - $amount = bcmul(app('steam')->positive(strval($transaction->transaction_amount)), '-1'); - - $format = '%s'; - - if ($transaction->transaction_type_type === TransactionType::DEPOSIT) { - $amount = bcmul($amount, '-1'); - } - - if ($transaction->transaction_type_type === TransactionType::TRANSFER) { - $amount = app('steam')->positive($amount); - $coloured = false; - $format = '%s'; - } - if ($transaction->transaction_type_type === TransactionType::OPENING_BALANCE) { - $amount = strval($transaction->transaction_amount); - } - - $currency = new TransactionCurrency; - $currency->symbol = $transaction->transaction_currency_symbol; - $currency->decimal_places = $transaction->transaction_currency_dp; - $str = sprintf($format, $this->formatAnything($currency, $amount, $coloured)); - - - if (!is_null($transaction->transaction_foreign_amount)) { - $amount = bcmul(app('steam')->positive(strval($transaction->transaction_foreign_amount)), '-1'); - if ($transaction->transaction_type_type === TransactionType::DEPOSIT) { - $amount = bcmul($amount, '-1'); - } - - - if ($transaction->transaction_type_type === TransactionType::TRANSFER) { - $amount = app('steam')->positive($amount); - $coloured = false; - $format = '%s'; - } - - $currency = new TransactionCurrency; - $currency->symbol = $transaction->foreign_currency_symbol; - $currency->decimal_places = $transaction->foreign_currency_dp; - $str .= ' (' . sprintf($format, $this->formatAnything($currency, $amount, $coloured)) . ')'; - } - - return $str; - } } diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index c6f08cac21..7ca5dbbd3d 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -37,7 +37,7 @@ class CacheProperties { /** @var string */ - protected $md5 = ''; + protected $hash = ''; /** @var Collection */ protected $properties; @@ -66,15 +66,15 @@ class CacheProperties */ public function get() { - return Cache::get($this->md5); + return Cache::get($this->hash); } /** * @return string */ - public function getMd5(): string + public function getHash(): string { - return $this->md5; + return $this->hash; } /** @@ -85,9 +85,9 @@ class CacheProperties if (getenv('APP_ENV') === 'testing') { return false; } - $this->md5(); + $this->hash(); - return Cache::has($this->md5); + return Cache::has($this->hash); } /** @@ -95,18 +95,18 @@ class CacheProperties */ public function store($data) { - Cache::forever($this->md5, $data); + Cache::forever($this->hash, $data); } /** * @return void */ - private function md5() + private function hash() { - $this->md5 = ''; + $content = ''; foreach ($this->properties as $property) { - $this->md5 .= json_encode($property); + $content .= json_encode($property); } - $this->md5 = md5($this->md5); + $this->hash = substr(sha1($content), 0, 16); } } diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 9b5f04986f..9174e837e3 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -346,7 +346,7 @@ class ExpandedForm $options['step'] = 'any'; unset($options['placeholder']); - $html = view('form.number', compact( 'classes', 'name', 'label', 'value', 'options'))->render(); + $html = view('form.number', compact('classes', 'name', 'label', 'value', 'options'))->render(); return $html; } @@ -586,7 +586,7 @@ class ExpandedForm $value = $this->fillFieldValue($name, $value); $options['step'] = 'any'; $defaultCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency(); - $currencies = Amt::getAllCurrencies(); + $currencies = app('amount')->getAllCurrencies(); unset($options['currency']); unset($options['placeholder']); diff --git a/app/Support/SingleCacheProperties.php b/app/Support/SingleCacheProperties.php new file mode 100644 index 0000000000..d1eebe83e0 --- /dev/null +++ b/app/Support/SingleCacheProperties.php @@ -0,0 +1,47 @@ +. + */ + +declare(strict_types=1); + +namespace FireflyIII\Support; + + +use Illuminate\Support\Collection; + +/** + * Class CacheProperties + * + * @package FireflyIII\Support + */ +class SingleCacheProperties extends CacheProperties +{ + /** + * + */ + public function __construct() + { + parent::__construct(); + $this->properties = new Collection; + if (auth()->check()) { + $this->addProperty(auth()->user()->id); + } + } +} diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.php index d87c6bf119..551caf3ee5 100644 --- a/app/Support/Twig/AmountFormat.php +++ b/app/Support/Twig/AmountFormat.php @@ -59,9 +59,6 @@ class AmountFormat extends Twig_Extension return [ $this->formatAmountByAccount(), $this->formatAmountBySymbol(), - $this->transactionAmount(), - $this->journalAmount(), - $this->journalTotalAmount(), $this->formatDestinationAfter(), $this->formatDestinationBefore(), $this->formatSourceAfter(), @@ -274,43 +271,4 @@ class AmountFormat extends Twig_Extension ); } - /** - * @return Twig_SimpleFunction - */ - protected function journalAmount(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'journalAmount', function (TransactionJournal $journal): string { - - return app('amount')->journalAmount($journal, true); - }, ['is_safe' => ['html']] - ); - } - - /** - * @return Twig_SimpleFunction - */ - protected function journalTotalAmount(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'journalTotalAmount', function (TransactionJournal $journal): string { - - return app('amount')->journalTotalAmount($journal, true); - }, ['is_safe' => ['html']] - ); - } - - /** - * @return Twig_SimpleFunction - */ - protected function transactionAmount(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'transactionAmount', function (TransactionModel $transaction): string { - - return app('amount')->transactionAmount($transaction, true); - }, ['is_safe' => ['html']] - ); - } - } diff --git a/app/Support/Twig/Extension/Transaction.php b/app/Support/Twig/Extension/Transaction.php new file mode 100644 index 0000000000..1dc87d68e0 --- /dev/null +++ b/app/Support/Twig/Extension/Transaction.php @@ -0,0 +1,487 @@ +. + */ + +declare(strict_types=1); + +namespace FireflyIII\Support\Twig\Extension; + +use FireflyIII\Models\AccountType; +use FireflyIII\Models\Attachment; +use FireflyIII\Models\Transaction as TransactionModel; +use FireflyIII\Models\TransactionCurrency; +use FireflyIII\Models\TransactionType; +use FireflyIII\Support\SingleCacheProperties; +use Lang; +use Twig_Extension; + +/** + * Class Transaction + * + * @package FireflyIII\Support\Twig\Extension + */ +class Transaction extends Twig_Extension +{ + /** + * Can show the amount of a transaction, if that transaction has been collected by the journal collector. + * + * @param TransactionModel $transaction + * + * @return string + */ + public function amount(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('transaction-amount'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + + $amount = bcmul(app('steam')->positive(strval($transaction->transaction_amount)), '-1'); + $format = '%s'; + $coloured = true; + + if ($transaction->transaction_type_type === TransactionType::DEPOSIT) { + $amount = bcmul($amount, '-1'); + } + + if ($transaction->transaction_type_type === TransactionType::TRANSFER) { + $amount = app('steam')->positive($amount); + $coloured = false; + $format = '%s'; + } + if ($transaction->transaction_type_type === TransactionType::OPENING_BALANCE) { + $amount = strval($transaction->transaction_amount); + } + + $currency = new TransactionCurrency; + $currency->symbol = $transaction->transaction_currency_symbol; + $currency->decimal_places = $transaction->transaction_currency_dp; + $str = sprintf($format, app('amount')->formatAnything($currency, $amount, $coloured)); + + + if (!is_null($transaction->transaction_foreign_amount)) { + $amount = bcmul(app('steam')->positive(strval($transaction->transaction_foreign_amount)), '-1'); + if ($transaction->transaction_type_type === TransactionType::DEPOSIT) { + $amount = bcmul($amount, '-1'); + } + + + if ($transaction->transaction_type_type === TransactionType::TRANSFER) { + $amount = app('steam')->positive($amount); + $coloured = false; + $format = '%s'; + } + + $currency = new TransactionCurrency; + $currency->symbol = $transaction->foreign_currency_symbol; + $currency->decimal_places = $transaction->foreign_currency_dp; + $str .= ' (' . sprintf($format, app('amount')->formatAnything($currency, $amount, $coloured)) . ')'; + } + $cache->store($str); + + return $str; + } + + /** + * @param array $transaction + * + * @return string + */ + public function amountArray(array $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('transaction-array-amount'); + $cache->addProperty($transaction['source_id']); + $cache->addProperty($transaction['destination_id']); + $cache->addProperty($transaction['updated_at']); + if ($cache->has()) { + return $cache->get(); + } + + // first display amount: + $amount = $transaction['journal_type'] === TransactionType::WITHDRAWAL ? $transaction['source_amount'] + : $transaction['destination_amount']; + $fakeCurrency = new TransactionCurrency; + $fakeCurrency->decimal_places = $transaction['transaction_currency_dp']; + $fakeCurrency->symbol = $transaction['transaction_currency_symbol']; + $string = app('amount')->formatAnything($fakeCurrency, $amount, true); + + // then display (if present) the foreign amount: + if(!is_null($transaction['foreign_source_amount'])) { + $amount = $transaction['journal_type'] === TransactionType::WITHDRAWAL ? $transaction['foreign_source_amount'] + : $transaction['foreign_destination_amount']; + $fakeCurrency = new TransactionCurrency; + $fakeCurrency->decimal_places = $transaction['foreign_currency_dp']; + $fakeCurrency->symbol = $transaction['foreign_currency_symbol']; + $string .= ' ('.app('amount')->formatAnything($fakeCurrency, $amount, true).')'; + } + $cache->store($string); + + return $string; + } + + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function budgets(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('transaction-budgets'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + + // journal has a budget: + if (isset($transaction->transaction_journal_budget_id)) { + $name = app('steam')->tryDecrypt($transaction->transaction_journal_budget_name); + $txt = sprintf('%s', route('budgets.show', [$transaction->transaction_journal_budget_id]), $name, $name); + $cache->store($txt); + + return $txt; + } + + // transaction has a budget + if (isset($transaction->transaction_budget_id)) { + $name = app('steam')->tryDecrypt($transaction->transaction_budget_name); + $txt = sprintf('%s', route('budgets.show', [$transaction->transaction_budget_id]), $name, $name); + $cache->store($txt); + + return $txt; + } + + // see if the transaction has a budget: + $budgets = $transaction->budgets()->get(); + if ($budgets->count() === 0) { + $budgets = $transaction->transactionJournal()->first()->budgets()->get(); + } + if ($budgets->count() > 0) { + $str = []; + foreach ($budgets as $budget) { + $str[] = sprintf('%s', route('budgets.show', [$budget->id]), $budget->name, $budget->name); + } + + $txt = join(', ', $str); + $cache->store($txt); + + return $txt; + } + $txt = ''; + $cache->store($txt); + + return $txt; + + } + + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function categories(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('transaction-categories'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + + // journal has a category: + if (isset($transaction->transaction_journal_category_id)) { + $name = app('steam')->tryDecrypt($transaction->transaction_journal_category_name); + $txt = sprintf('%s', route('categories.show', [$transaction->transaction_journal_category_id]), $name, $name); + $cache->store($txt); + + return $txt; + } + + // transaction has a category: + if (isset($transaction->transaction_category_id)) { + $name = app('steam')->tryDecrypt($transaction->transaction_category_name); + $txt = sprintf('%s', route('categories.show', [$transaction->transaction_category_id]), $name, $name); + $cache->store($txt); + + return $txt; + } + + // see if the transaction has a category: + $categories = $transaction->categories()->get(); + if ($categories->count() === 0) { + $categories = $transaction->transactionJournal()->first()->categories()->get(); + } + if ($categories->count() > 0) { + $str = []; + foreach ($categories as $category) { + $str[] = sprintf('%s', route('categories.show', [$category->id]), $category->name, $category->name); + } + + $txt = join(', ', $str); + $cache->store($txt); + + return $txt; + } + + $txt = ''; + $cache->store($txt); + + return $txt; + } + + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function description(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('description'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + $description = $transaction->description; + if (strlen(strval($transaction->transaction_description)) > 0) { + $description = $transaction->transaction_description . '(' . $transaction->description . ')'; + } + + $cache->store($description); + + return $description; + } + + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function destinationAccount(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('transaction-destination'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + + $name = app('steam')->tryDecrypt($transaction->account_name); + $transactionId = intval($transaction->account_id); + $type = $transaction->account_type; + + // name is present in object, use that one: + if (bccomp($transaction->transaction_amount, '0') === -1 && !is_null($transaction->opposing_account_id)) { + $name = $transaction->opposing_account_name; + $transactionId = intval($transaction->opposing_account_id); + $type = $transaction->opposing_account_type; + } + + // Find the opposing account and use that one: + if (bccomp($transaction->transaction_amount, '0') === -1 && is_null($transaction->opposing_account_id)) { + // if the amount is negative, find the opposing account and use that one: + $journalId = $transaction->journal_id; + /** @var TransactionModel $other */ + $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) + ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where( + 'identifier', $transaction->identifier + ) + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') + ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') + ->first(['transactions.account_id', 'accounts.encrypted', 'accounts.name', 'account_types.type']); + $name = app('steam')->tryDecrypt($other->name); + $transactionId = $other->account_id; + $type = $other->type; + } + + if ($type === AccountType::CASH) { + $txt = '(' . trans('firefly.cash') . ')'; + $cache->store($txt); + + return $txt; + } + + $txt = sprintf('%1$s', e($name), route('accounts.show', [$transactionId])); + $cache->store($txt); + + return $txt; + } + + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function hasAttachments(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('attachments'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + $journalId = intval($transaction->journal_id); + $count = Attachment::whereNull('deleted_at') + ->where('attachable_type', 'FireflyIII\Models\TransactionJournal') + ->where('attachable_id', $journalId) + ->count(); + if ($count > 0) { + $res = sprintf('', Lang::choice('firefly.nr_of_attachments', $count, ['count' => $count])); + $cache->store($res); + + return $res; + } + + $res = ''; + $cache->store($res); + + return $res; + } + + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function icon(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('icon'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + + switch ($transaction->transaction_type_type) { + case TransactionType::WITHDRAWAL: + $txt = sprintf('', trans('firefly.withdrawal')); + break; + case TransactionType::DEPOSIT: + $txt = sprintf('', trans('firefly.deposit')); + break; + case TransactionType::TRANSFER: + $txt = sprintf('', trans('firefly.transfer')); + break; + case TransactionType::OPENING_BALANCE: + $txt = sprintf('', trans('firefly.openingBalance')); + break; + default: + $txt = ''; + break; + } + $cache->store($txt); + + return $txt; + } + + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function isSplit(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('split'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + $journalId = intval($transaction->journal_id); + $count = TransactionModel::where('transaction_journal_id', $journalId)->whereNull('deleted_at')->count(); + if ($count > 2) { + $res = ''; + $cache->store($res); + + return $res; + } + + $res = ''; + $cache->store($res); + + return $res; + } + + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function sourceAccount(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('transaction-source'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + + // if the amount is negative, assume that the current account (the one in $transaction) is indeed the source account. + $name = app('steam')->tryDecrypt($transaction->account_name); + $transactionId = intval($transaction->account_id); + $type = $transaction->account_type; + + // name is present in object, use that one: + if (bccomp($transaction->transaction_amount, '0') === 1 && !is_null($transaction->opposing_account_id)) { + $name = $transaction->opposing_account_name; + $transactionId = intval($transaction->opposing_account_id); + $type = $transaction->opposing_account_type; + } + // Find the opposing account and use that one: + if (bccomp($transaction->transaction_amount, '0') === 1 && is_null($transaction->opposing_account_id)) { + $journalId = $transaction->journal_id; + /** @var TransactionModel $other */ + $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) + ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where( + 'identifier', $transaction->identifier + ) + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') + ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') + ->first(['transactions.account_id', 'accounts.encrypted', 'accounts.name', 'account_types.type']); + $name = app('steam')->tryDecrypt(intval($other->encrypted), $other->name); + $transactionId = $other->account_id; + $type = $other->type; + } + + if ($type === AccountType::CASH) { + $txt = '(' . trans('firefly.cash') . ')'; + $cache->store($txt); + + return $txt; + } + + $txt = sprintf('%1$s', e($name), route('accounts.show', [$transactionId])); + $cache->store($txt); + + return $txt; + } +} \ No newline at end of file diff --git a/app/Support/Twig/Extension/TransactionJournal.php b/app/Support/Twig/Extension/TransactionJournal.php new file mode 100644 index 0000000000..c8e748701f --- /dev/null +++ b/app/Support/Twig/Extension/TransactionJournal.php @@ -0,0 +1,92 @@ +. + */ + +declare(strict_types=1); + +namespace FireflyIII\Support\Twig\Extension; + +use FireflyIII\Models\Transaction; +use FireflyIII\Models\TransactionJournal as JournalModel; +use FireflyIII\Models\TransactionType; +use FireflyIII\Support\SingleCacheProperties; +use Twig_Extension; + +class TransactionJournal extends Twig_Extension +{ + + /** + * @param JournalModel $journal + * + * @return string + */ + function totalAmount(JournalModel $journal): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('total-amount'); + $cache->addProperty($journal->id); + $cache->addProperty($journal->updated_at); + if ($cache->has()) { + return $cache->get(); + } + + $transactions = $journal->transactions()->where('amount', '>', 0)->get(); + $totals = []; + $type = $journal->transactionType->type; + /** @var Transaction $transaction */ + foreach ($transactions as $transaction) { + $currencyId = $transaction->transaction_currency_id; + $currency = $transaction->transactionCurrency; + + if (!isset($totals[$currencyId])) { + $totals[$currencyId] = [ + 'amount' => '0', + 'currency' => $currency, + ]; + } + $totals[$currencyId]['amount'] = bcadd($transaction->amount, $totals[$currencyId]['amount']); + + if (!is_null($transaction->foreign_currency_id)) { + $foreignId = $transaction->foreign_currency_id; + $foreign = $transaction->foreignCurrency; + if (!isset($totals[$foreignId])) { + $totals[$foreignId] = [ + 'amount' => '0', + 'currency' => $foreign, + ]; + } + $totals[$foreignId]['amount'] = bcadd($transaction->foreign_amount, $totals[$foreignId]['amount']); + } + } + $array = []; + foreach ($totals as $total) { + if ($type === TransactionType::WITHDRAWAL) { + $total['amount'] = bcmul($total['amount'], '-1'); + } + $array[] = app('amount')->formatAnything($total['currency'], $total['amount']); + } + $txt = join(' / ', $array); + $cache->store($txt); + + return $txt; + + } + +} \ No newline at end of file diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php index df404affd6..f39c307d54 100644 --- a/app/Support/Twig/Journal.php +++ b/app/Support/Twig/Journal.php @@ -32,7 +32,7 @@ use FireflyIII\Support\CacheProperties; use Twig_Extension; use Twig_SimpleFilter; use Twig_SimpleFunction; - +use FireflyIII\Support\Twig\Extension\TransactionJournal as TransactionJournalExtension; /** * Class Journal * @@ -83,6 +83,7 @@ class Journal extends Twig_Extension { $filters = [ $this->typeIcon(), + new Twig_SimpleFilter('journalTotalAmount', [TransactionJournalExtension::class, 'totalAmount'], ['is_safe' => ['html']]), ]; return $filters; diff --git a/app/Support/Twig/Loader/TransactionJournalLoader.php b/app/Support/Twig/Loader/TransactionJournalLoader.php new file mode 100644 index 0000000000..c1e6f06e85 --- /dev/null +++ b/app/Support/Twig/Loader/TransactionJournalLoader.php @@ -0,0 +1,57 @@ +. + */ + +declare(strict_types=1); + +namespace FireflyIII\Support\Twig\Loader; + + +use FireflyIII\Support\Twig\Extension\TransactionJournal; +use Twig_RuntimeLoaderInterface; + +/** + * Class TransactionJournalLoader + * + * @package FireflyIII\Support\Twig\Extension + */ +class TransactionJournalLoader implements Twig_RuntimeLoaderInterface +{ + + /** + * Creates the runtime implementation of a Twig element (filter/function/test). + * + * @param string $class A runtime class + * + * @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class + */ + public function load($class) + { + // implement the logic to create an instance of $class + // and inject its dependencies + // most of the time, it means using your dependency injection container + + if (TransactionJournal::class === $class) { + return app(TransactionJournal::class); + } + + return null; + } +} \ No newline at end of file diff --git a/app/Support/Twig/Loader/TransactionLoader.php b/app/Support/Twig/Loader/TransactionLoader.php new file mode 100644 index 0000000000..67f00dfb9e --- /dev/null +++ b/app/Support/Twig/Loader/TransactionLoader.php @@ -0,0 +1,57 @@ +. + */ + +declare(strict_types=1); + +namespace FireflyIII\Support\Twig\Loader; + + +use FireflyIII\Support\Twig\Extension\Transaction; +use Twig_RuntimeLoaderInterface; + +/** + * Class TransactionLoader + * + * @package FireflyIII\Support\Twig\Extension + */ +class TransactionLoader implements Twig_RuntimeLoaderInterface +{ + + /** + * Creates the runtime implementation of a Twig element (filter/function/test). + * + * @param string $class A runtime class + * + * @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class + */ + public function load($class) + { + // implement the logic to create an instance of $class + // and inject its dependencies + // most of the time, it means using your dependency injection container + + if (Transaction::class === $class) { + return app(Transaction::class); + } + + return null; + } +} \ No newline at end of file diff --git a/app/Support/Twig/Transaction.php b/app/Support/Twig/Transaction.php index 9c5bb8406e..7fe539adbf 100644 --- a/app/Support/Twig/Transaction.php +++ b/app/Support/Twig/Transaction.php @@ -23,12 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Support\Twig; -use FireflyIII\Models\AccountType; -use FireflyIII\Models\Attachment; use FireflyIII\Models\Transaction as TransactionModel; -use FireflyIII\Models\TransactionType; -use FireflyIII\Support\CacheProperties; -use Lang; +use FireflyIII\Support\Twig\Extension\Transaction as TransactionExtension; use Steam; use Twig_Extension; use Twig_SimpleFilter; @@ -41,48 +37,22 @@ use Twig_SimpleFunction; */ class Transaction extends Twig_Extension { - /** - * @return Twig_SimpleFunction - */ - public function attachmentIndicator(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'attachmentIndicator', function (int $journalId) { - - $cache = new CacheProperties; - $cache->addProperty('attachments_journal'); - $cache->addProperty($journalId); - if ($cache->has()) { - return $cache->get(); - } - $count = Attachment::whereNull('deleted_at') - ->where('attachable_type', 'FireflyIII\Models\TransactionJournal') - ->where('attachable_id', $journalId) - ->count(); - if ($count > 0) { - $res = sprintf('', Lang::choice('firefly.nr_of_attachments', $count, ['count' => $count])); - $cache->store($res); - - return $res; - } - - $res = ''; - $cache->store($res); - - return $res; - - - }, ['is_safe' => ['html']] - ); - } - /** * @return array */ public function getFilters(): array { $filters = [ - $this->typeIconTransaction(), + new Twig_SimpleFilter('transactionIcon', [TransactionExtension::class, 'icon'], ['is_safe' => ['html']]), + new Twig_SimpleFilter('transactionDescription', [TransactionExtension::class, 'description']), + new Twig_SimpleFilter('transactionIsSplit', [TransactionExtension::class, 'isSplit'], ['is_safe' => ['html']]), + new Twig_SimpleFilter('transactionHasAtt', [TransactionExtension::class, 'hasAttachments'], ['is_safe' => ['html']]), + new Twig_SimpleFilter('transactionAmount', [TransactionExtension::class, 'amount'], ['is_safe' => ['html']]), + new Twig_SimpleFilter('transactionArrayAmount', [TransactionExtension::class, 'amountArray'], ['is_safe' => ['html']]), + new Twig_SimpleFilter('transactionBudgets', [TransactionExtension::class, 'budgets'], ['is_safe' => ['html']]), + new Twig_SimpleFilter('transactionCategories', [TransactionExtension::class, 'categories'], ['is_safe' => ['html']]), + new Twig_SimpleFilter('transactionSourceAccount', [TransactionExtension::class, 'sourceAccount'], ['is_safe' => ['html']]), + new Twig_SimpleFilter('transactionDestinationAccount', [TransactionExtension::class, 'destinationAccount'], ['is_safe' => ['html']]), ]; return $filters; @@ -94,14 +64,8 @@ class Transaction extends Twig_Extension public function getFunctions(): array { $functions = [ - $this->transactionSourceAccount(), - $this->transactionDestinationAccount(), - $this->transactionBudgets(), $this->transactionIdBudgets(), - $this->transactionCategories(), $this->transactionIdCategories(), - $this->splitJournalIndicator(), - $this->attachmentIndicator(), ]; return $functions; @@ -117,107 +81,6 @@ class Transaction extends Twig_Extension return 'transaction'; } - /** - * @return Twig_SimpleFunction - */ - public function splitJournalIndicator(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'splitJournalIndicator', function (int $journalId) { - - $cache = new CacheProperties; - $cache->addProperty('is_split_journal'); - $cache->addProperty($journalId); - if ($cache->has()) { - return $cache->get(); - } - $count = TransactionModel::where('transaction_journal_id', $journalId)->whereNull('deleted_at')->count(); - if ($count > 2) { - $res = ''; - $cache->store($res); - - return $res; - } - - $res = ''; - $cache->store($res); - - return $res; - - - }, ['is_safe' => ['html']] - ); - } - - /** - * @return Twig_SimpleFunction - */ - public function transactionBudgets(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'transactionBudgets', function (TransactionModel $transaction): string { - return $this->getTransactionBudgets($transaction); - }, ['is_safe' => ['html']] - ); - } - - /** - * @return Twig_SimpleFunction - */ - public function transactionCategories(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'transactionCategories', function (TransactionModel $transaction): string { - return $this->getTransactionCategories($transaction); - }, ['is_safe' => ['html']] - ); - } - - /** - * @return Twig_SimpleFunction - */ - public function transactionDestinationAccount(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'transactionDestinationAccount', function (TransactionModel $transaction): string { - - $name = Steam::decrypt(intval($transaction->account_encrypted), $transaction->account_name); - $transactionId = intval($transaction->account_id); - $type = $transaction->account_type; - - // name is present in object, use that one: - if (bccomp($transaction->transaction_amount, '0') === -1 && !is_null($transaction->opposing_account_id)) { - $name = $transaction->opposing_account_name; - $transactionId = intval($transaction->opposing_account_id); - $type = $transaction->opposing_account_type; - } - - // Find the opposing account and use that one: - if (bccomp($transaction->transaction_amount, '0') === -1 && is_null($transaction->opposing_account_id)) { - // if the amount is negative, find the opposing account and use that one: - $journalId = $transaction->journal_id; - /** @var TransactionModel $other */ - $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) - ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where( - 'identifier', $transaction->identifier - ) - ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') - ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') - ->first(['transactions.account_id', 'accounts.encrypted', 'accounts.name', 'account_types.type']); - $name = Steam::decrypt(intval($other->encrypted), $other->name); - $transactionId = $other->account_id; - $type = $other->type; - } - - if ($type === AccountType::CASH) { - return '(cash)'; - } - - return sprintf('%1$s', e($name), route('accounts.show', [$transactionId])); - - }, ['is_safe' => ['html']] - ); - } /** * @return Twig_SimpleFunction @@ -247,84 +110,6 @@ class Transaction extends Twig_Extension ); } - /** - * @return Twig_SimpleFunction - */ - public function transactionSourceAccount(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'transactionSourceAccount', function (TransactionModel $transaction): string { - - // if the amount is negative, assume that the current account (the one in $transaction) is indeed the source account. - $name = Steam::decrypt(intval($transaction->account_encrypted), $transaction->account_name); - $transactionId = intval($transaction->account_id); - $type = $transaction->account_type; - - // name is present in object, use that one: - if (bccomp($transaction->transaction_amount, '0') === 1 && !is_null($transaction->opposing_account_id)) { - $name = $transaction->opposing_account_name; - $transactionId = intval($transaction->opposing_account_id); - $type = $transaction->opposing_account_type; - } - // Find the opposing account and use that one: - if (bccomp($transaction->transaction_amount, '0') === 1 && is_null($transaction->opposing_account_id)) { - $journalId = $transaction->journal_id; - /** @var TransactionModel $other */ - $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) - ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where( - 'identifier', $transaction->identifier - ) - ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') - ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') - ->first(['transactions.account_id', 'accounts.encrypted', 'accounts.name', 'account_types.type']); - $name = Steam::decrypt(intval($other->encrypted), $other->name); - $transactionId = $other->account_id; - $type = $other->type; - } - - if ($type === AccountType::CASH) { - return '(cash)'; - } - - return sprintf('%1$s', e($name), route('accounts.show', [$transactionId])); - - }, ['is_safe' => ['html']] - ); - } - - /** - * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's 5. - * - * @return Twig_SimpleFilter - */ - public function typeIconTransaction(): Twig_SimpleFilter - { - return new Twig_SimpleFilter( - 'typeIconTransaction', function (TransactionModel $transaction): string { - - switch ($transaction->transaction_type_type) { - case TransactionType::WITHDRAWAL: - $txt = sprintf('', trans('firefly.withdrawal')); - break; - case TransactionType::DEPOSIT: - $txt = sprintf('', trans('firefly.deposit')); - break; - case TransactionType::TRANSFER: - $txt = sprintf('', trans('firefly.transfer')); - break; - case TransactionType::OPENING_BALANCE: - $txt = sprintf('', trans('firefly.openingBalance')); - break; - default: - $txt = ''; - break; - } - - return $txt; - }, ['is_safe' => ['html']] - ); - } - /** * @param TransactionModel $transaction * diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 0b277062a0..d2b50eeb36 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', diff --git a/resources/views/admin/link/show.twig b/resources/views/admin/link/show.twig index bf71cb1f5a..9515d56588 100644 --- a/resources/views/admin/link/show.twig +++ b/resources/views/admin/link/show.twig @@ -34,13 +34,14 @@
{{ link.source.description }} {{ journalAmount(link.source) }}{{ link.source|journalTotalAmount }} {{ linkType.outward }} {{ link.destination.description }} - {{ journalAmount(link.destination) }} + {{ link.destination|journalTotalAmount }} +
- - - {% if transaction.transaction_description|length > 0 %} - {{ transaction.transaction_description }} ({{ transaction.description }}) - {% else %} - {{ transaction.description }} - {% endif %} - - {# is a split journal #} - {{ splitJournalIndicator(transaction.journal_id) }} - - {# count attachments #} - {{ attachmentIndicator(transaction.journal_id) }} - - - {{ transactionAmount(transaction) }} - - -
diff --git a/resources/views/partials/transaction-row.twig b/resources/views/partials/transaction-row.twig new file mode 100644 index 0000000000..0d0b4d44b5 --- /dev/null +++ b/resources/views/partials/transaction-row.twig @@ -0,0 +1,65 @@ + + + {# input buttons #} + + +
{% if sorting %}{% endif %}
+ + + {# icon #} + + {{ transaction|transactionIcon }} + + + {# description #} + + + {{ transaction|transactionDescription }} + + {# is a split journal #} + {{ transaction|transactionIsSplit }} + {# count attachments #} + {{ transaction|transactionHasAtt }} + + {{ transaction|transactionAmount }} + + {{ transaction.date.formatLocalized(monthAndDayFormat) }} + + + {# all source accounts #} + {{ transaction|transactionSourceAccount }} + + + {# all destination accounts #} + {{ transaction|transactionDestinationAccount }} + + + {# Do NOT hide the budget? #} + {% if not hideBudgets %} + + {{ transaction|transactionBudgets }} + + {% endif %} + + {# Do NOT hide the category? #} + {% if not hideCategories %} + + {{ transaction|transactionCategories }} + + {% endif %} + + {# Do NOT hide the bill? #} + {% if not hideBills %} + + {% if transaction.bill_id %} + {{ transaction.bill_name }} + {% endif %} + + {% endif %} + \ No newline at end of file diff --git a/resources/views/popup/list/journals.twig b/resources/views/popup/list/journals.twig index 1829dfe1c5..3c2e74077a 100644 --- a/resources/views/popup/list/journals.twig +++ b/resources/views/popup/list/journals.twig @@ -11,68 +11,61 @@ {% if not hideDestination %} {{ trans('list.to') }} {% endif %} - + {# Hide budgets? #} {% if not hideBudget %} {% endif %} - + {# Hide categories? #} {% if not hideCategory %} {% endif %} - {% for transaction in journals %} - {{ transaction|typeIconTransaction }} + {{ transaction|transactionIcon }} - {% if transaction.transaction_description|length > 0 %} - {{ transaction.transaction_description }} ({{ transaction.description }}) - {% else %} - {{ transaction.description }} - {% endif %} + {{ transaction|transactionDescription }} - {# TODO replace with new format code #} - {{ transactionAmount(transaction) }} + {{ transaction|transactionAmount }} {{ transaction.date.formatLocalized(monthAndDayFormat) }} {% if not hideSource %} - {{ transactionSourceAccount(transaction) }} + {{ transaction|transactionSourceAccount }} {% endif %} {% if not hideDestination %} - {{ transactionDestinationAccount(transaction) }} + {{ transaction|transactionDestinationAccount }} {% endif %} - + {# Do NOT hide the budget? #} {% if not hideBudget %} - {{ transactionBudgets(transaction) }} + {{ transaction|transactionBudgets }} {% endif %} - + {# Do NOT hide the category? #} {% if not hideCategory %} - {{ transactionCategories(transaction) }} + {{ transaction|transactionCategories }} {% endif %} diff --git a/resources/views/reports/partials/journals-audit.twig b/resources/views/reports/partials/journals-audit.twig index b17b1b97af..a63c8e863d 100644 --- a/resources/views/reports/partials/journals-audit.twig +++ b/resources/views/reports/partials/journals-audit.twig @@ -46,7 +46,7 @@
- {{ transaction|typeIconTransaction }} + {{ transaction|transactionIcon }} @@ -59,7 +59,7 @@ {{ formatAmountByCurrency(transaction.currency, transaction.before) }} - {{ transactionAmount(transaction) }} + {{ transaction|transactionAmount }} {{ formatAmountByCurrency(transaction.currency, transaction.after) }} @@ -104,17 +104,17 @@ - {{ transactionSourceAccount(transaction) }} + {{ transaction|transactionSourceAccount }} - {{ transactionDestinationAccount(transaction) }} + {{ transaction|transactionDestinationAccount }} - {{ transactionBudgets(transaction) }} + {{ transaction|transactionBudgets }} - {{ transactionCategories(transaction) }} + {{ transaction|transactionCategories }} {% if transaction.bill_id %} diff --git a/resources/views/search/search.twig b/resources/views/search/search.twig index 84a038e094..bfda384977 100644 --- a/resources/views/search/search.twig +++ b/resources/views/search/search.twig @@ -28,7 +28,7 @@ class="fa fa-fw fa-trash-o">
- {{ transaction|typeIconTransaction }} + {{ transaction|transactionIcon }} @@ -39,7 +39,7 @@ {{ transaction.description }} {% endif %} - {{ splitJournalIndicator(transaction.journal_id) }} + {{ transaction|transactionIsSplit }} {% if transaction.transactionJournal.attachments|length > 0 %} - {{ transactionAmount(transaction) }} + {{ transaction|transactionAmount }} {{ transaction.date.formatLocalized(monthAndDayFormat) }} - {{ transactionSourceAccount(transaction) }} + {{ transaction|transactionSourceAccount }} - {{ transactionDestinationAccount(transaction) }} + {{ transaction|transactionDestinationAccount }} - {{ transactionBudgets(transaction) }} + {{ transaction|transactionBudgets }} - {{ transactionCategories(transaction) }} + {{ transaction|transactionCategories }} {% if transaction.bill_id %} diff --git a/resources/views/transactions/mass-delete.twig b/resources/views/transactions/mass-delete.twig index 864ea084ae..51e2ee3835 100644 --- a/resources/views/transactions/mass-delete.twig +++ b/resources/views/transactions/mass-delete.twig @@ -43,7 +43,8 @@ {{ journal.description }} - {{ journalAmount(journal) }} + {{ journal|journalTotalAmount }} + {{ journal.date.formatLocalized(monthAndDayFormat) }} diff --git a/resources/views/transactions/show.twig b/resources/views/transactions/show.twig index 0406e0bdbd..bf2449906c 100644 --- a/resources/views/transactions/show.twig +++ b/resources/views/transactions/show.twig @@ -88,11 +88,13 @@ {{ 'total_amount'|_ }} - {{ journalAmount(journal) }} + {{ journal|journalTotalAmount }} + {# if more transactions, list each one: #} {% if transactions|length > 1 %} - ({{ journalTotalAmount(journal) }}) + ({% for transaction in transactions %}{{ transaction|transactionArrayAmount }}{% if loop.index != loop.length %}, {% endif %}{% endfor %}) {% endif %} + @@ -336,12 +338,12 @@ #{{ link.destination.id }}: {{ link.destination.description }} - ({{ journalAmount(link.destination) }}) + ({{ link.destination|journalTotalAmount }}) {% else %} {{ journalLinkTranslation('inward', link.linkType.inward) }} #{{ link.source.id }}: {{ link.source.description }} - ({{ journalAmount(link.source) }}) + ({{ link.source|journalTotalAmount }}) {% endif %} {% if link.comment != "" %}
{{ link.comment }} From a71e9e578db69509a1e4fd93479c5f3ebeb54132 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:13 +0100 Subject: [PATCH 071/258] New translations firefly.php (Russian) --- resources/lang/ru_RU/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index 235708e7c7..3e9ca8535d 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', From 71eeffdbf49eccb1f9fc5e19158a40ff306ff93f Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:24 +0100 Subject: [PATCH 072/258] New translations firefly.php (Indonesian) --- resources/lang/id_ID/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index 0b277062a0..d2b50eeb36 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', From e75ada49b7e1fae4bce7f7f5b673577de96fdc2b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:33 +0100 Subject: [PATCH 073/258] New translations firefly.php (Dutch) --- resources/lang/nl_NL/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index e40bf6b39b..2ce65eb2ab 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Debiteuren', 'cash_accounts' => 'Contant geldrekeningen', 'Cash account' => 'Contant geldrekening', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Rekeningtype', 'save_transactions_by_moving' => 'Bewaar deze transacties door ze aan een andere rekening te koppelen:', 'stored_new_account' => 'Nieuwe rekening ":name" opgeslagen!', From 31b5899fb026e6537e32ddf818df9e595c30b7b6 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:38 +0100 Subject: [PATCH 074/258] New translations firefly.php (French) --- resources/lang/fr_FR/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index cd2942a629..b737991a50 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -618,7 +618,7 @@ return [ 'revenue_accounts' => 'Comptes de recettes', 'cash_accounts' => 'Comptes de trésorerie', 'Cash account' => 'Compte de trésorerie', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Type de compte', 'save_transactions_by_moving' => 'Enregistrer ces opération(s) en les déplaçant vers un autre compte :', 'stored_new_account' => 'Nouveau compte ":name" créé !', From 3d318abf1bf0cd8dc2672913c610d8191780b852 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:43 +0100 Subject: [PATCH 075/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index a798404c4f..1fc2af7f8f 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -618,7 +618,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'revenue_accounts' => 'Schuldner', 'cash_accounts' => 'Bargeldkonten', 'Cash account' => 'Bargeldkonto', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Kontotyp', 'save_transactions_by_moving' => 'Speichern Sie diese Transaktion(en), indem Sie sie auf ein anderes Konto verschieben:', 'stored_new_account' => 'Neues Konto ":name" gespeichert!', From bc19919bed369be5407c7137c9c143f571e473bb Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:48 +0100 Subject: [PATCH 076/258] New translations firefly.php (Spanish) --- resources/lang/es_ES/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index 009f1c5c13..37aa3bb4e6 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Cuentas de ingresos', 'cash_accounts' => 'Cuentas de efectivo', 'Cash account' => 'Cash account', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', From 3320b69cd828d9b6fed81a6241540650698b5ea1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:51 +0100 Subject: [PATCH 077/258] New translations firefly.php (Slovenian) --- resources/lang/sl_SI/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index 0981cee1f1..65bf10da17 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', 'stored_new_account' => 'New account ":name" stored!', From 5a8f8d24480e39ec5801d35dd5f0edf2093536f8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:53 +0100 Subject: [PATCH 078/258] New translations firefly.php (Portuguese, Brazilian) --- resources/lang/pt_BR/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 2a48a12ee8..3f35dd27a8 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Contas de receitas', 'cash_accounts' => 'Contas Correntes', 'Cash account' => 'Conta Corrente', - 'cash' => 'cash', + 'cash' => 'cash', 'account_type' => 'Tipo de conta', 'save_transactions_by_moving' => 'Salve essas transações, movendo-os para outra conta:', 'stored_new_account' => 'Nova conta ":name" armazenado!', From a3bd4ccfbf7cf12a254fc9fddcc18554b117c87e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 4 Nov 2017 07:20:56 +0100 Subject: [PATCH 079/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index 768cff497f..7052d11eb4 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -617,7 +617,7 @@ return [ 'revenue_accounts' => 'Konta przychodów', 'cash_accounts' => 'Konta gotówkowe', 'Cash account' => 'Konto gotówkowe', - 'cash' => 'gotówka', + 'cash' => 'gotówka', 'account_type' => 'Typ konta', 'save_transactions_by_moving' => 'Zapisz te transakcje, przenosząc je do innego konta:', 'stored_new_account' => 'Nowe konto ":name" zostało zapisane!', From 33d89d52c2fefddebc0f4c9d2830d2105c033358 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 5 Nov 2017 19:48:43 +0100 Subject: [PATCH 080/258] Code that allows transaction reconciliation. #736 --- app/Helpers/Collector/JournalCollector.php | 6 +- .../Json/TransactionController.php | 93 +++++++++++++++++++ .../Controllers/TransactionController.php | 18 +++- app/Models/Transaction.php | 1 + .../Journal/JournalRepository.php | 63 ++++++++++++- .../Journal/JournalRepositoryInterface.php | 22 +++++ app/Repositories/Journal/JournalTasker.php | 10 ++ app/Support/Twig/Extension/Transaction.php | 29 +++++- .../2017_11_04_170844_changes_for_v470a.php | 33 +++++++ public/js/ff/transactions/list.js | 90 +++++++++++++++++- resources/lang/en_US/firefly.php | 3 +- resources/views/list/journals.twig | 15 +-- resources/views/partials/transaction-row.twig | 12 ++- resources/views/search/index.twig | 6 +- resources/views/transactions/show.twig | 17 +--- routes/web.php | 4 + 16 files changed, 387 insertions(+), 35 deletions(-) create mode 100644 app/Http/Controllers/Json/TransactionController.php create mode 100644 database/migrations/2017_11_04_170844_changes_for_v470a.php diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php index fb71210ad1..218c69a5d5 100644 --- a/app/Helpers/Collector/JournalCollector.php +++ b/app/Helpers/Collector/JournalCollector.php @@ -80,6 +80,7 @@ class JournalCollector implements JournalCollectorInterface 'transactions.id as id', 'transactions.description as transaction_description', 'transactions.account_id', + 'transactions.reconciled', 'transactions.identifier', 'transactions.transaction_journal_id', 'transactions.amount as transaction_amount', @@ -171,7 +172,7 @@ class JournalCollector implements JournalCollectorInterface $q1->where( function (EloquentBuilder $q2) use ($amount) { // amount < 0 and .amount > -$amount - $amount = bcmul($amount,'-1'); + $amount = bcmul($amount, '-1'); $q2->where('transactions.amount', '<', 0)->where('transactions.amount', '>', $amount); } ) @@ -199,7 +200,7 @@ class JournalCollector implements JournalCollectorInterface $q1->where( function (EloquentBuilder $q2) use ($amount) { // amount < 0 and .amount < -$amount - $amount = bcmul($amount,'-1'); + $amount = bcmul($amount, '-1'); $q2->where('transactions.amount', '<', 0)->where('transactions.amount', '<', $amount); } ) @@ -211,6 +212,7 @@ class JournalCollector implements JournalCollectorInterface ); } ); + return $this; } diff --git a/app/Http/Controllers/Json/TransactionController.php b/app/Http/Controllers/Json/TransactionController.php new file mode 100644 index 0000000000..707c2a20ef --- /dev/null +++ b/app/Http/Controllers/Json/TransactionController.php @@ -0,0 +1,93 @@ +. + */ + +declare(strict_types=1); + +namespace FireflyIII\Http\Controllers\Json; + + +use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\TransactionType; +use FireflyIII\Repositories\Journal\JournalRepositoryInterface; +use FireflyIII\Support\SingleCacheProperties; +use Illuminate\Http\Request; +use Response; + +class TransactionController extends Controller +{ + public function amounts(Request $request, JournalRepositoryInterface $repository) + { + $ids = $request->get('transactions'); + + $cache = new SingleCacheProperties; + $cache->addProperty('json-reconcile-amounts'); + $cache->addProperty($ids); + if ($cache->has()) { + return Response::json($cache->get()); + } + + $totals = []; + // for each transaction, get amount(s) + foreach ($ids as $transactionId) { + $transaction = $repository->findTransaction(intval($transactionId)); + $transactionType = $transaction->transactionJournal->transactionType->type; + + // default amount: + $currencyId = $transaction->transaction_currency_id; + if (!isset($totals[$currencyId])) { + $totals[$currencyId] = [ + 'amount' => '0', + 'currency' => $transaction->transactionCurrency, + 'type' => $transactionType, + ]; + } + // add default amount: + $totals[$currencyId]['amount'] = bcadd($totals[$currencyId]['amount'], app('steam')->positive($transaction->amount)); + + // foreign amount: + if (!is_null($transaction->foreign_amount)) { + $currencyId = $transaction->foreign_currency_id; + if (!isset($totals[$currencyId])) { + $totals[$currencyId] = [ + 'amount' => '0', + 'currency' => $transaction->foreignCurrency, + 'type' => $transactionType, + ]; + } + // add foreign amount: + $totals[$currencyId]['amount'] = bcadd($totals[$currencyId]['amount'], app('steam')->positive($transaction->foreign_amount)); + } + } + $entries = []; + foreach ($totals as $entry) { + $amount = $entry['amount']; + if ($entry['type'] === TransactionType::WITHDRAWAL) { + $amount = bcmul($entry['amount'], '-1'); + } + $entries[] = app('amount')->formatAnything($entry['currency'], $amount, false); + } + $result = ['amounts' => join(' / ', $entries)]; + $cache->store($result); + + return Response::json($result); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 9343a6324e..7b9393909e 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -133,6 +133,22 @@ class TransactionController extends Controller } + /** + * @param Request $request + */ + public function reconcile(Request $request, JournalRepositoryInterface $repository) + { + $transactionIds = $request->get('transactions'); + foreach ($transactionIds as $transactionId) { + $transactionId = intval($transactionId); + $transaction = $repository->findTransaction($transactionId); + Log::debug(sprintf('Transaction ID is %d', $transaction->id)); + + $repository->reconcile($transaction); + } + + } + /** * @param Request $request * @param JournalRepositoryInterface $repository @@ -181,8 +197,6 @@ class TransactionController extends Controller $subTitle = trans('firefly.' . $what) . ' "' . $journal->description . '"'; return view('transactions.show', compact('journal', 'events', 'subTitle', 'what', 'transactions', 'linkTypes', 'links')); - - } /** diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 217f3484fa..504782567b 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -93,6 +93,7 @@ class Transaction extends Model 'identifier' => 'int', 'encrypted' => 'boolean', // model does not have these fields though 'bill_name_encrypted' => 'boolean', + 'reconciled' => 'boolean', ]; protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount', 'identifier', 'transaction_currency_id', 'foreign_currency_id', diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index f2688a5b68..6738da804e 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Journal; use FireflyIII\Models\Account; +use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\User; @@ -123,6 +124,38 @@ class JournalRepository implements JournalRepositoryInterface return $journal; } + /** + * @param Transaction $transaction + * + * @return Transaction|null + */ + public function findOpposingTransaction(Transaction $transaction): ?Transaction + { + $opposing = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->where('transaction_journals.user_id', $this->user->id) + ->where('transactions.transaction_journal_id', $transaction->transaction_journal_id) + ->where('transactions.identifier', $transaction->identifier) + ->where('amount', bcmul($transaction->amount, '-1')) + ->first(['transactions.*']); + + return $opposing; + } + + /** + * @param int $transactionid + * + * @return Transaction|null + */ + public function findTransaction(int $transactionid): ?Transaction + { + $transaction = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->where('transaction_journals.user_id', $this->user->id) + ->where('transactions.id', $transactionid) + ->first(['transactions.*']); + + return $transaction; + } + /** * Get users first transaction journal * @@ -158,6 +191,32 @@ class JournalRepository implements JournalRepositoryInterface return $journal->transactionType->type === TransactionType::TRANSFER; } + /** + * @param Transaction $transaction + * + * @return bool + */ + public function reconcile(Transaction $transaction): bool + { + Log::debug(sprintf('Going to reconcile transaction #%d', $transaction->id)); + $opposing = $this->findOpposingTransaction($transaction); + + if (is_null($opposing)) { + Log::debug('Opposing transaction is NULL. Cannot reconcile.'); + + return false; + } + Log::debug(sprintf('Opposing transaction ID is #%d', $opposing->id)); + + $transaction->reconciled = true; + $opposing->reconciled = true; + $transaction->save(); + $opposing->save(); + + return true; + + } + /** * @param TransactionJournal $journal * @param int $order @@ -303,7 +362,7 @@ class JournalRepository implements JournalRepositoryInterface } // update note: - if (isset($data['notes']) && !is_null($data['notes']) ) { + if (isset($data['notes']) && !is_null($data['notes'])) { $this->updateNote($journal, strval($data['notes'])); } @@ -345,7 +404,7 @@ class JournalRepository implements JournalRepositoryInterface $journal->budgets()->detach(); // update note: - if (isset($data['notes']) && !is_null($data['notes']) ) { + if (isset($data['notes']) && !is_null($data['notes'])) { $this->updateNote($journal, strval($data['notes'])); } diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index 41d2b3aed2..1979b0dbce 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Journal; use FireflyIII\Models\Account; +use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\User; @@ -73,6 +74,20 @@ interface JournalRepositoryInterface */ public function find(int $journalId): TransactionJournal; + /** + * @param Transaction $transaction + * + * @return Transaction|null + */ + public function findOpposingTransaction(Transaction $transaction): ?Transaction; + + /** + * @param int $transactionid + * + * @return Transaction|null + */ + public function findTransaction(int $transactionid): ?Transaction; + /** * Get users very first transaction journal * @@ -92,6 +107,13 @@ interface JournalRepositoryInterface */ public function isTransfer(TransactionJournal $journal): bool; + /** + * @param Transaction $transaction + * + * @return bool + */ + public function reconcile(Transaction $transaction): bool; + /** * @param TransactionJournal $journal * @param int $order diff --git a/app/Repositories/Journal/JournalTasker.php b/app/Repositories/Journal/JournalTasker.php index 469deb95b2..8c4f2b2043 100644 --- a/app/Repositories/Journal/JournalTasker.php +++ b/app/Repositories/Journal/JournalTasker.php @@ -28,6 +28,7 @@ use FireflyIII\Models\AccountType; use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; +use FireflyIII\Support\SingleCacheProperties; use FireflyIII\User; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Query\JoinClause; @@ -74,6 +75,13 @@ class JournalTasker implements JournalTaskerInterface */ public function getTransactionsOverview(TransactionJournal $journal): array { + $cache = new SingleCacheProperties; + $cache->addProperty('transaction-overview'); + $cache->addProperty($journal->id); + $cache->addProperty($journal->updated_at); + if ($cache->has()) { + return $cache->get(); + } // get all transaction data + the opposite site in one list. $set = $journal ->transactions()// "source" @@ -136,6 +144,7 @@ class JournalTasker implements JournalTaskerInterface 'journal_type' => $transactionType, 'updated_at' => $journal->updated_at, 'source_id' => $entry->id, + 'source' => $journal->transactions()->find($entry->id), 'source_amount' => $entry->amount, 'foreign_source_amount' => $entry->foreign_amount, 'description' => $entry->description, @@ -174,6 +183,7 @@ class JournalTasker implements JournalTaskerInterface $transactions[] = $transaction; } + $cache->store($transactions); return $transactions; } diff --git a/app/Support/Twig/Extension/Transaction.php b/app/Support/Twig/Extension/Transaction.php index 1dc87d68e0..4efb1fb73b 100644 --- a/app/Support/Twig/Extension/Transaction.php +++ b/app/Support/Twig/Extension/Transaction.php @@ -39,6 +39,7 @@ use Twig_Extension; */ class Transaction extends Twig_Extension { + /** * Can show the amount of a transaction, if that transaction has been collected by the journal collector. * @@ -127,13 +128,13 @@ class Transaction extends Twig_Extension $string = app('amount')->formatAnything($fakeCurrency, $amount, true); // then display (if present) the foreign amount: - if(!is_null($transaction['foreign_source_amount'])) { + if (!is_null($transaction['foreign_source_amount'])) { $amount = $transaction['journal_type'] === TransactionType::WITHDRAWAL ? $transaction['foreign_source_amount'] : $transaction['foreign_destination_amount']; $fakeCurrency = new TransactionCurrency; $fakeCurrency->decimal_places = $transaction['foreign_currency_dp']; $fakeCurrency->symbol = $transaction['foreign_currency_symbol']; - $string .= ' ('.app('amount')->formatAnything($fakeCurrency, $amount, true).')'; + $string .= ' (' . app('amount')->formatAnything($fakeCurrency, $amount, true) . ')'; } $cache->store($string); @@ -401,6 +402,30 @@ class Transaction extends Twig_Extension return $txt; } + /** + * @param TransactionModel $transaction + * + * @return string + */ + public function isReconciled(TransactionModel $transaction): string + { + $cache = new SingleCacheProperties; + $cache->addProperty('transaction-reconciled'); + $cache->addProperty($transaction->id); + $cache->addProperty($transaction->updated_at); + if ($cache->has()) { + return $cache->get(); + } + $icon = ''; + if (intval($transaction->reconciled) === 1) { + $icon = ''; + } + + $cache->store($icon); + + return $icon; + } + /** * @param TransactionModel $transaction * diff --git a/database/migrations/2017_11_04_170844_changes_for_v470a.php b/database/migrations/2017_11_04_170844_changes_for_v470a.php new file mode 100644 index 0000000000..af94df3f41 --- /dev/null +++ b/database/migrations/2017_11_04_170844_changes_for_v470a.php @@ -0,0 +1,33 @@ +boolean('reconciled')->after('deleted_at')->default(0); + } + ); + } +} diff --git a/public/js/ff/transactions/list.js b/public/js/ff/transactions/list.js index 58729480ef..a537436c8e 100644 --- a/public/js/ff/transactions/list.js +++ b/public/js/ff/transactions/list.js @@ -20,6 +20,9 @@ /** global: edit_selected_txt, delete_selected_txt */ +/** + * + */ $(document).ready(function () { "use strict"; $('.mass_edit_all').show(); @@ -44,8 +47,43 @@ $(document).ready(function () { $('.mass_edit').click(goToMassEdit); // click the delete button: $('.mass_delete').click(goToMassDelete); + // click reconcile button + $('.mass_reconcile').click(goToReconcile); }); +/** + * + * @returns {boolean} + */ +function goToReconcile() { + + var checked = $('.select_all_single:checked'); + var ids = []; + $.each(checked, function (i, v) { + ids.push(parseInt($(v).data('transaction'))); + }); + + // go to specially crafted URL: + var bases = document.getElementsByTagName('base'); + var baseHref = null; + + if (bases.length > 0) { + baseHref = bases[0].href; + } + + $.post(baseHref + 'transactions/reconcile', {transactions: ids}).done(function () { + alert('OK then.'); + }).fail(function () { + alert('Could not reconcile transactions: please check the logs and try again later.'); + }); + + return false; +} + +/** + * + * @returns {boolean} + */ function goToMassEdit() { "use strict"; var checkedArray = getCheckboxes(); @@ -62,6 +100,10 @@ function goToMassEdit() { return false; } +/** + * + * @returns {boolean} + */ function goToMassDelete() { "use strict"; var checkedArray = getCheckboxes(); @@ -77,6 +119,10 @@ function goToMassDelete() { return false; } +/** + * + * @returns {Array} + */ function getCheckboxes() { "use strict"; var list = []; @@ -90,13 +136,19 @@ function getCheckboxes() { return list; } - +/** + * + */ function countChecked() { "use strict"; var checked = $('.select_all_single:checked').length; if (checked > 0) { $('.mass_edit span').text(edit_selected_txt + ' (' + checked + ')'); $('.mass_delete span').text(delete_selected_txt + ' (' + checked + ')'); + + // get amount for the transactions: + getAmounts(); + $('.mass_button_options').show(); } else { @@ -104,17 +156,49 @@ function countChecked() { } } +function getAmounts() { + $('.mass_reconcile span').html(reconcile_selected_txt + ' ()'); + var checked = $('.select_all_single:checked'); + var ids = []; + $.each(checked, function (i, v) { + ids.push(parseInt($(v).data('transaction'))); + }); + // go to specially crafted URL: + var bases = document.getElementsByTagName('base'); + var baseHref = null; + + if (bases.length > 0) { + baseHref = bases[0].href; + } + + $.getJSON(baseHref + 'json/transactions/amount', {transactions: ids}).done(function (data) { + $('.mass_reconcile span').text(reconcile_selected_txt + ' (' + data.amounts + ')'); + console.log(data); + }); + return; +} + +/** + * + */ function checkAll() { "use strict"; $('.select_all_single').prop('checked', true); } +/** + * + */ function uncheckAll() { "use strict"; $('.select_all_single').prop('checked', false); } +/** + * + * @returns {boolean} + */ function stopMassSelect() { "use strict"; @@ -145,6 +229,10 @@ function stopMassSelect() { return false; } +/** + * + * @returns {boolean} + */ function startMassSelect() { "use strict"; // show "select all" box in table header. diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index d2b50eeb36..36db837878 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -663,8 +663,7 @@ return [ 'stored_journal' => 'Successfully created new transaction ":description"', 'select_transactions' => 'Select transactions', 'stop_selection' => 'Stop selecting transactions', - 'edit_selected' => 'Edit selected', - 'delete_selected' => 'Delete selected', + 'reconcile_selected' => 'Reconcile', 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', diff --git a/resources/views/list/journals.twig b/resources/views/list/journals.twig index 4b202354a2..fdb0685e80 100644 --- a/resources/views/list/journals.twig +++ b/resources/views/list/journals.twig @@ -33,13 +33,15 @@ @@ -58,5 +61,5 @@ diff --git a/resources/views/search/index.twig b/resources/views/search/index.twig index 98600a006b..d915476cd6 100644 --- a/resources/views/search/index.twig +++ b/resources/views/search/index.twig @@ -109,7 +109,7 @@ {% endblock %} diff --git a/resources/views/list/journals.twig b/resources/views/list/journals.twig index 6752cc2c9c..1a070710d6 100644 --- a/resources/views/list/journals.twig +++ b/resources/views/list/journals.twig @@ -48,7 +48,11 @@ {% if showReconcile == true %} - {{ 'reconcile_this_account'|_ }} + {% if moment == 'all' %} + {{ 'reconcile_this_account'|_ }} + {% else %} + {{ 'reconcile_this_account'|_ }} + {% endif %} {% endif %}
diff --git a/routes/web.php b/routes/web.php index 559c2a4f2f..163db19429 100755 --- a/routes/web.php +++ b/routes/web.php @@ -90,7 +90,7 @@ Route::group( Route::get('{what}', ['uses' => 'AccountController@index', 'as' => 'index'])->where('what', 'revenue|asset|expense'); Route::get('create/{what}', ['uses' => 'AccountController@create', 'as' => 'create'])->where('what', 'revenue|asset|expense'); Route::get('edit/{account}', ['uses' => 'AccountController@edit', 'as' => 'edit']); - Route::get('reconcile/{account}/{moment?}', ['uses' => 'AccountController@reconcile', 'as' => 'reconcile']); + Route::get('reconcile/{account}/{start_date?}/{end_date?}', ['uses' => 'AccountController@reconcile', 'as' => 'reconcile']); Route::get('delete/{account}', ['uses' => 'AccountController@delete', 'as' => 'delete']); Route::get('show/{account}/{moment?}', ['uses' => 'AccountController@show', 'as' => 'show']); From 18f2b28b114d4f8cb42b8e9e7328dbcb08521473 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:00 +0100 Subject: [PATCH 140/258] New translations firefly.php (Russian) --- resources/lang/ru_RU/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index 4188d3106c..f701906aed 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -619,6 +619,8 @@ return [ 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', From 34c74ee3a3f29402f7748413b2748b8152c734a1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:11 +0100 Subject: [PATCH 141/258] New translations firefly.php (Indonesian) --- resources/lang/id_ID/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index 399222cc02..c6b211e967 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -619,6 +619,8 @@ return [ 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', From fb20293e402c6adcde59f7b7292969181b9c82b6 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:20 +0100 Subject: [PATCH 142/258] New translations firefly.php (Dutch) --- resources/lang/nl_NL/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index 8da3e282a7..b0908b0e94 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -619,6 +619,8 @@ return [ 'cash_accounts' => 'Contant geldrekeningen', 'Cash account' => 'Contant geldrekening', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'cash', 'account_type' => 'Rekeningtype', 'save_transactions_by_moving' => 'Bewaar deze transacties door ze aan een andere rekening te koppelen:', From b79cbacce9a6f39e9de2fbde000e0b3078fcf976 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:25 +0100 Subject: [PATCH 143/258] New translations firefly.php (French) --- resources/lang/fr_FR/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index 467b14406e..4b5eb2a881 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -620,6 +620,8 @@ return [ 'cash_accounts' => 'Comptes de trésorerie', 'Cash account' => 'Compte de trésorerie', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'espèce', 'account_type' => 'Type de compte', 'save_transactions_by_moving' => 'Enregistrer ces opération(s) en les déplaçant vers un autre compte :', From 65b9d2cb00c8d999f02927001e6e4f5b59d8230a Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:31 +0100 Subject: [PATCH 144/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index a331675392..302a54fe7e 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -620,6 +620,8 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'cash_accounts' => 'Bargeldkonten', 'Cash account' => 'Bargeldkonto', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'cash', 'account_type' => 'Kontotyp', 'save_transactions_by_moving' => 'Speichern Sie diese Transaktion(en), indem Sie sie auf ein anderes Konto verschieben:', From b950b82e1008be3fc9b93a711c2e61236bfc2e75 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:37 +0100 Subject: [PATCH 145/258] New translations firefly.php (Spanish) --- resources/lang/es_ES/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index 6b31f442b5..bc0db40ec5 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -619,6 +619,8 @@ return [ 'cash_accounts' => 'Cuentas de efectivo', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', From f6ebabe41d6077e0d416fbd0683dadb0ee038a96 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:39 +0100 Subject: [PATCH 146/258] New translations firefly.php (Slovenian) --- resources/lang/sl_SI/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index 1f7c7426a0..6d25c9274f 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -619,6 +619,8 @@ return [ 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', From 8f6a5672fa6ce41d190e2b00a1e6fc88b6ed7e7a Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:42 +0100 Subject: [PATCH 147/258] New translations firefly.php (Portuguese, Brazilian) --- resources/lang/pt_BR/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 39fc44d603..66217e96b0 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -619,6 +619,8 @@ return [ 'cash_accounts' => 'Contas Correntes', 'Cash account' => 'Conta Corrente', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'cash', 'account_type' => 'Tipo de conta', 'save_transactions_by_moving' => 'Salve essas transações, movendo-os para outra conta:', From f3a2a467d43433faf2f2fbe6ab4033afde035ba2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Nov 2017 18:31:45 +0100 Subject: [PATCH 148/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index 7c0f529260..adaa9debdb 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -619,6 +619,8 @@ return [ 'cash_accounts' => 'Konta gotówkowe', 'Cash account' => 'Konto gotówkowe', 'reconcile_account' => 'Reconcile account ":account"', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'gotówka', 'account_type' => 'Typ konta', 'save_transactions_by_moving' => 'Zapisz te transakcje, przenosząc je do innego konta:', From c013ce5bdb180f06017870d37c47e5ebd045aaf9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 11 Nov 2017 17:40:58 +0100 Subject: [PATCH 149/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 302a54fe7e..e11769eaf0 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -619,7 +619,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'revenue_accounts' => 'Schuldner', 'cash_accounts' => 'Bargeldkonten', 'Cash account' => 'Bargeldkonto', - 'reconcile_account' => 'Reconcile account ":account"', + 'reconcile_account' => 'Konto ":account" ausgleichen', 'end_of_reconcile_period' => 'End of reconcile period: :period', 'start_of_reconcile_period' => 'Start of reconcile period: :period', 'cash' => 'cash', From 6c8f6315826bbb8f612474c6a29d570d09c2fd3c Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 12 Nov 2017 08:42:25 +0100 Subject: [PATCH 150/258] Fix #992 --- app/Repositories/Budget/BudgetRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 365d14ee7e..0a2a72d000 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -90,7 +90,7 @@ class BudgetRepository implements BudgetRepositoryInterface // get account information /** @var AccountRepositoryInterface $accountRepository */ $accountRepository = app(AccountRepositoryInterface::class); - $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); + $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $return = []; /** @var Budget $budget */ foreach ($budgets as $budget) { From d413615943ceec47d2978f439c0c06d18e29ea6f Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 13 Nov 2017 16:26:44 +0100 Subject: [PATCH 151/258] Update tag routine for #993 --- app/Repositories/Tag/TagRepository.php | 60 ++++++++++++----- .../{reconcile.twig => reconcile/index.twig} | 67 +++++++++++-------- 2 files changed, 83 insertions(+), 44 deletions(-) rename resources/views/accounts/{reconcile.twig => reconcile/index.twig} (88%) diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 8fa5f3cf4f..f4b3e9cdd8 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -25,6 +25,7 @@ namespace FireflyIII\Repositories\Tag; use Carbon\Carbon; +use DB; use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Helpers\Filter\InternalTransferFilter; use FireflyIII\Models\Tag; @@ -328,39 +329,69 @@ class TagRepository implements TagRepositoryInterface */ public function tagCloud(?int $year): array { + /* + * Some vars + */ $min = null; - $max = 0; - $query = $this->user->tags(); + $max = '0'; $return = []; - Log::debug('Going to build tag-cloud'); + /* + * get tags with a certain amount (in this range): + */ + $query = $this->user->tags() + ->leftJoin('tag_transaction_journal', 'tag_transaction_journal.tag_id', '=', 'tags.id') + ->leftJoin('transaction_journals', 'tag_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') + ->leftJoin('transactions', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->where('transactions.amount', '>', 0) + ->groupBy('tags.id'); + + // add date range (or not): + if (is_null($year)) { + $query->whereNull('tags.date'); + } + if (!is_null($year)) { + $start = $year . '-01-01'; + $end = $year . '-12-31'; + $query->where('tags.date', '>=', $start)->where('tags.date', '<=', $end); + } + $set = $query->get(['tags.id', DB::raw('SUM(transactions.amount) as amount_sum')]); + $tagsWithAmounts = []; + /** @var Tag $tag */ + foreach ($set as $tag) { + $tagsWithAmounts[$tag->id] = strval($tag->amount_sum); + } + + /* + * get all tags in period: + */ + $query = $this->user->tags(); if (!is_null($year)) { - Log::debug(sprintf('Year is not null: %d', $year)); $start = $year . '-01-01'; $end = $year . '-12-31'; $query->where('date', '>=', $start)->where('date', '<=', $end); } if (is_null($year)) { $query->whereNull('date'); - Log::debug('Year is NULL'); } $tags = $query->orderBy('id', 'desc')->get(); $temporary = []; - Log::debug(sprintf('Found %d tags', $tags->count())); /** @var Tag $tag */ foreach ($tags as $tag) { - $amount = floatval($this->sumOfTag($tag, null, null)); - $min = $amount < $min || is_null($min) ? $amount : $min; - $max = $amount > $max ? $amount : $max; + $amount = $tagsWithAmounts[$tag->id] ?? '0'; + if (is_null($min)) { + $min = $amount; + } + $max = bccomp($amount, $max) === 1 ? $amount : $max; + $min = bccomp($amount, $min) === -1 ? $amount : $min; + $temporary[] = [ 'amount' => $amount, 'tag' => $tag, ]; - Log::debug(sprintf('Now working on tag %s with total amount %s', $tag->tag, $amount)); - Log::debug(sprintf('Minimum is now %f, maximum is %f', $min, $max)); } /** @var array $entry */ foreach ($temporary as $entry) { - $scale = $this->cloudScale([12, 20], $entry['amount'], $min, $max); + $scale = $this->cloudScale([12, 20], floatval($entry['amount']), floatval($min), floatval($max)); $tagId = $entry['tag']->id; $return[$tagId] = [ 'scale' => $scale, @@ -368,8 +399,6 @@ class TagRepository implements TagRepositoryInterface ]; } - Log::debug('DONE with tagcloud'); - return $return; } @@ -402,13 +431,10 @@ class TagRepository implements TagRepositoryInterface */ private function cloudScale(array $range, float $amount, float $min, float $max): int { - Log::debug(sprintf('Now in cloudScale with %s as amount and %f min, %f max', $amount, $min, $max)); $amountDiff = $max - $min; - Log::debug(sprintf('AmountDiff is %f', $amountDiff)); // no difference? Every tag same range: if ($amountDiff === 0.0) { - Log::debug(sprintf('AmountDiff is zero, return %d', $range[0])); return $range[0]; } diff --git a/resources/views/accounts/reconcile.twig b/resources/views/accounts/reconcile/index.twig similarity index 88% rename from resources/views/accounts/reconcile.twig rename to resources/views/accounts/reconcile/index.twig index 1cb62fc343..e111c69190 100644 --- a/resources/views/accounts/reconcile.twig +++ b/resources/views/accounts/reconcile/index.twig @@ -67,12 +67,17 @@ - - - - {{ 'update_view'|_ }} - - (unsaved progress will be lost!) + + +
+ {{ 'update_balance_dates_instruction'|_ }} +
+ + + + {{ 'start_reconcile'|_ }} @@ -96,12 +101,11 @@ - +

- Reconcile - Reconcile with transaction +
@@ -157,6 +161,25 @@ {% set startSet = true %} {% endif %} + + {# end marker #} + {% if transaction.date <= end and endSet == false %} + + +   + + + + {{ trans('firefly.end_of_reconcile_period', {period: end.formatLocalized(monthAndDayFormat) }) }} + + + +   + + + {% set endSet = true %} + {% endif %} + @@ -185,7 +208,13 @@ {{ transaction|transactionAmount }} - + {% if transaction.reconciled %} + {{ transaction|transactionReconciled }} + {% else %} + + {% endif %} {{ transaction.date.formatLocalized(monthAndDayFormat) }} @@ -205,23 +234,7 @@ {{ transaction|transactionCategories }} - {# end marker #} - {% if transaction.date <= end and endSet == false %} - - -   - - - - {{ trans('firefly.end_of_reconcile_period', {period: end.formatLocalized(monthAndDayFormat) }) }} - - - -   - - - {% set endSet = true %} - {% endif %} + {% endfor %} From e2ecfc70733a83b3ff3f33f5609de2b3bd4d5085 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 14 Nov 2017 09:50:09 +0100 Subject: [PATCH 152/258] New translations validation.php (Russian) --- resources/lang/ru_RU/validation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lang/ru_RU/validation.php b/resources/lang/ru_RU/validation.php index 8273315994..5a10ec4586 100644 --- a/resources/lang/ru_RU/validation.php +++ b/resources/lang/ru_RU/validation.php @@ -23,7 +23,7 @@ return [ 'file_too_large' => 'Файл ":name" слишком большой.', 'belongs_to_user' => 'Значение :attribute неизвестно', 'accepted' => 'The :attribute must be accepted.', - 'bic' => 'This is not a valid BIC.', + 'bic' => 'Это некорректный BIC.', 'more' => ':attribute must be larger than zero.', 'active_url' => 'The :attribute is not a valid URL.', 'after' => 'The :attribute must be a date after :date.', @@ -63,8 +63,8 @@ return [ 'min.file' => 'The :attribute must be at least :min kilobytes.', 'min.string' => 'The :attribute must be at least :min characters.', 'min.array' => 'The :attribute must have at least :min items.', - 'not_in' => 'The selected :attribute is invalid.', - 'numeric' => 'The :attribute must be a number.', + 'not_in' => 'Выбранный :attribute не верный.', + 'numeric' => ':attribute должен быть числом.', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.', 'required_if' => 'The :attribute field is required when :other is :value.', From e73a7a3d14226986b10eb397f5bf3e3f86e16b7c Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 14 Nov 2017 09:50:10 +0100 Subject: [PATCH 153/258] New translations demo.php (Russian) --- resources/lang/ru_RU/demo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/ru_RU/demo.php b/resources/lang/ru_RU/demo.php index 53cc86a59b..babdfb5310 100644 --- a/resources/lang/ru_RU/demo.php +++ b/resources/lang/ru_RU/demo.php @@ -21,6 +21,6 @@ return [ 'transactions-index' => 'These expenses, deposits and transfers are not particularly imaginative. They have been generated automatically.', 'piggy-banks-index' => 'As you can see, there are three piggy banks. Use the plus and minus buttons to influence the amount of money in each piggy bank. Click the name of the piggy bank to see the administration for each piggy bank.', 'import-index' => 'Of course, any CSV file can be imported into Firefly III', - 'import-configure-security' => 'Because of security concerns, your upload has been replaced with a local file.', + 'import-configure-security' => 'По соображениям безопасности, загружаемый вами файл был заменен локальным.', 'import-configure-configuration' => 'The configuration you see below is correct for the local file.', ]; From 16ebee549b62220653b864dbf2aa0b2dab1e1497 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 14 Nov 2017 09:50:11 +0100 Subject: [PATCH 154/258] New translations bank.php (Russian) --- resources/lang/ru_RU/bank.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/ru_RU/bank.php b/resources/lang/ru_RU/bank.php index 4becc5984c..27d103f5f9 100644 --- a/resources/lang/ru_RU/bank.php +++ b/resources/lang/ru_RU/bank.php @@ -3,6 +3,6 @@ declare(strict_types=1); return [ - 'bunq_prerequisites_title' => 'Prerequisites for an import from bunq', - 'bunq_prerequisites_text' => 'In order to import from bunq, you need to obtain an API key. You can do this through the app.', + 'bunq_prerequisites_title' => 'Реквизиты для импорта из bunq', + 'bunq_prerequisites_text' => 'Для импорта из bunq вам необходимо получить API ключ. Вы можете сделать это через приложение.', ]; From cf460a05847ab59f93da25a5971d623b2de35982 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 14 Nov 2017 10:00:16 +0100 Subject: [PATCH 155/258] New translations validation.php (Russian) --- resources/lang/ru_RU/validation.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lang/ru_RU/validation.php b/resources/lang/ru_RU/validation.php index 5a10ec4586..8235868f6b 100644 --- a/resources/lang/ru_RU/validation.php +++ b/resources/lang/ru_RU/validation.php @@ -78,9 +78,9 @@ return [ 'size.file' => 'The :attribute must be :size kilobytes.', 'size.string' => 'The :attribute must be :size characters.', 'size.array' => 'The :attribute must contain :size items.', - 'unique' => 'The :attribute has already been taken.', - 'string' => 'The :attribute must be a string.', - 'url' => 'The :attribute format is invalid.', + 'unique' => ':attribute уже занят.', + 'string' => 'Значение :attribute должно быть строкой.', + 'url' => 'Неверный формат ввода :attribute.', 'timezone' => 'The :attribute must be a valid zone.', '2fa_code' => 'The :attribute field is invalid.', 'dimensions' => 'The :attribute has invalid image dimensions.', @@ -88,6 +88,6 @@ return [ 'file' => 'The :attribute must be a file.', 'in_array' => 'The :attribute field does not exist in :other.', 'present' => 'The :attribute field must be present.', - 'amount_zero' => 'The total amount cannot be zero', - 'secure_password' => 'This is not a secure password. Please try again. For more information, visit https://goo.gl/NCh2tN', + 'amount_zero' => 'Общее количество не может быть равно нулю', + 'secure_password' => 'Это не безопасный пароль. Попробуйте еще раз. Для получения справки посетите https://goo.gl/NCh2tN', ]; From 080a4002c62eb13eaa8f751c68c78c9232b33692 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 14 Nov 2017 10:10:14 +0100 Subject: [PATCH 156/258] New translations validation.php (Russian) --- resources/lang/ru_RU/validation.php | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/resources/lang/ru_RU/validation.php b/resources/lang/ru_RU/validation.php index 8235868f6b..8b812c9aa8 100644 --- a/resources/lang/ru_RU/validation.php +++ b/resources/lang/ru_RU/validation.php @@ -22,14 +22,14 @@ return [ 'file_invalid_mime' => 'Файл ":name" имеет тип ":mime". Загрузка файлов такого типа невозможна.', 'file_too_large' => 'Файл ":name" слишком большой.', 'belongs_to_user' => 'Значение :attribute неизвестно', - 'accepted' => 'The :attribute must be accepted.', + 'accepted' => 'Необходимо принять :attribute.', 'bic' => 'Это некорректный BIC.', - 'more' => ':attribute must be larger than zero.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'alpha' => 'The :attribute may only contain letters.', - 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', - 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'more' => ':attribute должен быть больше нуля.', + 'active_url' => ':attribute не является допустимым URL-адресом.', + 'after' => ':attribute должна быть позже :date.', + 'alpha' => ':attribute может содержать только буквы.', + 'alpha_dash' => ':attribute может содержать только буквы, числа и дефис.', + 'alpha_num' => ':attribute может содержать только буквы и числа.', 'array' => 'The :attribute must be an array.', 'unique_for_user' => 'There already is an entry with this :attribute.', 'before' => 'The :attribute must be a date before :date.', @@ -74,20 +74,20 @@ return [ 'required_without' => 'The :attribute field is required when :values is not present.', 'required_without_all' => 'The :attribute field is required when none of :values are present.', 'same' => 'The :attribute and :other must match.', - 'size.numeric' => 'The :attribute must be :size.', - 'size.file' => 'The :attribute must be :size kilobytes.', - 'size.string' => 'The :attribute must be :size characters.', - 'size.array' => 'The :attribute must contain :size items.', + 'size.numeric' => ':attribute должен быть размером :size.', + 'size.file' => ':attribute должен быть размером :size килобайт.', + 'size.string' => ':attribute должен состоять из :size символов.', + 'size.array' => ':attribute должен содержать :size элементов.', 'unique' => ':attribute уже занят.', 'string' => 'Значение :attribute должно быть строкой.', 'url' => 'Неверный формат ввода :attribute.', - 'timezone' => 'The :attribute must be a valid zone.', - '2fa_code' => 'The :attribute field is invalid.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'file' => 'The :attribute must be a file.', - 'in_array' => 'The :attribute field does not exist in :other.', - 'present' => 'The :attribute field must be present.', + 'timezone' => ':attribute должен быть в допустимом диапазоне.', + '2fa_code' => ':attribute введен неверно.', + 'dimensions' => 'Недопустимые размеры изображения :attribute.', + 'distinct' => 'Поле :attribute содержит повторяющееся значение.', + 'file' => ':attribute должен быть файлом.', + 'in_array' => 'Поле :attribute не существует в :other.', + 'present' => 'Поле :attribute должно быть заполнено.', 'amount_zero' => 'Общее количество не может быть равно нулю', 'secure_password' => 'Это не безопасный пароль. Попробуйте еще раз. Для получения справки посетите https://goo.gl/NCh2tN', ]; From 3243288e44cfc854f2f0f130142314417f92b59d Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 14 Nov 2017 10:20:11 +0100 Subject: [PATCH 157/258] New translations validation.php (Russian) --- resources/lang/ru_RU/validation.php | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/resources/lang/ru_RU/validation.php b/resources/lang/ru_RU/validation.php index 8b812c9aa8..d821dc8cc6 100644 --- a/resources/lang/ru_RU/validation.php +++ b/resources/lang/ru_RU/validation.php @@ -30,21 +30,21 @@ return [ 'alpha' => ':attribute может содержать только буквы.', 'alpha_dash' => ':attribute может содержать только буквы, числа и дефис.', 'alpha_num' => ':attribute может содержать только буквы и числа.', - 'array' => 'The :attribute must be an array.', - 'unique_for_user' => 'There already is an entry with this :attribute.', - 'before' => 'The :attribute must be a date before :date.', - 'unique_object_for_user' => 'This name is already in use', - 'unique_account_for_user' => 'This account name is already in use', - 'between.numeric' => 'The :attribute must be between :min and :max.', - 'between.file' => 'The :attribute must be between :min and :max kilobytes.', - 'between.string' => 'The :attribute must be between :min and :max characters.', - 'between.array' => 'The :attribute must have between :min and :max items.', - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'date' => 'The :attribute is not a valid date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', + 'array' => ':attribute должен быть массивом.', + 'unique_for_user' => 'Уже существует запись с этим :attribute.', + 'before' => ':attribute должна быть раньше :date.', + 'unique_object_for_user' => 'Это имя уже используется', + 'unique_account_for_user' => 'Имя аккаунта уже используется', + 'between.numeric' => ':attribute должен быть больше :min и меньше :max.', + 'between.file' => ':attribute должен быть размером :min - :max килобайт.', + 'between.string' => ':attribute должен содержать :min - :max символов.', + 'between.array' => ':attribute должен содержать :min - :max элементов.', + 'boolean' => 'Поле :attribute должно быть истинным или ложным.', + 'confirmed' => ':attribute не совпадает с подтверждением.', + 'date' => ':attribute не является верной датой.', + 'date_format' => ':attribute не совпадает с форматом :format.', + 'different' => ':attribute и :other не должны совпадать.', + 'digits' => ':attribute должно содержать :digits цифр.', 'digits_between' => 'The :attribute must be between :min and :max digits.', 'email' => 'The :attribute must be a valid email address.', 'filled' => 'The :attribute field is required.', @@ -73,7 +73,7 @@ return [ 'required_with_all' => 'The :attribute field is required when :values is present.', 'required_without' => 'The :attribute field is required when :values is not present.', 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', + 'same' => ':attribute и :other должны совпадать.', 'size.numeric' => ':attribute должен быть размером :size.', 'size.file' => ':attribute должен быть размером :size килобайт.', 'size.string' => ':attribute должен состоять из :size символов.', From 1971fb7e29c641f5f1c975242233e26be5a9f0e3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 14 Nov 2017 10:30:10 +0100 Subject: [PATCH 158/258] New translations validation.php (Russian) --- resources/lang/ru_RU/validation.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/resources/lang/ru_RU/validation.php b/resources/lang/ru_RU/validation.php index d821dc8cc6..a4ef9fd56b 100644 --- a/resources/lang/ru_RU/validation.php +++ b/resources/lang/ru_RU/validation.php @@ -45,22 +45,22 @@ return [ 'date_format' => ':attribute не совпадает с форматом :format.', 'different' => ':attribute и :other не должны совпадать.', 'digits' => ':attribute должно содержать :digits цифр.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'email' => 'The :attribute must be a valid email address.', - 'filled' => 'The :attribute field is required.', - 'exists' => 'The selected :attribute is invalid.', - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'json' => 'The :attribute must be a valid JSON string.', + 'digits_between' => ':attribute должен содержать :min - :max цифр.', + 'email' => ':attribute не является верным email адресом.', + 'filled' => 'Поле :attribute должно быть заполнено.', + 'exists' => 'Выбран неверный :attribute.', + 'image' => ':attribute должен быть изображением.', + 'in' => 'Выбранный :attribute не верный.', + 'integer' => ':attribute должно быть целым числом.', + 'ip' => ':attribute должен быть верным IP-адресом.', + 'json' => ':attribute должно быть верной JSON строкой.', 'max.numeric' => 'The :attribute may not be greater than :max.', 'max.file' => 'The :attribute may not be greater than :max kilobytes.', 'max.string' => 'The :attribute may not be greater than :max characters.', 'max.array' => 'The :attribute may not have more than :max items.', 'mimes' => 'The :attribute must be a file of type: :values.', - 'min.numeric' => 'The :attribute must be at least :min.', - 'min.file' => 'The :attribute must be at least :min kilobytes.', + 'min.numeric' => ':attribute должен быть минимум :min.', + 'min.file' => ':attribute должен быть минимум :min килобайт.', 'min.string' => 'The :attribute must be at least :min characters.', 'min.array' => 'The :attribute must have at least :min items.', 'not_in' => 'Выбранный :attribute не верный.', @@ -72,7 +72,7 @@ return [ 'required_with' => 'The :attribute field is required when :values is present.', 'required_with_all' => 'The :attribute field is required when :values is present.', 'required_without' => 'The :attribute field is required when :values is not present.', - 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'required_without_all' => ':attribute поле обязательно для заполнения, так как ни одно из :values не существует.', 'same' => ':attribute и :other должны совпадать.', 'size.numeric' => ':attribute должен быть размером :size.', 'size.file' => ':attribute должен быть размером :size килобайт.', From 88ebcd108639946bd75b84a514eaa08c7ac0893b Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 14 Nov 2017 17:20:26 +0100 Subject: [PATCH 159/258] New translations list.php (Spanish) --- resources/lang/es_ES/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lang/es_ES/list.php b/resources/lang/es_ES/list.php index 77824e1ef7..50ae1b1135 100644 --- a/resources/lang/es_ES/list.php +++ b/resources/lang/es_ES/list.php @@ -83,10 +83,10 @@ return [ 'inward' => 'Descripción interna', 'outward' => 'Descripción externa', 'number_of_transactions' => 'Número de transacciones', - 'total_amount' => 'Total amount', - 'sum' => 'Sum', + 'total_amount' => 'Total', + 'sum' => 'Suma', 'sum_excluding_transfers' => 'Sum (excluding transfers)', 'sum_withdrawals' => 'Sum of withdrawals', 'sum_deposits' => 'Sum of deposits', - 'sum_transfers' => 'Sum of transfers', + 'sum_transfers' => 'Suma de transferencias', ]; From 5530347bb2b92fb22fa4309e796c3d59c62862e9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:29:49 +0100 Subject: [PATCH 160/258] New code for #736 --- .../Account/ReconcileController.php | 173 +++++++++++++++++ app/Http/Controllers/AccountController.php | 68 ------- public/js/ff/accounts/reconcile.js | 174 +++++++++++++++++- resources/lang/en_US/firefly.php | 15 +- resources/views/accounts/reconcile/index.twig | 124 +------------ .../views/accounts/reconcile/overview.twig | 39 ++++ .../accounts/reconcile/transactions.twig | 131 +++++++++++++ resources/views/partials/transaction-row.twig | 2 +- routes/web.php | 7 +- 9 files changed, 539 insertions(+), 194 deletions(-) create mode 100644 app/Http/Controllers/Account/ReconcileController.php create mode 100644 resources/views/accounts/reconcile/overview.twig create mode 100644 resources/views/accounts/reconcile/transactions.twig diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php new file mode 100644 index 0000000000..2ef5905eeb --- /dev/null +++ b/app/Http/Controllers/Account/ReconcileController.php @@ -0,0 +1,173 @@ +. + */ + +declare(strict_types=1); + +namespace FireflyIII\Http\Controllers\Account; + + +use Carbon\Carbon; +use FireflyIII\Helpers\Collector\JournalCollectorInterface; +use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\Account; +use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use Illuminate\Http\Request; +use Illuminate\Support\Collection; +use Navigation; +use Preferences; +use Response; +use View; + +/** + * Class ReconcileController + * + * @package FireflyIII\Http\Controllers\Account + */ +class ReconcileController extends Controller +{ + /** + * + */ + public function __construct() + { + parent::__construct(); + + // translations: + $this->middleware( + function ($request, $next) { + View::share('mainTitleIcon', 'fa-credit-card'); + View::share('title', trans('firefly.accounts')); + + return $next($request); + } + ); + } + + /** + * @param Request $request + * @param Account $account + * @param Carbon $start + * @param Carbon $end + * + * @return \Illuminate\Http\JsonResponse + */ + public function overview(Request $request, Account $account, Carbon $start, Carbon $end) + { + $startBalance = $request->get('startBalance'); + $endBalance = $request->get('endBalance'); + $transactions = $request->get('transactions'); + + $return = [ + 'is_zero' => false, + 'post_uri' => route('accounts.reconcile.submit', [$account->id, $start->format('Ymd'), $end->format('Ymd')]), + 'html' => '', + ]; + $return['html'] = view('accounts.reconcile.overview', compact('account', 'start', 'end'))->render(); + + return Response::json($return); + + } + + /** + * @param Account $account + * @param Carbon|null $start + * @param Carbon|null $end + * + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function reconcile(Account $account, Carbon $start = null, Carbon $end = null) + { + if ($account->accountType->type === AccountType::INITIAL_BALANCE) { + return $this->redirectToOriginalAccount($account); + } + /** @var CurrencyRepositoryInterface $currencyRepos */ + $currencyRepos = app(CurrencyRepositoryInterface::class); + $currencyId = intval($account->getMeta('currency_id')); + $currency = $currencyRepos->find($currencyId); + if ($currencyId === 0) { + $currency = app('amount')->getDefaultCurrency(); + } + + // no start or end: + $range = Preferences::get('viewRange', '1M')->data; + + // get start and end + if (is_null($start) && is_null($end)) { + $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); + $end = clone session('end', Navigation::endOfPeriod(new Carbon, $range)); + } + if (is_null($end)) { + $end = Navigation::endOfPeriod($start, $range); + } + + $startDate = clone $start; + $startDate->subDays(1); + $startBalance = round(app('steam')->balance($account, $startDate), $currency->decimal_places); + $endBalance = round(app('steam')->balance($account, $end), $currency->decimal_places); + $subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type); + $subTitle = trans('firefly.reconcile_account', ['account' => $account->name]); + + // various links + $transactionsUri = route('accounts.reconcile.transactions', [$account->id, '%start%', '%end%']); + $overviewUri = route('accounts.reconcile.overview', [$account->id, '%start%', '%end%']); + $indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']); + + return view( + 'accounts.reconcile.index', compact( + 'account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance', 'transactionsUri', + 'selectionStart', 'selectionEnd', 'overviewUri', 'indexUri' + ) + ); + } + + /** + * @param Account $account + * @param Carbon $start + * @param Carbon $end + * + * @return mixed + */ + public function transactions(Account $account, Carbon $start, Carbon $end) + { + if ($account->accountType->type === AccountType::INITIAL_BALANCE) { + return $this->redirectToOriginalAccount($account); + } + + // get the transactions + $selectionStart = clone $start; + $selectionStart->subDays(3); + $selectionEnd = clone $end; + $selectionEnd->addDays(3); + + + // grab transactions: + /** @var JournalCollectorInterface $collector */ + $collector = app(JournalCollectorInterface::class); + $collector->setAccounts(new Collection([$account])) + ->setRange($selectionStart, $selectionEnd)->withBudgetInformation()->withOpposingAccount()->withCategoryInformation(); + $transactions = $collector->getJournals(); + $html = view('accounts.reconcile.transactions', compact('account', 'transactions', 'start', 'end', 'selectionStart', 'selectionEnd'))->render(); + + return Response::json(['html' => $html]); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 1181029657..ecd68c0b91 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -250,74 +250,6 @@ class AccountController extends Controller return view('accounts.index', compact('what', 'subTitleIcon', 'subTitle', 'accounts')); } - /** - * @param Request $request - * @param Account $account - * @param string $moment - * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View - */ - public function reconcile(Request $request, Account $account, Carbon $start = null, Carbon $end = null) - { - if ($account->accountType->type === AccountType::INITIAL_BALANCE) { - return $this->redirectToOriginalAccount($account); - } - /** @var CurrencyRepositoryInterface $currencyRepos */ - $currencyRepos = app(CurrencyRepositoryInterface::class); - $currencyId = intval($account->getMeta('currency_id')); - $currency = $currencyRepos->find($currencyId); - if ($currencyId === 0) { - $currency = app('amount')->getDefaultCurrency(); - } - - // no start or end: - $range = Preferences::get('viewRange', '1M')->data; - - // get start and end - if(is_null($start) && is_null($end)) { - $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); - $end = clone session('end', Navigation::endOfPeriod(new Carbon, $range)); - } - if(is_null($end)) { - $end = Navigation::endOfPeriod($start, $range); - } - - $startDate = clone $start; - $startDate->subDays(1); - $startBalance = round(app('steam')->balance($account, $startDate), $currency->decimal_places); - $endBalance = round(app('steam')->balance($account, $end), $currency->decimal_places); - $subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type); - $subTitle = trans('firefly.reconcile_account', ['account' => $account->name]); - - // get the transactions - $selectionStart = clone $start; - $selectionStart->subDays(7); - $selectionEnd = clone $end; - $selectionEnd->addDays(5); - - // grab transactions: - /** @var JournalCollectorInterface $collector */ - $collector = app(JournalCollectorInterface::class); - $collector->setAccounts(new Collection([$account])) - ->setRange($selectionStart, $selectionEnd)->withBudgetInformation()->withOpposingAccount()->withCategoryInformation(); - $transactions = $collector->getJournals(); - - return view('accounts.reconcile', compact('account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance','transactions','selectionStart','selectionEnd')); - - // prep for "specific date" view. - if (strlen($moment) > 0 && $moment !== 'all') { - $start = new Carbon($moment); - $end = Navigation::endOfPeriod($start, $range); - } - - - - return view( - 'accounts.show', - compact('account', 'currency', 'moment', 'periods', 'subTitleIcon', 'transactions', 'subTitle', 'start', 'end', 'chartUri') - ); - } - /** * Show an account. * diff --git a/public/js/ff/accounts/reconcile.js b/public/js/ff/accounts/reconcile.js index c19b64d482..8611b24f74 100644 --- a/public/js/ff/accounts/reconcile.js +++ b/public/js/ff/accounts/reconcile.js @@ -18,20 +18,178 @@ * along with Firefly III. If not, see . */ +var balanceDifference = 0; +var difference = 0; +var selectedAmount = 0; +var reconcileStarted = false; +/** + * + */ $(function () { "use strict"; - $('input[type="date"]').on('change', showUpdateButton); - $('.update_view').on('click', updateView); + + /* + Respond to changes in balance statements. + */ + $('input[type="number"]').on('change', function () { + if (reconcileStarted) { + calculateBalanceDifference(); + difference = balanceDifference - selectedAmount; + updateDifference(); + } + }); + + /* + Respond to changes in the date range. + */ + $('input[type="date"]').on('change', function () { + if (reconcileStarted) { + // hide original instructions. + $('.select_transactions_instruction').hide(); + + // show date-change warning + $('.date_change_warning').show(); + + // show update button + $('.change_date_button').show(); + } + }); + + $('.change_date_button').click(startReconcile); + $('.start_reconcile').click(startReconcile); + $('.store_reconcile').click(storeReconcile); + }); -function showUpdateButton() { - $('.update_date_button').show(); +function storeReconcile() { + // get modal HTML: + var ids = []; + $.each($('.reconcile_checkbox:checked'), function (i, v) { + ids.push($(v).data('id')); + }); + var variables = { + startBalance: parseFloat($('input[name="start_balance"]').val()), + endBalance: parseFloat($('input[name="end_balance"]').val()), + startDate: $('input[name="start_date"]').val(), + startEnd: $('input[name="end_date"]').val(), + transactions: ids + }; + var uri = overviewUri.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val()); + + + $.getJSON(uri, variables).done(function (data) { + if (data.is_zero === false) { + $('#defaultModal').empty().html(data.html).modal('show'); + } + }); } -function updateView() { - var startDate = $('input[name="start_date"]').val(); - var endDate = $('input[name="end_date"]').val(); - window.location = '/accounts/reconcile/2/' + startDate + '/' + endDate; +/** + * What happens when you check a checkbox: + * @param e + */ +function checkReconciledBox(e) { + var el = $(e.target); + var amount = parseFloat(el.val()); + console.log('Amount is ' + amount); + // if checked, add to selected amount + if (el.prop('checked') === true && el.data('younger') === false) { + console.log("Sum is: " + selectedAmount + " - " + amount + " = " + (selectedAmount - amount)); + selectedAmount = selectedAmount - amount; + } + if (el.prop('checked') === false && el.data('younger') === false) { + console.log("Sum is: " + selectedAmount + " + " + amount + " = " + (selectedAmount + amount)); + selectedAmount = selectedAmount + amount; + } + difference = balanceDifference - selectedAmount; + updateDifference(); + allowReconcile(); +} + +/** + * + */ +function allowReconcile() { + var count = $('.reconcile_checkbox:checked').length; + console.log('Count checkboxes is ' + count); + if (count > 0) { + $('.store_reconcile').prop('disabled', false); + } +} + +/** + * Calculate the difference between given start and end balance + * and put it in balanceDifference. + */ +function calculateBalanceDifference() { + var startBalance = parseFloat($('input[name="start_balance"]').val()); + var endBalance = parseFloat($('input[name="end_balance"]').val()); + balanceDifference = startBalance - endBalance; + if (balanceDifference < 0) { + balanceDifference = balanceDifference * -1; + } +} + +function getTransactionsForRange() { + // clear out the box: + $('#transactions_holder').empty().append($('

').addClass('text-center').html('')); + var uri = transactionsUri.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val()); + var index = indexUri.replace('%start%', $('input[name="start_date"]').val()).replace('%end%', $('input[name="end_date"]').val()); + window.history.pushState('object or string', "Reconcile account", index); + + $.getJSON(uri).done(placeTransactions); +} + +function placeTransactions(data) { + $('#transactions_holder').empty().html(data.html); + + + // as long as the dates are equal, changing the balance does not matter. + calculateBalanceDifference(); + difference = balanceDifference; + updateDifference(); + + // enable the check buttons: + $('.reconcile_checkbox').prop('disabled', false).unbind('change').change(checkReconciledBox); + + // show the other instruction: + $('.select_transactions_instruction').show(); +} + +/** + * + * @returns {boolean} + */ +function startReconcile() { + + reconcileStarted = true; + + // hide the start button. + $('.start_reconcile').hide(); + + // hide the start instructions: + $('.update_balance_instruction').hide(); + + // hide date-change warning + $('.date_change_warning').hide(); + + // hide update button + $('.change_date_button').hide(); + + getTransactionsForRange(); + + return false; } + +function updateDifference() { + var addClass = 'text-info'; + if (difference > 0) { + addClass = 'text-success'; + } + if (difference < 0) { + addClass = 'text-danger'; + } + $('#difference').addClass(addClass).text(accounting.formatMoney(difference)); +} \ No newline at end of file diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index c6b211e967..d387359f22 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -619,8 +619,19 @@ return [ 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', diff --git a/resources/views/accounts/reconcile/index.twig b/resources/views/accounts/reconcile/index.twig index e111c69190..a5aade3415 100644 --- a/resources/views/accounts/reconcile/index.twig +++ b/resources/views/accounts/reconcile/index.twig @@ -75,9 +75,13 @@

+ {{ 'start_reconcile'|_ }} + @@ -124,120 +128,9 @@

{{ 'transactions'|_ }}

- - - - - - - - - - - - - - - - - {# data for previous/next markers #} - {% set endSet = false %} - {% set startSet = false %} - {% for transaction in transactions %} - {# start marker #} - {% if transaction.date < start and startSet == false %} - - - - - - {% set startSet = true %} - {% endif %} - - {# end marker #} - {% if transaction.date <= end and endSet == false %} - - - - - - {% set endSet = true %} - {% endif %} - - - - {# icon #} - - - {# description #} - - - - - - - - - - - {% endfor %} - -
{{ trans('list.description') }}{{ trans('list.amount') }}
-   - - - {{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }} - - -   -
-   - - - {{ trans('firefly.end_of_reconcile_period', {period: end.formatLocalized(monthAndDayFormat) }) }} - - -   -
- - {{ transaction|transactionDescription }} - - {# is a split journal #} - {{ transaction|transactionIsSplit }} - - {# count attachments #} - {{ transaction|transactionHasAtt }} - - - {{ transaction|transactionAmount }} - {% if transaction.reconciled %} - {{ transaction|transactionReconciled }} - {% else %} - - {% endif %} -
+
+

{{ 'select_range_and_balance'|_ }}

+
@@ -253,6 +146,9 @@ var accountID = {{ account.id }}; var startBalance = {{ startBalance }}; var endBalance = {{ endBalance }}; + var transactionsUri = '{{ transactionsUri }}'; + var overviewUri = '{{ overviewUri }}'; + var indexUri = '{{ indexUri }}'; {% endblock %} diff --git a/resources/views/accounts/reconcile/overview.twig b/resources/views/accounts/reconcile/overview.twig new file mode 100644 index 0000000000..4ae512ff15 --- /dev/null +++ b/resources/views/accounts/reconcile/overview.twig @@ -0,0 +1,39 @@ + + diff --git a/resources/views/accounts/reconcile/transactions.twig b/resources/views/accounts/reconcile/transactions.twig new file mode 100644 index 0000000000..3b10c7b2a2 --- /dev/null +++ b/resources/views/accounts/reconcile/transactions.twig @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + {# data for previous/next markers #} + {% set endSet = false %} + {% set startSet = false %} + {% for transaction in transactions %} + {# start marker #} + {% if transaction.date < start and startSet == false %} + + + + + + {% set startSet = true %} + {% endif %} + + {# end marker #} + {% if transaction.date <= end and endSet == false %} + + + + + + {% set endSet = true %} + {% endif %} + + + + {# icon #} + + + {# description #} + + + + + + + + + + {% endfor %} + + {# if the start marker has not been generated yet, do it now, at the end of the loop. #} + {% if startSet == false %} + + + + + + {% set startSet = true %} + {% endif %} + +
{{ trans('list.description') }}{{ trans('list.amount') }}
+   + + + {{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }} + + +   +
+   + + + {{ trans('firefly.end_of_reconcile_period', {period: end.formatLocalized(monthAndDayFormat) }) }} + + +   +
+ + {{ transaction|transactionDescription }} + + {# is a split journal #} + {{ transaction|transactionIsSplit }} + + {# count attachments #} + {{ transaction|transactionHasAtt }} + + + {{ transaction|transactionAmount }} + {% if transaction.reconciled %} + {{ transaction|transactionReconciled }} + {% else %} + + {% endif %} +
+   + + + {{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }} + + +   +
\ No newline at end of file diff --git a/resources/views/partials/transaction-row.twig b/resources/views/partials/transaction-row.twig index d823971f9b..e969a07888 100644 --- a/resources/views/partials/transaction-row.twig +++ b/resources/views/partials/transaction-row.twig @@ -21,7 +21,7 @@ {# description #} - {# count attachments #} + {# is reconciled? #} {{ transaction|transactionReconciled }} diff --git a/routes/web.php b/routes/web.php index 163db19429..a7fa87e95e 100755 --- a/routes/web.php +++ b/routes/web.php @@ -90,10 +90,15 @@ Route::group( Route::get('{what}', ['uses' => 'AccountController@index', 'as' => 'index'])->where('what', 'revenue|asset|expense'); Route::get('create/{what}', ['uses' => 'AccountController@create', 'as' => 'create'])->where('what', 'revenue|asset|expense'); Route::get('edit/{account}', ['uses' => 'AccountController@edit', 'as' => 'edit']); - Route::get('reconcile/{account}/{start_date?}/{end_date?}', ['uses' => 'AccountController@reconcile', 'as' => 'reconcile']); Route::get('delete/{account}', ['uses' => 'AccountController@delete', 'as' => 'delete']); Route::get('show/{account}/{moment?}', ['uses' => 'AccountController@show', 'as' => 'show']); + // reconcile routes: + Route::get('reconcile/{account}/index/{start_date?}/{end_date?}', ['uses' => 'Account\ReconcileController@reconcile', 'as' => 'reconcile']); + Route::get('reconcile/{account}/transactions/{start_date?}/{end_date?}', ['uses' => 'Account\ReconcileController@transactions', 'as' => 'reconcile.transactions']); + Route::get('reconcile/{account}/overview/{start_date?}/{end_date?}', ['uses' => 'Account\ReconcileController@overview', 'as' => 'reconcile.overview']); + Route::post('reconcile/{account}/submit/{start_date?}/{end_date?}', ['uses' => 'Account\ReconcileController@submit', 'as' => 'reconcile.submit']); + Route::post('store', ['uses' => 'AccountController@store', 'as' => 'store']); Route::post('update/{account}', ['uses' => 'AccountController@update', 'as' => 'update']); Route::post('destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'destroy']); From 50e32cd5702d079718fee4ecc78ecb876bb305eb Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:15 +0100 Subject: [PATCH 161/258] New translations firefly.php (Russian) --- resources/lang/ru_RU/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index f701906aed..fcb392d864 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -619,8 +619,19 @@ return [ 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', From 6b1b41d32058914bfead90bf2bf4ffff6ccc0ce7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:24 +0100 Subject: [PATCH 162/258] New translations firefly.php (Indonesian) --- resources/lang/id_ID/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index c6b211e967..d387359f22 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -619,8 +619,19 @@ return [ 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', From 0cc33cc3f6cec68ff46df62d527628cc9f1b24c4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:33 +0100 Subject: [PATCH 163/258] New translations firefly.php (Dutch) --- resources/lang/nl_NL/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index b0908b0e94..932da53b42 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -619,8 +619,19 @@ return [ 'cash_accounts' => 'Contant geldrekeningen', 'Cash account' => 'Contant geldrekening', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'cash', 'account_type' => 'Rekeningtype', 'save_transactions_by_moving' => 'Bewaar deze transacties door ze aan een andere rekening te koppelen:', From 62b38f43cd586db85272aaf1828c3b3615ba69e9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:38 +0100 Subject: [PATCH 164/258] New translations firefly.php (French) --- resources/lang/fr_FR/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index 4b5eb2a881..4e8e52fee4 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -620,8 +620,19 @@ return [ 'cash_accounts' => 'Comptes de trésorerie', 'Cash account' => 'Compte de trésorerie', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'espèce', 'account_type' => 'Type de compte', 'save_transactions_by_moving' => 'Enregistrer ces opération(s) en les déplaçant vers un autre compte :', From 56501930b97bd2e4845981b257166ec45df8299b Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:43 +0100 Subject: [PATCH 165/258] New translations firefly.php (German) --- resources/lang/de_DE/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index e11769eaf0..56ff6d415d 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -620,8 +620,19 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'cash_accounts' => 'Bargeldkonten', 'Cash account' => 'Bargeldkonto', 'reconcile_account' => 'Konto ":account" ausgleichen', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'cash', 'account_type' => 'Kontotyp', 'save_transactions_by_moving' => 'Speichern Sie diese Transaktion(en), indem Sie sie auf ein anderes Konto verschieben:', From af6f21c4fdfeaf762822c38882873520e2e48998 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:48 +0100 Subject: [PATCH 166/258] New translations firefly.php (Spanish) --- resources/lang/es_ES/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index bc0db40ec5..093ae4c41c 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -619,8 +619,19 @@ return [ 'cash_accounts' => 'Cuentas de efectivo', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', From 683dde54b71f842a1e18a1e2acb2fcabadf84e45 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:51 +0100 Subject: [PATCH 167/258] New translations firefly.php (Slovenian) --- resources/lang/sl_SI/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index 6d25c9274f..a184096fe3 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -619,8 +619,19 @@ return [ 'cash_accounts' => 'Cash accounts', 'Cash account' => 'Cash account', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'cash', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', From f6d0aea0156b6c9f49c33e8433fc58f712d9ab80 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:53 +0100 Subject: [PATCH 168/258] New translations firefly.php (Portuguese, Brazilian) --- resources/lang/pt_BR/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 66217e96b0..28c55bffe6 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -619,8 +619,19 @@ return [ 'cash_accounts' => 'Contas Correntes', 'Cash account' => 'Conta Corrente', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'cash', 'account_type' => 'Tipo de conta', 'save_transactions_by_moving' => 'Salve essas transações, movendo-os para outra conta:', From 9fbad8df07e0f5264d3b1be66b2ba3ada264914f Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 06:30:56 +0100 Subject: [PATCH 169/258] New translations firefly.php (Polish) --- resources/lang/pl_PL/firefly.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index adaa9debdb..a5fc671de9 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -619,8 +619,19 @@ return [ 'cash_accounts' => 'Konta gotówkowe', 'Cash account' => 'Konto gotówkowe', 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'end_of_reconcile_period' => 'End of reconcile period: :period', + 'start_of_reconcile_period' => 'Start of reconcile period: :period', + 'start_balance' => 'Start balance', + 'end_balance' => 'End balance', + 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', + 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', + 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', + 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', + 'update_selection' => 'Update selection', + 'store_reconcile' => 'Store reconciliation', + 'reconcile_options' => 'Reconciliation options', + 'reconcile_range' => 'Reconciliation range', + 'start_reconcile' => 'Start reconciling', 'cash' => 'gotówka', 'account_type' => 'Typ konta', 'save_transactions_by_moving' => 'Zapisz te transakcje, przenosząc je do innego konta:', From c1259843cb3b62340f6382bd355df4d168eb3e14 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 07:18:02 +0100 Subject: [PATCH 170/258] Update language config. --- config/firefly.php | 12 +++-- crowdin.yaml | 4 -- crowdin.yml | 129 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+), 8 deletions(-) delete mode 100644 crowdin.yaml create mode 100644 crowdin.yml diff --git a/config/firefly.php b/config/firefly.php index 8ca8c90385..2a518e3e4f 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -125,16 +125,20 @@ return [ 'Cash account' => 'cash', ], 'languages' => [ + // completed languages + 'nl_NL' => ['name_locale' => 'Nederlands', 'name_english' => 'Dutch', 'complete' => true], 'de_DE' => ['name_locale' => 'Deutsch', 'name_english' => 'German', 'complete' => true], - 'es_ES' => ['name_locale' => 'Spanish', 'name_english' => 'Spanish', 'complete' => false], 'en_US' => ['name_locale' => 'English', 'name_english' => 'English', 'complete' => true], 'fr_FR' => ['name_locale' => 'Français', 'name_english' => 'French', 'complete' => true], - 'id_ID' => ['name_locale' => 'Indonesian', 'name_english' => 'Indonesian', 'complete' => false], - 'nl_NL' => ['name_locale' => 'Nederlands', 'name_english' => 'Dutch', 'complete' => true], 'pl_PL' => ['name_locale' => 'Polski', 'name_english' => 'Polish ', 'complete' => true], - 'pt_BR' => ['name_locale' => 'Português do Brasil', 'name_english' => 'Portuguese (Brazil)', 'complete' => true], + + // incomplete languages: + 'pt_BR' => ['name_locale' => 'Português do Brasil', 'name_english' => 'Portuguese (Brazil)', 'complete' => false], + 'id_ID' => ['name_locale' => 'Indonesian', 'name_english' => 'Indonesian', 'complete' => false], + 'es_ES' => ['name_locale' => 'Spanish', 'name_english' => 'Spanish', 'complete' => false], 'ru_RU' => ['name_locale' => 'Русский', 'name_english' => 'Russian', 'complete' => false], 'sl_SI' => ['name_locale' => 'Slovenščina', 'name_english' => 'Slovenian', 'complete' => false], + 'tr_TR' => ['name_locale' => 'Türkçe', 'name_english' => 'Turkish', 'complete' => false], ], 'transactionTypesByWhat' => [ 'expenses' => ['Withdrawal'], diff --git a/crowdin.yaml b/crowdin.yaml deleted file mode 100644 index 2ebe1dbabf..0000000000 --- a/crowdin.yaml +++ /dev/null @@ -1,4 +0,0 @@ -files: - - - source: /resources/lang/en_US/*.php - translation: /resources/lang/%locale_with_underscore%/%original_file_name% diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 0000000000..c4313cfa93 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,129 @@ +# +# Your crowdin's credentials +# +"api_key_env": CROWDIN_API_KEY +"project_identifier_env": CROWDIN_PROJECT_ID +"base_path_env": CROWDIN_BASE_PATH +#"base_url" : "" + +# +# Choose file structure in crowdin +# e.g. true or false +# +"preserve_hierarchy": false + +# +# Files configuration +# +files: [ + { + # + # Source files filter + # e.g. "/resources/en/*.json" + # + "source" : "", + source: "/resources/lang/en_US/*.php", + + # + # where translations live + # e.g. "/resources/%two_letters_code%/%original_file_name%" + # + "translation" : "", + translation: /resources/lang/%locale_with_underscore%/%original_file_name%, + + # + # files or directories for ignore + # e.g. ["/**/?.txt", "/**/[0-9].txt", "/**/*\?*.txt"] + # + #"ignore" : [], + + # + # The dest allows you to specify a file name on Crowdin + # e.g. "/messages.json" + # + #"dest" : "", + + # + # File type + # e.g. "json" + # + #type:"json" + + # + # The parameter "update_option" is optional. If it is not set, translations for changed strings will be lost. Useful for typo fixes and minor changes in source strings. + # e.g. "update_as_unapproved" or "update_without_changes" + # + #"update_option" : "", + + # + # Start block only for XML + # + + # + # Defines whether to translate tags attributes. + # e.g. 0 or 1 (Default is 1) + # + # "translate_attributes" : 1, + + # + # Defines whether to translate texts placed inside the tags. + # e.g. 0 or 1 (Default is 1) + # + # "translate_content" : 1, + + # + # This is an array of strings, where each item is the XPaths to DOM element that should be imported + # e.g. ["/content/text", "/content/text[@value]"] + # + # "translatable_elements" : [], + + # + # Defines whether to split long texts into smaller text segments. + # e.g. 0 or 1 (Default is 1) + # + # "content_segmentation" : 1, + + # + # End block only for XML + # + + # + # Start .properties block + # + + # + # Defines whether single quote should be escaped by another single quote or backslash in exported translations. + # e.g. 0 or 1 or 2 or 3 (Default is 3) + # 0 - do not escape single quote; + # 1 - escape single quote by another single quote; + # 2 - escape single quote by backslash; + # 3 - escape single quote by another single quote only in strings containing variables ( {0} ). + # + # "escape_quotes" : 3, + + # + # End .properties block + # + + # + # Often software projects have custom names for locale directories. crowdin-cli allows you to map your own languages to be understandable by Crowdin. + # + #"languages_mapping" : { + # "two_letters_code" : { + # "crowdin_language_code" : "local_name" + # } + #}, + + # + # Is first line contains header? + # e.g. true or false + # + #"first_line_contains_header" : true, + + # + # for spreadsheets + # e.g. "identifier,source_phrase,context,uk,ru,fr" + # + # "scheme" : "", + } +] \ No newline at end of file From 845d7d701f14bc86004f7340275b61ab4bc366d4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 10:36:50 +0100 Subject: [PATCH 171/258] Update language files. --- resources/lang/de_DE/firefly.php | 4 ++-- resources/lang/es_ES/firefly.php | 2 +- resources/lang/fr_FR/firefly.php | 4 ++-- resources/lang/id_ID/firefly.php | 2 +- resources/lang/nl_NL/firefly.php | 34 ++++++++++++++++---------------- resources/lang/nl_NL/form.php | 2 ++ resources/lang/pl_PL/firefly.php | 4 ++-- resources/lang/pt_BR/firefly.php | 4 ++-- resources/lang/ru_RU/firefly.php | 2 +- resources/lang/sl_SI/firefly.php | 2 +- 10 files changed, 31 insertions(+), 29 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 56ff6d415d..93592bc900 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -683,7 +683,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'mass_delete_journals' => 'Löschen Sie eine Reihe von Überweisungen', 'mass_edit_journals' => 'Bearbeiten Sie eine Reihe von Überweisungen', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', - 'no_budget' => 'none', + 'no_budget' => '(kein Budget)', 'perm-delete-many' => 'Das Löschen von mehreren Elementen auf einmal kann sich störend auswirken. Bitte seien Sie vorsichtig.', 'mass_deleted_transactions_success' => ':amount Überweisung(en) gelöscht.', 'mass_edited_transactions_success' => ':amount Überweisung(en) aktualisiert', @@ -861,7 +861,7 @@ Sollen zusätzlich Ihre Girokonten angezeigt werden?', 'earned' => 'Verdient', 'overspent' => 'Zuviel ausgegeben', 'left' => 'Übrig', - 'no_budget' => '(kein Budget)', + 'no_budget' => '(no budget)', 'max-amount' => 'Höchstbetrag', 'min-amount' => 'Mindestbetrag', 'journal-amount' => 'Aktueller Rechnungseintrag', diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index 093ae4c41c..2ec5979915 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -682,7 +682,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', - 'no_budget' => 'none', + 'no_budget' => '(no budget)', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index 4e8e52fee4..f2a8b095bc 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -683,7 +683,7 @@ return [ 'mass_delete_journals' => 'Supprimer un certain nombre de transactions', 'mass_edit_journals' => 'Modifier un certain nombre d’opérations', 'cannot_edit_other_fields' => 'Vous ne peut pas modifier en masse d\'autres champs que ceux ici, car il n’y a pas de place pour tous les montrer. S’il vous plaît suivez le lien et modifiez les par un par un, si vous devez modifier ces champs.', - 'no_budget' => 'aucun', + 'no_budget' => '(pas de budget)', 'perm-delete-many' => 'Supprimer de nombreux éléments en une seule fois peut être très problématique. Soyez prudent.', 'mass_deleted_transactions_success' => 'Montant des opérations supprimées : :amount.', 'mass_edited_transactions_success' => 'Montant des opérations mises à jour : :amount', @@ -861,7 +861,7 @@ return [ 'earned' => 'Gagné', 'overspent' => 'Trop dépensé', 'left' => 'Reste', - 'no_budget' => '(pas de budget)', + 'no_budget' => '(no budget)', 'max-amount' => 'Montant maximum', 'min-amount' => 'Montant minimum', 'journal-amount' => 'Entrée de facture courante', diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index d387359f22..1ccf0ac21f 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -682,7 +682,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', - 'no_budget' => 'none', + 'no_budget' => '(no budget)', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index 932da53b42..1256dfa222 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -618,21 +618,21 @@ return [ 'revenue_accounts' => 'Debiteuren', 'cash_accounts' => 'Contant geldrekeningen', 'Cash account' => 'Contant geldrekening', - 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', - 'start_balance' => 'Start balance', - 'end_balance' => 'End balance', - 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', - 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', - 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', - 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', - 'update_selection' => 'Update selection', - 'store_reconcile' => 'Store reconciliation', - 'reconcile_options' => 'Reconciliation options', - 'reconcile_range' => 'Reconciliation range', - 'start_reconcile' => 'Start reconciling', - 'cash' => 'cash', + 'reconcile_account' => 'Afstemmen betaalrekening ": account"', + 'end_of_reconcile_period' => 'Einde van verrekenperiode: :period', + 'start_of_reconcile_period' => 'Begin van verrekenperiode: :period', + 'start_balance' => 'Startsaldo', + 'end_balance' => 'Eindsaldo', + 'update_balance_dates_instruction' => 'Vergelijk de bedragen en datums hierboven met uw bankafschrift en druk op "Begin met afstemmen"', + 'select_transactions_instruction' => 'Selecteer de transacties die op je bankafschrift staan.', + 'select_range_and_balance' => 'Controleer eerst het datumbereik en de saldo\'s. Druk vervolgens op "Begin met afstemmen"', + 'date_change_instruction' => 'Als je het datumbereik nu wijzigt, gaat je voortgang verloren.', + 'update_selection' => 'Selectie bijwerken', + 'store_reconcile' => 'Afstemming opslaan', + 'reconcile_options' => 'Afstemmingsopties', + 'reconcile_range' => 'Afstemmingsbereik', + 'start_reconcile' => 'Begin met afstemmen', + 'cash' => 'contant', 'account_type' => 'Rekeningtype', 'save_transactions_by_moving' => 'Bewaar deze transacties door ze aan een andere rekening te koppelen:', 'stored_new_account' => 'Nieuwe rekening ":name" opgeslagen!', @@ -682,7 +682,7 @@ return [ 'mass_delete_journals' => 'Verwijder een aantal transacties', 'mass_edit_journals' => 'Wijzig een aantal transacties', 'cannot_edit_other_fields' => 'Je kan andere velden dan de velden die je hier ziet niet groepsgewijs wijzigen. Er is geen ruimte om ze te laten zien. Als je deze velden toch wilt wijzigen, volg dan de link naast de transactie en wijzig ze stuk voor stuk.', - 'no_budget' => 'geen', + 'no_budget' => '(geen budget)', 'perm-delete-many' => 'Veel items in één keer verwijderen kan zeer storend zijn. Wees voorzichtig.', 'mass_deleted_transactions_success' => 'Verwijder :amount transactie(s).', 'mass_edited_transactions_success' => 'Wijzig :amount transactie(s)', @@ -1022,7 +1022,7 @@ return [ 'split_this_transfer' => 'Splits deze overschrijving', 'cannot_edit_multiple_source' => 'Je kan transactie #:id met omschrijving ":description" niet splitsen, want deze bevat meerdere bronrekeningen.', 'cannot_edit_multiple_dest' => 'Je kan transactie #:id met omschrijving ":description" niet wijzigen, want deze bevat meerdere doelrekeningen.', - 'cannot_edit_reconciled' => 'You cannot edit transaction #:id with description ":description" because it has been marked as reconciled.', + 'cannot_edit_reconciled' => 'U kunt transactie #:id met omschrijving ": description" niet bewerken omdat deze is gemarkeerd als afgestemd (verrekend).', 'cannot_edit_opening_balance' => 'Je kan het startsaldo van een rekening niet wijzigen via dit scherm.', 'no_edit_multiple_left' => 'Je hebt geen geldige transacties geselecteerd.', 'cannot_convert_split_journal' => 'Kan geen gesplitste transactie omzetten', diff --git a/resources/lang/nl_NL/form.php b/resources/lang/nl_NL/form.php index 23aee16c7e..848f24e7aa 100644 --- a/resources/lang/nl_NL/form.php +++ b/resources/lang/nl_NL/form.php @@ -184,6 +184,8 @@ return [ 'csv_tab' => 'Een tab (onzichtbaar)', 'csv_delimiter' => 'CSV scheidingsteken', 'csv_import_account' => 'Standaard rekening voor importeren', + 'csv_config' => 'Configuratiebestand', + 'due_date' => 'Vervaldatum', 'payment_date' => 'Betalingsdatum', diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index a5fc671de9..55b571d572 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -682,7 +682,7 @@ return [ 'mass_delete_journals' => 'Usuń wiele transakcji', 'mass_edit_journals' => 'Modyfikuj wiele transakcji', 'cannot_edit_other_fields' => 'Nie możesz masowo modyfikować innych pól niż te tutaj, ponieważ nie ma miejsca, aby je pokazać. Proszę użyć ikony edycji i edytować je jedno po drugim, jeśli chcesz edytować te pola.', - 'no_budget' => 'żaden', + 'no_budget' => '(bez budżetu)', 'perm-delete-many' => 'Usuwanie wielu elementów jednocześnie może być bardzo destrukcyjne. Proszę zachować ostrożność.', 'mass_deleted_transactions_success' => 'Usunięto :amount transakcję(i).', 'mass_edited_transactions_success' => 'Zaktualizowano :amount transakcję(i)', @@ -860,7 +860,7 @@ return [ 'earned' => 'Zarobiono', 'overspent' => 'Przepłacono', 'left' => 'Pozostało', - 'no_budget' => '(bez budżetu)', + 'no_budget' => '(no budget)', 'max-amount' => 'Maksymalna kwota', 'min-amount' => 'Minimalna kwota', 'journal-amount' => 'Faktyczna kwota', diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 28c55bffe6..5d1ce8ee7d 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -682,7 +682,7 @@ return [ 'mass_delete_journals' => 'Excluir um número de transacções', 'mass_edit_journals' => 'Editar um número de transacções', 'cannot_edit_other_fields' => 'Você não pode editar em massa outros campos que não esse aqui, porque não há espaço para mostrá-los. Por favor siga o link e editá-los por um por um, se você precisar editar esses campos.', - 'no_budget' => 'none', + 'no_budget' => '(sem orçamento)', 'perm-delete-many' => 'Exclusão de muitos itens de uma só vez pode ser muito perturbador. Por favor, seja cauteloso.', 'mass_deleted_transactions_success' => 'Excluído :amount de transação(ões).', 'mass_edited_transactions_success' => 'Atualizado :amount de transação(ões)', @@ -860,7 +860,7 @@ return [ 'earned' => 'Ganho', 'overspent' => 'Gasto excedido', 'left' => 'Esquerda', - 'no_budget' => '(sem orçamento)', + 'no_budget' => '(no budget)', 'max-amount' => 'Maximum amount', 'min-amount' => 'Minumum amount', 'journal-amount' => 'Current bill entry', diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index fcb392d864..5ced61b508 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -682,7 +682,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', - 'no_budget' => 'none', + 'no_budget' => '(no budget)', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index a184096fe3..73394b16bb 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -682,7 +682,7 @@ return [ 'mass_delete_journals' => 'Delete a number of transactions', 'mass_edit_journals' => 'Edit a number of transactions', 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', - 'no_budget' => 'none', + 'no_budget' => '(no budget)', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', From aee17221ebe1854fc9feefe909d84ab5f21e5810 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 10:50:23 +0100 Subject: [PATCH 172/258] Code clean up. --- app/Console/Commands/CreateExport.php | 1 - app/Console/Commands/DecryptAttachment.php | 1 - app/Console/Commands/UpgradeDatabase.php | 21 +++++++++++-------- .../Commands/UpgradeFireflyInstructions.php | 6 ------ app/Console/Commands/VerifiesAccessToken.php | 1 - app/Console/Commands/VerifyDatabase.php | 19 ++++++++++------- app/Events/AdminRequestedTestMessage.php | 1 - app/Events/RequestedNewPassword.php | 1 - app/Events/StoredTransactionJournal.php | 3 --- app/Events/UpdatedTransactionJournal.php | 2 -- app/Exceptions/FireflyException.php | 4 +--- app/Exceptions/Handler.php | 2 -- app/Exceptions/NotImplementedException.php | 4 +--- app/Exceptions/ValidationException.php | 3 +-- app/Export/Collector/AttachmentCollector.php | 3 --- app/Export/Collector/BasicCollector.php | 3 --- app/Export/Collector/CollectorInterface.php | 1 - app/Export/Collector/UploadCollector.php | 1 - app/Export/Entry/Entry.php | 5 ++--- app/Export/ExpandedProcessor.php | 2 -- app/Export/Exporter/BasicExporter.php | 3 --- app/Export/Exporter/ExporterInterface.php | 1 - .../Chart/Basic/GeneratorInterface.php | 1 - .../Report/Audit/MonthReportGenerator.php | 4 ---- .../Report/Audit/MultiYearReportGenerator.php | 1 - .../Report/Audit/YearReportGenerator.php | 1 - .../Report/Budget/MonthReportGenerator.php | 1 - .../Budget/MultiYearReportGenerator.php | 1 - .../Report/Budget/YearReportGenerator.php | 1 - .../Report/Category/MonthReportGenerator.php | 11 ++++++++-- .../Category/MultiYearReportGenerator.php | 1 - .../Report/Category/YearReportGenerator.php | 1 - .../Report/ReportGeneratorInterface.php | 2 -- .../Report/Standard/MonthReportGenerator.php | 1 - .../Standard/MultiYearReportGenerator.php | 1 - .../Report/Standard/YearReportGenerator.php | 1 - app/Generator/Report/Support.php | 2 -- .../Report/Tag/MonthReportGenerator.php | 13 +++++++++--- .../Report/Tag/MultiYearReportGenerator.php | 1 - .../Report/Tag/YearReportGenerator.php | 1 - app/Handlers/Events/AdminEventHandler.php | 1 - .../Events/StoredJournalEventHandler.php | 1 - .../Events/UpdatedJournalEventHandler.php | 2 -- app/Handlers/Events/UserEventHandler.php | 1 - .../Attachments/AttachmentHelperInterface.php | 1 - app/Helpers/FiscalHelperInterface.php | 1 - 46 files changed, 47 insertions(+), 93 deletions(-) diff --git a/app/Console/Commands/CreateExport.php b/app/Console/Commands/CreateExport.php index d2c95eaa96..c991d086cd 100644 --- a/app/Console/Commands/CreateExport.php +++ b/app/Console/Commands/CreateExport.php @@ -34,7 +34,6 @@ use FireflyIII\Repositories\User\UserRepositoryInterface; use Illuminate\Console\Command; use Storage; - /** * Class CreateExport * diff --git a/app/Console/Commands/DecryptAttachment.php b/app/Console/Commands/DecryptAttachment.php index 5e9180f978..226c66c9fd 100644 --- a/app/Console/Commands/DecryptAttachment.php +++ b/app/Console/Commands/DecryptAttachment.php @@ -58,7 +58,6 @@ class DecryptAttachment extends Command public function __construct() { parent::__construct(); - } /** diff --git a/app/Console/Commands/UpgradeDatabase.php b/app/Console/Commands/UpgradeDatabase.php index 32db86834d..5a97b618f6 100644 --- a/app/Console/Commands/UpgradeDatabase.php +++ b/app/Console/Commands/UpgradeDatabase.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands; - use DB; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; @@ -93,8 +92,6 @@ class UpgradeDatabase extends Command $this->info('Firefly III database is up to date.'); return; - - } /** @@ -314,7 +311,6 @@ class UpgradeDatabase extends Command $note->save(); Log::debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id)); $meta->delete(); - } } @@ -334,7 +330,10 @@ class UpgradeDatabase extends Command if (!(intval($currency->id) === intval($journal->transaction_currency_id))) { $this->line( sprintf( - 'Transfer #%d ("%s") has been updated to use %s instead of %s.', $journal->id, $journal->description, $currency->code, + 'Transfer #%d ("%s") has been updated to use %s instead of %s.', + $journal->id, + $journal->description, + $currency->code, $journal->transactionCurrency->code ) ); @@ -423,8 +422,11 @@ class UpgradeDatabase extends Command if ($transaction->transaction_currency_id !== $currency->id && is_null($transaction->foreign_amount)) { Log::debug( sprintf( - 'Transaction #%d has a currency setting (#%d) that should be #%d. Amount remains %s, currency is changed.', $transaction->id, - $transaction->transaction_currency_id, $currency->id, $transaction->amount + 'Transaction #%d has a currency setting (#%d) that should be #%d. Amount remains %s, currency is changed.', + $transaction->id, + $transaction->transaction_currency_id, + $currency->id, + $transaction->amount ) ); $transaction->transaction_currency_id = $currency->id; @@ -483,7 +485,6 @@ class UpgradeDatabase extends Command // when both are zero, try to grab it from journal: if (is_null($opposing->foreign_amount) && is_null($transaction->foreign_amount)) { - $foreignAmount = $journal->getMeta('foreign_amount'); if (is_null($foreignAmount)) { Log::debug(sprintf('Journal #%d has missing foreign currency data, forced to do 1:1 conversion :(.', $transaction->transaction_journal_id)); @@ -497,7 +498,9 @@ class UpgradeDatabase extends Command $foreignPositive = app('steam')->positive(strval($foreignAmount)); Log::debug( sprintf( - 'Journal #%d has missing foreign currency info, try to restore from meta-data ("%s").', $transaction->transaction_journal_id, $foreignAmount + 'Journal #%d has missing foreign currency info, try to restore from meta-data ("%s").', + $transaction->transaction_journal_id, + $foreignAmount ) ); $transaction->foreign_amount = bcmul($foreignPositive, '-1'); diff --git a/app/Console/Commands/UpgradeFireflyInstructions.php b/app/Console/Commands/UpgradeFireflyInstructions.php index 8e331f8adb..18464559ef 100644 --- a/app/Console/Commands/UpgradeFireflyInstructions.php +++ b/app/Console/Commands/UpgradeFireflyInstructions.php @@ -59,7 +59,6 @@ class UpgradeFireflyInstructions extends Command */ public function handle() { - if ($this->argument('task') === 'update') { $this->updateInstructions(); } @@ -109,12 +108,10 @@ class UpgradeFireflyInstructions extends Command if (substr($version, 0, $len) === $compare) { $text = $config[$compare]; } - } $this->showLine(); $this->boxed(''); if (is_null($text)) { - $this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version)); $this->boxedInfo('There are no extra installation instructions.'); $this->boxed('Firefly III should be ready for use.'); @@ -141,7 +138,6 @@ class UpgradeFireflyInstructions extends Command } $line .= '+'; $this->line($line); - } /** @@ -159,12 +155,10 @@ class UpgradeFireflyInstructions extends Command if (substr($version, 0, $len) === $compare) { $text = $config[$compare]; } - } $this->showLine(); $this->boxed(''); if (is_null($text)) { - $this->boxed(sprintf('Thank you for updating to Firefly III, v%s', $version)); $this->boxedInfo('There are no extra upgrade instructions.'); $this->boxed('Firefly III should be ready for use.'); diff --git a/app/Console/Commands/VerifiesAccessToken.php b/app/Console/Commands/VerifiesAccessToken.php index c2d62bd594..9d1b13b863 100644 --- a/app/Console/Commands/VerifiesAccessToken.php +++ b/app/Console/Commands/VerifiesAccessToken.php @@ -77,5 +77,4 @@ trait VerifiesAccessToken return true; } - } diff --git a/app/Console/Commands/VerifyDatabase.php b/app/Console/Commands/VerifyDatabase.php index d731bb19c8..693f2f53cc 100644 --- a/app/Console/Commands/VerifyDatabase.php +++ b/app/Console/Commands/VerifyDatabase.php @@ -96,7 +96,6 @@ class VerifyDatabase extends Command $this->repairPiggyBanks(); $this->createLinkTypes(); $this->createAccessTokens(); - } /** @@ -208,7 +207,10 @@ class VerifyDatabase extends Command foreach ($set as $entry) { $line = sprintf( 'User #%d (%s) has budget #%d ("%s") which has no budget limits.', - $entry->user_id, $entry->email, $entry->id, $entry->name + $entry->user_id, + $entry->email, + $entry->id, + $entry->name ); $this->line($line); } @@ -327,7 +329,6 @@ class VerifyDatabase extends Command 'Error: Journal #' . $entry->id . ' has zero transactions. Open table "transaction_journals" and delete the entry with id #' . $entry->id ); } - } /** @@ -349,7 +350,6 @@ class VerifyDatabase extends Command /** @var stdClass $entry */ foreach ($set as $entry) { - $objName = $entry->name; try { $objName = Crypt::decrypt($objName); @@ -359,7 +359,11 @@ class VerifyDatabase extends Command $line = sprintf( 'User #%d (%s) has %s #%d ("%s") which has no transactions.', - $entry->user_id, $entry->email, $name, $entry->id, $objName + $entry->user_id, + $entry->email, + $name, + $entry->id, + $objName ); $this->line($line); } @@ -419,11 +423,10 @@ class VerifyDatabase extends Command $this->error( sprintf( 'Error: Transaction journal #%d is a %s, but has a budget. Edit it without changing anything, so the budget will be removed.', - $entry->id, $entry->transactionType->type + $entry->id, + $entry->transactionType->type ) ); } - - } } diff --git a/app/Events/AdminRequestedTestMessage.php b/app/Events/AdminRequestedTestMessage.php index e556a5ce84..0a54637908 100644 --- a/app/Events/AdminRequestedTestMessage.php +++ b/app/Events/AdminRequestedTestMessage.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Events; - use FireflyIII\User; use Illuminate\Queue\SerializesModels; use Log; diff --git a/app/Events/RequestedNewPassword.php b/app/Events/RequestedNewPassword.php index f442332fda..154eb22647 100644 --- a/app/Events/RequestedNewPassword.php +++ b/app/Events/RequestedNewPassword.php @@ -52,5 +52,4 @@ class RequestedNewPassword extends Event $this->token = $token; $this->ipAddress = $ipAddress; } - } diff --git a/app/Events/StoredTransactionJournal.php b/app/Events/StoredTransactionJournal.php index 51e07fc40b..07a18f8cdf 100644 --- a/app/Events/StoredTransactionJournal.php +++ b/app/Events/StoredTransactionJournal.php @@ -33,7 +33,6 @@ use Illuminate\Queue\SerializesModels; */ class StoredTransactionJournal extends Event { - use SerializesModels; /** @var TransactionJournal */ @@ -52,7 +51,5 @@ class StoredTransactionJournal extends Event // $this->journal = $journal; $this->piggyBankId = $piggyBankId; - } - } diff --git a/app/Events/UpdatedTransactionJournal.php b/app/Events/UpdatedTransactionJournal.php index 603fb90ae2..f83ca87595 100644 --- a/app/Events/UpdatedTransactionJournal.php +++ b/app/Events/UpdatedTransactionJournal.php @@ -33,7 +33,6 @@ use Illuminate\Queue\SerializesModels; */ class UpdatedTransactionJournal extends Event { - use SerializesModels; /** @var TransactionJournal */ @@ -49,5 +48,4 @@ class UpdatedTransactionJournal extends Event // $this->journal = $journal; } - } diff --git a/app/Exceptions/FireflyException.php b/app/Exceptions/FireflyException.php index 669dfed765..5bcde065a7 100644 --- a/app/Exceptions/FireflyException.php +++ b/app/Exceptions/FireflyException.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Exceptions; - /** * Class FireflyException * @@ -31,5 +30,4 @@ namespace FireflyIII\Exceptions; */ class FireflyException extends \Exception { - -} +} diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 47b7d3bfe7..1dc47c3053 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -39,7 +39,6 @@ use FireflyIII\Jobs\MailError; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Request; - class Handler extends ExceptionHandler { /** @@ -73,7 +72,6 @@ class Handler extends ExceptionHandler public function render($request, Exception $exception) { if ($exception instanceof FireflyException || $exception instanceof ErrorException) { - $isDebug = env('APP_DEBUG', false); return response()->view('errors.FireflyException', ['exception' => $exception, 'debug' => $isDebug], 500); diff --git a/app/Exceptions/NotImplementedException.php b/app/Exceptions/NotImplementedException.php index 3052ecd9a4..d6decc2bc7 100644 --- a/app/Exceptions/NotImplementedException.php +++ b/app/Exceptions/NotImplementedException.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Exceptions; - /** * Class NotImplementedException * @@ -31,5 +30,4 @@ namespace FireflyIII\Exceptions; */ class NotImplementedException extends \Exception { - -} +} diff --git a/app/Exceptions/ValidationException.php b/app/Exceptions/ValidationException.php index 37b99b8cd0..f46b5b1588 100644 --- a/app/Exceptions/ValidationException.php +++ b/app/Exceptions/ValidationException.php @@ -30,5 +30,4 @@ namespace FireflyIII\Exceptions; */ class ValidationException extends \Exception { - -} +} diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php index b584e272e1..0fe6ec7f9b 100644 --- a/app/Export/Collector/AttachmentCollector.php +++ b/app/Export/Collector/AttachmentCollector.php @@ -104,11 +104,9 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface $exportFile = $this->exportFileName($attachment); $this->exportDisk->put($exportFile, $decrypted); $this->getEntries()->push($exportFile); - } catch (DecryptException $e) { Log::error('Catchable error: could not decrypt attachment #' . $attachment->id . ' because: ' . $e->getMessage()); } - } return true; @@ -123,7 +121,6 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface */ private function exportFileName($attachment): string { - return sprintf('%s-Attachment nr. %s - %s', $this->job->key, strval($attachment->id), $attachment->filename); } diff --git a/app/Export/Collector/BasicCollector.php b/app/Export/Collector/BasicCollector.php index fee997d1f9..80bb64ba37 100644 --- a/app/Export/Collector/BasicCollector.php +++ b/app/Export/Collector/BasicCollector.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Export\Collector; - use FireflyIII\Models\ExportJob; use FireflyIII\User; use Illuminate\Support\Collection; @@ -82,6 +81,4 @@ class BasicCollector { $this->user = $user; } - - } diff --git a/app/Export/Collector/CollectorInterface.php b/app/Export/Collector/CollectorInterface.php index 7df33bec46..d36a76c202 100644 --- a/app/Export/Collector/CollectorInterface.php +++ b/app/Export/Collector/CollectorInterface.php @@ -57,5 +57,4 @@ interface CollectorInterface * @return mixed */ public function setJob(ExportJob $job); - } diff --git a/app/Export/Collector/UploadCollector.php b/app/Export/Collector/UploadCollector.php index e4f68e780b..732b04e750 100644 --- a/app/Export/Collector/UploadCollector.php +++ b/app/Export/Collector/UploadCollector.php @@ -116,5 +116,4 @@ class UploadCollector extends BasicCollector implements CollectorInterface return true; } - } diff --git a/app/Export/Entry/Entry.php b/app/Export/Entry/Entry.php index bbbcf4a4a6..43246627f0 100644 --- a/app/Export/Entry/Entry.php +++ b/app/Export/Entry/Entry.php @@ -122,7 +122,8 @@ final class Entry ? null : strval( round( - $transaction->transaction_foreign_amount, $transaction->foreignCurrency->decimal_places + $transaction->transaction_foreign_amount, + $transaction->foreignCurrency->decimal_places ) ); @@ -166,6 +167,4 @@ final class Entry return $entry; } - - } diff --git a/app/Export/ExpandedProcessor.php b/app/Export/ExpandedProcessor.php index 9497b5b90f..bafd575006 100644 --- a/app/Export/ExpandedProcessor.php +++ b/app/Export/ExpandedProcessor.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Export; - use Crypt; use DB; use FireflyIII\Exceptions\FireflyException; @@ -136,7 +135,6 @@ class ExpandedProcessor implements ProcessorInterface $transaction->opposing_account_number = $ibans[$opposingId]['accountNumber'] ?? ''; $transaction->opposing_account_bic = $ibans[$opposingId]['BIC'] ?? ''; $transaction->opposing_currency_code = $currencies[$opposingCurrencyId] ?? ''; - } ); diff --git a/app/Export/Exporter/BasicExporter.php b/app/Export/Exporter/BasicExporter.php index 131f9190c6..c04869286c 100644 --- a/app/Export/Exporter/BasicExporter.php +++ b/app/Export/Exporter/BasicExporter.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Export\Exporter; - use FireflyIII\Models\ExportJob; use Illuminate\Support\Collection; @@ -70,6 +69,4 @@ class BasicExporter { $this->job = $job; } - - } diff --git a/app/Export/Exporter/ExporterInterface.php b/app/Export/Exporter/ExporterInterface.php index 4bd459e056..0ef9fb12c6 100644 --- a/app/Export/Exporter/ExporterInterface.php +++ b/app/Export/Exporter/ExporterInterface.php @@ -60,5 +60,4 @@ interface ExporterInterface * @param ExportJob $job */ public function setJob(ExportJob $job); - } diff --git a/app/Generator/Chart/Basic/GeneratorInterface.php b/app/Generator/Chart/Basic/GeneratorInterface.php index 99aa255035..37b089d903 100644 --- a/app/Generator/Chart/Basic/GeneratorInterface.php +++ b/app/Generator/Chart/Basic/GeneratorInterface.php @@ -88,5 +88,4 @@ interface GeneratorInterface * @return array */ public function singleSet(string $setLabel, array $data): array; - } diff --git a/app/Generator/Report/Audit/MonthReportGenerator.php b/app/Generator/Report/Audit/MonthReportGenerator.php index d3c20331d0..809e047b6f 100644 --- a/app/Generator/Report/Audit/MonthReportGenerator.php +++ b/app/Generator/Report/Audit/MonthReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Audit; - use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Helpers\Collector\JournalCollectorInterface; @@ -52,8 +51,6 @@ class MonthReportGenerator implements ReportGeneratorInterface */ public function generate(): string { - - $auditData = []; $dayBefore = clone $this->start; $dayBefore->subDay(); @@ -81,7 +78,6 @@ class MonthReportGenerator implements ReportGeneratorInterface return view('reports.audit.report', compact('reportType', 'accountIds', 'auditData', 'hideable', 'defaultShow')) ->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts) ->render(); - } /** diff --git a/app/Generator/Report/Audit/MultiYearReportGenerator.php b/app/Generator/Report/Audit/MultiYearReportGenerator.php index 54e61d51b7..42e06b1349 100644 --- a/app/Generator/Report/Audit/MultiYearReportGenerator.php +++ b/app/Generator/Report/Audit/MultiYearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Audit; - /** * Class MultiYearReportGenerator * diff --git a/app/Generator/Report/Audit/YearReportGenerator.php b/app/Generator/Report/Audit/YearReportGenerator.php index 865970e427..d5a7d8eb82 100644 --- a/app/Generator/Report/Audit/YearReportGenerator.php +++ b/app/Generator/Report/Audit/YearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Audit; - /** * Class YearReportGenerator * diff --git a/app/Generator/Report/Budget/MonthReportGenerator.php b/app/Generator/Report/Budget/MonthReportGenerator.php index bc93bc28e6..59edfe32ab 100644 --- a/app/Generator/Report/Budget/MonthReportGenerator.php +++ b/app/Generator/Report/Budget/MonthReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Budget; - use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\Support; diff --git a/app/Generator/Report/Budget/MultiYearReportGenerator.php b/app/Generator/Report/Budget/MultiYearReportGenerator.php index 2185ee7ce6..2f49d7bd7f 100644 --- a/app/Generator/Report/Budget/MultiYearReportGenerator.php +++ b/app/Generator/Report/Budget/MultiYearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Budget; - /** * Class MultiYearReportGenerator * diff --git a/app/Generator/Report/Budget/YearReportGenerator.php b/app/Generator/Report/Budget/YearReportGenerator.php index 717c8b8371..3ac751cbc6 100644 --- a/app/Generator/Report/Budget/YearReportGenerator.php +++ b/app/Generator/Report/Budget/YearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Budget; - /** * Class YearReportGenerator * diff --git a/app/Generator/Report/Category/MonthReportGenerator.php b/app/Generator/Report/Category/MonthReportGenerator.php index 68012445f7..58f110627c 100644 --- a/app/Generator/Report/Category/MonthReportGenerator.php +++ b/app/Generator/Report/Category/MonthReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Category; - use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\Support; @@ -88,7 +87,15 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface return view( 'reports.category.month', compact( - 'accountIds', 'categoryIds', 'topIncome', 'reportType', 'accountSummary', 'categorySummary', 'averageExpenses', 'averageIncome', 'topExpenses' + 'accountIds', + 'categoryIds', + 'topIncome', + 'reportType', + 'accountSummary', + 'categorySummary', + 'averageExpenses', + 'averageIncome', + 'topExpenses' ) ) ->with('start', $this->start)->with('end', $this->end) diff --git a/app/Generator/Report/Category/MultiYearReportGenerator.php b/app/Generator/Report/Category/MultiYearReportGenerator.php index a986490ba1..c3112ce681 100644 --- a/app/Generator/Report/Category/MultiYearReportGenerator.php +++ b/app/Generator/Report/Category/MultiYearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Category; - /** * Class MultiYearReportGenerator * diff --git a/app/Generator/Report/Category/YearReportGenerator.php b/app/Generator/Report/Category/YearReportGenerator.php index 6b83a5dd76..5186ec9f50 100644 --- a/app/Generator/Report/Category/YearReportGenerator.php +++ b/app/Generator/Report/Category/YearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Category; - /** * Class YearReportGenerator * diff --git a/app/Generator/Report/ReportGeneratorInterface.php b/app/Generator/Report/ReportGeneratorInterface.php index 7f6770e896..5fecbf0e91 100644 --- a/app/Generator/Report/ReportGeneratorInterface.php +++ b/app/Generator/Report/ReportGeneratorInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report; - use Carbon\Carbon; use Illuminate\Support\Collection; @@ -80,5 +79,4 @@ interface ReportGeneratorInterface * @return ReportGeneratorInterface */ public function setTags(Collection $tags): ReportGeneratorInterface; - } diff --git a/app/Generator/Report/Standard/MonthReportGenerator.php b/app/Generator/Report/Standard/MonthReportGenerator.php index a9e5efd61e..c042e3ac13 100644 --- a/app/Generator/Report/Standard/MonthReportGenerator.php +++ b/app/Generator/Report/Standard/MonthReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Standard; - use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Helpers\Report\ReportHelperInterface; diff --git a/app/Generator/Report/Standard/MultiYearReportGenerator.php b/app/Generator/Report/Standard/MultiYearReportGenerator.php index 42c20c943b..d625767dfd 100644 --- a/app/Generator/Report/Standard/MultiYearReportGenerator.php +++ b/app/Generator/Report/Standard/MultiYearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Standard; - use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use Illuminate\Support\Collection; diff --git a/app/Generator/Report/Standard/YearReportGenerator.php b/app/Generator/Report/Standard/YearReportGenerator.php index c61e97168a..8209e6bfc8 100644 --- a/app/Generator/Report/Standard/YearReportGenerator.php +++ b/app/Generator/Report/Standard/YearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Standard; - use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use Illuminate\Support\Collection; diff --git a/app/Generator/Report/Support.php b/app/Generator/Report/Support.php index f2aec9c1c5..c4749d1cc6 100644 --- a/app/Generator/Report/Support.php +++ b/app/Generator/Report/Support.php @@ -26,7 +26,6 @@ namespace FireflyIII\Generator\Report; use FireflyIII\Models\Transaction; use Illuminate\Support\Collection; - /** * Class Support * @@ -153,5 +152,4 @@ class Support return $result; } - } diff --git a/app/Generator/Report/Tag/MonthReportGenerator.php b/app/Generator/Report/Tag/MonthReportGenerator.php index aa13b1897d..9abd0af38d 100644 --- a/app/Generator/Report/Tag/MonthReportGenerator.php +++ b/app/Generator/Report/Tag/MonthReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Tag; - use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\Support; @@ -88,8 +87,16 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface // render! return view( - 'reports.tag.month', compact( - 'accountIds', 'tagTags', 'reportType', 'accountSummary', 'tagSummary', 'averageExpenses', 'averageIncome', 'topIncome', + 'reports.tag.month', + compact( + 'accountIds', + 'tagTags', + 'reportType', + 'accountSummary', + 'tagSummary', + 'averageExpenses', + 'averageIncome', + 'topIncome', 'topExpenses' ) )->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render(); diff --git a/app/Generator/Report/Tag/MultiYearReportGenerator.php b/app/Generator/Report/Tag/MultiYearReportGenerator.php index fc57ea6545..4be4f8a7dc 100644 --- a/app/Generator/Report/Tag/MultiYearReportGenerator.php +++ b/app/Generator/Report/Tag/MultiYearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Tag; - /** * Class MultiYearReportGenerator * diff --git a/app/Generator/Report/Tag/YearReportGenerator.php b/app/Generator/Report/Tag/YearReportGenerator.php index 46a9835694..5e362745dc 100644 --- a/app/Generator/Report/Tag/YearReportGenerator.php +++ b/app/Generator/Report/Tag/YearReportGenerator.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Generator\Report\Tag; - /** * Class YearReportGenerator * diff --git a/app/Handlers/Events/AdminEventHandler.php b/app/Handlers/Events/AdminEventHandler.php index 5d4d35fca1..c08a81b9ed 100644 --- a/app/Handlers/Events/AdminEventHandler.php +++ b/app/Handlers/Events/AdminEventHandler.php @@ -44,7 +44,6 @@ class AdminEventHandler */ public function sendTestMessage(AdminRequestedTestMessage $event): bool { - $email = $event->user->email; $ipAddress = $event->ipAddress; diff --git a/app/Handlers/Events/StoredJournalEventHandler.php b/app/Handlers/Events/StoredJournalEventHandler.php index c8ec8c84c2..51cb16b375 100644 --- a/app/Handlers/Events/StoredJournalEventHandler.php +++ b/app/Handlers/Events/StoredJournalEventHandler.php @@ -137,7 +137,6 @@ class StoredJournalEventHandler $rules = $this->ruleGroupRepository->getActiveStoreRules($group); /** @var Rule $rule */ foreach ($rules as $rule) { - $processor = Processor::make($rule); $processor->handleTransactionJournal($journal); diff --git a/app/Handlers/Events/UpdatedJournalEventHandler.php b/app/Handlers/Events/UpdatedJournalEventHandler.php index 775ad01e7a..beca510fd2 100644 --- a/app/Handlers/Events/UpdatedJournalEventHandler.php +++ b/app/Handlers/Events/UpdatedJournalEventHandler.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; - use FireflyIII\Events\UpdatedTransactionJournal; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleGroup; @@ -77,7 +76,6 @@ class UpdatedJournalEventHandler if ($rule->stop_processing) { break; } - } } diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index f110737aef..8f3379f2c5 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -152,7 +152,6 @@ class UserEventHandler */ public function sendRegistrationMail(RegisteredUser $event) { - $sendMail = env('SEND_REGISTRATION_MAIL', true); if (!$sendMail) { return true; // @codeCoverageIgnore diff --git a/app/Helpers/Attachments/AttachmentHelperInterface.php b/app/Helpers/Attachments/AttachmentHelperInterface.php index d439845694..4d398739dd 100644 --- a/app/Helpers/Attachments/AttachmentHelperInterface.php +++ b/app/Helpers/Attachments/AttachmentHelperInterface.php @@ -66,5 +66,4 @@ interface AttachmentHelperInterface * @return bool */ public function saveAttachmentsForModel(Model $model, ?array $files): bool; - } diff --git a/app/Helpers/FiscalHelperInterface.php b/app/Helpers/FiscalHelperInterface.php index 9539b2b54e..152ba48262 100644 --- a/app/Helpers/FiscalHelperInterface.php +++ b/app/Helpers/FiscalHelperInterface.php @@ -52,5 +52,4 @@ interface FiscalHelperInterface * @return Carbon date object */ public function startOfFiscalYear(Carbon $date): Carbon; - } From 649dca77f53dc82d43a0652b048555b923d228a1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 10:52:29 +0100 Subject: [PATCH 173/258] Code clean up. --- app/Helpers/Chart/MetaPieChart.php | 2 - app/Helpers/Chart/MetaPieChartInterface.php | 1 - app/Helpers/Collection/Balance.php | 2 - app/Helpers/Collection/BalanceEntry.php | 2 - app/Helpers/Collection/BalanceHeader.php | 2 - app/Helpers/Collection/BalanceLine.php | 2 - app/Helpers/Collection/Bill.php | 2 - app/Helpers/Collection/BillLine.php | 2 - app/Helpers/Collection/Category.php | 3 - app/Helpers/Collector/JournalCollector.php | 18 +- app/Helpers/Filter/FilterInterface.php | 2 - app/Helpers/Filter/InternalTransferFilter.php | 10 +- app/Helpers/Filter/OpposingAccountFilter.php | 1 - app/Helpers/Help/Help.php | 2 - app/Helpers/Report/BalanceReportHelper.php | 8 +- .../Report/BalanceReportHelperInterface.php | 1 - app/Helpers/Report/BudgetReportHelper.php | 2 - .../Report/BudgetReportHelperInterface.php | 2 - app/Helpers/Report/ReportHelper.php | 1 - app/Helpers/Report/ReportHelperInterface.php | 1 - .../Account/ReconcileController.php | 23 +- app/Http/Controllers/AccountController.php | 15 +- .../Admin/ConfigurationController.php | 4 - app/Http/Controllers/Admin/HomeController.php | 2 - app/Http/Controllers/Admin/LinkController.php | 2 - app/Http/Controllers/Admin/UserController.php | 13 +- app/Http/Controllers/AttachmentController.php | 3 - .../Auth/ForgotPasswordController.php | 1 - app/Http/Controllers/Auth/LoginController.php | 11 +- .../Controllers/Auth/RegisterController.php | 3 +- .../Controllers/Auth/TwoFactorController.php | 2 - app/Http/Controllers/BillController.php | 3 - app/Http/Controllers/BudgetController.php | 28 +- app/Http/Controllers/CategoryController.php | 3 - .../Controllers/Chart/AccountController.php | 3 - .../Controllers/Chart/BudgetController.php | 3 - .../Chart/BudgetReportController.php | 3 - .../Controllers/Chart/CategoryController.php | 5 - .../Chart/CategoryReportController.php | 2 - .../Controllers/Chart/PiggyBankController.php | 2 - .../Controllers/Chart/ReportController.php | 10 +- .../Controllers/Chart/TagReportController.php | 2 - app/Http/Controllers/Controller.php | 3 - app/Http/Controllers/CurrencyController.php | 3 - app/Http/Controllers/ExportController.php | 2 - app/Http/Controllers/HelpController.php | 5 - app/Http/Controllers/HomeController.php | 27 +- .../Controllers/Import/BankController.php | 6 - .../Controllers/Import/FileController.php | 3 - app/Http/Controllers/ImportController.php | 1 - app/Http/Controllers/JavascriptController.php | 1 - .../Json/AutoCompleteController.php | 3 - app/Http/Controllers/Json/BoxController.php | 2 - .../Controllers/Json/ExchangeController.php | 2 - .../Controllers/Json/FrontpageController.php | 2 - app/Http/Controllers/Json/IntroController.php | 2 - .../Json/TransactionController.php | 2 - app/Http/Controllers/JsonController.php | 2 - app/Http/Controllers/NewUserController.php | 4 - app/Http/Controllers/PiggyBankController.php | 14 +- .../Controllers/Popup/ReportController.php | 5 - .../Controllers/PreferencesController.php | 16 +- app/Http/Controllers/ProfileController.php | 6 +- .../Controllers/Report/AccountController.php | 1 - .../Controllers/Report/BalanceController.php | 1 - .../Controllers/Report/BudgetController.php | 2 - .../Controllers/Report/CategoryController.php | 3 - .../Report/OperationsController.php | 11 +- app/Http/Controllers/ReportController.php | 24 +- app/Http/Controllers/RuleController.php | 26 +- app/Http/Controllers/RuleGroupController.php | 5 - app/Http/Controllers/SearchController.php | 4 - app/Http/Controllers/TagController.php | 5 - .../Transaction/ConvertController.php | 15 +- .../Transaction/LinkController.php | 9 +- .../Transaction/MassController.php | 6 +- .../Transaction/SingleController.php | 4 - .../Transaction/SplitController.php | 19 +- .../Controllers/TransactionController.php | 5 - app/Http/Kernel.php | 1 - app/Http/Middleware/Binder.php | 1 - app/Http/Middleware/Range.php | 4 - .../RedirectIfTwoFactorAuthenticated.php | 2 - app/Http/Middleware/Sandstorm.php | 1 - app/Http/Middleware/StartFireflySession.php | 1 - app/Http/Requests/ImportUploadRequest.php | 1 - app/Http/Requests/PiggyBankFormRequest.php | 1 - app/Http/Requests/ReportFormRequest.php | 1 - app/Http/Requests/TagFormRequest.php | 2 - app/Http/breadcrumbs.php | 1119 +++++++++-------- .../Configurator/ConfiguratorInterface.php | 1 - app/Import/Configurator/CsvConfigurator.php | 1 - app/Import/Converter/Amount.php | 1 - app/Import/Converter/INGDebetCredit.php | 1 - app/Import/FileProcessor/CsvProcessor.php | 3 - app/Import/Mapper/AssetAccountIbans.php | 1 - app/Import/Mapper/AssetAccounts.php | 1 - app/Import/Mapper/Bills.php | 1 - app/Import/Mapper/Budgets.php | 2 - app/Import/Mapper/Categories.php | 2 - app/Import/Mapper/Tags.php | 1 - app/Import/Mapper/TransactionCurrencies.php | 1 - .../PreProcessorInterface.php | 1 - app/Import/Object/ImportAccount.php | 12 +- app/Import/Object/ImportBill.php | 4 - app/Import/Object/ImportBudget.php | 5 - app/Import/Object/ImportCategory.php | 5 - app/Import/Object/ImportCurrency.php | 6 - app/Import/Object/ImportJournal.php | 1 - app/Import/Routine/ImportRoutine.php | 3 +- app/Import/Specifics/AbnAmroDescription.php | 5 - app/Import/Specifics/IngDescription.php | 1 - app/Import/Specifics/PresidentsChoice.php | 2 - app/Import/Specifics/RabobankDescription.php | 3 +- app/Import/Specifics/SpecificInterface.php | 1 - app/Import/Storage/ImportStorage.php | 4 +- app/Import/Storage/ImportSupport.php | 26 +- ...ExecuteRuleGroupOnExistingTransactions.php | 4 +- .../ExecuteRuleOnExistingTransactions.php | 2 - app/Jobs/Job.php | 1 - app/Jobs/MailError.php | 3 +- app/Mail/ConfirmEmailChangeMail.php | 1 - app/Mail/UndoEmailChangeMail.php | 1 - app/Models/Account.php | 11 +- app/Models/AccountMeta.php | 1 - app/Models/Attachment.php | 2 - app/Models/AvailableBudget.php | 1 - app/Models/Bill.php | 5 - app/Models/Budget.php | 5 - app/Models/BudgetLimit.php | 1 - app/Models/Category.php | 3 - app/Models/Configuration.php | 2 - app/Models/CurrencyExchangeRate.php | 2 - app/Models/ImportJob.php | 2 - app/Models/LimitRepetition.php | 1 - app/Models/LinkType.php | 2 - app/Models/Note.php | 1 - app/Models/PiggyBank.php | 3 - app/Models/PiggyBankEvent.php | 1 - app/Models/PiggyBankRepetition.php | 2 - app/Models/Preference.php | 1 - app/Models/Role.php | 2 - app/Models/Rule.php | 1 - app/Models/Tag.php | 3 - app/Models/TransactionJournal.php | 3 - app/Models/TransactionJournalLink.php | 3 - app/Models/TransactionJournalMeta.php | 1 - app/Models/TransactionType.php | 1 - app/Providers/AdminServiceProvider.php | 4 - app/Providers/CategoryServiceProvider.php | 1 - app/Providers/CurrencyServiceProvider.php | 1 - app/Providers/EventServiceProvider.php | 2 - app/Providers/ExportJobServiceProvider.php | 3 - app/Providers/FireflyServiceProvider.php | 43 +- app/Providers/FireflySessionProvider.php | 20 +- app/Providers/JournalServiceProvider.php | 2 - app/Providers/LogServiceProvider.php | 3 +- app/Providers/PiggyBankServiceProvider.php | 1 - app/Providers/RuleGroupServiceProvider.php | 1 - .../Account/AccountRepository.php | 19 +- .../Account/AccountRepositoryInterface.php | 1 - .../Account/AccountTaskerInterface.php | 1 - .../Account/FindAccountsTrait.php | 1 - .../Attachment/AttachmentRepository.php | 2 - .../AttachmentRepositoryInterface.php | 1 - app/Repositories/Bill/BillRepository.php | 21 +- .../Bill/BillRepositoryInterface.php | 1 - app/Repositories/Budget/BudgetRepository.php | 3 - .../Budget/BudgetRepositoryInterface.php | 1 - .../Category/CategoryRepository.php | 1 - .../Currency/CurrencyRepository.php | 3 - .../Currency/CurrencyRepositoryInterface.php | 2 - .../ExportJob/ExportJobRepository.php | 2 - .../ExportJobRepositoryInterface.php | 1 - .../ImportJob/ImportJobRepository.php | 4 +- .../Journal/CreateJournalsTrait.php | 2 - .../Journal/JournalRepository.php | 3 - .../Journal/JournalRepositoryInterface.php | 1 - app/Repositories/Journal/JournalTasker.php | 7 +- .../Journal/JournalTaskerInterface.php | 1 - .../Journal/SupportJournalsTrait.php | 1 - .../Journal/UpdateJournalsTrait.php | 2 - .../LinkType/LinkTypeRepository.php | 3 - .../LinkType/LinkTypeRepositoryInterface.php | 1 - .../PiggyBank/PiggyBankRepository.php | 2 - app/Repositories/Rule/RuleRepository.php | 2 - .../Rule/RuleRepositoryInterface.php | 1 - .../RuleGroup/RuleGroupRepository.php | 5 - .../RuleGroupRepositoryInterface.php | 3 - app/Repositories/Tag/TagRepository.php | 4 - .../Tag/TagRepositoryInterface.php | 1 - app/Repositories/User/UserRepository.php | 1 - .../User/UserRepositoryInterface.php | 1 - app/Services/Bunq/Id/BunqId.php | 2 - app/Services/Bunq/Id/DeviceServerId.php | 2 - app/Services/Bunq/Id/DeviceSessionId.php | 2 - app/Services/Bunq/Id/InstallationId.php | 2 - app/Services/Bunq/Object/Alias.php | 2 - app/Services/Bunq/Object/Amount.php | 2 - app/Services/Bunq/Object/Avatar.php | 1 - app/Services/Bunq/Object/BunqObject.php | 1 - app/Services/Bunq/Object/DeviceServer.php | 3 - .../Bunq/Object/MonetaryAccountBank.php | 1 - .../Bunq/Object/MonetaryAccountProfile.php | 1 - .../Bunq/Object/MonetaryAccountSetting.php | 2 - .../Bunq/Object/NotificationFilter.php | 1 - app/Services/Bunq/Object/ServerPublicKey.php | 2 - app/Services/Bunq/Object/UserCompany.php | 3 - app/Services/Bunq/Object/UserLight.php | 1 - app/Services/Bunq/Object/UserPerson.php | 2 - .../Bunq/Request/DeviceSessionRequest.php | 3 - .../Bunq/Request/InstallationTokenRequest.php | 2 - .../Request/ListMonetaryAccountRequest.php | 1 - app/Services/Bunq/Token/BunqToken.php | 2 - app/Services/Bunq/Token/InstallationToken.php | 2 - app/Services/Bunq/Token/SessionToken.php | 1 - .../Currency/ExchangeRateInterface.php | 2 - app/Services/Currency/FixerIO.php | 1 - app/Services/Password/Verifier.php | 1 - app/Support/Amount.php | 6 - app/Support/Binder/AccountList.php | 3 - app/Support/Binder/BinderInterface.php | 1 - app/Support/Binder/BudgetList.php | 1 - app/Support/Binder/UnfinishedJournal.php | 1 - app/Support/CacheProperties.php | 1 - app/Support/Domain.php | 1 - app/Support/Events/BillScanner.php | 2 - app/Support/ExpandedForm.php | 8 - app/Support/Facades/Amount.php | 1 - app/Support/Facades/ExpandedForm.php | 1 - app/Support/Facades/FireflyConfig.php | 1 - app/Support/Facades/Navigation.php | 1 - app/Support/Facades/Preferences.php | 1 - app/Support/Facades/Steam.php | 1 - app/Support/FireflyConfig.php | 2 - .../Configuration/ConfigurationInterface.php | 1 - app/Support/Import/Configuration/Csv/Map.php | 4 - .../Import/Configuration/Csv/Roles.php | 3 - .../Import/Information/BunqInformation.php | 2 - .../Prerequisites/BunqPrerequisites.php | 2 - .../Prerequisites/PrerequisitesInterface.php | 1 - .../Models/TransactionJournalTrait.php | 3 - app/Support/Navigation.php | 9 - app/Support/Preferences.php | 3 - app/Support/Search/Modifier.php | 2 - app/Support/Search/Search.php | 4 - app/Support/SingleCacheProperties.php | 1 - app/Support/Steam.php | 5 - app/Support/Twig/AmountFormat.php | 173 ++- app/Support/Twig/Extension/Transaction.php | 7 +- .../Twig/Extension/TransactionJournal.php | 4 +- app/Support/Twig/General.php | 143 ++- app/Support/Twig/Journal.php | 192 ++- .../Twig/Loader/TransactionJournalLoader.php | 1 - app/Support/Twig/Loader/TransactionLoader.php | 1 - app/Support/Twig/PiggyBank.php | 14 +- app/Support/Twig/Rule.php | 55 +- app/Support/Twig/Translation.php | 31 +- app/TransactionRules/Actions/AddTag.php | 1 - .../Actions/AppendDescription.php | 1 - app/TransactionRules/Actions/AppendNotes.php | 1 - app/TransactionRules/Actions/ClearBudget.php | 1 - .../Actions/ClearCategory.php | 2 - app/TransactionRules/Actions/ClearNotes.php | 1 - .../Actions/PrependDescription.php | 1 - app/TransactionRules/Actions/PrependNotes.php | 1 - .../Actions/RemoveAllTags.php | 2 - app/TransactionRules/Actions/RemoveTag.php | 2 - app/TransactionRules/Actions/SetBudget.php | 6 +- app/TransactionRules/Actions/SetCategory.php | 2 - .../Actions/SetDescription.php | 4 +- .../Actions/SetDestinationAccount.php | 5 +- app/TransactionRules/Actions/SetNotes.php | 1 - .../Actions/SetSourceAccount.php | 5 +- app/TransactionRules/Processor.php | 7 - app/TransactionRules/TransactionMatcher.php | 5 - .../Triggers/AbstractTrigger.php | 3 - .../Triggers/AmountExactly.php | 2 - app/TransactionRules/Triggers/AmountLess.php | 2 - app/TransactionRules/Triggers/AmountMore.php | 2 - app/TransactionRules/Triggers/BudgetIs.php | 5 +- app/TransactionRules/Triggers/CategoryIs.php | 5 +- .../Triggers/DescriptionContains.php | 2 - .../Triggers/DescriptionEnds.php | 1 - .../Triggers/DescriptionIs.php | 1 - .../Triggers/FromAccountContains.php | 6 +- .../Triggers/FromAccountEnds.php | 1 - .../Triggers/FromAccountIs.php | 1 - .../Triggers/HasAnyBudget.php | 1 - .../Triggers/HasAnyCategory.php | 1 - app/TransactionRules/Triggers/HasAnyTag.php | 1 - .../Triggers/HasAttachment.php | 6 +- app/TransactionRules/Triggers/HasNoBudget.php | 1 - .../Triggers/HasNoCategory.php | 1 - app/TransactionRules/Triggers/HasNoTag.php | 1 - app/TransactionRules/Triggers/NotesAny.php | 1 - app/TransactionRules/Triggers/NotesAre.php | 1 - .../Triggers/NotesContain.php | 3 - app/TransactionRules/Triggers/NotesEmpty.php | 1 - app/TransactionRules/Triggers/NotesEnd.php | 1 - app/TransactionRules/Triggers/NotesStart.php | 2 - .../Triggers/ToAccountContains.php | 5 +- app/TransactionRules/Triggers/ToAccountIs.php | 1 - .../Triggers/ToAccountStarts.php | 1 - app/Validation/FireflyValidator.php | 8 - 305 files changed, 1200 insertions(+), 1600 deletions(-) diff --git a/app/Helpers/Chart/MetaPieChart.php b/app/Helpers/Chart/MetaPieChart.php index d2ed458bd3..4950e9f855 100644 --- a/app/Helpers/Chart/MetaPieChart.php +++ b/app/Helpers/Chart/MetaPieChart.php @@ -133,7 +133,6 @@ class MetaPieChart implements MetaPieChartInterface } return $chartData; - } /** @@ -342,7 +341,6 @@ class MetaPieChart implements MetaPieChartInterface } return $chartData; - } /** diff --git a/app/Helpers/Chart/MetaPieChartInterface.php b/app/Helpers/Chart/MetaPieChartInterface.php index 0aede8b59f..cc15e17308 100644 --- a/app/Helpers/Chart/MetaPieChartInterface.php +++ b/app/Helpers/Chart/MetaPieChartInterface.php @@ -97,5 +97,4 @@ interface MetaPieChartInterface * @return MetaPieChartInterface */ public function setUser(User $user): MetaPieChartInterface; - } diff --git a/app/Helpers/Collection/Balance.php b/app/Helpers/Collection/Balance.php index 63a4ffa878..aef2709026 100644 --- a/app/Helpers/Collection/Balance.php +++ b/app/Helpers/Collection/Balance.php @@ -87,6 +87,4 @@ class Balance { $this->balanceLines = $balanceLines; } - - } diff --git a/app/Helpers/Collection/BalanceEntry.php b/app/Helpers/Collection/BalanceEntry.php index a601c2571e..e67a11e7de 100644 --- a/app/Helpers/Collection/BalanceEntry.php +++ b/app/Helpers/Collection/BalanceEntry.php @@ -89,6 +89,4 @@ class BalanceEntry { $this->spent = $spent; } - - } diff --git a/app/Helpers/Collection/BalanceHeader.php b/app/Helpers/Collection/BalanceHeader.php index 5908343073..7a6746997c 100644 --- a/app/Helpers/Collection/BalanceHeader.php +++ b/app/Helpers/Collection/BalanceHeader.php @@ -61,6 +61,4 @@ class BalanceHeader { return $this->accounts; } - - } diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index f5c456056a..e9673eb680 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -36,7 +36,6 @@ use Illuminate\Support\Collection; */ class BalanceLine { - const ROLE_DEFAULTROLE = 1; const ROLE_TAGROLE = 2; const ROLE_DIFFROLE = 3; @@ -57,7 +56,6 @@ class BalanceLine public function __construct() { $this->balanceEntries = new Collection; - } /** diff --git a/app/Helpers/Collection/Bill.php b/app/Helpers/Collection/Bill.php index de8eff5c2f..e79ce41076 100644 --- a/app/Helpers/Collection/Bill.php +++ b/app/Helpers/Collection/Bill.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Collection; - use Carbon\Carbon; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use Illuminate\Support\Collection; @@ -132,5 +131,4 @@ class Bill { $this->startDate = $startDate; } - } diff --git a/app/Helpers/Collection/BillLine.php b/app/Helpers/Collection/BillLine.php index 9359d2db1c..a82f8fb289 100644 --- a/app/Helpers/Collection/BillLine.php +++ b/app/Helpers/Collection/BillLine.php @@ -177,6 +177,4 @@ class BillLine { $this->hit = $hit; } - - } diff --git a/app/Helpers/Collection/Category.php b/app/Helpers/Collection/Category.php index c9e551cf32..9bb918cb5e 100644 --- a/app/Helpers/Collection/Category.php +++ b/app/Helpers/Collection/Category.php @@ -26,7 +26,6 @@ namespace FireflyIII\Helpers\Collection; use FireflyIII\Models\Category as CategoryModel; use Illuminate\Support\Collection; - /** * * Class Category @@ -91,6 +90,4 @@ class Category { return $this->total; } - - } diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php index 62bc80789f..2a281c1a9b 100644 --- a/app/Helpers/Collector/JournalCollector.php +++ b/app/Helpers/Collector/JournalCollector.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Collector; - use Carbon\Carbon; use DB; use FireflyIII\Exceptions\FireflyException; @@ -265,8 +264,6 @@ class JournalCollector implements JournalCollectorInterface $transaction->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name); $transaction->account_iban = app('steam')->tryDecrypt($transaction->account_iban); $transaction->opposing_account_iban = app('steam')->tryDecrypt($transaction->opposing_account_iban); - - } ); @@ -390,7 +387,6 @@ class JournalCollector implements JournalCollectorInterface } return $this; - } /** @@ -630,7 +626,6 @@ class JournalCollector implements JournalCollectorInterface ->orderBy('transactions.amount', 'DESC'); $this->query = $query; - } /** @@ -648,7 +643,6 @@ class JournalCollector implements JournalCollectorInterface */ public function withCategoryInformation(): JournalCollectorInterface { - $this->joinCategoryTables(); return $this; @@ -760,7 +754,10 @@ class JournalCollector implements JournalCollectorInterface $this->joinedCategory = true; $this->query->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id'); $this->query->leftJoin( - 'categories as transaction_journal_categories', 'transaction_journal_categories.id', '=', 'category_transaction_journal.category_id' + 'categories as transaction_journal_categories', + 'transaction_journal_categories.id', + '=', + 'category_transaction_journal.category_id' ); $this->query->leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id'); @@ -785,11 +782,12 @@ class JournalCollector implements JournalCollectorInterface Log::debug('joinedOpposing is false'); // join opposing transaction (hard): $this->query->leftJoin( - 'transactions as opposing', function (JoinClause $join) { - $join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id') + 'transactions as opposing', + function (JoinClause $join) { + $join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id') ->where('opposing.identifier', '=', DB::raw('transactions.identifier')) ->where('opposing.amount', '=', DB::raw('transactions.amount * -1')); - } + } ); $this->query->leftJoin('accounts as opposing_accounts', 'opposing.account_id', '=', 'opposing_accounts.id'); $this->query->leftJoin('account_types as opposing_account_types', 'opposing_accounts.account_type_id', '=', 'opposing_account_types.id'); diff --git a/app/Helpers/Filter/FilterInterface.php b/app/Helpers/Filter/FilterInterface.php index 8ce5290fa8..24e3362a32 100644 --- a/app/Helpers/Filter/FilterInterface.php +++ b/app/Helpers/Filter/FilterInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Filter; - use Illuminate\Support\Collection; interface FilterInterface @@ -34,5 +33,4 @@ interface FilterInterface * @return Collection */ public function filter(Collection $set): Collection; - } diff --git a/app/Helpers/Filter/InternalTransferFilter.php b/app/Helpers/Filter/InternalTransferFilter.php index 8020ec04c9..2f72d22f30 100644 --- a/app/Helpers/Filter/InternalTransferFilter.php +++ b/app/Helpers/Filter/InternalTransferFilter.php @@ -68,18 +68,18 @@ class InternalTransferFilter implements FilterInterface Log::debug( sprintf( 'Transaction #%d has #%d and #%d in set, so removed', - $transaction->id, $transaction->account_id, $transaction->opposing_account_id - ), $this->accounts + $transaction->id, + $transaction->account_id, + $transaction->opposing_account_id + ), + $this->accounts ); return false; } return $transaction; - } ); - - } } diff --git a/app/Helpers/Filter/OpposingAccountFilter.php b/app/Helpers/Filter/OpposingAccountFilter.php index 2829d4ff52..df02f9405a 100644 --- a/app/Helpers/Filter/OpposingAccountFilter.php +++ b/app/Helpers/Filter/OpposingAccountFilter.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Filter; - use FireflyIII\Models\Transaction; use Illuminate\Support\Collection; use Log; diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index 9f8a91f3f3..9a27a368c4 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -62,7 +62,6 @@ class Help implements HelpInterface */ public function getFromGithub(string $route, string $language): string { - $uri = sprintf('https://raw.githubusercontent.com/firefly-iii/help/master/%s/%s.md', $language, $route); Log::debug(sprintf('Trying to get %s...', $uri)); $opt = ['useragent' => $this->userAgent]; @@ -119,7 +118,6 @@ class Help implements HelpInterface } return $result; - } /** diff --git a/app/Helpers/Report/BalanceReportHelper.php b/app/Helpers/Report/BalanceReportHelper.php index 4a9f322968..244ab9be70 100644 --- a/app/Helpers/Report/BalanceReportHelper.php +++ b/app/Helpers/Report/BalanceReportHelper.php @@ -114,7 +114,10 @@ class BalanceReportHelper implements BalanceReportHelperInterface $balanceEntry = new BalanceEntry; $balanceEntry->setAccount($account); $spent = $this->budgetRepository->spentInPeriod( - new Collection([$budgetLimit->budget]), new Collection([$account]), $budgetLimit->start_date, $budgetLimit->end_date + new Collection([$budgetLimit->budget]), + new Collection([$account]), + $budgetLimit->start_date, + $budgetLimit->end_date ); $balanceEntry->setSpent($spent); $line->addBalanceEntry($balanceEntry); @@ -142,7 +145,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface $budgetEntry->setAccount($account); $budgetEntry->setSpent($spent); $empty->addBalanceEntry($budgetEntry); - } return $empty; @@ -176,7 +178,5 @@ class BalanceReportHelper implements BalanceReportHelperInterface $balance->setBalanceLines($newSet); return $balance; - } - } diff --git a/app/Helpers/Report/BalanceReportHelperInterface.php b/app/Helpers/Report/BalanceReportHelperInterface.php index 9fd6b5858f..9aa17f589f 100644 --- a/app/Helpers/Report/BalanceReportHelperInterface.php +++ b/app/Helpers/Report/BalanceReportHelperInterface.php @@ -27,7 +27,6 @@ use Carbon\Carbon; use FireflyIII\Helpers\Collection\Balance; use Illuminate\Support\Collection; - /** * Interface BalanceReportHelperInterface * diff --git a/app/Helpers/Report/BudgetReportHelper.php b/app/Helpers/Report/BudgetReportHelper.php index 7865f0203e..07d4cda721 100644 --- a/app/Helpers/Report/BudgetReportHelper.php +++ b/app/Helpers/Report/BudgetReportHelper.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Report; - use Carbon\Carbon; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; @@ -163,6 +162,5 @@ class BudgetReportHelper implements BudgetReportHelperInterface $array['expenses'] = $expenses; return $array; - } } diff --git a/app/Helpers/Report/BudgetReportHelperInterface.php b/app/Helpers/Report/BudgetReportHelperInterface.php index 3ba574bd5d..3c86a0fd12 100644 --- a/app/Helpers/Report/BudgetReportHelperInterface.php +++ b/app/Helpers/Report/BudgetReportHelperInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Report; - use Carbon\Carbon; use Illuminate\Support\Collection; @@ -52,5 +51,4 @@ interface BudgetReportHelperInterface * @return Collection */ public function getBudgetsWithExpenses(Carbon $start, Carbon $end, Collection $accounts): Collection; - } diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 18d1558e6d..c355f65821 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -153,5 +153,4 @@ class ReportHelper implements ReportHelperInterface return $months; } - } diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php index a12950234a..98e26667ad 100644 --- a/app/Helpers/Report/ReportHelperInterface.php +++ b/app/Helpers/Report/ReportHelperInterface.php @@ -57,5 +57,4 @@ interface ReportHelperInterface * @return array */ public function listOfMonths(Carbon $date): array; - } diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php index 2ef5905eeb..0d5f9a58cb 100644 --- a/app/Http/Controllers/Account/ReconcileController.php +++ b/app/Http/Controllers/Account/ReconcileController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; - use Carbon\Carbon; use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Http\Controllers\Controller; @@ -84,7 +83,6 @@ class ReconcileController extends Controller $return['html'] = view('accounts.reconcile.overview', compact('account', 'start', 'end'))->render(); return Response::json($return); - } /** @@ -132,9 +130,21 @@ class ReconcileController extends Controller $indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']); return view( - 'accounts.reconcile.index', compact( - 'account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance', 'transactionsUri', - 'selectionStart', 'selectionEnd', 'overviewUri', 'indexUri' + 'accounts.reconcile.index', + compact( + 'account', + 'currency', + 'subTitleIcon', + 'start', + 'end', + 'subTitle', + 'startBalance', + 'endBalance', + 'transactionsUri', + 'selectionStart', + 'selectionEnd', + 'overviewUri', + 'indexUri' ) ); } @@ -169,5 +179,4 @@ class ReconcileController extends Controller return Response::json(['html' => $html]); } - -} \ No newline at end of file +} diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index ecd68c0b91..0162b01c55 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -103,7 +103,6 @@ class AccountController extends Controller $request->session()->flash('gaEventAction', 'create-' . $what); return view('accounts.create', compact('subTitleIcon', 'what', 'subTitle', 'currencySelectList', 'allCurrencies', 'roles')); - } /** @@ -208,8 +207,17 @@ class AccountController extends Controller $request->session()->flash('gaEventAction', 'edit-' . $what); return view( - 'accounts.edit', compact( - 'allCurrencies', 'currencySelectList', 'account', 'currency', 'subTitle', 'subTitleIcon', 'what', 'roles', 'preFilled' + 'accounts.edit', + compact( + 'allCurrencies', + 'currencySelectList', + 'account', + 'currency', + 'subTitle', + 'subTitleIcon', + 'what', + 'roles', + 'preFilled' ) ); } @@ -386,7 +394,6 @@ class AccountController extends Controller // redirect to previous URL. return redirect($this->getPreviousUri('accounts.edit.uri')); - } diff --git a/app/Http/Controllers/Admin/ConfigurationController.php b/app/Http/Controllers/Admin/ConfigurationController.php index 3948ecbe01..1be473766c 100644 --- a/app/Http/Controllers/Admin/ConfigurationController.php +++ b/app/Http/Controllers/Admin/ConfigurationController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; - use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\ConfigurationRequest; use FireflyIII\Support\Facades\FireflyConfig; @@ -55,7 +54,6 @@ class ConfigurationController extends Controller return $next($request); } ); - } /** @@ -76,7 +74,6 @@ class ConfigurationController extends Controller 'admin.configuration.index', compact('subTitle', 'subTitleIcon', 'singleUserMode', 'isDemoSite', 'siteOwner') ); - } /** @@ -99,5 +96,4 @@ class ConfigurationController extends Controller return Redirect::route('admin.configuration.index'); } - } diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index a801448374..1c25ae67d1 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; - use FireflyIII\Events\AdminRequestedTestMessage; use FireflyIII\Http\Controllers\Controller; use Illuminate\Http\Request; @@ -62,5 +61,4 @@ class HomeController extends Controller return redirect(route('admin.index')); } - } diff --git a/app/Http/Controllers/Admin/LinkController.php b/app/Http/Controllers/Admin/LinkController.php index 4b11b5a7be..ee25cab6a7 100644 --- a/app/Http/Controllers/Admin/LinkController.php +++ b/app/Http/Controllers/Admin/LinkController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; - use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\LinkTypeFormRequest; use FireflyIII\Models\LinkType; @@ -236,5 +235,4 @@ class LinkController extends Controller // redirect to previous URL. return redirect($this->getPreviousUri('link_types.edit.uri')); } - } diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index f152582b52..e8cf8288cf 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; - use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\UserFormRequest; use FireflyIII\Repositories\User\UserRepositoryInterface; @@ -107,7 +106,6 @@ class UserController extends Controller ]; return view('admin.users.edit', compact('user', 'subTitle', 'subTitleIcon', 'codes')); - } /** @@ -136,7 +134,6 @@ class UserController extends Controller return view('admin.users.index', compact('subTitle', 'subTitleIcon', 'users')); - } /** @@ -156,7 +153,12 @@ class UserController extends Controller return view( 'admin.users.show', compact( - 'title', 'mainTitleIcon', 'subTitle', 'subTitleIcon', 'information', 'user' + 'title', + 'mainTitleIcon', + 'subTitle', + 'subTitleIcon', + 'information', + 'user' ) ); } @@ -195,8 +197,5 @@ class UserController extends Controller // redirect to previous URL. return redirect($this->getPreviousUri('users.edit.uri')); - } - - } diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index 57cdd8be55..e09f8cb8d5 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -108,7 +108,6 @@ class AttachmentController extends Controller */ public function download(AttachmentRepositoryInterface $repository, Attachment $attachment) { - if ($repository->exists($attachment)) { $content = $repository->getContent($attachment); $quoted = sprintf('"%s"', addcslashes(basename($attachment->filename), '"\\')); @@ -198,7 +197,5 @@ class AttachmentController extends Controller // redirect to previous URL. return redirect($this->getPreviousUri('attachments.edit.uri')); - } - } diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index be79510661..82f1f40c44 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -59,6 +59,5 @@ class ForgotPasswordController extends Controller { parent::__construct(); $this->middleware('guest'); - } } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index caa33aa923..f6f1a986a5 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -42,7 +42,6 @@ use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Http\Request; use Schema; - class LoginController extends Controller { /* @@ -85,16 +84,16 @@ class LoginController extends Controller // check for presence of tables: $hasTable = Schema::hasTable('users'); - if(!$hasTable) { + if (!$hasTable) { $message = 'Firefly III could not find the "users" table. This is a strong indication your database credentials are wrong or the database has not been initialized. Did you follow the installation instructions correctly?'; - return view('error',compact('message')); + return view('error', compact('message')); } // check for presence of currency: - $currency = TransactionCurrency::where('code','EUR')->first(); - if(is_null($currency)) { + $currency = TransactionCurrency::where('code', 'EUR')->first(); + if (is_null($currency)) { $message = 'Firefly III could not find the EURO currency. This is a strong indication the database has not been initialized correctly. Did you follow the installation instructions?'; - return view('error',compact('message')); + return view('error', compact('message')); } // forget 2fa cookie: diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 0a4df46b9d..8bea5e15da 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -158,7 +158,8 @@ class RegisterController extends Controller protected function validator(array $data) { return Validator::make( - $data, [ + $data, + [ 'email' => 'required|string|email|max:255|unique:users', 'password' => 'required|string|secure_password|confirmed', ] diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index 573104a91c..2a9fd275c3 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -49,7 +49,6 @@ class TwoFactorController extends Controller */ public function index(Request $request) { - $user = auth()->user(); // to make sure the validator in the next step gets the secret, we push it in session @@ -105,5 +104,4 @@ class TwoFactorController extends Controller return redirect(route('home'))->withCookie($cookie); } - } diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index 98ce6dcc98..55bbbaba06 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -264,7 +264,6 @@ class BillController extends Controller // redirect to previous URL. return redirect($this->getPreviousUri('bills.create.uri')); - } /** @@ -291,7 +290,5 @@ class BillController extends Controller } return redirect($this->getPreviousUri('bills.edit.uri')); - } - } diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index c9c27fd605..fdcfc77ec6 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -94,7 +94,6 @@ class BudgetController extends Controller Preferences::mark(); return Response::json(['name' => $budget->name, 'limit' => $budgetLimit ? $budgetLimit->id : 0, 'amount' => $amount]); - } /** @@ -142,7 +141,6 @@ class BudgetController extends Controller */ public function destroy(Request $request, Budget $budget) { - $name = $budget->name; $this->repository->destroy($budget); $request->session()->flash('success', strval(trans('firefly.deleted_budget', ['name' => $name]))); @@ -170,7 +168,6 @@ class BudgetController extends Controller $request->session()->flash('gaEventAction', 'edit'); return view('budgets.edit', compact('budget', 'subTitle')); - } /** @@ -246,9 +243,23 @@ class BudgetController extends Controller return view( 'budgets.index', compact( - 'available', 'currentMonth', 'next', 'nextText', 'prev', 'prevText', - 'periodStart', 'periodEnd', 'budgetInformation', 'inactive', 'budgets', - 'spent', 'budgeted', 'previousLoop', 'nextLoop', 'start', 'end' + 'available', + 'currentMonth', + 'next', + 'nextText', + 'prev', + 'prevText', + 'periodStart', + 'periodEnd', + 'budgetInformation', + 'inactive', + 'budgets', + 'spent', + 'budgeted', + 'previousLoop', + 'nextLoop', + 'start', + 'end' ) ); } @@ -442,7 +453,8 @@ class BudgetController extends Controller $page = intval($request->get('page')); $pageSize = intval(Preferences::get('transactionPageSize', 50)->data); $subTitle = trans( - 'firefly.budget_in_period', [ + 'firefly.budget_in_period', + [ 'name' => $budget->name, 'start' => $budgetLimit->start_date->formatLocalized($this->monthAndDayFormat), 'end' => $budgetLimit->end_date->formatLocalized($this->monthAndDayFormat), @@ -461,7 +473,6 @@ class BudgetController extends Controller $limits = $this->getLimits($budget, $start, $end); return view('budgets.show', compact('limits', 'budget', 'budgetLimit', 'transactions', 'subTitle')); - } /** @@ -601,5 +612,4 @@ class BudgetController extends Controller return $entries; } - } diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 8b0d41fa10..2ebd43efa6 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -114,7 +114,6 @@ class CategoryController extends Controller */ public function destroy(Request $request, CategoryRepositoryInterface $repository, Category $category) { - $name = $category->name; $repository->destroy($category); @@ -143,7 +142,6 @@ class CategoryController extends Controller $request->session()->flash('gaEventAction', 'edit'); return view('categories.edit', compact('category', 'subTitle')); - } /** @@ -487,5 +485,4 @@ class CategoryController extends Controller return $entries; } - } diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 182d472fa3..04981b69cb 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -243,7 +243,6 @@ class AccountController extends Controller $cache->store($data); return Response::json($data); - } /** @@ -326,7 +325,6 @@ class AccountController extends Controller $cache->store($data); return Response::json($data); - } /** @@ -580,5 +578,4 @@ class AccountController extends Controller return $return; } - } diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 58f650150b..6ebb6222bb 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -208,7 +208,6 @@ class BudgetController extends Controller $cache->store($data); return Response::json($data); - } /** @@ -255,7 +254,6 @@ class BudgetController extends Controller $cache->store($data); return Response::json($data); - } /** @@ -301,7 +299,6 @@ class BudgetController extends Controller $cache->store($data); return Response::json($data); - } /** diff --git a/app/Http/Controllers/Chart/BudgetReportController.php b/app/Http/Controllers/Chart/BudgetReportController.php index 517ec450ef..62b3b07f3a 100644 --- a/app/Http/Controllers/Chart/BudgetReportController.php +++ b/app/Http/Controllers/Chart/BudgetReportController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; - use Carbon\Carbon; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Helpers\Chart\MetaPieChartInterface; @@ -95,7 +94,6 @@ class BudgetReportController extends Controller $data = $this->generator->pieChart($chartData); return Response::json($data); - } /** @@ -277,5 +275,4 @@ class BudgetReportController extends Controller return $grouped; } - } diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 44a6a439f2..83b5cbd656 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; - use Carbon\Carbon; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Http\Controllers\Controller; @@ -120,7 +119,6 @@ class CategoryController extends Controller $cache->store($data); return Response::json($data); - } /** @@ -269,7 +267,6 @@ class CategoryController extends Controller $chartData[0]['entries'][$label] = bcmul($spent, '-1'); $chartData[1]['entries'][$label] = $earned; $chartData[2]['entries'][$label] = $sum; - } $data = $this->generator->multiSet($chartData); $cache->store($data); @@ -358,7 +355,5 @@ class CategoryController extends Controller $cache->store($data); return $data; - } - } diff --git a/app/Http/Controllers/Chart/CategoryReportController.php b/app/Http/Controllers/Chart/CategoryReportController.php index 92e5e5e756..1fea301d5a 100644 --- a/app/Http/Controllers/Chart/CategoryReportController.php +++ b/app/Http/Controllers/Chart/CategoryReportController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; - use Carbon\Carbon; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Helpers\Chart\MetaPieChartInterface; @@ -41,7 +40,6 @@ use Illuminate\Support\Collection; use Navigation; use Response; - /** * Separate controller because many helper functions are shared. * diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index b5f8ffdbd0..275fab7f68 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -31,7 +31,6 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Support\CacheProperties; use Response; - /** * Class PiggyBankController * @@ -86,6 +85,5 @@ class PiggyBankController extends Controller $cache->store($data); return Response::json($data); - } } diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 29d84f6a91..5ffe130df5 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; - use Carbon\Carbon; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Http\Controllers\Controller; @@ -149,7 +148,6 @@ class ReportController extends Controller $cache->store($data); return Response::json($data); - } /** @@ -224,7 +222,6 @@ class ReportController extends Controller $cache->store($data); return Response::json($data); - } /** @@ -270,14 +267,14 @@ class ReportController extends Controller $tasker = app(AccountTaskerInterface::class); while ($currentStart <= $end) { - $currentEnd = Navigation::endOfPeriod($currentStart, '1M'); $earned = strval( array_sum( array_map( function ($item) { return $item['sum']; - }, $tasker->getIncomeReport($currentStart, $currentEnd, $accounts) + }, + $tasker->getIncomeReport($currentStart, $currentEnd, $accounts) ) ) ); @@ -287,7 +284,8 @@ class ReportController extends Controller array_map( function ($item) { return $item['sum']; - }, $tasker->getExpenseReport($currentStart, $currentEnd, $accounts) + }, + $tasker->getExpenseReport($currentStart, $currentEnd, $accounts) ) ) ); diff --git a/app/Http/Controllers/Chart/TagReportController.php b/app/Http/Controllers/Chart/TagReportController.php index 3299d1aa22..6aead89388 100644 --- a/app/Http/Controllers/Chart/TagReportController.php +++ b/app/Http/Controllers/Chart/TagReportController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; - use Carbon\Carbon; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Helpers\Chart\MetaPieChartInterface; @@ -375,5 +374,4 @@ class TagReportController extends Controller return $grouped; } - } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 89a9293a35..3d7e3e0999 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -110,7 +110,6 @@ class Controller extends BaseController return $next($request); } ); - } /** @@ -162,7 +161,6 @@ class Controller extends BaseController if (in_array($account->accountType->type, $valid)) { return redirect(route('accounts.show', [$account->id])); } - } // @codeCoverageIgnoreStart Session::flash('error', strval(trans('firefly.cannot_redirect_to_account'))); @@ -178,5 +176,4 @@ class Controller extends BaseController { Session::put($identifier, URL::previous()); } - } diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php index f06a710c71..62c8e519f9 100644 --- a/app/Http/Controllers/CurrencyController.php +++ b/app/Http/Controllers/CurrencyController.php @@ -102,7 +102,6 @@ class CurrencyController extends Controller */ public function defaultCurrency(Request $request, TransactionCurrency $currency) { - Preferences::set('currencyPreference', $currency->code); Preferences::mark(); @@ -111,7 +110,6 @@ class CurrencyController extends Controller Cache::forget('FFCURRENCYCODE'); return redirect(route('currencies.index')); - } @@ -205,7 +203,6 @@ class CurrencyController extends Controller $request->session()->flash('gaEventAction', 'edit'); return view('currencies.edit', compact('currency', 'subTitle', 'subTitleIcon')); - } /** diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index 9e1ec777b7..025de96265 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -98,7 +98,6 @@ class ExportController extends Controller ->header('Content-Length', strlen($content)); return $response; - } /** @@ -134,7 +133,6 @@ class ExportController extends Controller $today = Carbon::create()->format('Y-m-d'); return view('export.index', compact('job', 'checked', 'accountList', 'formats', 'defaultFormat', 'first', 'today')); - } /** diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php index 000b8cb17d..05d3d256f1 100644 --- a/app/Http/Controllers/HelpController.php +++ b/app/Http/Controllers/HelpController.php @@ -66,7 +66,6 @@ class HelpController extends Controller $html = $this->getHelpText($route, $language); return Response::json(['html' => $html]); - } /** @@ -112,7 +111,6 @@ class HelpController extends Controller } $content = $this->help->getFromGithub($route, $language); - } // help still empty? @@ -120,11 +118,8 @@ class HelpController extends Controller $this->help->putInCache($route, $language, $content); return $content; - } return '

' . strval(trans('firefly.route_has_no_help')) . '

'; } - - } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 9d7ba8ff45..e6f754dc3e 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -63,7 +63,6 @@ class HomeController extends Controller */ public function dateRange(Request $request) { - $start = new Carbon($request->get('start')); $end = new Carbon($request->get('end')); $label = $request->get('label'); @@ -122,11 +121,23 @@ class HomeController extends Controller $logContent = 'Truncated from this point <----|' . substr($logContent, -4096); return view( - 'debug', compact( - 'phpVersion', 'extensions', 'carbon', 'now', 'drivers', 'currentDriver', 'userAgent', 'phpOs', 'interface', 'logContent', 'isDocker', 'isSandstorm','trustedProxies' + 'debug', + compact( + 'phpVersion', + 'extensions', + 'carbon', + 'now', + 'drivers', + 'currentDriver', + 'userAgent', + 'phpOs', + 'interface', + 'logContent', + 'isDocker', + 'isSandstorm', + 'trustedProxies' ) ); - } /** @@ -176,7 +187,8 @@ class HomeController extends Controller $subTitle = trans('firefly.welcomeBack'); $transactions = []; $frontPage = Preferences::get( - 'frontPageAccounts', $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray() + 'frontPageAccounts', + $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray() ); /** @var Carbon $start */ $start = session('start', Carbon::now()->startOfMonth()); @@ -199,7 +211,8 @@ class HomeController extends Controller } return view( - 'index', compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount') + 'index', + compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount') ); } @@ -228,7 +241,6 @@ class HomeController extends Controller if (!$found) { echo 'touch ' . $route->getName() . '.md;'; } - } } @@ -247,5 +259,4 @@ class HomeController extends Controller return redirect(route('home')); } - } diff --git a/app/Http/Controllers/Import/BankController.php b/app/Http/Controllers/Import/BankController.php index d42cc8e6a6..0018673cac 100644 --- a/app/Http/Controllers/Import/BankController.php +++ b/app/Http/Controllers/Import/BankController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Import; - use FireflyIII\Http\Controllers\Controller; use FireflyIII\Support\Import\Information\InformationInterface; use FireflyIII\Support\Import\Prerequisites\PrerequisitesInterface; @@ -60,7 +59,6 @@ class BankController extends Controller $remoteAccounts = $object->getAccounts(); return view('import.bank.form', compact('remoteAccounts', 'bank')); - } /** @@ -75,7 +73,6 @@ class BankController extends Controller */ public function postForm(Request $request, string $bank) { - $class = config(sprintf('firefly.import_pre.%s', $bank)); /** @var PrerequisitesInterface $object */ $object = app($class); @@ -95,8 +92,6 @@ class BankController extends Controller // get import file // get import config - - } /** @@ -161,5 +156,4 @@ class BankController extends Controller return redirect(route('import.bank.form', [$bank])); } - } diff --git a/app/Http/Controllers/Import/FileController.php b/app/Http/Controllers/Import/FileController.php index c32a34345a..93950180d3 100644 --- a/app/Http/Controllers/Import/FileController.php +++ b/app/Http/Controllers/Import/FileController.php @@ -39,7 +39,6 @@ use Response; use Session; use View; - /** * Class FileController. * @@ -128,8 +127,6 @@ class FileController extends Controller ->header('Content-Length', strlen($result)); return $response; - - } /** diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index 4188dfbfcb..aa1720146a 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -72,5 +72,4 @@ class ImportController extends Controller return view('import.index', compact('subTitle', 'subTitleIcon', 'importFileTypes', 'defaultImportType')); } - } diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index 565330c229..5cff2e72f3 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -182,6 +182,5 @@ class JavascriptController extends Controller return $return; - } } diff --git a/app/Http/Controllers/Json/AutoCompleteController.php b/app/Http/Controllers/Json/AutoCompleteController.php index 35c82ca35d..bdb54ce2b0 100644 --- a/app/Http/Controllers/Json/AutoCompleteController.php +++ b/app/Http/Controllers/Json/AutoCompleteController.php @@ -58,7 +58,6 @@ class AutoCompleteController extends Controller sort($return); return Response::json($return); - } /** @@ -111,7 +110,6 @@ class AutoCompleteController extends Controller */ public function journalsWithId(JournalCollectorInterface $collector, TransactionJournal $except) { - $cache = new CacheProperties; $cache->addProperty('recent-journals-id'); @@ -178,5 +176,4 @@ class AutoCompleteController extends Controller return Response::json($return); } - } diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php index 545ba93955..c971426085 100644 --- a/app/Http/Controllers/Json/BoxController.php +++ b/app/Http/Controllers/Json/BoxController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; - use Carbon\Carbon; use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Http\Controllers\Controller; @@ -214,5 +213,4 @@ class BoxController extends Controller return Response::json($return); } - } diff --git a/app/Http/Controllers/Json/ExchangeController.php b/app/Http/Controllers/Json/ExchangeController.php index 7d633266b5..38c8a696dd 100644 --- a/app/Http/Controllers/Json/ExchangeController.php +++ b/app/Http/Controllers/Json/ExchangeController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; - use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\TransactionCurrency; @@ -73,5 +72,4 @@ class ExchangeController extends Controller return Response::json($return); } - } diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index a062b5d394..00af0970ea 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -61,7 +61,6 @@ class FrontpageController extends Controller $info[] = $entry; } - } $html = ''; if (count($info) > 0) { @@ -70,5 +69,4 @@ class FrontpageController extends Controller return Response::json(['html' => $html]); } - } diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index 3a693b500c..df89f71a19 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -56,7 +56,6 @@ class IntroController // merge arrays and add last step again $steps = array_merge($steps, $specificSteps); $steps[] = $lastStep; - } if (!$this->hasOutroStep($route)) { $steps = array_merge($steps, $specificSteps); @@ -174,5 +173,4 @@ class IntroController return $steps; } - } diff --git a/app/Http/Controllers/Json/TransactionController.php b/app/Http/Controllers/Json/TransactionController.php index efa08e43d0..5de85266ab 100644 --- a/app/Http/Controllers/Json/TransactionController.php +++ b/app/Http/Controllers/Json/TransactionController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; - use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; @@ -89,5 +88,4 @@ class TransactionController extends Controller return Response::json($result); } - } diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index e3646e111c..1194d4d599 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -105,7 +105,6 @@ class JsonController extends Controller sort($return); return Response::json($return); - } /** @@ -143,5 +142,4 @@ class JsonController extends Controller return Response::json(['html' => $view]); } - } diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index cc41dd4273..cc7a1f8838 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -47,7 +47,6 @@ class NewUserController extends Controller $this->middleware( function ($request, $next) { - return $next($request); } ); @@ -61,7 +60,6 @@ class NewUserController extends Controller */ public function index(AccountRepositoryInterface $repository) { - View::share('title', trans('firefly.welcome')); View::share('mainTitleIcon', 'fa-fire'); @@ -70,7 +68,6 @@ class NewUserController extends Controller if ($count > 0) { return redirect(route('index')); - } return view('new-user.index'); @@ -154,5 +151,4 @@ class NewUserController extends Controller return true; } - } diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index f017f9c0c9..1d092b25b5 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -174,7 +174,6 @@ class PiggyBankController extends Controller */ public function edit(AccountRepositoryInterface $repository, PiggyBank $piggyBank) { - $accounts = ExpandedForm::makeSelectList($repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); $subTitle = trans('firefly.update_piggy_title', ['name' => $piggyBank->name]); $subTitleIcon = 'fa-pencil'; @@ -290,7 +289,8 @@ class PiggyBankController extends Controller if ($repository->canAddAmount($piggyBank, $amount)) { $repository->addAmount($piggyBank, $amount); Session::flash( - 'success', strval( + 'success', + strval( trans( 'firefly.added_amount_to_piggy', ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] @@ -304,7 +304,8 @@ class PiggyBankController extends Controller Log::error('Cannot add ' . $amount . ' because canAddAmount returned false.'); Session::flash( - 'error', strval( + 'error', + strval( trans( 'firefly.cannot_add_amount_piggy', ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] @@ -332,7 +333,8 @@ class PiggyBankController extends Controller 'success', strval( trans( - 'firefly.removed_amount_from_piggy', ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] + 'firefly.removed_amount_from_piggy', + ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] ) ) ); @@ -344,7 +346,8 @@ class PiggyBankController extends Controller $amount = strval(round($request->get('amount'), 12)); Session::flash( - 'error', strval( + 'error', + strval( trans( 'firefly.cannot_remove_from_piggy', ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] @@ -391,7 +394,6 @@ class PiggyBankController extends Controller $subTitle = e($piggyBank->name); return view('piggy-banks.show', compact('piggyBank', 'events', 'subTitle', 'note')); - } /** diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php index 276f42dcc8..4eeafb197a 100644 --- a/app/Http/Controllers/Popup/ReportController.php +++ b/app/Http/Controllers/Popup/ReportController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Popup; - use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collection\BalanceLine; @@ -80,7 +79,6 @@ class ReportController extends Controller return $next($request); } ); - } @@ -119,8 +117,6 @@ class ReportController extends Controller } return Response::json(['html' => $html]); - - } /** @@ -251,5 +247,4 @@ class ReportController extends Controller return $attributes; } - } diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 0b605feb42..30b0a6135a 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -113,9 +113,18 @@ class PreferencesController extends Controller return view( 'preferences.index', compact( - 'language', 'accounts', 'frontPageAccounts', 'tjOptionalFields', - 'viewRange', 'customFiscalYear', 'transactionPageSize', 'fiscalYearStart', 'is2faEnabled', - 'has2faSecret', 'showIncomplete', 'showDeps' + 'language', + 'accounts', + 'frontPageAccounts', + 'tjOptionalFields', + 'viewRange', + 'customFiscalYear', + 'transactionPageSize', + 'fiscalYearStart', + 'is2faEnabled', + 'has2faSecret', + 'showIncomplete', + 'showDeps' ) ); } @@ -236,5 +245,4 @@ class PreferencesController extends Controller return $parts['host']; } - } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 2a9e37caf4..9c4a398968 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -64,7 +64,6 @@ class ProfileController extends Controller } ); $this->middleware(IsLimitedUser::class)->except(['confirmEmailChange', 'undoEmailChange']); - } /** @@ -253,7 +252,7 @@ class ProfileController extends Controller /** * */ - function regenerate() + public function regenerate() { $token = auth()->user()->generateAccessToken(); Preferences::set('access_token', $token); @@ -328,8 +327,5 @@ class ProfileController extends Controller } return true; - } - - } diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php index b2c0edeb8f..1ab913d8df 100644 --- a/app/Http/Controllers/Report/AccountController.php +++ b/app/Http/Controllers/Report/AccountController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; - use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Repositories\Account\AccountTaskerInterface; diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 5700d1e640..7cb28859fa 100644 --- a/app/Http/Controllers/Report/BalanceController.php +++ b/app/Http/Controllers/Report/BalanceController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; - use Carbon\Carbon; use FireflyIII\Helpers\Report\BalanceReportHelperInterface; use FireflyIII\Http\Controllers\Controller; diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index 6ebe2a1928..0f82aa54f0 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; - use Carbon\Carbon; use FireflyIII\Helpers\Report\BudgetReportHelperInterface; use FireflyIII\Http\Controllers\Controller; @@ -68,7 +67,6 @@ class BudgetController extends Controller $cache->store($result); return $result; - } /** diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php index 5256c9a881..9f681fc7c9 100644 --- a/app/Http/Controllers/Report/CategoryController.php +++ b/app/Http/Controllers/Report/CategoryController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; - use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Category; @@ -172,6 +171,4 @@ class CategoryController extends Controller return $data; } - - } diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php index 6397ee6f16..3e33e3c28b 100644 --- a/app/Http/Controllers/Report/OperationsController.php +++ b/app/Http/Controllers/Report/OperationsController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; - use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Repositories\Account\AccountTaskerInterface; @@ -63,7 +62,6 @@ class OperationsController extends Controller $cache->store($result); return $result; - } /** @@ -92,7 +90,6 @@ class OperationsController extends Controller $cache->store($result); return $result; - } /** @@ -121,7 +118,8 @@ class OperationsController extends Controller array_map( function ($item) { return $item['sum']; - }, $incomes + }, + $incomes ) ); @@ -129,7 +127,8 @@ class OperationsController extends Controller array_map( function ($item) { return $item['sum']; - }, $expenses + }, + $expenses ) ); @@ -137,7 +136,5 @@ class OperationsController extends Controller $cache->store($result); return $result; - } - } diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 3b7a33b5d6..1b5a9fb89f 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -69,7 +69,6 @@ class ReportController extends Controller return $next($request); } ); - } /** @@ -89,7 +88,8 @@ class ReportController extends Controller } View::share( - 'subTitle', trans( + 'subTitle', + trans( 'firefly.report_audit', [ 'start' => $start->formatLocalized($this->monthFormat), @@ -104,7 +104,6 @@ class ReportController extends Controller $result = $generator->generate(); return $result; - } /** @@ -125,7 +124,8 @@ class ReportController extends Controller } View::share( - 'subTitle', trans( + 'subTitle', + trans( 'firefly.report_budget', [ 'start' => $start->formatLocalized($this->monthFormat), @@ -140,7 +140,6 @@ class ReportController extends Controller $result = $generator->generate(); return $result; - } /** @@ -161,7 +160,8 @@ class ReportController extends Controller } View::share( - 'subTitle', trans( + 'subTitle', + trans( 'firefly.report_category', [ 'start' => $start->formatLocalized($this->monthFormat), @@ -176,7 +176,6 @@ class ReportController extends Controller $result = $generator->generate(); return $result; - } /** @@ -197,7 +196,8 @@ class ReportController extends Controller } View::share( - 'subTitle', trans( + 'subTitle', + trans( 'firefly.report_default', [ 'start' => $start->formatLocalized($this->monthFormat), @@ -211,7 +211,6 @@ class ReportController extends Controller $result = $generator->generate(); return $result; - } /** @@ -343,7 +342,8 @@ class ReportController extends Controller } View::share( - 'subTitle', trans( + 'subTitle', + trans( 'firefly.report_tag', [ 'start' => $start->formatLocalized($this->monthFormat), @@ -358,7 +358,6 @@ class ReportController extends Controller $result = $generator->generate(); return $result; - } /** @@ -372,7 +371,6 @@ class ReportController extends Controller $result = view('reports.options.budget', compact('budgets'))->render(); return $result; - } /** @@ -386,7 +384,6 @@ class ReportController extends Controller $result = view('reports.options.category', compact('categories'))->render(); return $result; - } /** @@ -412,6 +409,5 @@ class ReportController extends Controller $result = view('reports.options.tag', compact('tags'))->render(); return $result; - } } diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php index d96c883d66..12a30e77ed 100644 --- a/app/Http/Controllers/RuleController.php +++ b/app/Http/Controllers/RuleController.php @@ -110,7 +110,8 @@ class RuleController extends Controller Session::flash('gaEventAction', 'create-rule'); return view( - 'rules.rule.create', compact('subTitleIcon', 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount', 'ruleGroup', 'subTitle') + 'rules.rule.create', + compact('subTitleIcon', 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount', 'ruleGroup', 'subTitle') ); } @@ -143,7 +144,6 @@ class RuleController extends Controller */ public function destroy(RuleRepositoryInterface $repository, Rule $rule) { - $title = $rule->title; $repository->destroy($rule); @@ -164,7 +164,6 @@ class RuleController extends Controller $repository->moveDown($rule); return redirect(route('rules.index')); - } /** @@ -212,9 +211,16 @@ class RuleController extends Controller Session::flash('gaEventAction', 'edit-rule'); return view( - 'rules.rule.edit', compact( - 'rule', 'subTitle', - 'primaryTrigger', 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount', 'ruleGroups' + 'rules.rule.edit', + compact( + 'rule', + 'subTitle', + 'primaryTrigger', + 'oldTriggers', + 'oldActions', + 'triggerCount', + 'actionCount', + 'ruleGroups' ) ); } @@ -283,7 +289,6 @@ class RuleController extends Controller } return Response::json('true'); - } /** @@ -301,7 +306,6 @@ class RuleController extends Controller } return Response::json('true'); - } /** @@ -411,7 +415,6 @@ class RuleController extends Controller */ public function testTriggersByRule(Rule $rule) { - $triggers = $rule->ruleTriggers; if (count($triggers) === 0) { @@ -454,7 +457,6 @@ class RuleController extends Controller $repository->moveUp($rule); return redirect(route('rules.index')); - } /** @@ -510,7 +512,6 @@ class RuleController extends Controller $repository->store($data); } - } /** @@ -655,7 +656,6 @@ class RuleController extends Controller */ private function getValidTriggerList(TestRuleFormRequest $request): array { - $triggers = []; $data = [ 'rule-triggers' => $request->get('rule-trigger'), @@ -675,6 +675,4 @@ class RuleController extends Controller return $triggers; } - - } diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php index 6e0d16f0fd..ff7859cbdb 100644 --- a/app/Http/Controllers/RuleGroupController.php +++ b/app/Http/Controllers/RuleGroupController.php @@ -111,7 +111,6 @@ class RuleGroupController extends Controller */ public function destroy(Request $request, RuleGroupRepositoryInterface $repository, RuleGroup $ruleGroup) { - $title = $ruleGroup->title; $moveTo = auth()->user()->ruleGroups()->find(intval($request->get('move_rules_before_delete'))); @@ -135,7 +134,6 @@ class RuleGroupController extends Controller $repository->moveDown($ruleGroup); return redirect(route('rules.index')); - } /** @@ -156,7 +154,6 @@ class RuleGroupController extends Controller Session::flash('gaEventAction', 'edit-rule-group'); return view('rules.rule-group.edit', compact('ruleGroup', 'subTitle')); - } /** @@ -248,7 +245,6 @@ class RuleGroupController extends Controller $repository->moveUp($ruleGroup); return redirect(route('rules.index')); - } /** @@ -281,6 +277,5 @@ class RuleGroupController extends Controller // redirect to previous URL. return redirect($this->getPreviousUri('rule-groups.edit.uri')); - } } diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index b276c7b94e..f6c1d62ba6 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -51,7 +51,6 @@ class SearchController extends Controller return $next($request); } ); - } /** @@ -96,8 +95,5 @@ class SearchController extends Controller $html = view('search.search', compact('transactions'))->render(); return Response::json(['count' => $transactions->count(), 'html' => $html]); - - } - } diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 49c40a3904..c3f7a310cb 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -124,7 +124,6 @@ class TagController extends Controller */ public function destroy(Tag $tag) { - $tagName = $tag->tag; $this->repository->destroy($tag); @@ -284,7 +283,6 @@ class TagController extends Controller } return redirect($this->getPreviousUri('tags.create.uri')); - } /** @@ -356,8 +354,5 @@ class TagController extends Controller $cache->store($collection); return $collection; - } - - } diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php index 9bb9c222e4..aea7f98d97 100644 --- a/app/Http/Controllers/Transaction/ConvertController.php +++ b/app/Http/Controllers/Transaction/ConvertController.php @@ -107,9 +107,16 @@ class ConvertController extends Controller return view( 'transactions.convert', compact( - 'sourceType', 'destinationType', 'journal', 'assetAccounts', - 'positiveAmount', 'sourceAccount', 'destinationAccount', 'sourceType', - 'subTitle', 'subTitleIcon' + 'sourceType', + 'destinationType', + 'journal', + 'assetAccounts', + 'positiveAmount', + 'sourceAccount', + 'destinationAccount', + 'sourceType', + 'subTitle', + 'subTitleIcon' ) ); @@ -271,7 +278,5 @@ class ConvertController extends Controller } return $source; - } - } diff --git a/app/Http/Controllers/Transaction/LinkController.php b/app/Http/Controllers/Transaction/LinkController.php index cf86c8c639..42cc68786b 100644 --- a/app/Http/Controllers/Transaction/LinkController.php +++ b/app/Http/Controllers/Transaction/LinkController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; - use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\JournalLinkRequest; use FireflyIII\Models\TransactionJournal; @@ -60,7 +59,6 @@ class LinkController extends Controller return $next($request); } ); - } @@ -103,7 +101,10 @@ class LinkController extends Controller * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ public function store( - JournalLinkRequest $request, LinkTypeRepositoryInterface $repository, JournalRepositoryInterface $journalRepository, TransactionJournal $journal + JournalLinkRequest $request, + LinkTypeRepositoryInterface $repository, + JournalRepositoryInterface $journalRepository, + TransactionJournal $journal ) { $linkInfo = $request->getLinkInfo(); if ($linkInfo['transaction_journal_id'] === 0) { @@ -150,10 +151,8 @@ class LinkController extends Controller */ public function switch(LinkTypeRepositoryInterface $repository, TransactionJournalLink $link) { - $repository->switchLink($link); return redirect(URL::previous()); } - } diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index a88b9620ca..1add0b245e 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -78,7 +78,6 @@ class MassController extends Controller Session::flash('gaEventAction', 'mass-delete'); return view('transactions.mass-delete', compact('journals', 'subTitle')); - } /** @@ -115,7 +114,6 @@ class MassController extends Controller // redirect to previous URL: return redirect($this->getPreviousUri('transactions.mass-delete.uri')); - } @@ -161,7 +159,7 @@ class MassController extends Controller } // cannot edit reconciled transactions / journals: - if($journal->transactions->first()->reconciled) { + if ($journal->transactions->first()->reconciled) { $messages[] = trans('firefly.cannot_edit_reconciled', ['description' => $journal->description, 'id' => $journal->id]); continue; } @@ -270,13 +268,11 @@ class MassController extends Controller $count++; } } - } Preferences::mark(); Session::flash('success', trans('firefly.mass_edited_transactions_success', ['amount' => $count])); // redirect to previous URL: return redirect($this->getPreviousUri('transactions.mass-edit.uri')); - } } diff --git a/app/Http/Controllers/Transaction/SingleController.php b/app/Http/Controllers/Transaction/SingleController.php index 1d774223e3..ba260c7e1c 100644 --- a/app/Http/Controllers/Transaction/SingleController.php +++ b/app/Http/Controllers/Transaction/SingleController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; - use Carbon\Carbon; use ExpandedForm; use FireflyIII\Events\StoredTransactionJournal; @@ -99,7 +98,6 @@ class SingleController extends Controller return $next($request); } ); - } public function cloneTransaction(TransactionJournal $journal) @@ -214,8 +212,6 @@ class SingleController extends Controller Session::flash('gaEventAction', 'delete-' . $what); return view('transactions.single.delete', compact('journal', 'subTitle', 'what')); - - } /** diff --git a/app/Http/Controllers/Transaction/SplitController.php b/app/Http/Controllers/Transaction/SplitController.php index 256e15c9eb..1a0e994b9c 100644 --- a/app/Http/Controllers/Transaction/SplitController.php +++ b/app/Http/Controllers/Transaction/SplitController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; - use ExpandedForm; use FireflyIII\Events\UpdatedTransactionJournal; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; @@ -136,9 +135,17 @@ class SplitController extends Controller return view( 'transactions.split.edit', compact( - 'subTitleIcon', 'currencies', 'optionalFields', - 'preFilled', 'subTitle', 'uploadSize', 'assetAccounts', - 'budgets', 'journal', 'accountArray', 'previous' + 'subTitleIcon', + 'currencies', + 'optionalFields', + 'preFilled', + 'subTitle', + 'uploadSize', + 'assetAccounts', + 'budgets', + 'journal', + 'accountArray', + 'previous' ) ); } @@ -306,7 +313,6 @@ class SplitController extends Controller } $return[] = $set; - } return $return; @@ -322,7 +328,6 @@ class SplitController extends Controller $return = []; $transactions = $request->get('transactions'); foreach ($transactions as $transaction) { - $return[] = [ 'description' => $transaction['description'], 'source_account_id' => $transaction['source_account_id'] ?? 0, @@ -373,6 +378,4 @@ class SplitController extends Controller return $array; } - - } diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 7b9393909e..9e64cb5c10 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -64,7 +64,6 @@ class TransactionController extends Controller return $next($request); } ); - } /** @@ -130,7 +129,6 @@ class TransactionController extends Controller return view('transactions.index', compact('subTitle', 'what', 'subTitleIcon', 'transactions', 'periods', 'start', 'end', 'moment')); - } /** @@ -146,7 +144,6 @@ class TransactionController extends Controller $repository->reconcile($transaction); } - } /** @@ -173,7 +170,6 @@ class TransactionController extends Controller Preferences::mark(); return Response::json([true]); - } /** @@ -300,5 +296,4 @@ class TransactionController extends Controller return $return; } - } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 02130a9c93..8f2808c3d8 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -57,7 +57,6 @@ use Illuminate\Routing\Middleware\SubstituteBindings; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\View\Middleware\ShareErrorsFromSession; - class Kernel extends HttpKernel { /** diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.php index f635600c36..35b14b4fe1 100644 --- a/app/Http/Middleware/Binder.php +++ b/app/Http/Middleware/Binder.php @@ -27,7 +27,6 @@ use Closure; use FireflyIII\Support\Domain; use Illuminate\Http\Request; - /** * Class Binder * diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 673775747a..6e55ff3c56 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -35,7 +35,6 @@ use Preferences; use Session; use View; - /** * Class SessionFilter * @@ -85,7 +84,6 @@ class Range } return $next($request); - } /** @@ -132,7 +130,6 @@ class Range { // ignore preference. set the range to be the current month: if (!Session::has('start') && !Session::has('end')) { - $viewRange = Preferences::get('viewRange', '1M')->data; $start = new Carbon; $start = Navigation::updateStartDate($viewRange, $start); @@ -153,5 +150,4 @@ class Range Session::put('first', $first); } } - } diff --git a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php index 1a60c762fb..31fc050329 100644 --- a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php +++ b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php @@ -28,7 +28,6 @@ use Cookie; use Illuminate\Support\Facades\Auth; use Preferences; - /** * Class RedirectIfTwoFactorAuthenticated * @@ -48,7 +47,6 @@ class RedirectIfTwoFactorAuthenticated public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { - $is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); diff --git a/app/Http/Middleware/Sandstorm.php b/app/Http/Middleware/Sandstorm.php index c67298e711..b714853bd4 100644 --- a/app/Http/Middleware/Sandstorm.php +++ b/app/Http/Middleware/Sandstorm.php @@ -117,7 +117,6 @@ class Sandstorm if ($count > 1) { throw new FireflyException('Your Firefly III installation has more than one user, which is weird.'); } - } return $next($request); diff --git a/app/Http/Middleware/StartFireflySession.php b/app/Http/Middleware/StartFireflySession.php index 3183e0a035..a4e8604482 100644 --- a/app/Http/Middleware/StartFireflySession.php +++ b/app/Http/Middleware/StartFireflySession.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; - use Closure; use Illuminate\Http\Request; use Illuminate\Session\Middleware\StartSession; diff --git a/app/Http/Requests/ImportUploadRequest.php b/app/Http/Requests/ImportUploadRequest.php index 3fa5782bc6..813ad6bbd7 100644 --- a/app/Http/Requests/ImportUploadRequest.php +++ b/app/Http/Requests/ImportUploadRequest.php @@ -53,6 +53,5 @@ class ImportUploadRequest extends Request 'import_file_type' => 'required|in:' . join(',', $types), 'configuration_file' => 'file', ]; - } } diff --git a/app/Http/Requests/PiggyBankFormRequest.php b/app/Http/Requests/PiggyBankFormRequest.php index 3e126a2715..d4525faf88 100644 --- a/app/Http/Requests/PiggyBankFormRequest.php +++ b/app/Http/Requests/PiggyBankFormRequest.php @@ -62,7 +62,6 @@ class PiggyBankFormRequest extends Request */ public function rules() { - $nameRule = 'required|between:1,255|uniquePiggyBankForUser'; if (intval($this->get('id'))) { $nameRule = 'required|between:1,255|uniquePiggyBankForUser:' . intval($this->get('id')); diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index 76761deb3c..fa05499a90 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -183,5 +183,4 @@ class ReportFormRequest extends Request 'report_type' => 'in:audit,default,category,budget,tag', ]; } - } diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index 2280099ed0..00ae83beed 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -67,8 +67,6 @@ class TagFormRequest extends Request ]; return $data; - - } /** diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index aababe0719..3dac647c08 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -49,7 +49,6 @@ use Illuminate\Support\Collection; Breadcrumbs::register( 'home', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->push(trans('breadcrumbs.home'), route('index')); } ); @@ -57,7 +56,6 @@ Breadcrumbs::register( Breadcrumbs::register( 'index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->push(trans('breadcrumbs.home'), route('index')); } ); @@ -66,218 +64,237 @@ Breadcrumbs::register( * ACCOUNTS */ Breadcrumbs::register( - 'accounts.index', function (BreadCrumbGenerator $breadcrumbs, string $what) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts'), route('accounts.index', [$what])); -} -); - -Breadcrumbs::register( - 'accounts.create', function (BreadCrumbGenerator $breadcrumbs, string $what) { - $breadcrumbs->parent('accounts.index', $what); - $breadcrumbs->push(trans('firefly.new_' . strtolower(e($what)) . '_account'), route('accounts.create', [$what])); -} -); - -Breadcrumbs::register( - 'accounts.show', function (BreadCrumbGenerator $breadcrumbs, Account $account, string $moment, Carbon $start, Carbon $end) { - $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); - - $breadcrumbs->parent('accounts.index', $what); - $breadcrumbs->push($account->name, route('accounts.show', [$account->id])); - - // push when is all: - if ($moment === 'all') { - $breadcrumbs->push(trans('firefly.everything'), route('accounts.show', [$account->id, 'all'])); + 'accounts.index', + function (BreadCrumbGenerator $breadcrumbs, string $what) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts'), route('accounts.index', [$what])); } - // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { - $title = trans( - 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), +); + +Breadcrumbs::register( + 'accounts.create', + function (BreadCrumbGenerator $breadcrumbs, string $what) { + $breadcrumbs->parent('accounts.index', $what); + $breadcrumbs->push(trans('firefly.new_' . strtolower(e($what)) . '_account'), route('accounts.create', [$what])); + } +); + +Breadcrumbs::register( + 'accounts.show', + function (BreadCrumbGenerator $breadcrumbs, Account $account, string $moment, Carbon $start, Carbon $end) { + $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); + + $breadcrumbs->parent('accounts.index', $what); + $breadcrumbs->push($account->name, route('accounts.show', [$account->id])); + + // push when is all: + if ($moment === 'all') { + $breadcrumbs->push(trans('firefly.everything'), route('accounts.show', [$account->id, 'all'])); + } + // when is specific period or when empty: + if ($moment !== 'all' && $moment !== '(nothing)') { + $title = trans( + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] ); - $breadcrumbs->push($title, route('accounts.show', [$account->id, $moment, $start, $end])); + $breadcrumbs->push($title, route('accounts.show', [$account->id, $moment, $start, $end])); + } } - -} ); Breadcrumbs::register( - 'accounts.delete', function (BreadCrumbGenerator $breadcrumbs, Account $account) { - $breadcrumbs->parent('accounts.show', $account, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push(trans('firefly.delete_account', ['name' => e($account->name)]), route('accounts.delete', [$account->id])); -} + 'accounts.delete', + function (BreadCrumbGenerator $breadcrumbs, Account $account) { + $breadcrumbs->parent('accounts.show', $account, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push(trans('firefly.delete_account', ['name' => e($account->name)]), route('accounts.delete', [$account->id])); + } ); Breadcrumbs::register( - 'accounts.edit', function (BreadCrumbGenerator $breadcrumbs, Account $account) { - $breadcrumbs->parent('accounts.show', $account, '(nothing)', new Carbon, new Carbon); - $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); + 'accounts.edit', + function (BreadCrumbGenerator $breadcrumbs, Account $account) { + $breadcrumbs->parent('accounts.show', $account, '(nothing)', new Carbon, new Carbon); + $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); - $breadcrumbs->push(trans('firefly.edit_' . $what . '_account', ['name' => e($account->name)]), route('accounts.edit', [$account->id])); -} + $breadcrumbs->push(trans('firefly.edit_' . $what . '_account', ['name' => e($account->name)]), route('accounts.edit', [$account->id])); + } ); /** * ADMIN */ Breadcrumbs::register( - 'admin.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.administration'), route('admin.index')); -} + 'admin.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.administration'), route('admin.index')); + } ); Breadcrumbs::register( - 'admin.users', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('admin.index'); - $breadcrumbs->push(trans('firefly.list_all_users'), route('admin.users')); -} + 'admin.users', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('admin.index'); + $breadcrumbs->push(trans('firefly.list_all_users'), route('admin.users')); + } ); Breadcrumbs::register( - 'admin.users.show', function (BreadCrumbGenerator $breadcrumbs, User $user) { - $breadcrumbs->parent('admin.users'); - $breadcrumbs->push(trans('firefly.single_user_administration', ['email' => $user->email]), route('admin.users.show', [$user->id])); -} + 'admin.users.show', + function (BreadCrumbGenerator $breadcrumbs, User $user) { + $breadcrumbs->parent('admin.users'); + $breadcrumbs->push(trans('firefly.single_user_administration', ['email' => $user->email]), route('admin.users.show', [$user->id])); + } ); Breadcrumbs::register( - 'admin.users.edit', function (BreadCrumbGenerator $breadcrumbs, User $user) { - $breadcrumbs->parent('admin.users'); - $breadcrumbs->push(trans('firefly.edit_user', ['email' => $user->email]), route('admin.users.edit', [$user->id])); -} + 'admin.users.edit', + function (BreadCrumbGenerator $breadcrumbs, User $user) { + $breadcrumbs->parent('admin.users'); + $breadcrumbs->push(trans('firefly.edit_user', ['email' => $user->email]), route('admin.users.edit', [$user->id])); + } ); Breadcrumbs::register( - 'admin.users.delete', function (BreadCrumbGenerator $breadcrumbs, User $user) { - $breadcrumbs->parent('admin.users'); - $breadcrumbs->push(trans('firefly.delete_user', ['email' => $user->email]), route('admin.users.delete', [$user->id])); -} + 'admin.users.delete', + function (BreadCrumbGenerator $breadcrumbs, User $user) { + $breadcrumbs->parent('admin.users'); + $breadcrumbs->push(trans('firefly.delete_user', ['email' => $user->email]), route('admin.users.delete', [$user->id])); + } ); Breadcrumbs::register( - 'admin.users.domains', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('admin.index'); - $breadcrumbs->push(trans('firefly.blocked_domains'), route('admin.users.domains')); -} + 'admin.users.domains', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('admin.index'); + $breadcrumbs->push(trans('firefly.blocked_domains'), route('admin.users.domains')); + } ); Breadcrumbs::register( - 'admin.configuration.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('admin.index'); - $breadcrumbs->push(trans('firefly.instance_configuration'), route('admin.configuration.index')); -} + 'admin.configuration.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('admin.index'); + $breadcrumbs->push(trans('firefly.instance_configuration'), route('admin.configuration.index')); + } ); Breadcrumbs::register( - 'admin.links.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('admin.index'); - $breadcrumbs->push(trans('firefly.journal_link_configuration'), route('admin.links.index')); -} + 'admin.links.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('admin.index'); + $breadcrumbs->push(trans('firefly.journal_link_configuration'), route('admin.links.index')); + } ); Breadcrumbs::register( - 'admin.links.create', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('admin.links.index'); - $breadcrumbs->push(trans('firefly.create_new_link_type'), route('admin.links.create')); -} + 'admin.links.create', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('admin.links.index'); + $breadcrumbs->push(trans('firefly.create_new_link_type'), route('admin.links.create')); + } ); Breadcrumbs::register( - 'admin.links.show', function (BreadCrumbGenerator $breadcrumbs, LinkType $linkType) { - $breadcrumbs->parent('admin.links.index'); - $breadcrumbs->push(trans('firefly.overview_for_link', [$linkType->name]), route('admin.links.show', [$linkType->id])); -} + 'admin.links.show', + function (BreadCrumbGenerator $breadcrumbs, LinkType $linkType) { + $breadcrumbs->parent('admin.links.index'); + $breadcrumbs->push(trans('firefly.overview_for_link', [$linkType->name]), route('admin.links.show', [$linkType->id])); + } ); Breadcrumbs::register( - 'admin.links.edit', function (BreadCrumbGenerator $breadcrumbs, LinkType $linkType) { - $breadcrumbs->parent('admin.links.index'); - $breadcrumbs->push(trans('firefly.edit_link_type', ['name' => $linkType->name]), route('admin.links.edit', [$linkType->id])); -} + 'admin.links.edit', + function (BreadCrumbGenerator $breadcrumbs, LinkType $linkType) { + $breadcrumbs->parent('admin.links.index'); + $breadcrumbs->push(trans('firefly.edit_link_type', ['name' => $linkType->name]), route('admin.links.edit', [$linkType->id])); + } ); Breadcrumbs::register( - 'admin.links.delete', function (BreadCrumbGenerator $breadcrumbs, LinkType $linkType) { - $breadcrumbs->parent('admin.links.index'); - $breadcrumbs->push(trans('firefly.delete_link_type', ['name' => $linkType->name]), route('admin.links.delete', [$linkType->id])); -} + 'admin.links.delete', + function (BreadCrumbGenerator $breadcrumbs, LinkType $linkType) { + $breadcrumbs->parent('admin.links.index'); + $breadcrumbs->push(trans('firefly.delete_link_type', ['name' => $linkType->name]), route('admin.links.delete', [$linkType->id])); + } ); Breadcrumbs::register( - 'transactions.link.delete', function (BreadCrumbGenerator $breadcrumbs, TransactionJournalLink $link) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.delete_journal_link'), route('transactions.link.delete', $link->id)); - -} + 'transactions.link.delete', + function (BreadCrumbGenerator $breadcrumbs, TransactionJournalLink $link) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.delete_journal_link'), route('transactions.link.delete', $link->id)); + } ); /** * ATTACHMENTS */ Breadcrumbs::register( - 'attachments.edit', function (BreadCrumbGenerator $breadcrumbs, Attachment $attachment) { - $object = $attachment->attachable; - if ($object instanceof TransactionJournal) { - $breadcrumbs->parent('transactions.show', $object); - $breadcrumbs->push($attachment->filename, route('attachments.edit', [$attachment])); - - } else { - throw new FireflyException('Cannot make breadcrumb for attachment connected to object of type ' . get_class($object)); + 'attachments.edit', + function (BreadCrumbGenerator $breadcrumbs, Attachment $attachment) { + $object = $attachment->attachable; + if ($object instanceof TransactionJournal) { + $breadcrumbs->parent('transactions.show', $object); + $breadcrumbs->push($attachment->filename, route('attachments.edit', [$attachment])); + } else { + throw new FireflyException('Cannot make breadcrumb for attachment connected to object of type ' . get_class($object)); + } } - -} ); Breadcrumbs::register( - 'attachments.delete', function (BreadCrumbGenerator $breadcrumbs, Attachment $attachment) { - - $object = $attachment->attachable; - if ($object instanceof TransactionJournal) { - $breadcrumbs->parent('transactions.show', $object); - $breadcrumbs->push(trans('firefly.delete_attachment', ['name' => $attachment->filename]), route('attachments.edit', [$attachment])); - - } else { - throw new FireflyException('Cannot make breadcrumb for attachment connected to object of type ' . get_class($object)); + 'attachments.delete', + function (BreadCrumbGenerator $breadcrumbs, Attachment $attachment) { + $object = $attachment->attachable; + if ($object instanceof TransactionJournal) { + $breadcrumbs->parent('transactions.show', $object); + $breadcrumbs->push(trans('firefly.delete_attachment', ['name' => $attachment->filename]), route('attachments.edit', [$attachment])); + } else { + throw new FireflyException('Cannot make breadcrumb for attachment connected to object of type ' . get_class($object)); + } } -} ); /** * BILLS */ Breadcrumbs::register( - 'bills.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.bills'), route('bills.index')); -} + 'bills.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.bills'), route('bills.index')); + } ); Breadcrumbs::register( - 'bills.create', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('bills.index'); - $breadcrumbs->push(trans('breadcrumbs.newBill'), route('bills.create')); -} + 'bills.create', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('bills.index'); + $breadcrumbs->push(trans('breadcrumbs.newBill'), route('bills.create')); + } ); Breadcrumbs::register( - 'bills.edit', function (BreadCrumbGenerator $breadcrumbs, Bill $bill) { - $breadcrumbs->parent('bills.show', $bill); - $breadcrumbs->push(trans('breadcrumbs.edit_bill', ['name' => e($bill->name)]), route('bills.edit', [$bill->id])); -} + 'bills.edit', + function (BreadCrumbGenerator $breadcrumbs, Bill $bill) { + $breadcrumbs->parent('bills.show', $bill); + $breadcrumbs->push(trans('breadcrumbs.edit_bill', ['name' => e($bill->name)]), route('bills.edit', [$bill->id])); + } ); Breadcrumbs::register( - 'bills.delete', function (BreadCrumbGenerator $breadcrumbs, Bill $bill) { - $breadcrumbs->parent('bills.show', $bill); - $breadcrumbs->push(trans('breadcrumbs.delete_bill', ['name' => e($bill->name)]), route('bills.delete', [$bill->id])); -} + 'bills.delete', + function (BreadCrumbGenerator $breadcrumbs, Bill $bill) { + $breadcrumbs->parent('bills.show', $bill); + $breadcrumbs->push(trans('breadcrumbs.delete_bill', ['name' => e($bill->name)]), route('bills.delete', [$bill->id])); + } ); Breadcrumbs::register( - 'bills.show', function (BreadCrumbGenerator $breadcrumbs, Bill $bill) { - $breadcrumbs->parent('bills.index'); - $breadcrumbs->push(e($bill->name), route('bills.show', [$bill->id])); - -} + 'bills.show', + function (BreadCrumbGenerator $breadcrumbs, Bill $bill) { + $breadcrumbs->parent('bills.index'); + $breadcrumbs->push(e($bill->name), route('bills.show', [$bill->id])); + } ); @@ -285,148 +302,161 @@ Breadcrumbs::register( * BUDGETS */ Breadcrumbs::register( - 'budgets.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.budgets'), route('budgets.index')); -} -); -Breadcrumbs::register( - 'budgets.create', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('budgets.index'); - $breadcrumbs->push(trans('firefly.create_new_budget'), route('budgets.create')); -} -); - -Breadcrumbs::register( - 'budgets.edit', function (BreadCrumbGenerator $breadcrumbs, Budget $budget) { - $breadcrumbs->parent('budgets.show', $budget); - $breadcrumbs->push(trans('firefly.edit_budget', ['name' => e($budget->name)]), route('budgets.edit', [$budget->id])); -} -); -Breadcrumbs::register( - 'budgets.delete', function (BreadCrumbGenerator $breadcrumbs, Budget $budget) { - $breadcrumbs->parent('budgets.show', $budget); - $breadcrumbs->push(trans('firefly.delete_budget', ['name' => e($budget->name)]), route('budgets.delete', [$budget->id])); -} -); - -Breadcrumbs::register( - 'budgets.no-budget', function (BreadCrumbGenerator $breadcrumbs, string $moment, Carbon $start, Carbon $end) { - $breadcrumbs->parent('budgets.index'); - $breadcrumbs->push(trans('firefly.journals_without_budget'), route('budgets.no-budget')); - - // push when is all: - if ($moment === 'all') { - $breadcrumbs->push(trans('firefly.everything'), route('budgets.no-budget', ['all'])); + 'budgets.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.budgets'), route('budgets.index')); } - // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { - $title = trans( - 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), +); +Breadcrumbs::register( + 'budgets.create', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('budgets.index'); + $breadcrumbs->push(trans('firefly.create_new_budget'), route('budgets.create')); + } +); + +Breadcrumbs::register( + 'budgets.edit', + function (BreadCrumbGenerator $breadcrumbs, Budget $budget) { + $breadcrumbs->parent('budgets.show', $budget); + $breadcrumbs->push(trans('firefly.edit_budget', ['name' => e($budget->name)]), route('budgets.edit', [$budget->id])); + } +); +Breadcrumbs::register( + 'budgets.delete', + function (BreadCrumbGenerator $breadcrumbs, Budget $budget) { + $breadcrumbs->parent('budgets.show', $budget); + $breadcrumbs->push(trans('firefly.delete_budget', ['name' => e($budget->name)]), route('budgets.delete', [$budget->id])); + } +); + +Breadcrumbs::register( + 'budgets.no-budget', + function (BreadCrumbGenerator $breadcrumbs, string $moment, Carbon $start, Carbon $end) { + $breadcrumbs->parent('budgets.index'); + $breadcrumbs->push(trans('firefly.journals_without_budget'), route('budgets.no-budget')); + + // push when is all: + if ($moment === 'all') { + $breadcrumbs->push(trans('firefly.everything'), route('budgets.no-budget', ['all'])); + } + // when is specific period or when empty: + if ($moment !== 'all' && $moment !== '(nothing)') { + $title = trans( + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] ); - $breadcrumbs->push($title, route('budgets.no-budget', [$moment])); + $breadcrumbs->push($title, route('budgets.no-budget', [$moment])); + } } - - -} ); Breadcrumbs::register( - 'budgets.show', function (BreadCrumbGenerator $breadcrumbs, Budget $budget) { - $breadcrumbs->parent('budgets.index'); - $breadcrumbs->push(e($budget->name), route('budgets.show', [$budget->id])); - $breadcrumbs->push(trans('firefly.everything'), route('budgets.show', [$budget->id])); -} + 'budgets.show', + function (BreadCrumbGenerator $breadcrumbs, Budget $budget) { + $breadcrumbs->parent('budgets.index'); + $breadcrumbs->push(e($budget->name), route('budgets.show', [$budget->id])); + $breadcrumbs->push(trans('firefly.everything'), route('budgets.show', [$budget->id])); + } ); Breadcrumbs::register( - 'budgets.show.limit', function (BreadCrumbGenerator $breadcrumbs, Budget $budget, BudgetLimit $budgetLimit) { - $breadcrumbs->parent('budgets.index'); - $breadcrumbs->push(e($budget->name), route('budgets.show', [$budget->id])); + 'budgets.show.limit', + function (BreadCrumbGenerator $breadcrumbs, Budget $budget, BudgetLimit $budgetLimit) { + $breadcrumbs->parent('budgets.index'); + $breadcrumbs->push(e($budget->name), route('budgets.show', [$budget->id])); - $title = trans( - 'firefly.between_dates_breadcrumb', ['start' => $budgetLimit->start_date->formatLocalized(strval(trans('config.month_and_day'))), + $title = trans( + 'firefly.between_dates_breadcrumb', + ['start' => $budgetLimit->start_date->formatLocalized(strval(trans('config.month_and_day'))), 'end' => $budgetLimit->end_date->formatLocalized(strval(trans('config.month_and_day'))),] ); - $breadcrumbs->push( - $title, route('budgets.show.limit', [$budget->id, $budgetLimit->id]) + $breadcrumbs->push( + $title, + route('budgets.show.limit', [$budget->id, $budgetLimit->id]) ); -} + } ); /** * CATEGORIES */ Breadcrumbs::register( - 'categories.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.categories'), route('categories.index')); -} -); -Breadcrumbs::register( - 'categories.create', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('categories.index'); - $breadcrumbs->push(trans('firefly.new_category'), route('categories.create')); -} -); - -Breadcrumbs::register( - 'categories.edit', function (BreadCrumbGenerator $breadcrumbs, Category $category) { - $breadcrumbs->parent('categories.show', $category, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push(trans('firefly.edit_category', ['name' => e($category->name)]), route('categories.edit', [$category->id])); -} -); -Breadcrumbs::register( - 'categories.delete', function (BreadCrumbGenerator $breadcrumbs, Category $category) { - $breadcrumbs->parent('categories.show', $category, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push(trans('firefly.delete_category', ['name' => e($category->name)]), route('categories.delete', [$category->id])); -} -); - -Breadcrumbs::register( - 'categories.show', function (BreadCrumbGenerator $breadcrumbs, Category $category, string $moment, Carbon $start, Carbon $end) { - - $breadcrumbs->parent('categories.index'); - $breadcrumbs->push($category->name, route('categories.show', [$category->id])); - - // push when is all: - if ($moment === 'all') { - $breadcrumbs->push(trans('firefly.everything'), route('categories.show', [$category->id, 'all'])); + 'categories.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.categories'), route('categories.index')); } - // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { - $title = trans( - 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), +); +Breadcrumbs::register( + 'categories.create', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('categories.index'); + $breadcrumbs->push(trans('firefly.new_category'), route('categories.create')); + } +); + +Breadcrumbs::register( + 'categories.edit', + function (BreadCrumbGenerator $breadcrumbs, Category $category) { + $breadcrumbs->parent('categories.show', $category, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push(trans('firefly.edit_category', ['name' => e($category->name)]), route('categories.edit', [$category->id])); + } +); +Breadcrumbs::register( + 'categories.delete', + function (BreadCrumbGenerator $breadcrumbs, Category $category) { + $breadcrumbs->parent('categories.show', $category, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push(trans('firefly.delete_category', ['name' => e($category->name)]), route('categories.delete', [$category->id])); + } +); + +Breadcrumbs::register( + 'categories.show', + function (BreadCrumbGenerator $breadcrumbs, Category $category, string $moment, Carbon $start, Carbon $end) { + $breadcrumbs->parent('categories.index'); + $breadcrumbs->push($category->name, route('categories.show', [$category->id])); + + // push when is all: + if ($moment === 'all') { + $breadcrumbs->push(trans('firefly.everything'), route('categories.show', [$category->id, 'all'])); + } + // when is specific period or when empty: + if ($moment !== 'all' && $moment !== '(nothing)') { + $title = trans( + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] ); - $breadcrumbs->push($title, route('categories.show', [$category->id, $moment])); + $breadcrumbs->push($title, route('categories.show', [$category->id, $moment])); + } } -} ); Breadcrumbs::register( - 'categories.no-category', function (BreadCrumbGenerator $breadcrumbs, string $moment, Carbon $start, Carbon $end) { - $breadcrumbs->parent('categories.index'); - $breadcrumbs->push(trans('firefly.journals_without_category'), route('categories.no-category')); + 'categories.no-category', + function (BreadCrumbGenerator $breadcrumbs, string $moment, Carbon $start, Carbon $end) { + $breadcrumbs->parent('categories.index'); + $breadcrumbs->push(trans('firefly.journals_without_category'), route('categories.no-category')); - // push when is all: - if ($moment === 'all') { - $breadcrumbs->push(trans('firefly.everything'), route('categories.no-category', ['all'])); - } - // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { - $title = trans( - 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), + // push when is all: + if ($moment === 'all') { + $breadcrumbs->push(trans('firefly.everything'), route('categories.no-category', ['all'])); + } + // when is specific period or when empty: + if ($moment !== 'all' && $moment !== '(nothing)') { + $title = trans( + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] ); - $breadcrumbs->push($title, route('categories.no-category', [$moment])); + $breadcrumbs->push($title, route('categories.no-category', [$moment])); + } } - - -} ); @@ -434,315 +464,350 @@ Breadcrumbs::register( * CURRENCIES */ Breadcrumbs::register( - 'currencies.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.currencies'), route('currencies.index')); -} + 'currencies.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.currencies'), route('currencies.index')); + } ); Breadcrumbs::register( - 'currencies.create', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('currencies.index'); - $breadcrumbs->push(trans('firefly.create_currency'), route('currencies.create')); -} + 'currencies.create', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('currencies.index'); + $breadcrumbs->push(trans('firefly.create_currency'), route('currencies.create')); + } ); Breadcrumbs::register( - 'currencies.edit', function (BreadCrumbGenerator $breadcrumbs, TransactionCurrency $currency) { - $breadcrumbs->parent('currencies.index'); - $breadcrumbs->push(trans('breadcrumbs.edit_currency', ['name' => e($currency->name)]), route('currencies.edit', [$currency->id])); -} + 'currencies.edit', + function (BreadCrumbGenerator $breadcrumbs, TransactionCurrency $currency) { + $breadcrumbs->parent('currencies.index'); + $breadcrumbs->push(trans('breadcrumbs.edit_currency', ['name' => e($currency->name)]), route('currencies.edit', [$currency->id])); + } ); Breadcrumbs::register( - 'currencies.delete', function (BreadCrumbGenerator $breadcrumbs, TransactionCurrency $currency) { - $breadcrumbs->parent('currencies.index'); - $breadcrumbs->push(trans('breadcrumbs.delete_currency', ['name' => e($currency->name)]), route('currencies.delete', [$currency->id])); -} + 'currencies.delete', + function (BreadCrumbGenerator $breadcrumbs, TransactionCurrency $currency) { + $breadcrumbs->parent('currencies.index'); + $breadcrumbs->push(trans('breadcrumbs.delete_currency', ['name' => e($currency->name)]), route('currencies.delete', [$currency->id])); + } ); /** * EXPORT */ Breadcrumbs::register( - 'export.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.export_data'), route('export.index')); -} + 'export.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.export_data'), route('export.index')); + } ); /** * PIGGY BANKS */ Breadcrumbs::register( - 'piggy-banks.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.piggyBanks'), route('piggy-banks.index')); -} + 'piggy-banks.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.piggyBanks'), route('piggy-banks.index')); + } ); Breadcrumbs::register( - 'piggy-banks.create', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('piggy-banks.index'); - $breadcrumbs->push(trans('breadcrumbs.newPiggyBank'), route('piggy-banks.create')); -} + 'piggy-banks.create', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('piggy-banks.index'); + $breadcrumbs->push(trans('breadcrumbs.newPiggyBank'), route('piggy-banks.create')); + } ); Breadcrumbs::register( - 'piggy-banks.edit', function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { - $breadcrumbs->parent('piggy-banks.show', $piggyBank); - $breadcrumbs->push(trans('breadcrumbs.edit_piggyBank', ['name' => e($piggyBank->name)]), route('piggy-banks.edit', [$piggyBank->id])); -} + 'piggy-banks.edit', + function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { + $breadcrumbs->parent('piggy-banks.show', $piggyBank); + $breadcrumbs->push(trans('breadcrumbs.edit_piggyBank', ['name' => e($piggyBank->name)]), route('piggy-banks.edit', [$piggyBank->id])); + } ); Breadcrumbs::register( - 'piggy-banks.delete', function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { - $breadcrumbs->parent('piggy-banks.show', $piggyBank); - $breadcrumbs->push(trans('firefly.delete_piggy_bank', ['name' => e($piggyBank->name)]), route('piggy-banks.delete', [$piggyBank->id])); -} + 'piggy-banks.delete', + function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { + $breadcrumbs->parent('piggy-banks.show', $piggyBank); + $breadcrumbs->push(trans('firefly.delete_piggy_bank', ['name' => e($piggyBank->name)]), route('piggy-banks.delete', [$piggyBank->id])); + } ); Breadcrumbs::register( - 'piggy-banks.show', function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { - $breadcrumbs->parent('piggy-banks.index'); - $breadcrumbs->push(e($piggyBank->name), route('piggy-banks.show', [$piggyBank->id])); -} + 'piggy-banks.show', + function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { + $breadcrumbs->parent('piggy-banks.index'); + $breadcrumbs->push(e($piggyBank->name), route('piggy-banks.show', [$piggyBank->id])); + } ); Breadcrumbs::register( - 'piggy-banks.add-money-mobile', function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { - $breadcrumbs->parent('piggy-banks.show', $piggyBank); - $breadcrumbs->push(trans('firefly.add_money_to_piggy', ['name' => $piggyBank->name]), route('piggy-banks.add-money-mobile', [$piggyBank->id])); -} + 'piggy-banks.add-money-mobile', + function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { + $breadcrumbs->parent('piggy-banks.show', $piggyBank); + $breadcrumbs->push(trans('firefly.add_money_to_piggy', ['name' => $piggyBank->name]), route('piggy-banks.add-money-mobile', [$piggyBank->id])); + } ); Breadcrumbs::register( - 'piggy-banks.remove-money-mobile', function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { - $breadcrumbs->parent('piggy-banks.show', $piggyBank); - $breadcrumbs->push( - trans('firefly.remove_money_from_piggy_title', ['name' => $piggyBank->name]), route('piggy-banks.remove-money-mobile', [$piggyBank->id]) + 'piggy-banks.remove-money-mobile', + function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { + $breadcrumbs->parent('piggy-banks.show', $piggyBank); + $breadcrumbs->push( + trans('firefly.remove_money_from_piggy_title', ['name' => $piggyBank->name]), + route('piggy-banks.remove-money-mobile', [$piggyBank->id]) ); -} + } ); /** * IMPORT */ Breadcrumbs::register( - 'import.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.import'), route('import.index')); -} + 'import.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.import'), route('import.index')); + } ); /** * FILE IMPORT */ Breadcrumbs::register( - 'import.file.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('import.index'); - $breadcrumbs->push(trans('firefly.import_file'), route('import.file.index')); -} + 'import.file.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('import.index'); + $breadcrumbs->push(trans('firefly.import_file'), route('import.file.index')); + } ); Breadcrumbs::register( - 'import.file.configure', function (BreadCrumbGenerator $breadcrumbs, ImportJob $job) { - $breadcrumbs->parent('import.file.index'); - $breadcrumbs->push(trans('firefly.import_config_sub_title', ['key' => $job->key]), route('import.file.configure', [$job->key])); -} + 'import.file.configure', + function (BreadCrumbGenerator $breadcrumbs, ImportJob $job) { + $breadcrumbs->parent('import.file.index'); + $breadcrumbs->push(trans('firefly.import_config_sub_title', ['key' => $job->key]), route('import.file.configure', [$job->key])); + } ); Breadcrumbs::register( - 'import.file.status', function (BreadCrumbGenerator $breadcrumbs, ImportJob $job) { - $breadcrumbs->parent('import.file.index'); - $breadcrumbs->push(trans('firefly.import_status_bread_crumb', ['key' => $job->key]), route('import.file.status', [$job->key])); -} + 'import.file.status', + function (BreadCrumbGenerator $breadcrumbs, ImportJob $job) { + $breadcrumbs->parent('import.file.index'); + $breadcrumbs->push(trans('firefly.import_status_bread_crumb', ['key' => $job->key]), route('import.file.status', [$job->key])); + } ); /** * PREFERENCES */ Breadcrumbs::register( - 'preferences.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.preferences'), route('preferences.index')); -} + 'preferences.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.preferences'), route('preferences.index')); + } ); Breadcrumbs::register( - 'preferences.code', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.preferences'), route('preferences.index')); - -} + 'preferences.code', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.preferences'), route('preferences.index')); + } ); /** * PROFILE */ Breadcrumbs::register( - 'profile.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.profile'), route('profile.index')); - -} + 'profile.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.profile'), route('profile.index')); + } ); Breadcrumbs::register( - 'profile.change-password', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('profile.index'); - $breadcrumbs->push(trans('breadcrumbs.changePassword'), route('profile.change-password')); - -} + 'profile.change-password', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('profile.index'); + $breadcrumbs->push(trans('breadcrumbs.changePassword'), route('profile.change-password')); + } ); Breadcrumbs::register( - 'profile.delete-account', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('profile.index'); - $breadcrumbs->push(trans('firefly.delete_account'), route('profile.delete-account')); - -} + 'profile.delete-account', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('profile.index'); + $breadcrumbs->push(trans('firefly.delete_account'), route('profile.delete-account')); + } ); /** * REPORTS */ Breadcrumbs::register( - 'reports.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.reports'), route('reports.index')); -} + 'reports.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.reports'), route('reports.index')); + } ); Breadcrumbs::register( - 'reports.report.audit', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) { - $breadcrumbs->parent('reports.index'); + 'reports.report.audit', + function (BreadCrumbGenerator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) { + $breadcrumbs->parent('reports.index'); - $monthFormat = (string)trans('config.month_and_day'); - $startString = $start->formatLocalized($monthFormat); - $endString = $end->formatLocalized($monthFormat); - $title = (string)trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]); + $monthFormat = (string)trans('config.month_and_day'); + $startString = $start->formatLocalized($monthFormat); + $endString = $end->formatLocalized($monthFormat); + $title = (string)trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]); - $breadcrumbs->push($title, route('reports.report.audit', [$accountIds, $start->format('Ymd'), $end->format('Ymd')])); -} + $breadcrumbs->push($title, route('reports.report.audit', [$accountIds, $start->format('Ymd'), $end->format('Ymd')])); + } ); Breadcrumbs::register( - 'reports.report.budget', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, string $budgetIds, Carbon $start, Carbon $end) { - $breadcrumbs->parent('reports.index'); + 'reports.report.budget', + function (BreadCrumbGenerator $breadcrumbs, string $accountIds, string $budgetIds, Carbon $start, Carbon $end) { + $breadcrumbs->parent('reports.index'); - $monthFormat = (string)trans('config.month_and_day'); - $startString = $start->formatLocalized($monthFormat); - $endString = $end->formatLocalized($monthFormat); - $title = (string)trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]); + $monthFormat = (string)trans('config.month_and_day'); + $startString = $start->formatLocalized($monthFormat); + $endString = $end->formatLocalized($monthFormat); + $title = (string)trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]); - $breadcrumbs->push($title, route('reports.report.budget', [$accountIds, $budgetIds, $start->format('Ymd'), $end->format('Ymd')])); -} + $breadcrumbs->push($title, route('reports.report.budget', [$accountIds, $budgetIds, $start->format('Ymd'), $end->format('Ymd')])); + } ); Breadcrumbs::register( - 'reports.report.tag', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, string $tagTags, Carbon $start, Carbon $end) { - $breadcrumbs->parent('reports.index'); + 'reports.report.tag', + function (BreadCrumbGenerator $breadcrumbs, string $accountIds, string $tagTags, Carbon $start, Carbon $end) { + $breadcrumbs->parent('reports.index'); - $monthFormat = (string)trans('config.month_and_day'); - $startString = $start->formatLocalized($monthFormat); - $endString = $end->formatLocalized($monthFormat); - $title = (string)trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]); + $monthFormat = (string)trans('config.month_and_day'); + $startString = $start->formatLocalized($monthFormat); + $endString = $end->formatLocalized($monthFormat); + $title = (string)trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]); - $breadcrumbs->push($title, route('reports.report.tag', [$accountIds, $tagTags, $start->format('Ymd'), $end->format('Ymd')])); -} + $breadcrumbs->push($title, route('reports.report.tag', [$accountIds, $tagTags, $start->format('Ymd'), $end->format('Ymd')])); + } ); Breadcrumbs::register( - 'reports.report.category', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, string $categoryIds, Carbon $start, Carbon $end) { - $breadcrumbs->parent('reports.index'); + 'reports.report.category', + function (BreadCrumbGenerator $breadcrumbs, string $accountIds, string $categoryIds, Carbon $start, Carbon $end) { + $breadcrumbs->parent('reports.index'); - $monthFormat = (string)trans('config.month_and_day'); - $startString = $start->formatLocalized($monthFormat); - $endString = $end->formatLocalized($monthFormat); - $title = (string)trans('firefly.report_category', ['start' => $startString, 'end' => $endString]); + $monthFormat = (string)trans('config.month_and_day'); + $startString = $start->formatLocalized($monthFormat); + $endString = $end->formatLocalized($monthFormat); + $title = (string)trans('firefly.report_category', ['start' => $startString, 'end' => $endString]); - $breadcrumbs->push($title, route('reports.report.category', [$accountIds, $categoryIds, $start->format('Ymd'), $end->format('Ymd')])); -} + $breadcrumbs->push($title, route('reports.report.category', [$accountIds, $categoryIds, $start->format('Ymd'), $end->format('Ymd')])); + } ); Breadcrumbs::register( - 'reports.report.default', function (BreadCrumbGenerator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) { - $breadcrumbs->parent('reports.index'); + 'reports.report.default', + function (BreadCrumbGenerator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) { + $breadcrumbs->parent('reports.index'); - $monthFormat = (string)trans('config.month_and_day'); - $startString = $start->formatLocalized($monthFormat); - $endString = $end->formatLocalized($monthFormat); - $title = (string)trans('firefly.report_default', ['start' => $startString, 'end' => $endString]); + $monthFormat = (string)trans('config.month_and_day'); + $startString = $start->formatLocalized($monthFormat); + $endString = $end->formatLocalized($monthFormat); + $title = (string)trans('firefly.report_default', ['start' => $startString, 'end' => $endString]); - $breadcrumbs->push($title, route('reports.report.default', [$accountIds, $start->format('Ymd'), $end->format('Ymd')])); -} + $breadcrumbs->push($title, route('reports.report.default', [$accountIds, $start->format('Ymd'), $end->format('Ymd')])); + } ); /** * New user Controller */ Breadcrumbs::register( - 'new-user.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.getting_started'), route('new-user.index')); -} + 'new-user.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.getting_started'), route('new-user.index')); + } ); /** * Rules */ Breadcrumbs::register( - 'rules.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('firefly.rules'), route('rules.index')); -} + 'rules.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.rules'), route('rules.index')); + } ); Breadcrumbs::register( - 'rules.create', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { - $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.make_new_rule', ['title' => $ruleGroup->title]), route('rules.create', [$ruleGroup])); -} + 'rules.create', + function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { + $breadcrumbs->parent('rules.index'); + $breadcrumbs->push(trans('firefly.make_new_rule', ['title' => $ruleGroup->title]), route('rules.create', [$ruleGroup])); + } ); Breadcrumbs::register( - 'rules.edit', function (BreadCrumbGenerator $breadcrumbs, Rule $rule) { - $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.edit_rule', ['title' => $rule->title]), route('rules.edit', [$rule])); -} + 'rules.edit', + function (BreadCrumbGenerator $breadcrumbs, Rule $rule) { + $breadcrumbs->parent('rules.index'); + $breadcrumbs->push(trans('firefly.edit_rule', ['title' => $rule->title]), route('rules.edit', [$rule])); + } ); Breadcrumbs::register( - 'rules.delete', function (BreadCrumbGenerator $breadcrumbs, Rule $rule) { - $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.delete_rule', ['title' => $rule->title]), route('rules.delete', [$rule])); -} + 'rules.delete', + function (BreadCrumbGenerator $breadcrumbs, Rule $rule) { + $breadcrumbs->parent('rules.index'); + $breadcrumbs->push(trans('firefly.delete_rule', ['title' => $rule->title]), route('rules.delete', [$rule])); + } ); Breadcrumbs::register( - 'rule-groups.create', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.make_new_rule_group'), route('rule-groups.create')); -} + 'rule-groups.create', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('rules.index'); + $breadcrumbs->push(trans('firefly.make_new_rule_group'), route('rule-groups.create')); + } ); Breadcrumbs::register( - 'rule-groups.edit', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { - $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.edit_rule_group', ['title' => $ruleGroup->title]), route('rule-groups.edit', [$ruleGroup])); -} + 'rule-groups.edit', + function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { + $breadcrumbs->parent('rules.index'); + $breadcrumbs->push(trans('firefly.edit_rule_group', ['title' => $ruleGroup->title]), route('rule-groups.edit', [$ruleGroup])); + } ); Breadcrumbs::register( - 'rule-groups.delete', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { - $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.delete_rule_group', ['title' => $ruleGroup->title]), route('rule-groups.delete', [$ruleGroup])); -} + 'rule-groups.delete', + function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { + $breadcrumbs->parent('rules.index'); + $breadcrumbs->push(trans('firefly.delete_rule_group', ['title' => $ruleGroup->title]), route('rule-groups.delete', [$ruleGroup])); + } ); Breadcrumbs::register( - 'rule-groups.select-transactions', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { - $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.rule_group_select_transactions', ['title' => $ruleGroup->title]), route('rule-groups.select-transactions', [$ruleGroup])); -} + 'rule-groups.select-transactions', + function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { + $breadcrumbs->parent('rules.index'); + $breadcrumbs->push(trans('firefly.rule_group_select_transactions', ['title' => $ruleGroup->title]), route('rule-groups.select-transactions', [$ruleGroup])); + } ); Breadcrumbs::register( - 'rule-groups.select_transactions', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { - $breadcrumbs->parent('rules.index'); - $breadcrumbs->push( - trans('firefly.execute_group_on_existing_transactions', ['title' => $ruleGroup->title]), route('rule-groups.select_transactions', [$ruleGroup]) + 'rule-groups.select_transactions', + function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { + $breadcrumbs->parent('rules.index'); + $breadcrumbs->push( + trans('firefly.execute_group_on_existing_transactions', ['title' => $ruleGroup->title]), + route('rule-groups.select_transactions', [$ruleGroup]) ); -} + } ); @@ -750,10 +815,11 @@ Breadcrumbs::register( * SEARCH */ Breadcrumbs::register( - 'search.index', function (BreadCrumbGenerator $breadcrumbs, $query) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.search_result', ['query' => e($query)]), route('search.index')); -} + 'search.index', + function (BreadCrumbGenerator $breadcrumbs, $query) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.search_result', ['query' => e($query)]), route('search.index')); + } ); @@ -761,146 +827,154 @@ Breadcrumbs::register( * TAGS */ Breadcrumbs::register( - 'tags.index', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.tags'), route('tags.index')); -} -); - -Breadcrumbs::register( - 'tags.create', function (BreadCrumbGenerator $breadcrumbs) { - $breadcrumbs->parent('tags.index'); - $breadcrumbs->push(trans('breadcrumbs.createTag'), route('tags.create')); -} -); - -Breadcrumbs::register( - 'tags.edit', function (BreadCrumbGenerator $breadcrumbs, Tag $tag) { - $breadcrumbs->parent('tags.show', $tag, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push(trans('breadcrumbs.edit_tag', ['tag' => e($tag->tag)]), route('tags.edit', [$tag->id])); -} -); - -Breadcrumbs::register( - 'tags.delete', function (BreadCrumbGenerator $breadcrumbs, Tag $tag) { - $breadcrumbs->parent('tags.show', $tag, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push(trans('breadcrumbs.delete_tag', ['tag' => e($tag->tag)]), route('tags.delete', [$tag->id])); -} -); - - -Breadcrumbs::register( - 'tags.show', function (BreadCrumbGenerator $breadcrumbs, Tag $tag, string $moment, Carbon $start, Carbon $end) { - $breadcrumbs->parent('tags.index'); - $breadcrumbs->push(e($tag->tag), route('tags.show', [$tag->id, $moment])); - if ($moment === 'all') { - $breadcrumbs->push(trans('firefly.everything'), route('tags.show', [$tag->id, $moment])); + 'tags.index', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.tags'), route('tags.index')); } - // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { - $title = trans( - 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), +); + +Breadcrumbs::register( + 'tags.create', + function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('tags.index'); + $breadcrumbs->push(trans('breadcrumbs.createTag'), route('tags.create')); + } +); + +Breadcrumbs::register( + 'tags.edit', + function (BreadCrumbGenerator $breadcrumbs, Tag $tag) { + $breadcrumbs->parent('tags.show', $tag, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push(trans('breadcrumbs.edit_tag', ['tag' => e($tag->tag)]), route('tags.edit', [$tag->id])); + } +); + +Breadcrumbs::register( + 'tags.delete', + function (BreadCrumbGenerator $breadcrumbs, Tag $tag) { + $breadcrumbs->parent('tags.show', $tag, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push(trans('breadcrumbs.delete_tag', ['tag' => e($tag->tag)]), route('tags.delete', [$tag->id])); + } +); + + +Breadcrumbs::register( + 'tags.show', + function (BreadCrumbGenerator $breadcrumbs, Tag $tag, string $moment, Carbon $start, Carbon $end) { + $breadcrumbs->parent('tags.index'); + $breadcrumbs->push(e($tag->tag), route('tags.show', [$tag->id, $moment])); + if ($moment === 'all') { + $breadcrumbs->push(trans('firefly.everything'), route('tags.show', [$tag->id, $moment])); + } + // when is specific period or when empty: + if ($moment !== 'all' && $moment !== '(nothing)') { + $title = trans( + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] ); - $breadcrumbs->push($title, route('tags.show', [$tag->id, $moment])); + $breadcrumbs->push($title, route('tags.show', [$tag->id, $moment])); + } } -} ); /** * TRANSACTIONS */ Breadcrumbs::register( - 'transactions.index', function (BreadCrumbGenerator $breadcrumbs, string $what, string $moment = '', Carbon $start, Carbon $end) { + 'transactions.index', + function (BreadCrumbGenerator $breadcrumbs, string $what, string $moment = '', Carbon $start, Carbon $end) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what])); + if ($moment === 'all') { + $breadcrumbs->push(trans('firefly.everything'), route('transactions.index', [$what, 'all'])); + } - - $breadcrumbs->parent('home'); - $breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what])); - if ($moment === 'all') { - $breadcrumbs->push(trans('firefly.everything'), route('transactions.index', [$what, 'all'])); - } - - // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { - $title = trans( - 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), + // when is specific period or when empty: + if ($moment !== 'all' && $moment !== '(nothing)') { + $title = trans( + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] ); - $breadcrumbs->push($title, route('transactions.index', [$what, $moment])); + $breadcrumbs->push($title, route('transactions.index', [$what, $moment])); + } } - -} ); Breadcrumbs::register( - 'transactions.create', function (BreadCrumbGenerator $breadcrumbs, string $what) { - $breadcrumbs->parent('transactions.index', $what, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push(trans('breadcrumbs.create_' . e($what)), route('transactions.create', [$what])); -} + 'transactions.create', + function (BreadCrumbGenerator $breadcrumbs, string $what) { + $breadcrumbs->parent('transactions.index', $what, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push(trans('breadcrumbs.create_' . e($what)), route('transactions.create', [$what])); + } ); Breadcrumbs::register( - 'transactions.edit', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { - $breadcrumbs->parent('transactions.show', $journal); - $breadcrumbs->push(trans('breadcrumbs.edit_journal', ['description' => $journal->description]), route('transactions.edit', [$journal->id])); -} + 'transactions.edit', + function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { + $breadcrumbs->parent('transactions.show', $journal); + $breadcrumbs->push(trans('breadcrumbs.edit_journal', ['description' => $journal->description]), route('transactions.edit', [$journal->id])); + } ); Breadcrumbs::register( - 'transactions.delete', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { - $breadcrumbs->parent('transactions.show', $journal); - $breadcrumbs->push(trans('breadcrumbs.delete_journal', ['description' => e($journal->description)]), route('transactions.delete', [$journal->id])); -} + 'transactions.delete', + function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { + $breadcrumbs->parent('transactions.show', $journal); + $breadcrumbs->push(trans('breadcrumbs.delete_journal', ['description' => e($journal->description)]), route('transactions.delete', [$journal->id])); + } ); Breadcrumbs::register( - 'transactions.show', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { - - $what = strtolower($journal->transactionType->type); - $breadcrumbs->parent('transactions.index', $what, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push($journal->description, route('transactions.show', [$journal->id])); -} + 'transactions.show', + function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { + $what = strtolower($journal->transactionType->type); + $breadcrumbs->parent('transactions.index', $what, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push($journal->description, route('transactions.show', [$journal->id])); + } ); Breadcrumbs::register( - 'transactions.convert', function (BreadCrumbGenerator $breadcrumbs, TransactionType $destinationType, TransactionJournal $journal) { - - $breadcrumbs->parent('transactions.show', $journal); - $breadcrumbs->push( + 'transactions.convert', + function (BreadCrumbGenerator $breadcrumbs, TransactionType $destinationType, TransactionJournal $journal) { + $breadcrumbs->parent('transactions.show', $journal); + $breadcrumbs->push( trans('firefly.convert_to_' . $destinationType->type, ['description' => $journal->description]), route('transactions.convert.index', [strtolower($destinationType->type), $journal->id]) ); -} + } ); /** * MASS TRANSACTION EDIT / DELETE */ Breadcrumbs::register( - 'transactions.mass.edit', function (BreadCrumbGenerator $breadcrumbs, Collection $journals): void { + 'transactions.mass.edit', + function (BreadCrumbGenerator $breadcrumbs, Collection $journals): void { + if ($journals->count() > 0) { + $journalIds = $journals->pluck('id')->toArray(); + $what = strtolower($journals->first()->transactionType->type); + $breadcrumbs->parent('transactions.index', $what, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push(trans('firefly.mass_edit_journals'), route('transactions.mass.edit', $journalIds)); - if ($journals->count() > 0) { - $journalIds = $journals->pluck('id')->toArray(); - $what = strtolower($journals->first()->transactionType->type); - $breadcrumbs->parent('transactions.index', $what, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push(trans('firefly.mass_edit_journals'), route('transactions.mass.edit', $journalIds)); + return; + } + + $breadcrumbs->parent('index'); return; } - - $breadcrumbs->parent('index'); - - return; -} ); Breadcrumbs::register( - 'transactions.mass.delete', function (BreadCrumbGenerator $breadcrumbs, Collection $journals) { - - $journalIds = $journals->pluck('id')->toArray(); - $what = strtolower($journals->first()->transactionType->type); - $breadcrumbs->parent('transactions.index', $what, '(nothing)', new Carbon, new Carbon); - $breadcrumbs->push(trans('firefly.mass_edit_journals'), route('transactions.mass.delete', $journalIds)); -} + 'transactions.mass.delete', + function (BreadCrumbGenerator $breadcrumbs, Collection $journals) { + $journalIds = $journals->pluck('id')->toArray(); + $what = strtolower($journals->first()->transactionType->type); + $breadcrumbs->parent('transactions.index', $what, '(nothing)', new Carbon, new Carbon); + $breadcrumbs->push(trans('firefly.mass_edit_journals'), route('transactions.mass.delete', $journalIds)); + } ); @@ -908,8 +982,9 @@ Breadcrumbs::register( * SPLIT */ Breadcrumbs::register( - 'transactions.split.edit', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { - $breadcrumbs->parent('transactions.show', $journal); - $breadcrumbs->push(trans('breadcrumbs.edit_journal', ['description' => $journal->description]), route('transactions.split.edit', [$journal->id])); -} + 'transactions.split.edit', + function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { + $breadcrumbs->parent('transactions.show', $journal); + $breadcrumbs->push(trans('breadcrumbs.edit_journal', ['description' => $journal->description]), route('transactions.split.edit', [$journal->id])); + } ); diff --git a/app/Import/Configurator/ConfiguratorInterface.php b/app/Import/Configurator/ConfiguratorInterface.php index 70a98e55e1..64230bc552 100644 --- a/app/Import/Configurator/ConfiguratorInterface.php +++ b/app/Import/Configurator/ConfiguratorInterface.php @@ -80,5 +80,4 @@ interface ConfiguratorInterface * @return void */ public function setJob(ImportJob $job); - } diff --git a/app/Import/Configurator/CsvConfigurator.php b/app/Import/Configurator/CsvConfigurator.php index 24440ebfa1..217b72b332 100644 --- a/app/Import/Configurator/CsvConfigurator.php +++ b/app/Import/Configurator/CsvConfigurator.php @@ -87,7 +87,6 @@ class CsvConfigurator implements ConfiguratorInterface $object->setJob($job); return $object->getData(); - } /** diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php index 9ed5b426d3..d9e98f73d8 100644 --- a/app/Import/Converter/Amount.php +++ b/app/Import/Converter/Amount.php @@ -93,6 +93,5 @@ class Amount implements ConverterInterface } return strval(round(floatval($value), 12)); - } } diff --git a/app/Import/Converter/INGDebetCredit.php b/app/Import/Converter/INGDebetCredit.php index 2ce63b66b5..04eb26cfa3 100644 --- a/app/Import/Converter/INGDebetCredit.php +++ b/app/Import/Converter/INGDebetCredit.php @@ -51,6 +51,5 @@ class INGDebetCredit implements ConverterInterface Log::debug('Return 1'); return 1; - } } diff --git a/app/Import/FileProcessor/CsvProcessor.php b/app/Import/FileProcessor/CsvProcessor.php index 956a2da617..7dd6e83da2 100644 --- a/app/Import/FileProcessor/CsvProcessor.php +++ b/app/Import/FileProcessor/CsvProcessor.php @@ -285,7 +285,6 @@ class CsvProcessor implements FileProcessorInterface } return false; - } /** @@ -301,7 +300,6 @@ class CsvProcessor implements FileProcessorInterface $config = $this->job->configuration; $names = array_keys($config['specifics']); foreach ($names as $name) { - if (!in_array($name, $this->validSpecifics)) { throw new FireflyException(sprintf('"%s" is not a valid class name', $name)); } @@ -314,6 +312,5 @@ class CsvProcessor implements FileProcessorInterface } return $row; - } } diff --git a/app/Import/Mapper/AssetAccountIbans.php b/app/Import/Mapper/AssetAccountIbans.php index 0bcc9407d0..b5d5699529 100644 --- a/app/Import/Mapper/AssetAccountIbans.php +++ b/app/Import/Mapper/AssetAccountIbans.php @@ -63,6 +63,5 @@ class AssetAccountIbans implements MapperInterface $list = [0 => trans('csv.map_do_not_map')] + $list; return $list; - } } diff --git a/app/Import/Mapper/AssetAccounts.php b/app/Import/Mapper/AssetAccounts.php index 936c496ef2..e12b33340d 100644 --- a/app/Import/Mapper/AssetAccounts.php +++ b/app/Import/Mapper/AssetAccounts.php @@ -60,6 +60,5 @@ class AssetAccounts implements MapperInterface $list = [0 => trans('csv.map_do_not_map')] + $list; return $list; - } } diff --git a/app/Import/Mapper/Bills.php b/app/Import/Mapper/Bills.php index 505c9dccd0..8770f8c988 100644 --- a/app/Import/Mapper/Bills.php +++ b/app/Import/Mapper/Bills.php @@ -53,6 +53,5 @@ class Bills implements MapperInterface $list = [0 => trans('csv.map_do_not_map')] + $list; return $list; - } } diff --git a/app/Import/Mapper/Budgets.php b/app/Import/Mapper/Budgets.php index 662b38c815..ab1b8bc151 100644 --- a/app/Import/Mapper/Budgets.php +++ b/app/Import/Mapper/Budgets.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Mapper; - use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; @@ -54,6 +53,5 @@ class Budgets implements MapperInterface $list = [0 => trans('csv.map_do_not_map')] + $list; return $list; - } } diff --git a/app/Import/Mapper/Categories.php b/app/Import/Mapper/Categories.php index 0204012fae..76b3b60f55 100644 --- a/app/Import/Mapper/Categories.php +++ b/app/Import/Mapper/Categories.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Mapper; - use FireflyIII\Models\Category; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; @@ -54,6 +53,5 @@ class Categories implements MapperInterface $list = [0 => trans('csv.map_do_not_map')] + $list; return $list; - } } diff --git a/app/Import/Mapper/Tags.php b/app/Import/Mapper/Tags.php index 6294e42cc9..a09a64c260 100644 --- a/app/Import/Mapper/Tags.php +++ b/app/Import/Mapper/Tags.php @@ -53,6 +53,5 @@ class Tags implements MapperInterface $list = [0 => trans('csv.map_do_not_map')] + $list; return $list; - } } diff --git a/app/Import/Mapper/TransactionCurrencies.php b/app/Import/Mapper/TransactionCurrencies.php index ac8a969a58..2ba0703bd1 100644 --- a/app/Import/Mapper/TransactionCurrencies.php +++ b/app/Import/Mapper/TransactionCurrencies.php @@ -49,6 +49,5 @@ class TransactionCurrencies implements MapperInterface $list = [0 => trans('csv.map_do_not_map')] + $list; return $list; - } } diff --git a/app/Import/MapperPreProcess/PreProcessorInterface.php b/app/Import/MapperPreProcess/PreProcessorInterface.php index 5de7418756..5c302557df 100644 --- a/app/Import/MapperPreProcess/PreProcessorInterface.php +++ b/app/Import/MapperPreProcess/PreProcessorInterface.php @@ -36,5 +36,4 @@ interface PreProcessorInterface * @return array */ public function run(string $value): array; - } diff --git a/app/Import/Object/ImportAccount.php b/app/Import/Object/ImportAccount.php index d48d4a3ea1..7a26cf9f29 100644 --- a/app/Import/Object/ImportAccount.php +++ b/app/Import/Object/ImportAccount.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Object; - use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -179,7 +178,8 @@ class ImportAccount Log::debug(sprintf('Finding account of type %d and ID %d', $accountType->id, $this->accountId['value'])); /** @var Account $account */ $account = $this->user->accounts()->where('id', '!=', $this->forbiddenAccountId)->where('account_type_id', $accountType->id)->where( - 'id', $this->accountId['value'] + 'id', + $this->accountId['value'] )->first(); if (!is_null($account)) { Log::debug(sprintf('Found unmapped %s account by ID (#%d): %s', $this->expectedType, $account->id, $account->name)); @@ -239,7 +239,6 @@ class ImportAccount Log::debug('Found NO existing accounts.'); return new Account; - } /** @@ -259,7 +258,6 @@ class ImportAccount return $mapped; } - } Log::debug('Found no account on mapped data or no map present.'); @@ -302,7 +300,9 @@ class ImportAccount if ($account->accountType->type !== $this->expectedType && $account->accountType->type !== AccountType::ASSET) { Log::error( sprintf( - 'Mapped account #%d is of type "%s" but we expect a "%s"-account. Mapping will be ignored.', $account->id, $account->accountType->type, + 'Mapped account #%d is of type "%s" but we expect a "%s"-account. Mapping will be ignored.', + $account->id, + $account->accountType->type, $this->expectedType ) ); @@ -372,6 +372,4 @@ class ImportAccount return true; } - - } diff --git a/app/Import/Object/ImportBill.php b/app/Import/Object/ImportBill.php index 769b8241d1..5a17423b6c 100644 --- a/app/Import/Object/ImportBill.php +++ b/app/Import/Object/ImportBill.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Object; - use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\User; @@ -154,7 +153,6 @@ class ImportBill Log::debug('Found NO existing bills.'); return new Bill; - } /** @@ -174,7 +172,6 @@ class ImportBill return $mapped; } - } Log::debug('Found no bill on mapped data or no map present.'); @@ -264,5 +261,4 @@ class ImportBill return true; } - } diff --git a/app/Import/Object/ImportBudget.php b/app/Import/Object/ImportBudget.php index cef49e677d..456eb466ce 100644 --- a/app/Import/Object/ImportBudget.php +++ b/app/Import/Object/ImportBudget.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Object; - use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\User; @@ -143,7 +142,6 @@ class ImportBudget Log::debug('Found NO existing budgets.'); return new Budget; - } /** @@ -163,7 +161,6 @@ class ImportBudget return $mapped; } - } Log::debug('Found no budget on mapped data or no map present.'); @@ -242,6 +239,4 @@ class ImportBudget return true; } - - } diff --git a/app/Import/Object/ImportCategory.php b/app/Import/Object/ImportCategory.php index bd986623bf..e49c38acc4 100644 --- a/app/Import/Object/ImportCategory.php +++ b/app/Import/Object/ImportCategory.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Object; - use FireflyIII\Models\Category; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\User; @@ -137,7 +136,6 @@ class ImportCategory Log::debug('Found NO existing categories.'); return new Category; - } /** @@ -157,7 +155,6 @@ class ImportCategory return $mapped; } - } Log::debug('Found no category on mapped data or no map present.'); @@ -236,6 +233,4 @@ class ImportCategory return true; } - - } diff --git a/app/Import/Object/ImportCurrency.php b/app/Import/Object/ImportCurrency.php index a8daca201a..e826d65b8d 100644 --- a/app/Import/Object/ImportCurrency.php +++ b/app/Import/Object/ImportCurrency.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Object; - use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\User; @@ -68,7 +67,6 @@ class ImportCurrency $mapped = $this->findMappedObject(); if (!is_null($mapped->id)) { - Log::debug('Mapped existing currency.', ['new' => $mapped->toArray()]); $this->currency = $mapped; @@ -101,7 +99,6 @@ class ImportCurrency return $currency; - } /** @@ -189,7 +186,6 @@ class ImportCurrency return $mapped; } - } Log::debug('Found no currency on mapped data or no map present.'); @@ -232,6 +228,4 @@ class ImportCurrency return $currency; } - - } diff --git a/app/Import/Object/ImportJournal.php b/app/Import/Object/ImportJournal.php index 028086cd34..2d51098c4f 100644 --- a/app/Import/Object/ImportJournal.php +++ b/app/Import/Object/ImportJournal.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Object; - use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Import\Converter\Amount; diff --git a/app/Import/Routine/ImportRoutine.php b/app/Import/Routine/ImportRoutine.php index fecfd24df4..304fd3a09e 100644 --- a/app/Import/Routine/ImportRoutine.php +++ b/app/Import/Routine/ImportRoutine.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Routine; - use Carbon\Carbon; use DB; use FireflyIII\Import\FileProcessor\FileProcessorInterface; @@ -139,7 +138,7 @@ class ImportRoutine { Log::debug('Now in createImportTag()'); - if($this->journals->count() < 1) { + if ($this->journals->count() < 1) { Log::info(sprintf('Will not create tag, %d journals imported.', $this->journals->count())); return new Tag; } diff --git a/app/Import/Specifics/AbnAmroDescription.php b/app/Import/Specifics/AbnAmroDescription.php index 0472179b51..6a754c50cc 100644 --- a/app/Import/Specifics/AbnAmroDescription.php +++ b/app/Import/Specifics/AbnAmroDescription.php @@ -89,7 +89,6 @@ class AbnAmroDescription implements SpecificInterface { // See if the current description is formatted in ABN AMRO format if (preg_match('/ABN AMRO.{24} (.*)/', $this->row[7], $matches)) { - $this->row[8] = 'ABN AMRO'; // this one is new (opposing account name) $this->row[7] = $matches[1]; // this is the description @@ -133,7 +132,6 @@ class AbnAmroDescription implements SpecificInterface { // See if the current description is formatted as a SEPA plain description if (preg_match('/^SEPA(.{28})/', $this->row[7], $matches)) { - $type = $matches[1]; $reference = ''; $name = ''; @@ -188,7 +186,6 @@ class AbnAmroDescription implements SpecificInterface { // See if the current description is formatted in TRTP format if (preg_match_all('!\/([A-Z]{3,4})\/([^/]*)!', $this->row[7], $matches, PREG_SET_ORDER)) { - $type = ''; $name = ''; $reference = ''; @@ -235,6 +232,4 @@ class AbnAmroDescription implements SpecificInterface return false; } - - } diff --git a/app/Import/Specifics/IngDescription.php b/app/Import/Specifics/IngDescription.php index cb14ee71e2..781f7e3395 100644 --- a/app/Import/Specifics/IngDescription.php +++ b/app/Import/Specifics/IngDescription.php @@ -121,5 +121,4 @@ class IngDescription implements SpecificInterface return true; } - } diff --git a/app/Import/Specifics/PresidentsChoice.php b/app/Import/Specifics/PresidentsChoice.php index 11203ba03c..7a0331a475 100644 --- a/app/Import/Specifics/PresidentsChoice.php +++ b/app/Import/Specifics/PresidentsChoice.php @@ -65,7 +65,5 @@ class PresidentsChoice implements SpecificInterface } return $row; - - } } diff --git a/app/Import/Specifics/RabobankDescription.php b/app/Import/Specifics/RabobankDescription.php index 420b5d8e26..cebaa8aaec 100644 --- a/app/Import/Specifics/RabobankDescription.php +++ b/app/Import/Specifics/RabobankDescription.php @@ -64,7 +64,8 @@ class RabobankDescription implements SpecificInterface Log::debug( sprintf( 'Rabobank specific: Opposite account and opposite name are' . - ' both empty. Will use "%s" (from description) instead', $alternateName + ' both empty. Will use "%s" (from description) instead', + $alternateName ) ); $row[6] = $alternateName; diff --git a/app/Import/Specifics/SpecificInterface.php b/app/Import/Specifics/SpecificInterface.php index 148aed45aa..c6c1f0a444 100644 --- a/app/Import/Specifics/SpecificInterface.php +++ b/app/Import/Specifics/SpecificInterface.php @@ -46,5 +46,4 @@ interface SpecificInterface * @return array */ public function run(array $row): array; - } diff --git a/app/Import/Storage/ImportStorage.php b/app/Import/Storage/ImportStorage.php index 2761a6881f..02e3ab90cc 100644 --- a/app/Import/Storage/ImportStorage.php +++ b/app/Import/Storage/ImportStorage.php @@ -159,7 +159,6 @@ class ImportStorage $message = sprintf('Detected a possible duplicate, skip this one (hash: %s).', $importJournal->hash); Log::error($message, $parameters); throw new FireflyException($message); - } unset($parameters); @@ -258,7 +257,8 @@ class ImportStorage // number of hits is 4? Then it's a match if ($hits === 4) { Log::error( - 'There already is a transfer imported with these properties. Compare existing with new. ', ['existing' => $transfer, 'new' => $parameters] + 'There already is a transfer imported with these properties. Compare existing with new. ', + ['existing' => $transfer, 'new' => $parameters] ); return true; diff --git a/app/Import/Storage/ImportSupport.php b/app/Import/Storage/ImportSupport.php index 93019b3689..99ed36614a 100644 --- a/app/Import/Storage/ImportSupport.php +++ b/app/Import/Storage/ImportSupport.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Storage; - use Carbon\Carbon; use Exception; use FireflyIII\Exceptions\FireflyException; @@ -138,7 +137,6 @@ trait ImportSupport $currency = $this->defaultCurrencyId; return $currency; - } /** @@ -197,7 +195,6 @@ trait ImportSupport $databaseAccount = $account->getAccount(); return $databaseAccount; - } /** @@ -219,7 +216,6 @@ trait ImportSupport Log::debug(sprintf('Found %d user rules.', $set->count())); return $set; - } /** @@ -272,16 +268,20 @@ trait ImportSupport { $set = TransactionJournal::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') ->leftJoin( - 'transactions AS source', function (JoinClause $join) { - $join->on('transaction_journals.id', '=', 'source.transaction_journal_id')->where('source.amount', '<', 0); - } + 'transactions AS source', + function (JoinClause $join) { + $join->on('transaction_journals.id', '=', 'source.transaction_journal_id')->where('source.amount', '<', 0); + } ) ->leftJoin( - 'transactions AS destination', function (JoinClause $join) { - $join->on('transaction_journals.id', '=', 'destination.transaction_journal_id')->where( - 'destination.amount', '>', 0 + 'transactions AS destination', + function (JoinClause $join) { + $join->on('transaction_journals.id', '=', 'destination.transaction_journal_id')->where( + 'destination.amount', + '>', + 0 ); - } + } ) ->leftJoin('accounts as source_accounts', 'source.account_id', '=', 'source_accounts.id') ->leftJoin('accounts as destination_accounts', 'destination.account_id', '=', 'destination_accounts.id') @@ -330,7 +330,6 @@ trait ImportSupport } return false; - } /** @@ -364,12 +363,10 @@ trait ImportSupport */ private function storeCategory(TransactionJournal $journal, Category $category) { - if (!is_null($category->id)) { Log::debug(sprintf('Linked category #%d to journal #%d', $category->id, $journal->id)); $journal->categories()->save($category); } - } private function storeJournal(array $parameters): TransactionJournal @@ -464,5 +461,4 @@ trait ImportSupport return; } - } diff --git a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php index af3769eae9..629a03992c 100644 --- a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php +++ b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php @@ -192,8 +192,8 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue return array_map( function ($rule) { return Processor::make($rule); - }, $rules->all() + }, + $rules->all() ); } - } diff --git a/app/Jobs/ExecuteRuleOnExistingTransactions.php b/app/Jobs/ExecuteRuleOnExistingTransactions.php index 9dba6dde22..b331e3a300 100644 --- a/app/Jobs/ExecuteRuleOnExistingTransactions.php +++ b/app/Jobs/ExecuteRuleOnExistingTransactions.php @@ -162,7 +162,6 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue } } Log::info(sprintf('Total transactions: %d. Hits: %d, misses: %d', $total, $hits, $misses)); - } /** @@ -179,5 +178,4 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue return $collector->getJournals(); } - } diff --git a/app/Jobs/Job.php b/app/Jobs/Job.php index 34ec0ec156..51dc805c71 100644 --- a/app/Jobs/Job.php +++ b/app/Jobs/Job.php @@ -32,6 +32,5 @@ use Illuminate\Bus\Queueable; */ abstract class Job { - use Queueable; } diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 5c8482d80e..a7d6d47e41 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -87,7 +87,8 @@ class MailError extends Job implements ShouldQueue $args['ip'] = $this->ipAddress; Mail::send( - ['emails.error-html', 'emails.error-text'], $args, + ['emails.error-html', 'emails.error-text'], + $args, function (Message $message) use ($email) { if ($email !== 'mail@example.com') { $message->to($email, $email)->subject('Caught an error in Firely III'); diff --git a/app/Mail/ConfirmEmailChangeMail.php b/app/Mail/ConfirmEmailChangeMail.php index 2a98ddb814..cac7ae1d6c 100644 --- a/app/Mail/ConfirmEmailChangeMail.php +++ b/app/Mail/ConfirmEmailChangeMail.php @@ -50,7 +50,6 @@ class ConfirmEmailChangeMail extends Mailable */ public function __construct(string $newEmail, string $oldEmail, string $uri, string $ipAddress) { - $this->newEmail = $newEmail; $this->oldEmail = $oldEmail; $this->uri = $uri; diff --git a/app/Mail/UndoEmailChangeMail.php b/app/Mail/UndoEmailChangeMail.php index 1ee5771624..13d61426aa 100644 --- a/app/Mail/UndoEmailChangeMail.php +++ b/app/Mail/UndoEmailChangeMail.php @@ -50,7 +50,6 @@ class UndoEmailChangeMail extends Mailable */ public function __construct(string $newEmail, string $oldEmail, string $uri, string $ipAddress) { - $this->newEmail = $newEmail; $this->oldEmail = $oldEmail; $this->uri = $uri; diff --git a/app/Models/Account.php b/app/Models/Account.php index a4bd0ddb8a..09f4499b0e 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -36,7 +36,6 @@ use Illuminate\Database\Query\JoinClause; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Watson\Validating\ValidatingTrait; - /** * Class Account * @@ -112,7 +111,6 @@ class Account extends Model $account = self::create($fields); return $account; - } /** @@ -122,7 +120,6 @@ class Account extends Model */ public static function routeBinder(Account $value) { - if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { return $value; @@ -211,7 +208,6 @@ class Account extends Model */ public function getNameAttribute($value): string { - if ($this->encrypted) { return Crypt::decrypt($value); } @@ -321,9 +317,10 @@ class Account extends Model { $joinName = str_replace('.', '_', $name); $query->leftJoin( - 'account_meta as ' . $joinName, function (JoinClause $join) use ($joinName, $name) { - $join->on($joinName . '.account_id', '=', 'accounts.id')->where($joinName . '.name', '=', $name); - } + 'account_meta as ' . $joinName, + function (JoinClause $join) use ($joinName, $name) { + $join->on($joinName . '.account_id', '=', 'accounts.id')->where($joinName . '.name', '=', $name); + } ); $query->where($joinName . '.data', json_encode($value)); } diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index 02dfedbe3d..9eb33eae71 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -75,5 +75,4 @@ class AccountMeta extends Model { $this->attributes['data'] = json_encode($value); } - } diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index e11a7cb3df..268d16fb18 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -62,7 +62,6 @@ class Attachment extends Model public static function routeBinder(Attachment $value) { if (auth()->check()) { - if (intval($value->user_id) === auth()->user()->id) { return $value; } @@ -209,5 +208,4 @@ class Attachment extends Model { return $this->belongsTo('FireflyIII\User'); } - } diff --git a/app/Models/AvailableBudget.php b/app/Models/AvailableBudget.php index b8c26bae47..bbb342f40e 100644 --- a/app/Models/AvailableBudget.php +++ b/app/Models/AvailableBudget.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Models; - use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 2f399fbbb5..a4e4655133 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -38,7 +38,6 @@ use Watson\Validating\ValidatingTrait; */ class Bill extends Model { - use SoftDeletes, ValidatingTrait; /** * The attributes that should be casted to native types. @@ -85,7 +84,6 @@ class Bill extends Model */ public function getMatchAttribute($value) { - if (intval($this->match_encrypted) === 1) { return Crypt::decrypt($value); } @@ -100,7 +98,6 @@ class Bill extends Model */ public function getNameAttribute($value) { - if (intval($this->name_encrypted) === 1) { return Crypt::decrypt($value); } @@ -159,6 +156,4 @@ class Bill extends Model { return $this->belongsTo('FireflyIII\User'); } - - } diff --git a/app/Models/Budget.php b/app/Models/Budget.php index b1aae74667..5ce779ad83 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -37,7 +37,6 @@ use Watson\Validating\ValidatingTrait; */ class Budget extends Model { - use SoftDeletes, ValidatingTrait; /** @@ -85,7 +84,6 @@ class Budget extends Model $budget = self::create($fields); return $budget; - } /** @@ -119,7 +117,6 @@ class Budget extends Model */ public function getNameAttribute($value) { - if ($this->encrypted) { return Crypt::decrypt($value); } @@ -160,6 +157,4 @@ class Budget extends Model { return $this->belongsTo('FireflyIII\User'); } - - } diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 71eb68378e..f120cd5a5b 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -93,5 +93,4 @@ class BudgetLimit extends Model { $this->attributes['amount'] = strval(round($value, 12)); } - } diff --git a/app/Models/Category.php b/app/Models/Category.php index a52fc76532..a6760c5d8f 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -83,7 +83,6 @@ class Category extends Model $category = self::create($fields); return $category; - } /** @@ -109,7 +108,6 @@ class Category extends Model */ public function getNameAttribute($value) { - if ($this->encrypted) { return Crypt::decrypt($value); } @@ -151,5 +149,4 @@ class Category extends Model { return $this->belongsTo('FireflyIII\User'); } - } diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 16492e0762..d399ffee55 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -64,6 +64,4 @@ class Configuration extends Model { $this->attributes['data'] = json_encode($value); } - - } diff --git a/app/Models/CurrencyExchangeRate.php b/app/Models/CurrencyExchangeRate.php index 15d34a06b9..27c44b51ba 100644 --- a/app/Models/CurrencyExchangeRate.php +++ b/app/Models/CurrencyExchangeRate.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Models; - use FireflyIII\User; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -62,5 +61,4 @@ class CurrencyExchangeRate extends Model { return $this->belongsTo(User::class); } - } diff --git a/app/Models/ImportJob.php b/app/Models/ImportJob.php index c8c5c7079a..781ea2f27c 100644 --- a/app/Models/ImportJob.php +++ b/app/Models/ImportJob.php @@ -98,7 +98,6 @@ class ImportJob extends Model $status['done'] += $count; $this->extended_status = $status; $this->save(); - } /** @@ -110,7 +109,6 @@ class ImportJob extends Model $status['steps'] += $count; $this->extended_status = $status; $this->save(); - } /** diff --git a/app/Models/LimitRepetition.php b/app/Models/LimitRepetition.php index ab2fb1cf61..5b049fdb33 100644 --- a/app/Models/LimitRepetition.php +++ b/app/Models/LimitRepetition.php @@ -90,5 +90,4 @@ class LimitRepetition extends Model { $this->attributes['amount'] = strval(round($value, 2)); } - } diff --git a/app/Models/LinkType.php b/app/Models/LinkType.php index 7fe9faef47..25c64ee0af 100644 --- a/app/Models/LinkType.php +++ b/app/Models/LinkType.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Models; - use Illuminate\Database\Eloquent\Model; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -72,5 +71,4 @@ class LinkType extends Model { return $this->hasMany(TransactionJournalLink::class); } - } diff --git a/app/Models/Note.php b/app/Models/Note.php index c55efef879..9f8a1b410b 100644 --- a/app/Models/Note.php +++ b/app/Models/Note.php @@ -65,5 +65,4 @@ class Note extends Model { return $this->morphTo(); } - } diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index 44426cd6a2..1bb4dd2952 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -115,7 +115,6 @@ class PiggyBank extends Model */ public function getNameAttribute($value) { - if ($this->encrypted) { return Crypt::decrypt($value); } @@ -156,7 +155,6 @@ class PiggyBank extends Model */ public function leftOnAccount(Carbon $date): string { - $balance = Steam::balanceIgnoreVirtual($this->account, $date); /** @var PiggyBank $p */ foreach ($this->account->piggyBanks as $piggyBank) { @@ -166,7 +164,6 @@ class PiggyBank extends Model } return $balance; - } /** diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 69bcd531a8..389c8607a7 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -72,5 +72,4 @@ class PiggyBankEvent extends Model { return $this->belongsTo('FireflyIII\Models\TransactionJournal'); } - } diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index 7970cfaf3a..801eb44ad0 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -89,7 +89,6 @@ class PiggyBankRepetition extends Model ) ->where( function (EloquentBuilder $q) use ($date) { - $q->where('targetdate', '>=', $date->format('Y-m-d 00:00:00')); $q->orWhereNull('targetdate'); } @@ -103,5 +102,4 @@ class PiggyBankRepetition extends Model { $this->attributes['currentamount'] = strval(round($value, 12)); } - } diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 16f9dbaeb6..5aee3161ab 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -96,5 +96,4 @@ class Preference extends Model { return $this->belongsTo('FireflyIII\User'); } - } diff --git a/app/Models/Role.php b/app/Models/Role.php index 97e03192a2..6b3eb96012 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Models; - use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -53,5 +52,4 @@ class Role extends Model { return $this->belongsToMany('FireflyIII\User'); } - } diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 8a777698b7..d327b3c6b9 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -97,5 +97,4 @@ class Rule extends Model { return $this->belongsTo('FireflyIII\User'); } - } diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 93b31b4d75..060003a0d7 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -89,7 +89,6 @@ class Tag extends Model $tag = self::create($fields); return $tag; - } /** @@ -204,6 +203,4 @@ class Tag extends Model { return $this->belongsTo('FireflyIII\User'); } - - } diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 43b43deb1f..545890814b 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -333,7 +333,6 @@ class TransactionJournal extends Model $query->orderBy('transaction_journals.date', 'DESC'); $query->orderBy('transaction_journals.order', 'ASC'); $query->orderBy('transaction_journals.id', 'DESC'); - } /** @@ -343,7 +342,6 @@ class TransactionJournal extends Model */ public function scopeTransactionTypes(EloquentBuilder $query, array $types) { - if (!self::isJoined($query, 'transaction_types')) { $query->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'); } @@ -453,5 +451,4 @@ class TransactionJournal extends Model { return $this->belongsTo('FireflyIII\User'); } - } diff --git a/app/Models/TransactionJournalLink.php b/app/Models/TransactionJournalLink.php index 1289e82b3a..45036b5d29 100644 --- a/app/Models/TransactionJournalLink.php +++ b/app/Models/TransactionJournalLink.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Models; - use Crypt; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -111,6 +110,4 @@ class TransactionJournalLink extends Model { return $this->belongsTo(TransactionJournal::class, 'source_id'); } - - } diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index e23cf76edb..f673fbb8cc 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -34,7 +34,6 @@ use Illuminate\Database\Eloquent\SoftDeletes; */ class TransactionJournalMeta extends Model { - use SoftDeletes; /** * The attributes that should be casted to native types. diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index 1df75796aa..ea09c65b9f 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -68,7 +68,6 @@ class TransactionType extends Model return $transactionType; } throw new NotFoundHttpException; - } diff --git a/app/Providers/AdminServiceProvider.php b/app/Providers/AdminServiceProvider.php index 8bfc96491d..f75b40bc25 100644 --- a/app/Providers/AdminServiceProvider.php +++ b/app/Providers/AdminServiceProvider.php @@ -28,7 +28,6 @@ use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; - class AdminServiceProvider extends ServiceProvider { /** @@ -38,8 +37,6 @@ class AdminServiceProvider extends ServiceProvider */ public function boot() { - - } /** @@ -70,5 +67,4 @@ class AdminServiceProvider extends ServiceProvider } ); } - } diff --git a/app/Providers/CategoryServiceProvider.php b/app/Providers/CategoryServiceProvider.php index b945f3dd56..f39ef1c44c 100644 --- a/app/Providers/CategoryServiceProvider.php +++ b/app/Providers/CategoryServiceProvider.php @@ -65,6 +65,5 @@ class CategoryServiceProvider extends ServiceProvider return $repository; } ); - } } diff --git a/app/Providers/CurrencyServiceProvider.php b/app/Providers/CurrencyServiceProvider.php index 2f63de16b5..e00c5013b6 100644 --- a/app/Providers/CurrencyServiceProvider.php +++ b/app/Providers/CurrencyServiceProvider.php @@ -66,5 +66,4 @@ class CurrencyServiceProvider extends ServiceProvider } ); } - } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 110ba077af..fccd71f715 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -152,7 +152,5 @@ class EventServiceProvider extends ServiceProvider } } ); - } - } diff --git a/app/Providers/ExportJobServiceProvider.php b/app/Providers/ExportJobServiceProvider.php index c7f6b38a6d..5072d617a4 100644 --- a/app/Providers/ExportJobServiceProvider.php +++ b/app/Providers/ExportJobServiceProvider.php @@ -31,7 +31,6 @@ use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; - /** * Class ExportJobServiceProvider * @@ -46,8 +45,6 @@ class ExportJobServiceProvider extends ServiceProvider */ public function boot() { - - } /** diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index aa1b81bd6d..771f3a1ae7 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -102,36 +102,42 @@ class FireflyServiceProvider extends ServiceProvider public function register() { $this->app->bind( - 'preferences', function () { - return new Preferences; - } + 'preferences', + function () { + return new Preferences; + } ); $this->app->bind( - 'fireflyconfig', function () { - return new FireflyConfig; - } + 'fireflyconfig', + function () { + return new FireflyConfig; + } ); $this->app->bind( - 'navigation', function () { - return new Navigation; - } + 'navigation', + function () { + return new Navigation; + } ); $this->app->bind( - 'amount', function () { - return new Amount; - } + 'amount', + function () { + return new Amount; + } ); $this->app->bind( - 'steam', function () { - return new Steam; - } + 'steam', + function () { + return new Steam; + } ); $this->app->bind( - 'expandedform', function () { - return new ExpandedForm; - } + 'expandedform', + function () { + return new ExpandedForm; + } ); // chart generator: @@ -168,5 +174,4 @@ class FireflyServiceProvider extends ServiceProvider // password verifier thing $this->app->bind(Verifier::class, PwndVerifier::class); } - } diff --git a/app/Providers/FireflySessionProvider.php b/app/Providers/FireflySessionProvider.php index 4eb91f74a5..114c569deb 100644 --- a/app/Providers/FireflySessionProvider.php +++ b/app/Providers/FireflySessionProvider.php @@ -51,12 +51,13 @@ class FireflySessionProvider extends ServiceProvider protected function registerSessionDriver() { $this->app->singleton( - 'session.store', function ($app) { - // First, we will create the session manager which is responsible for the - // creation of the various session drivers when they are needed by the - // application instance, and will resolve them on a lazy load basis. - return $app->make('session')->driver(); - } + 'session.store', + function ($app) { + // First, we will create the session manager which is responsible for the + // creation of the various session drivers when they are needed by the + // application instance, and will resolve them on a lazy load basis. + return $app->make('session')->driver(); + } ); } @@ -68,9 +69,10 @@ class FireflySessionProvider extends ServiceProvider protected function registerSessionManager() { $this->app->singleton( - 'session', function ($app) { - return new SessionManager($app); - } + 'session', + function ($app) { + return new SessionManager($app); + } ); } } diff --git a/app/Providers/JournalServiceProvider.php b/app/Providers/JournalServiceProvider.php index 262b3b56de..03c22f3160 100644 --- a/app/Providers/JournalServiceProvider.php +++ b/app/Providers/JournalServiceProvider.php @@ -93,7 +93,6 @@ class JournalServiceProvider extends ServiceProvider /** @var JournalRepositoryInterface $repository */ $repository = app(JournalRepository::class); if ($app->auth->check()) { - $repository->setUser(auth()->user()); } @@ -121,5 +120,4 @@ class JournalServiceProvider extends ServiceProvider } ); } - } diff --git a/app/Providers/LogServiceProvider.php b/app/Providers/LogServiceProvider.php index 63243e409f..168a0a2e0b 100644 --- a/app/Providers/LogServiceProvider.php +++ b/app/Providers/LogServiceProvider.php @@ -43,7 +43,8 @@ class LogServiceProvider extends LaravelLogServiceProvider protected function configureDailyHandler(Writer $log) { $log->useDailyFiles( - $this->app->storagePath() . '/logs/firefly-iii.log', $this->maxFiles(), + $this->app->storagePath() . '/logs/firefly-iii.log', + $this->maxFiles(), $this->logLevel() ); } diff --git a/app/Providers/PiggyBankServiceProvider.php b/app/Providers/PiggyBankServiceProvider.php index 94dbe53dc8..b9f0569643 100644 --- a/app/Providers/PiggyBankServiceProvider.php +++ b/app/Providers/PiggyBankServiceProvider.php @@ -29,7 +29,6 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; - /** * Class PiggyBankServiceProvider * diff --git a/app/Providers/RuleGroupServiceProvider.php b/app/Providers/RuleGroupServiceProvider.php index 6a72412a5f..54173feb0b 100644 --- a/app/Providers/RuleGroupServiceProvider.php +++ b/app/Providers/RuleGroupServiceProvider.php @@ -29,7 +29,6 @@ use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; - /** * Class RuleGroupServiceProvider * diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 34adbd971c..fac886b38a 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -37,7 +37,6 @@ use FireflyIII\User; use Log; use Validator; - /** * * Class AccountRepository @@ -176,7 +175,6 @@ class AccountRepository implements AccountRepositoryInterface $this->deleteInitialBalance($newAccount); return $newAccount; - } /** @@ -211,7 +209,6 @@ class AccountRepository implements AccountRepositoryInterface if (!is_null($journal->id)) { $journal->delete(); } - } /** @@ -276,10 +273,10 @@ class AccountRepository implements AccountRepositoryInterface // verify its creation: if (is_null($newAccount->id)) { Log::error( - sprintf('Could not create account "%s" (%d error(s))', $data['name'], $newAccount->getErrors()->count()), $newAccount->getErrors()->toArray() + sprintf('Could not create account "%s" (%d error(s))', $data['name'], $newAccount->getErrors()->count()), + $newAccount->getErrors()->toArray() ); throw new FireflyException(sprintf('Tried to create account named "%s" but failed. The logs have more details.', $data['name'])); - } Log::debug(sprintf('Created new account #%d named "%s" of type %s.', $newAccount->id, $newAccount->name, $accountType->type)); @@ -424,7 +421,10 @@ class AccountRepository implements AccountRepositoryInterface Log::debug( sprintf( 'Created meta-field "%s":"%s" for account #%d ("%s") ', - $field, $data[$field], $account->id, $account->name + $field, + $data[$field], + $account->id, + $account->name ) ); AccountMeta::create( @@ -443,12 +443,14 @@ class AccountRepository implements AccountRepositoryInterface Log::debug( sprintf( 'Updated meta-field "%s":"%s" for account #%d ("%s") ', - $field, $data[$field], $account->id, $account->name + $field, + $data[$field], + $account->id, + $account->name ) ); } } - } /** @@ -496,7 +498,6 @@ class AccountRepository implements AccountRepositoryInterface Log::debug('Updated opening balance journal.'); return true; - } diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index aaaffe11d2..7457bbcc39 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -159,5 +159,4 @@ interface AccountRepositoryInterface * @return Account */ public function update(Account $account, array $data): Account; - } diff --git a/app/Repositories/Account/AccountTaskerInterface.php b/app/Repositories/Account/AccountTaskerInterface.php index a978f1a69e..f3b4e6fca3 100644 --- a/app/Repositories/Account/AccountTaskerInterface.php +++ b/app/Repositories/Account/AccountTaskerInterface.php @@ -65,5 +65,4 @@ interface AccountTaskerInterface * @param User $user */ public function setUser(User $user); - } diff --git a/app/Repositories/Account/FindAccountsTrait.php b/app/Repositories/Account/FindAccountsTrait.php index a674a25a12..e040ee8408 100644 --- a/app/Repositories/Account/FindAccountsTrait.php +++ b/app/Repositories/Account/FindAccountsTrait.php @@ -120,7 +120,6 @@ trait FindAccountsTrait if (count($types) > 0) { $query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id'); $query->whereIn('account_types.type', $types); - } Log::debug(sprintf('Searching for account named "%s" (of user #%d) of the following type(s)', $name, $this->user->id), ['types' => $types]); diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index ee5b8dd6c0..d3b2e73008 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -168,13 +168,11 @@ class AttachmentRepository implements AttachmentRepositoryInterface */ public function update(Attachment $attachment, array $data): Attachment { - $attachment->title = $data['title']; $attachment->description = $data['description']; $attachment->notes = $data['notes']; $attachment->save(); return $attachment; - } } diff --git a/app/Repositories/Attachment/AttachmentRepositoryInterface.php b/app/Repositories/Attachment/AttachmentRepositoryInterface.php index bfa0c662ad..7decdab90d 100644 --- a/app/Repositories/Attachment/AttachmentRepositoryInterface.php +++ b/app/Repositories/Attachment/AttachmentRepositoryInterface.php @@ -97,4 +97,3 @@ interface AttachmentRepositoryInterface */ public function update(Attachment $attachment, array $attachmentData): Attachment; } - diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 44e31d94fc..ee77dbc9fa 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -125,7 +125,6 @@ class BillRepository implements BillRepositoryInterface $set = $set->sortBy( function (Bill $bill) { - $int = $bill->active ? 0 : 1; return $int . strtolower($bill->name); @@ -161,14 +160,16 @@ class BillRepository implements BillRepositoryInterface $ids = $accounts->pluck('id')->toArray(); $set = $this->user->bills() ->leftJoin( - 'transaction_journals', function (JoinClause $join) { - $join->on('transaction_journals.bill_id', '=', 'bills.id')->whereNull('transaction_journals.deleted_at'); - } + 'transaction_journals', + function (JoinClause $join) { + $join->on('transaction_journals.bill_id', '=', 'bills.id')->whereNull('transaction_journals.deleted_at'); + } ) ->leftJoin( - 'transactions', function (JoinClause $join) { - $join->on('transaction_journals.id', '=', 'transactions.transaction_journal_id')->where('transactions.amount', '<', 0); - } + 'transactions', + function (JoinClause $join) { + $join->on('transaction_journals.id', '=', 'transactions.transaction_journal_id')->where('transactions.amount', '<', 0); + } ) ->whereIn('transactions.account_id', $ids) ->whereNull('transaction_journals.deleted_at') @@ -177,7 +178,6 @@ class BillRepository implements BillRepositoryInterface $set = $set->sortBy( function (Bill $bill) { - $int = $bill->active === 1 ? 0 : 1; return $int . strtolower($bill->name); @@ -238,7 +238,6 @@ class BillRepository implements BillRepositoryInterface Log::debug(sprintf('Dates = %d, journalCount = %d, total = %d', $dates->count(), $count, $total)); if ($total > 0) { - $average = bcdiv(bcadd($bill->amount_max, $bill->amount_min), '2'); $multi = bcmul($average, strval($total)); $sum = bcadd($sum, $multi); @@ -285,7 +284,6 @@ class BillRepository implements BillRepositoryInterface $dates = $bill->transactionJournals()->before($end)->after($start)->get(['transaction_journals.date'])->pluck('date'); return $dates; - } /** @@ -519,7 +517,6 @@ class BillRepository implements BillRepositoryInterface } return false; - } /** @@ -565,8 +562,6 @@ class BillRepository implements BillRepositoryInterface */ public function update(Bill $bill, array $data): Bill { - - $bill->name = $data['name']; $bill->match = $data['match']; $bill->amount_min = $data['amount_min']; diff --git a/app/Repositories/Bill/BillRepositoryInterface.php b/app/Repositories/Bill/BillRepositoryInterface.php index 8097f24294..0705dba846 100644 --- a/app/Repositories/Bill/BillRepositoryInterface.php +++ b/app/Repositories/Bill/BillRepositoryInterface.php @@ -188,5 +188,4 @@ interface BillRepositoryInterface * @return Bill */ public function update(Bill $bill, array $data): Bill; - } diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 0a2a72d000..9a8ed2f65a 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -72,7 +72,6 @@ class BudgetRepository implements BudgetRepositoryInterface } return true; - } /** @@ -229,7 +228,6 @@ class BudgetRepository implements BudgetRepositoryInterface } return $oldest; - } /** @@ -396,7 +394,6 @@ class BudgetRepository implements BudgetRepositoryInterface } return $data; - } /** diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index f1d4f6bc3f..e419a0b0f0 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -219,5 +219,4 @@ interface BudgetRepositoryInterface * @return BudgetLimit */ public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, int $amount): BudgetLimit; - } diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 86e44b213d..7c6f1e6f88 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -547,5 +547,4 @@ class CategoryRepository implements CategoryRepositoryInterface return null; } - } diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index af0e383460..eda842ccdd 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Currency; - use Carbon\Carbon; use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\Preference; @@ -228,8 +227,6 @@ class CurrencyRepository implements CurrencyRepositoryInterface } return new CurrencyExchangeRate; - - } /** diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php index bea29039f8..1e6982e63a 100644 --- a/app/Repositories/Currency/CurrencyRepositoryInterface.php +++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Currency; - use Carbon\Carbon; use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\Preference; @@ -142,5 +141,4 @@ interface CurrencyRepositoryInterface * @return TransactionCurrency */ public function update(TransactionCurrency $currency, array $data): TransactionCurrency; - } diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index c2a39deb9d..73a5306109 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -103,11 +103,9 @@ class ExportJobRepository implements ExportJobRepositoryInterface return $exportJob; } $count++; - } return new ExportJob; - } /** diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php index cd1a1d6337..6e513e57a2 100644 --- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php +++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php @@ -76,5 +76,4 @@ interface ExportJobRepositoryInterface * @param User $user */ public function setUser(User $user); - } diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php index cb1d005e43..38f900d938 100644 --- a/app/Repositories/ImportJob/ImportJobRepository.php +++ b/app/Repositories/ImportJob/ImportJobRepository.php @@ -81,7 +81,6 @@ class ImportJobRepository implements ImportJobRepositoryInterface return $importJob; } $count++; - } return new ImportJob; @@ -115,7 +114,8 @@ class ImportJobRepository implements ImportJobRepositoryInterface // demo user's configuration upload is ignored completely. if (!$repository->hasRole($this->user, 'demo')) { Log::debug( - 'Uploaded configuration file', ['name' => $file->getClientOriginalName(), 'size' => $file->getSize(), 'mime' => $file->getClientMimeType()] + 'Uploaded configuration file', + ['name' => $file->getClientOriginalName(), 'size' => $file->getSize(), 'mime' => $file->getClientMimeType()] ); $configFileObject = new SplFileObject($file->getRealPath()); diff --git a/app/Repositories/Journal/CreateJournalsTrait.php b/app/Repositories/Journal/CreateJournalsTrait.php index 088ac15663..cac82799ef 100644 --- a/app/Repositories/Journal/CreateJournalsTrait.php +++ b/app/Repositories/Journal/CreateJournalsTrait.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Journal; - use FireflyIII\Models\Budget; use FireflyIII\Models\Category; use FireflyIII\Models\Note; @@ -205,7 +204,6 @@ trait CreateJournalsTrait } return $transaction; - } diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index 6738da804e..8c99fa16b9 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -166,7 +166,6 @@ class JournalRepository implements JournalRepositoryInterface $entry = $this->user->transactionJournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']); if (is_null($entry)) { - return new TransactionJournal; } @@ -214,7 +213,6 @@ class JournalRepository implements JournalRepositoryInterface $opposing->save(); return true; - } /** @@ -321,7 +319,6 @@ class JournalRepository implements JournalRepositoryInterface $journal->save(); return $journal; - } /** diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index 1979b0dbce..d2c4edb1ea 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -149,5 +149,4 @@ interface JournalRepositoryInterface * @return TransactionJournal */ public function updateSplitJournal(TransactionJournal $journal, array $data): TransactionJournal; - } diff --git a/app/Repositories/Journal/JournalTasker.php b/app/Repositories/Journal/JournalTasker.php index 8c4f2b2043..31fb04e1cb 100644 --- a/app/Repositories/Journal/JournalTasker.php +++ b/app/Repositories/Journal/JournalTasker.php @@ -86,13 +86,14 @@ class JournalTasker implements JournalTaskerInterface $set = $journal ->transactions()// "source" ->leftJoin( - 'transactions as destination', function (JoinClause $join) { - $join + 'transactions as destination', + function (JoinClause $join) { + $join ->on('transactions.transaction_journal_id', '=', 'destination.transaction_journal_id') ->where('transactions.amount', '=', DB::raw('destination.amount * -1')) ->where('transactions.identifier', '=', DB::raw('destination.identifier')) ->whereNull('destination.deleted_at'); - } + } ) ->with(['budgets', 'categories']) ->leftJoin('accounts as source_accounts', 'transactions.account_id', '=', 'source_accounts.id') diff --git a/app/Repositories/Journal/JournalTaskerInterface.php b/app/Repositories/Journal/JournalTaskerInterface.php index 81ca557fae..98985477d8 100644 --- a/app/Repositories/Journal/JournalTaskerInterface.php +++ b/app/Repositories/Journal/JournalTaskerInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Journal; - use FireflyIII\Models\TransactionJournal; use FireflyIII\User; use Illuminate\Support\Collection; diff --git a/app/Repositories/Journal/SupportJournalsTrait.php b/app/Repositories/Journal/SupportJournalsTrait.php index 322102d060..d825158223 100644 --- a/app/Repositories/Journal/SupportJournalsTrait.php +++ b/app/Repositories/Journal/SupportJournalsTrait.php @@ -81,7 +81,6 @@ trait SupportJournalsTrait if (is_null($accounts['destination'])) { Log::error('"destination"-account is null, so we cannot continue!', ['data' => $data]); throw new FireflyException('"destination"-account is null, so we cannot continue!'); - } diff --git a/app/Repositories/Journal/UpdateJournalsTrait.php b/app/Repositories/Journal/UpdateJournalsTrait.php index d077096010..75aba8e0a0 100644 --- a/app/Repositories/Journal/UpdateJournalsTrait.php +++ b/app/Repositories/Journal/UpdateJournalsTrait.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Journal; - use DB; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; @@ -96,7 +95,6 @@ trait UpdateJournalsTrait $transaction->foreign_currency_id = $data['foreign_currency_id']; $transaction->account_id = $account->id; $transaction->save(); - } /** diff --git a/app/Repositories/LinkType/LinkTypeRepository.php b/app/Repositories/LinkType/LinkTypeRepository.php index c46fb2d2bd..2f71487d7d 100644 --- a/app/Repositories/LinkType/LinkTypeRepository.php +++ b/app/Repositories/LinkType/LinkTypeRepository.php @@ -106,8 +106,6 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface $opposingCount = TransactionJournalLink::whereDestinationId($two->id)->whereSourceId($one->id)->count(); return ($count + $opposingCount > 0); - - } /** @@ -187,6 +185,5 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface $linkType->save(); return $linkType; - } } diff --git a/app/Repositories/LinkType/LinkTypeRepositoryInterface.php b/app/Repositories/LinkType/LinkTypeRepositoryInterface.php index cfc44b4f14..5e4fe38e7e 100644 --- a/app/Repositories/LinkType/LinkTypeRepositoryInterface.php +++ b/app/Repositories/LinkType/LinkTypeRepositoryInterface.php @@ -109,5 +109,4 @@ interface LinkTypeRepositoryInterface * @return LinkType */ public function update(LinkType $linkType, array $data): LinkType; - } diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 8af13cbd28..a9e557f081 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -365,7 +365,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface */ public function update(PiggyBank $piggyBank, array $data): PiggyBank { - $piggyBank->name = $data['name']; $piggyBank->account_id = intval($data['account_id']); $piggyBank->targetamount = round($data['targetamount'], 2); @@ -380,7 +379,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface // remove money from the rep. $repetition = $piggyBank->currentRelevantRep(); if ($repetition->currentamount > $piggyBank->targetamount) { - $diff = bcsub($piggyBank->targetamount, $repetition->currentamount); $this->createEvent($piggyBank, $diff); diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index 5c5ccb4ab7..cf15854ea3 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -230,7 +230,6 @@ class RuleRepository implements RuleRepositoryInterface } return true; - } /** @@ -373,7 +372,6 @@ class RuleRepository implements RuleRepositoryInterface } return true; - } /** diff --git a/app/Repositories/Rule/RuleRepositoryInterface.php b/app/Repositories/Rule/RuleRepositoryInterface.php index e2e1bc2d15..a7fd8bacd7 100644 --- a/app/Repositories/Rule/RuleRepositoryInterface.php +++ b/app/Repositories/Rule/RuleRepositoryInterface.php @@ -147,5 +147,4 @@ interface RuleRepositoryInterface * @return Rule */ public function update(Rule $rule, array $data): Rule; - } diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 77cb222201..09b74d84ae 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\RuleGroup; - use FireflyIII\Models\Rule; use FireflyIII\Models\RuleGroup; use FireflyIII\User; @@ -58,9 +57,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface { /** @var Rule $rule */ foreach ($ruleGroup->rules as $rule) { - if (is_null($moveTo)) { - $rule->delete(); continue; } @@ -167,7 +164,6 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface 'rules' => function (HasMany $query) { $query->orderBy('active', 'DESC'); $query->orderBy('order', 'ASC'); - }, 'rules.ruleTriggers' => function (HasMany $query) { $query->orderBy('order', 'ASC'); @@ -267,7 +263,6 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface } return true; - } /** diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php index 583f5e7508..a2ee5e45a5 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php +++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\RuleGroup; - use FireflyIII\Models\RuleGroup; use FireflyIII\User; use Illuminate\Support\Collection; @@ -141,6 +140,4 @@ interface RuleGroupRepositoryInterface * @return RuleGroup */ public function update(RuleGroup $ruleGroup, array $data): RuleGroup; - - } diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index f4b3e9cdd8..25e99d7773 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Tag; - use Carbon\Carbon; use DB; use FireflyIII\Helpers\Collector\JournalCollectorInterface; @@ -252,8 +251,6 @@ class TagRepository implements TagRepositoryInterface $tag->save(); return $tag; - - } /** @@ -435,7 +432,6 @@ class TagRepository implements TagRepositoryInterface // no difference? Every tag same range: if ($amountDiff === 0.0) { - return $range[0]; } diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index 610700f3be..6e04a0a2df 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -29,7 +29,6 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\User; use Illuminate\Support\Collection; - /** * Interface TagRepositoryInterface * diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index ce8591e899..88bb889c86 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\User; - use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\Role; use FireflyIII\User; diff --git a/app/Repositories/User/UserRepositoryInterface.php b/app/Repositories/User/UserRepositoryInterface.php index ac5be916af..9bca371f10 100644 --- a/app/Repositories/User/UserRepositoryInterface.php +++ b/app/Repositories/User/UserRepositoryInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Repositories\User; - use FireflyIII\User; use Illuminate\Support\Collection; diff --git a/app/Services/Bunq/Id/BunqId.php b/app/Services/Bunq/Id/BunqId.php index ffbb7bd591..21609f5fa3 100644 --- a/app/Services/Bunq/Id/BunqId.php +++ b/app/Services/Bunq/Id/BunqId.php @@ -49,6 +49,4 @@ class BunqId { $this->id = $id; } - - } diff --git a/app/Services/Bunq/Id/DeviceServerId.php b/app/Services/Bunq/Id/DeviceServerId.php index d0b65cbd07..88b91358b5 100644 --- a/app/Services/Bunq/Id/DeviceServerId.php +++ b/app/Services/Bunq/Id/DeviceServerId.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Services\Bunq\Id; - /** * Class DeviceServerId * @@ -32,5 +31,4 @@ namespace FireflyIII\Services\Bunq\Id; */ class DeviceServerId extends BunqId { - } diff --git a/app/Services/Bunq/Id/DeviceSessionId.php b/app/Services/Bunq/Id/DeviceSessionId.php index db4e7fd37c..c8443c4f2f 100644 --- a/app/Services/Bunq/Id/DeviceSessionId.php +++ b/app/Services/Bunq/Id/DeviceSessionId.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Services\Bunq\Id; - /** * Class DeviceSessionId * @@ -31,5 +30,4 @@ namespace FireflyIII\Services\Bunq\Id; */ class DeviceSessionId extends BunqId { - } diff --git a/app/Services/Bunq/Id/InstallationId.php b/app/Services/Bunq/Id/InstallationId.php index 45704df8a1..84abcb61f9 100644 --- a/app/Services/Bunq/Id/InstallationId.php +++ b/app/Services/Bunq/Id/InstallationId.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Services\Bunq\Id; - /** * Class InstallationId * @@ -31,5 +30,4 @@ namespace FireflyIII\Services\Bunq\Id; */ class InstallationId extends BunqId { - } diff --git a/app/Services/Bunq/Object/Alias.php b/app/Services/Bunq/Object/Alias.php index 61fead70b3..a625543de8 100644 --- a/app/Services/Bunq/Object/Alias.php +++ b/app/Services/Bunq/Object/Alias.php @@ -74,6 +74,4 @@ class Alias extends BunqObject { return $this->value; } - - } diff --git a/app/Services/Bunq/Object/Amount.php b/app/Services/Bunq/Object/Amount.php index cc28b97e2e..854a5ca6ba 100644 --- a/app/Services/Bunq/Object/Amount.php +++ b/app/Services/Bunq/Object/Amount.php @@ -63,6 +63,4 @@ class Amount extends BunqObject { return $this->value; } - - } diff --git a/app/Services/Bunq/Object/Avatar.php b/app/Services/Bunq/Object/Avatar.php index 9f294302cf..034e9c817c 100644 --- a/app/Services/Bunq/Object/Avatar.php +++ b/app/Services/Bunq/Object/Avatar.php @@ -30,5 +30,4 @@ namespace FireflyIII\Services\Bunq\Object; */ class Avatar extends BunqObject { - } diff --git a/app/Services/Bunq/Object/BunqObject.php b/app/Services/Bunq/Object/BunqObject.php index 04dd2eed22..050ae58046 100644 --- a/app/Services/Bunq/Object/BunqObject.php +++ b/app/Services/Bunq/Object/BunqObject.php @@ -30,5 +30,4 @@ namespace FireflyIII\Services\Bunq\Object; */ class BunqObject { - } diff --git a/app/Services/Bunq/Object/DeviceServer.php b/app/Services/Bunq/Object/DeviceServer.php index 176532e91c..d1498dcb93 100644 --- a/app/Services/Bunq/Object/DeviceServer.php +++ b/app/Services/Bunq/Object/DeviceServer.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; - use Carbon\Carbon; use FireflyIII\Services\Bunq\Id\DeviceServerId; @@ -69,6 +68,4 @@ class DeviceServer extends BunqObject { return $this->ip; } - - } diff --git a/app/Services/Bunq/Object/MonetaryAccountBank.php b/app/Services/Bunq/Object/MonetaryAccountBank.php index 56e05debf8..1fe87a304b 100644 --- a/app/Services/Bunq/Object/MonetaryAccountBank.php +++ b/app/Services/Bunq/Object/MonetaryAccountBank.php @@ -159,5 +159,4 @@ class MonetaryAccountBank extends BunqObject { return $this->setting; } - } diff --git a/app/Services/Bunq/Object/MonetaryAccountProfile.php b/app/Services/Bunq/Object/MonetaryAccountProfile.php index 83cfffc668..8bcc47ec03 100644 --- a/app/Services/Bunq/Object/MonetaryAccountProfile.php +++ b/app/Services/Bunq/Object/MonetaryAccountProfile.php @@ -51,5 +51,4 @@ class MonetaryAccountProfile extends BunqObject return; } - } diff --git a/app/Services/Bunq/Object/MonetaryAccountSetting.php b/app/Services/Bunq/Object/MonetaryAccountSetting.php index ebf48e9970..d592e914da 100644 --- a/app/Services/Bunq/Object/MonetaryAccountSetting.php +++ b/app/Services/Bunq/Object/MonetaryAccountSetting.php @@ -74,6 +74,4 @@ class MonetaryAccountSetting extends BunqObject { return $this->restrictionChat; } - - } diff --git a/app/Services/Bunq/Object/NotificationFilter.php b/app/Services/Bunq/Object/NotificationFilter.php index be411c7544..baf65ed86c 100644 --- a/app/Services/Bunq/Object/NotificationFilter.php +++ b/app/Services/Bunq/Object/NotificationFilter.php @@ -38,5 +38,4 @@ class NotificationFilter extends BunqObject public function __construct(array $data) { } - } diff --git a/app/Services/Bunq/Object/ServerPublicKey.php b/app/Services/Bunq/Object/ServerPublicKey.php index dc72bc6440..bdea9e69a7 100644 --- a/app/Services/Bunq/Object/ServerPublicKey.php +++ b/app/Services/Bunq/Object/ServerPublicKey.php @@ -58,6 +58,4 @@ class ServerPublicKey extends BunqObject { $this->publicKey = $publicKey; } - - } diff --git a/app/Services/Bunq/Object/UserCompany.php b/app/Services/Bunq/Object/UserCompany.php index fab73dc3ca..54cfcdfc56 100644 --- a/app/Services/Bunq/Object/UserCompany.php +++ b/app/Services/Bunq/Object/UserCompany.php @@ -102,7 +102,6 @@ class UserCompany extends BunqObject $this->sectorOfIndustry = $data['sector_of_industry'] ?? ''; $this->counterBankIban = $data['counter_bank_iban']; $this->name = $data['name']; - } /** @@ -112,6 +111,4 @@ class UserCompany extends BunqObject { return $this->id; } - - } diff --git a/app/Services/Bunq/Object/UserLight.php b/app/Services/Bunq/Object/UserLight.php index 0f64cd8737..b7c7ee4c34 100644 --- a/app/Services/Bunq/Object/UserLight.php +++ b/app/Services/Bunq/Object/UserLight.php @@ -77,5 +77,4 @@ class UserLight extends BunqObject $this->legalName = $data['legal_name']; // aliases } - } diff --git a/app/Services/Bunq/Object/UserPerson.php b/app/Services/Bunq/Object/UserPerson.php index 73482d2f6b..d66b2e97d6 100644 --- a/app/Services/Bunq/Object/UserPerson.php +++ b/app/Services/Bunq/Object/UserPerson.php @@ -147,6 +147,4 @@ class UserPerson extends BunqObject { return $this->id; } - - } diff --git a/app/Services/Bunq/Request/DeviceSessionRequest.php b/app/Services/Bunq/Request/DeviceSessionRequest.php index 88910c26af..36319e79be 100644 --- a/app/Services/Bunq/Request/DeviceSessionRequest.php +++ b/app/Services/Bunq/Request/DeviceSessionRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; - use FireflyIII\Services\Bunq\Id\DeviceSessionId; use FireflyIII\Services\Bunq\Object\UserCompany; use FireflyIII\Services\Bunq\Object\UserPerson; @@ -155,6 +154,4 @@ class DeviceSessionRequest extends BunqRequest return $userPerson; } - - } diff --git a/app/Services/Bunq/Request/InstallationTokenRequest.php b/app/Services/Bunq/Request/InstallationTokenRequest.php index 604df78d4c..45e6cb81d0 100644 --- a/app/Services/Bunq/Request/InstallationTokenRequest.php +++ b/app/Services/Bunq/Request/InstallationTokenRequest.php @@ -108,7 +108,6 @@ class InstallationTokenRequest extends BunqRequest $installationId->setId(intval($data['id'])); return $installationId; - } /** @@ -118,7 +117,6 @@ class InstallationTokenRequest extends BunqRequest */ private function extractInstallationToken(array $response): InstallationToken { - $data = $this->getKeyFromResponse('Token', $response); $installationToken = new InstallationToken($data); diff --git a/app/Services/Bunq/Request/ListMonetaryAccountRequest.php b/app/Services/Bunq/Request/ListMonetaryAccountRequest.php index f62b3bb4b0..231ad1d8db 100644 --- a/app/Services/Bunq/Request/ListMonetaryAccountRequest.php +++ b/app/Services/Bunq/Request/ListMonetaryAccountRequest.php @@ -86,5 +86,4 @@ class ListMonetaryAccountRequest extends BunqRequest { $this->userId = $userId; } - } diff --git a/app/Services/Bunq/Token/BunqToken.php b/app/Services/Bunq/Token/BunqToken.php index 5dfc0615cf..7ea1b16ab7 100644 --- a/app/Services/Bunq/Token/BunqToken.php +++ b/app/Services/Bunq/Token/BunqToken.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Services\Bunq\Token; - use Carbon\Carbon; /** @@ -96,5 +95,4 @@ class BunqToken return; } - } diff --git a/app/Services/Bunq/Token/InstallationToken.php b/app/Services/Bunq/Token/InstallationToken.php index de3d1b59bc..1659da3598 100644 --- a/app/Services/Bunq/Token/InstallationToken.php +++ b/app/Services/Bunq/Token/InstallationToken.php @@ -30,6 +30,4 @@ namespace FireflyIII\Services\Bunq\Token; */ class InstallationToken extends BunqToken { - - } diff --git a/app/Services/Bunq/Token/SessionToken.php b/app/Services/Bunq/Token/SessionToken.php index 6113949fd9..1e9df7e787 100644 --- a/app/Services/Bunq/Token/SessionToken.php +++ b/app/Services/Bunq/Token/SessionToken.php @@ -32,5 +32,4 @@ namespace FireflyIII\Services\Bunq\Token; */ class SessionToken extends BunqToken { - } diff --git a/app/Services/Currency/ExchangeRateInterface.php b/app/Services/Currency/ExchangeRateInterface.php index 1d674059e3..e783de5f72 100644 --- a/app/Services/Currency/ExchangeRateInterface.php +++ b/app/Services/Currency/ExchangeRateInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Services\Currency; - use Carbon\Carbon; use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\TransactionCurrency; @@ -46,5 +45,4 @@ interface ExchangeRateInterface * @return mixed */ public function setUser(User $user); - } diff --git a/app/Services/Currency/FixerIO.php b/app/Services/Currency/FixerIO.php index 09f626ad9b..b7748953ee 100644 --- a/app/Services/Currency/FixerIO.php +++ b/app/Services/Currency/FixerIO.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Services\Currency; - use Carbon\Carbon; use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\TransactionCurrency; diff --git a/app/Services/Password/Verifier.php b/app/Services/Password/Verifier.php index a8636dbc14..db600e12ee 100644 --- a/app/Services/Password/Verifier.php +++ b/app/Services/Password/Verifier.php @@ -38,5 +38,4 @@ interface Verifier * @return bool */ public function validPassword(string $password): bool; - } diff --git a/app/Support/Amount.php b/app/Support/Amount.php index 767d2acc56..844f0cd5e1 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -141,7 +141,6 @@ class Amount } if ($coloured === true) { - if ($amount > 0) { return sprintf('%s', $result); } @@ -150,8 +149,6 @@ class Amount } return sprintf('%s', $result); - - } return $result; @@ -170,7 +167,6 @@ class Amount */ public function getCurrencyCode(): string { - $cache = new CacheProperties; $cache->addProperty('getCurrencyCode'); if ($cache->has()) { @@ -180,7 +176,6 @@ class Amount $currency = TransactionCurrency::where('code', $currencyPreference->data)->first(); if ($currency) { - $cache->store($currency->code); return $currency->code; @@ -263,5 +258,4 @@ class Amount 'zero' => $positive, ]; } - } diff --git a/app/Support/Binder/AccountList.php b/app/Support/Binder/AccountList.php index 9a5e786baf..415ed494ed 100644 --- a/app/Support/Binder/AccountList.php +++ b/app/Support/Binder/AccountList.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Binder; - use FireflyIII\Models\Account; use Illuminate\Support\Collection; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -44,9 +43,7 @@ class AccountList implements BinderInterface */ public static function routeBinder($value, $route): Collection { - if (auth()->check()) { - $ids = explode(',', $value); // filter ids: $ids = self::filterIds($ids); diff --git a/app/Support/Binder/BinderInterface.php b/app/Support/Binder/BinderInterface.php index 2eadbef6bd..1754966a77 100644 --- a/app/Support/Binder/BinderInterface.php +++ b/app/Support/Binder/BinderInterface.php @@ -37,5 +37,4 @@ interface BinderInterface * @return mixed */ public static function routeBinder($value, $route); - } diff --git a/app/Support/Binder/BudgetList.php b/app/Support/Binder/BudgetList.php index 835bb13448..1d91fd3a80 100644 --- a/app/Support/Binder/BudgetList.php +++ b/app/Support/Binder/BudgetList.php @@ -27,7 +27,6 @@ use FireflyIII\Models\Budget; use Illuminate\Support\Collection; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; - /** * Class BudgetList * diff --git a/app/Support/Binder/UnfinishedJournal.php b/app/Support/Binder/UnfinishedJournal.php index 2bb983cb45..1cf152879e 100644 --- a/app/Support/Binder/UnfinishedJournal.php +++ b/app/Support/Binder/UnfinishedJournal.php @@ -54,6 +54,5 @@ class UnfinishedJournal implements BinderInterface } throw new NotFoundHttpException; - } } diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 7ca5dbbd3d..5dc23ccfb5 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support; - use Cache; use Illuminate\Support\Collection; use Preferences as Prefs; diff --git a/app/Support/Domain.php b/app/Support/Domain.php index 97f0a882e6..03e093b638 100644 --- a/app/Support/Domain.php +++ b/app/Support/Domain.php @@ -36,7 +36,6 @@ class Domain public static function getBindables(): array { return config('firefly.bindables'); - } /** diff --git a/app/Support/Events/BillScanner.php b/app/Support/Events/BillScanner.php index 23341b0f09..d58a048e72 100644 --- a/app/Support/Events/BillScanner.php +++ b/app/Support/Events/BillScanner.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Events; - use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Bill\BillRepositoryInterface; @@ -48,5 +47,4 @@ class BillScanner $repository->scan($bill, $journal); } } - } diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 9174e837e3..764b8f1beb 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -133,7 +133,6 @@ class ExpandedForm $html = view('form.file', compact('classes', 'name', 'label', 'options'))->render(); return $html; - } /** @@ -153,7 +152,6 @@ class ExpandedForm $html = view('form.integer', compact('classes', 'name', 'label', 'value', 'options'))->render(); return $html; - } /** @@ -172,7 +170,6 @@ class ExpandedForm $html = view('form.location', compact('classes', 'name', 'label', 'value', 'options'))->render(); return $html; - } /** @@ -387,7 +384,6 @@ class ExpandedForm $html = view('form.password', compact('classes', 'name', 'label', 'value', 'options'))->render(); return $html; - } /** @@ -426,7 +422,6 @@ class ExpandedForm $html = view('form.static', compact('classes', 'name', 'label', 'value', 'options'))->render(); return $html; - } /** @@ -464,7 +459,6 @@ class ExpandedForm $html = view('form.text', compact('classes', 'name', 'label', 'value', 'options'))->render(); return $html; - } /** @@ -484,7 +478,6 @@ class ExpandedForm $html = view('form.textarea', compact('classes', 'name', 'label', 'value', 'options'))->render(); return $html; - } /** @@ -567,7 +560,6 @@ class ExpandedForm $name = str_replace('[]', '', $name); return strval(trans('form.' . $name)); - } /** diff --git a/app/Support/Facades/Amount.php b/app/Support/Facades/Amount.php index 561a01375a..ab7dcd3d4c 100644 --- a/app/Support/Facades/Amount.php +++ b/app/Support/Facades/Amount.php @@ -41,5 +41,4 @@ class Amount extends Facade { return 'amount'; } - } diff --git a/app/Support/Facades/ExpandedForm.php b/app/Support/Facades/ExpandedForm.php index 7b382a97f3..9f71f90399 100644 --- a/app/Support/Facades/ExpandedForm.php +++ b/app/Support/Facades/ExpandedForm.php @@ -41,5 +41,4 @@ class ExpandedForm extends Facade { return 'expandedform'; } - } diff --git a/app/Support/Facades/FireflyConfig.php b/app/Support/Facades/FireflyConfig.php index 6fa222424f..048e3e4b25 100644 --- a/app/Support/Facades/FireflyConfig.php +++ b/app/Support/Facades/FireflyConfig.php @@ -41,5 +41,4 @@ class FireflyConfig extends Facade { return 'fireflyconfig'; } - } diff --git a/app/Support/Facades/Navigation.php b/app/Support/Facades/Navigation.php index e98f22518d..95665752fb 100644 --- a/app/Support/Facades/Navigation.php +++ b/app/Support/Facades/Navigation.php @@ -41,5 +41,4 @@ class Navigation extends Facade { return 'navigation'; } - } diff --git a/app/Support/Facades/Preferences.php b/app/Support/Facades/Preferences.php index 2d036df025..d6a6373fb1 100644 --- a/app/Support/Facades/Preferences.php +++ b/app/Support/Facades/Preferences.php @@ -41,5 +41,4 @@ class Preferences extends Facade { return 'preferences'; } - } diff --git a/app/Support/Facades/Steam.php b/app/Support/Facades/Steam.php index 42eb0a82ec..015e910873 100644 --- a/app/Support/Facades/Steam.php +++ b/app/Support/Facades/Steam.php @@ -41,5 +41,4 @@ class Steam extends Facade { return 'steam'; } - } diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.php index 4fefbb9de1..367d4c7c06 100644 --- a/app/Support/FireflyConfig.php +++ b/app/Support/FireflyConfig.php @@ -117,7 +117,5 @@ class FireflyConfig Cache::forget('ff-config-' . $name); return $config; - } - } diff --git a/app/Support/Import/Configuration/ConfigurationInterface.php b/app/Support/Import/Configuration/ConfigurationInterface.php index 66e784e6b7..a5723a55ad 100644 --- a/app/Support/Import/Configuration/ConfigurationInterface.php +++ b/app/Support/Import/Configuration/ConfigurationInterface.php @@ -61,5 +61,4 @@ interface ConfigurationInterface * @return bool */ public function storeConfiguration(array $data): bool; - } diff --git a/app/Support/Import/Configuration/Csv/Map.php b/app/Support/Import/Configuration/Csv/Map.php index f877fb525f..612d782b4f 100644 --- a/app/Support/Import/Configuration/Csv/Map.php +++ b/app/Support/Import/Configuration/Csv/Map.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Import\Configuration\Csv; - use FireflyIII\Exceptions\FireflyException; use FireflyIII\Import\Mapper\MapperInterface; use FireflyIII\Import\MapperPreProcess\PreProcessorInterface; @@ -69,7 +68,6 @@ class Map implements ConfigurationInterface $indexes = array_keys($this->data); $rowIndex = 0; foreach ($results as $rowIndex => $row) { - $row = $this->runSpecifics($row); //do something here @@ -117,7 +115,6 @@ class Map implements ConfigurationInterface $this->job->save(); return $this->data; - } /** @@ -216,7 +213,6 @@ class Map implements ConfigurationInterface } return true; - } /** diff --git a/app/Support/Import/Configuration/Csv/Roles.php b/app/Support/Import/Configuration/Csv/Roles.php index 02c0701f06..265b98aeab 100644 --- a/app/Support/Import/Configuration/Csv/Roles.php +++ b/app/Support/Import/Configuration/Csv/Roles.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Import\Configuration\Csv; - use FireflyIII\Import\Specifics\SpecificInterface; use FireflyIII\Models\ImportJob; use FireflyIII\Support\Import\Configuration\ConfigurationInterface; @@ -150,7 +149,6 @@ class Roles implements ConfigurationInterface } return $roles; - } /** @@ -175,7 +173,6 @@ class Roles implements ConfigurationInterface $this->job->save(); return true; - } /** diff --git a/app/Support/Import/Information/BunqInformation.php b/app/Support/Import/Information/BunqInformation.php index d3de5bcd2a..9570506a0d 100644 --- a/app/Support/Import/Information/BunqInformation.php +++ b/app/Support/Import/Information/BunqInformation.php @@ -83,7 +83,6 @@ class BunqInformation implements InformationInterface $return = []; /** @var MonetaryAccountBank $account */ foreach ($accounts as $account) { - $current = [ 'id' => $account->getId(), 'name' => $account->getDescription(), @@ -156,7 +155,6 @@ class BunqInformation implements InformationInterface $request->call(); return $request->getMonetaryAccounts(); - } /** diff --git a/app/Support/Import/Prerequisites/BunqPrerequisites.php b/app/Support/Import/Prerequisites/BunqPrerequisites.php index a7b53f2f00..c9eae0595b 100644 --- a/app/Support/Import/Prerequisites/BunqPrerequisites.php +++ b/app/Support/Import/Prerequisites/BunqPrerequisites.php @@ -149,7 +149,6 @@ class BunqPrerequisites implements PrerequisitesInterface Log::debug('Created key pair'); return; - } /** @@ -334,5 +333,4 @@ class BunqPrerequisites implements PrerequisitesInterface return $deviceServerId; } - } diff --git a/app/Support/Import/Prerequisites/PrerequisitesInterface.php b/app/Support/Import/Prerequisites/PrerequisitesInterface.php index cbbc633154..f6042869d4 100644 --- a/app/Support/Import/Prerequisites/PrerequisitesInterface.php +++ b/app/Support/Import/Prerequisites/PrerequisitesInterface.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Import\Prerequisites; - use FireflyIII\User; use Illuminate\Http\Request; use Illuminate\Support\MessageBag; diff --git a/app/Support/Models/TransactionJournalTrait.php b/app/Support/Models/TransactionJournalTrait.php index 4bd4739672..ff039bea5a 100644 --- a/app/Support/Models/TransactionJournalTrait.php +++ b/app/Support/Models/TransactionJournalTrait.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Models; - use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Transaction; @@ -161,8 +160,6 @@ trait TransactionJournalTrait } return ''; - - } /** diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 3df169a12b..ae3ec494b0 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -176,7 +176,6 @@ class Navigation if (isset($functionMap[$repeatFreq])) { $function = $functionMap[$repeatFreq]; $currentEnd->$function(); - } if (!is_null($maxDate) && $currentEnd > $maxDate) { @@ -221,7 +220,6 @@ class Navigation } return $entries; - } /** @@ -310,7 +308,6 @@ class Navigation } return $format; - } /** @@ -357,7 +354,6 @@ class Navigation } return $format; - } /** @@ -381,7 +377,6 @@ class Navigation } return $format; - } /** @@ -565,11 +560,7 @@ class Navigation $start->startOfYear(); return $start; - - } throw new FireflyException(sprintf('updateStartDate cannot handle range "%s"', $range)); } - - } diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index bec81b756a..33a7becce5 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -115,7 +115,6 @@ class Preferences } return $result; - } /** @@ -146,7 +145,6 @@ class Preferences } return $this->setForUser($user, $name, $default); - } /** @@ -227,6 +225,5 @@ class Preferences Cache::forever($fullName, $pref); return $pref; - } } diff --git a/app/Support/Search/Modifier.php b/app/Support/Search/Modifier.php index c5ad8dd986..cf23cc9383 100644 --- a/app/Support/Search/Modifier.php +++ b/app/Support/Search/Modifier.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Search; - use Carbon\Carbon; use Exception; use FireflyIII\Exceptions\FireflyException; @@ -154,7 +153,6 @@ class Modifier Log::debug(sprintf('"%s" is in "%s"? %s', $needle, $haystack, var_export($res, true))); return $res; - } /** diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.php index 6016c7d1e4..7b59960233 100644 --- a/app/Support/Search/Search.php +++ b/app/Support/Search/Search.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Search; - use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\JournalCollectorInterface; @@ -134,7 +133,6 @@ class Search implements SearchInterface // Filter transactions that match the given triggers. $filtered = $set->filter( function (Transaction $transaction) { - if ($this->matchModifiers($transaction)) { return $transaction; } @@ -167,7 +165,6 @@ class Search implements SearchInterface // break at some point so the script does not crash: $currentTime = microtime(true) - $startTime; Log::debug(sprintf('Have been running for %f seconds.', $currentTime)); - } while (!$reachedEndOfList && !$foundEnough && $currentTime <= 30); $result = $result->slice(0, $this->limit); @@ -287,7 +284,6 @@ class Search implements SearchInterface } return true; - } /** diff --git a/app/Support/SingleCacheProperties.php b/app/Support/SingleCacheProperties.php index d1eebe83e0..9e2b3324ad 100644 --- a/app/Support/SingleCacheProperties.php +++ b/app/Support/SingleCacheProperties.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support; - use Illuminate\Support\Collection; /** diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 4f3a55c32d..a7b56c774d 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -208,8 +208,6 @@ class Steam $cache->store($balances); return $balances; - - } /** @@ -337,8 +335,6 @@ class Steam } return intval($string); - - } /** @@ -370,5 +366,4 @@ class Steam return $value; } - } diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.php index 96022ca313..45f30556f2 100644 --- a/app/Support/Twig/AmountFormat.php +++ b/app/Support/Twig/AmountFormat.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Twig; - use FireflyIII\Models\Account as AccountModel; use FireflyIII\Models\TransactionCurrency; use Twig_Extension; @@ -46,7 +45,6 @@ class AmountFormat extends Twig_Extension $this->formatAmount(), $this->formatAmountPlain(), ]; - } /** @@ -63,7 +61,6 @@ class AmountFormat extends Twig_Extension $this->formatSourceBefore(), $this->formatAmountByCurrency(), ]; - } /** @@ -83,12 +80,13 @@ class AmountFormat extends Twig_Extension protected function formatAmount(): Twig_SimpleFilter { return new Twig_SimpleFilter( - 'formatAmount', function (string $string): string { + 'formatAmount', + function (string $string): string { + $currency = app('amount')->getDefaultCurrency(); - $currency = app('amount')->getDefaultCurrency(); - - return app('amount')->formatAnything($currency, $string, true); - }, ['is_safe' => ['html']] + return app('amount')->formatAnything($currency, $string, true); + }, + ['is_safe' => ['html']] ); } @@ -100,20 +98,20 @@ class AmountFormat extends Twig_Extension protected function formatAmountByAccount(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'formatAmountByAccount', function (AccountModel $account, string $amount, bool $coloured = true): string { - $currencyId = intval($account->getMeta('currency_id')); + 'formatAmountByAccount', + function (AccountModel $account, string $amount, bool $coloured = true): string { + $currencyId = intval($account->getMeta('currency_id')); - if ($currencyId !== 0) { - $currency = TransactionCurrency::find($currencyId); + if ($currencyId !== 0) { + $currency = TransactionCurrency::find($currencyId); + + return app('amount')->formatAnything($currency, $amount, $coloured); + } + $currency = app('amount')->getDefaultCurrency(); return app('amount')->formatAnything($currency, $amount, $coloured); - } - $currency = app('amount')->getDefaultCurrency(); - - return app('amount')->formatAnything($currency, $amount, $coloured); - - - }, ['is_safe' => ['html']] + }, + ['is_safe' => ['html']] ); } @@ -125,12 +123,11 @@ class AmountFormat extends Twig_Extension protected function formatAmountByCurrency(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'formatAmountByCurrency', function (TransactionCurrency $currency, string $amount, bool $coloured = true): string { - - return app('amount')->formatAnything($currency, $amount, $coloured); - - - }, ['is_safe' => ['html']] + 'formatAmountByCurrency', + function (TransactionCurrency $currency, string $amount, bool $coloured = true): string { + return app('amount')->formatAnything($currency, $amount, $coloured); + }, + ['is_safe' => ['html']] ); } @@ -142,16 +139,15 @@ class AmountFormat extends Twig_Extension protected function formatAmountBySymbol(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'formatAmountBySymbol', function (string $amount, string $symbol, int $decimalPlaces = 2, bool $coloured = true): string { + 'formatAmountBySymbol', + function (string $amount, string $symbol, int $decimalPlaces = 2, bool $coloured = true): string { + $currency = new TransactionCurrency; + $currency->symbol = $symbol; + $currency->decimal_places = $decimalPlaces; - $currency = new TransactionCurrency; - $currency->symbol = $symbol; - $currency->decimal_places = $decimalPlaces; - - return app('amount')->formatAnything($currency, $amount, $coloured); - - - }, ['is_safe' => ['html']] + return app('amount')->formatAnything($currency, $amount, $coloured); + }, + ['is_safe' => ['html']] ); } @@ -161,12 +157,13 @@ class AmountFormat extends Twig_Extension protected function formatAmountPlain(): Twig_SimpleFilter { return new Twig_SimpleFilter( - 'formatAmountPlain', function (string $string): string { + 'formatAmountPlain', + function (string $string): string { + $currency = app('amount')->getDefaultCurrency(); - $currency = app('amount')->getDefaultCurrency(); - - return app('amount')->formatAnything($currency, $string, false); - }, ['is_safe' => ['html']] + return app('amount')->formatAnything($currency, $string, false); + }, + ['is_safe' => ['html']] ); } @@ -176,27 +173,28 @@ class AmountFormat extends Twig_Extension protected function formatDestinationAfter(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'formatDestinationAfter', function (array $transaction): string { + 'formatDestinationAfter', + function (array $transaction): string { // build fake currency for main amount. - $format = new TransactionCurrency; - $format->decimal_places = $transaction['transaction_currency_dp']; - $format->symbol = $transaction['transaction_currency_symbol']; - $string = app('amount')->formatAnything($format, $transaction['destination_account_after'], true); - - // also append foreign amount for clarity: - if (!is_null($transaction['foreign_destination_amount'])) { - // build fake currency for foreign amount $format = new TransactionCurrency; - $format->decimal_places = $transaction['foreign_currency_dp']; - $format->symbol = $transaction['foreign_currency_symbol']; - $string .= ' (' . app('amount')->formatAnything($format, $transaction['foreign_destination_amount'], true) . ')'; - } + $format->decimal_places = $transaction['transaction_currency_dp']; + $format->symbol = $transaction['transaction_currency_symbol']; + $string = app('amount')->formatAnything($format, $transaction['destination_account_after'], true); + + // also append foreign amount for clarity: + if (!is_null($transaction['foreign_destination_amount'])) { + // build fake currency for foreign amount + $format = new TransactionCurrency; + $format->decimal_places = $transaction['foreign_currency_dp']; + $format->symbol = $transaction['foreign_currency_symbol']; + $string .= ' (' . app('amount')->formatAnything($format, $transaction['foreign_destination_amount'], true) . ')'; + } - return $string; - - }, ['is_safe' => ['html']] + return $string; + }, + ['is_safe' => ['html']] ); } @@ -206,16 +204,17 @@ class AmountFormat extends Twig_Extension protected function formatDestinationBefore(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'formatDestinationBefore', function (array $transaction): string { + 'formatDestinationBefore', + function (array $transaction): string { // build fake currency for main amount. - $format = new TransactionCurrency; - $format->decimal_places = $transaction['transaction_currency_dp']; - $format->symbol = $transaction['transaction_currency_symbol']; + $format = new TransactionCurrency; + $format->decimal_places = $transaction['transaction_currency_dp']; + $format->symbol = $transaction['transaction_currency_symbol']; - return app('amount')->formatAnything($format, $transaction['destination_account_before'], true); - - }, ['is_safe' => ['html']] + return app('amount')->formatAnything($format, $transaction['destination_account_before'], true); + }, + ['is_safe' => ['html']] ); } @@ -225,28 +224,28 @@ class AmountFormat extends Twig_Extension protected function formatSourceAfter(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'formatSourceAfter', function (array $transaction): string { + 'formatSourceAfter', + function (array $transaction): string { // build fake currency for main amount. - $format = new TransactionCurrency; - $format->decimal_places = $transaction['transaction_currency_dp']; - $format->symbol = $transaction['transaction_currency_symbol']; - $string = app('amount')->formatAnything($format, $transaction['source_account_after'], true); - - // also append foreign amount for clarity: - if (!is_null($transaction['foreign_source_amount'])) { - // build fake currency for foreign amount $format = new TransactionCurrency; - $format->decimal_places = $transaction['foreign_currency_dp']; - $format->symbol = $transaction['foreign_currency_symbol']; - $string .= ' (' . app('amount')->formatAnything($format, $transaction['foreign_source_amount'], true) . ')'; - } + $format->decimal_places = $transaction['transaction_currency_dp']; + $format->symbol = $transaction['transaction_currency_symbol']; + $string = app('amount')->formatAnything($format, $transaction['source_account_after'], true); + + // also append foreign amount for clarity: + if (!is_null($transaction['foreign_source_amount'])) { + // build fake currency for foreign amount + $format = new TransactionCurrency; + $format->decimal_places = $transaction['foreign_currency_dp']; + $format->symbol = $transaction['foreign_currency_symbol']; + $string .= ' (' . app('amount')->formatAnything($format, $transaction['foreign_source_amount'], true) . ')'; + } - return $string; - - - }, ['is_safe' => ['html']] + return $string; + }, + ['is_safe' => ['html']] ); } @@ -256,17 +255,17 @@ class AmountFormat extends Twig_Extension protected function formatSourceBefore(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'formatSourceBefore', function (array $transaction): string { + 'formatSourceBefore', + function (array $transaction): string { // build fake currency for main amount. - $format = new TransactionCurrency; - $format->decimal_places = $transaction['transaction_currency_dp']; - $format->symbol = $transaction['transaction_currency_symbol']; + $format = new TransactionCurrency; + $format->decimal_places = $transaction['transaction_currency_dp']; + $format->symbol = $transaction['transaction_currency_symbol']; - return app('amount')->formatAnything($format, $transaction['source_account_before'], true); - - }, ['is_safe' => ['html']] + return app('amount')->formatAnything($format, $transaction['source_account_before'], true); + }, + ['is_safe' => ['html']] ); } - } diff --git a/app/Support/Twig/Extension/Transaction.php b/app/Support/Twig/Extension/Transaction.php index b7ab549e29..8bcde09923 100644 --- a/app/Support/Twig/Extension/Transaction.php +++ b/app/Support/Twig/Extension/Transaction.php @@ -194,7 +194,6 @@ class Transaction extends Twig_Extension $cache->store($txt); return $txt; - } /** @@ -310,7 +309,8 @@ class Transaction extends Twig_Extension /** @var TransactionModel $other */ $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where( - 'identifier', $transaction->identifier + 'identifier', + $transaction->identifier ) ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') @@ -488,7 +488,8 @@ class Transaction extends Twig_Extension /** @var TransactionModel $other */ $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where( - 'identifier', $transaction->identifier + 'identifier', + $transaction->identifier ) ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') diff --git a/app/Support/Twig/Extension/TransactionJournal.php b/app/Support/Twig/Extension/TransactionJournal.php index 0b0d78f384..5e429db205 100644 --- a/app/Support/Twig/Extension/TransactionJournal.php +++ b/app/Support/Twig/Extension/TransactionJournal.php @@ -37,7 +37,7 @@ class TransactionJournal extends Twig_Extension * * @return string */ - function totalAmount(JournalModel $journal): string + public function totalAmount(JournalModel $journal): string { $cache = new SingleCacheProperties; $cache->addProperty('total-amount'); @@ -86,7 +86,5 @@ class TransactionJournal extends Twig_Extension $cache->store($txt); return $txt; - } - } diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 6e3b303bab..b2d04de926 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -53,7 +53,6 @@ class General extends Twig_Extension $this->mimeIcon(), ]; - } /** @@ -73,7 +72,6 @@ class General extends Twig_Extension $this->activeRoutePartialWhat(), ]; - } /** @@ -93,16 +91,17 @@ class General extends Twig_Extension protected function activeRoutePartial(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'activeRoutePartial', function (): string { - $args = func_get_args(); - $route = $args[0]; // name of the route. - $name = Route::getCurrentRoute()->getName() ?? ''; - if (!(strpos($name, $route) === false)) { - return 'active'; - } + 'activeRoutePartial', + function (): string { + $args = func_get_args(); + $route = $args[0]; // name of the route. + $name = Route::getCurrentRoute()->getName() ?? ''; + if (!(strpos($name, $route) === false)) { + return 'active'; + } - return ''; - } + return ''; + } ); } @@ -115,18 +114,20 @@ class General extends Twig_Extension protected function activeRoutePartialWhat(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'activeRoutePartialWhat', function ($context): string { - $args = func_get_args(); - $route = $args[1]; // name of the route. + 'activeRoutePartialWhat', + function ($context): string { + $args = func_get_args(); + $route = $args[1]; // name of the route. $what = $args[2]; // name of the route. $activeWhat = $context['what'] ?? false; - if ($what === $activeWhat && !(strpos(Route::getCurrentRoute()->getName(), $route) === false)) { - return 'active'; - } + if ($what === $activeWhat && !(strpos(Route::getCurrentRoute()->getName(), $route) === false)) { + return 'active'; + } - return ''; - }, ['needs_context' => true] + return ''; + }, + ['needs_context' => true] ); } @@ -139,16 +140,17 @@ class General extends Twig_Extension protected function activeRouteStrict(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'activeRouteStrict', function (): string { - $args = func_get_args(); - $route = $args[0]; // name of the route. + 'activeRouteStrict', + function (): string { + $args = func_get_args(); + $route = $args[0]; // name of the route. - if (Route::getCurrentRoute()->getName() === $route) { - return 'active'; + if (Route::getCurrentRoute()->getName() === $route) { + return 'active'; + } + + return ''; } - - return ''; - } ); } @@ -158,14 +160,15 @@ class General extends Twig_Extension protected function balance(): Twig_SimpleFilter { return new Twig_SimpleFilter( - 'balance', function (?Account $account): string { - if (is_null($account)) { - return 'NULL'; - } - $date = session('end', Carbon::now()->endOfMonth()); + 'balance', + function (?Account $account): string { + if (is_null($account)) { + return 'NULL'; + } + $date = session('end', Carbon::now()->endOfMonth()); - return app('steam')->balance($account, $date); - } + return app('steam')->balance($account, $date); + } ); } @@ -175,9 +178,10 @@ class General extends Twig_Extension protected function env(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'env', function (string $name, string $default): string { - return env($name, $default); - } + 'env', + function (string $name, string $default): string { + return env($name, $default); + } ); } @@ -187,20 +191,21 @@ class General extends Twig_Extension protected function formatFilesize(): Twig_SimpleFilter { return new Twig_SimpleFilter( - 'filesize', function (int $size): string { + 'filesize', + function (int $size): string { // less than one GB, more than one MB - if ($size < (1024 * 1024 * 2014) && $size >= (1024 * 1024)) { - return round($size / (1024 * 1024), 2) . ' MB'; - } + if ($size < (1024 * 1024 * 2014) && $size >= (1024 * 1024)) { + return round($size / (1024 * 1024), 2) . ' MB'; + } - // less than one MB - if ($size < (1024 * 1024)) { - return round($size / 1024, 2) . ' KB'; - } + // less than one MB + if ($size < (1024 * 1024)) { + return round($size / 1024, 2) . ' KB'; + } - return $size . ' bytes'; - } + return $size . ' bytes'; + } ); } @@ -211,9 +216,10 @@ class General extends Twig_Extension protected function getCurrencyCode(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'getCurrencyCode', function (): string { - return app('amount')->getCurrencyCode(); - } + 'getCurrencyCode', + function (): string { + return app('amount')->getCurrencyCode(); + } ); } @@ -223,9 +229,10 @@ class General extends Twig_Extension protected function getCurrencySymbol(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'getCurrencySymbol', function (): string { - return app('amount')->getCurrencySymbol(); - } + 'getCurrencySymbol', + function (): string { + return app('amount')->getCurrencySymbol(); + } ); } @@ -235,8 +242,9 @@ class General extends Twig_Extension protected function mimeIcon(): Twig_SimpleFilter { return new Twig_SimpleFilter( - 'mimeIcon', function (string $string): string { - switch ($string) { + 'mimeIcon', + function (string $string): string { + switch ($string) { default: return 'fa-file-o'; case 'application/pdf': @@ -245,7 +253,8 @@ class General extends Twig_Extension case 'image/jpeg': return 'fa-file-image-o'; } - }, ['is_safe' => ['html']] + }, + ['is_safe' => ['html']] ); } @@ -255,9 +264,10 @@ class General extends Twig_Extension protected function phpdate() { return new Twig_SimpleFunction( - 'phpdate', function (string $str): string { - return date($str); - } + 'phpdate', + function (string $str): string { + return date($str); + } ); } @@ -267,9 +277,10 @@ class General extends Twig_Extension protected function steamPositive() { return new Twig_SimpleFunction( - 'steam_positive', function (string $str): string { - return Steam::positive($str); - } + 'steam_positive', + function (string $str): string { + return Steam::positive($str); + } ); } @@ -279,10 +290,10 @@ class General extends Twig_Extension private function getAmountFromJournal() { return new Twig_SimpleFunction( - 'getAmount', function (TransactionJournal $journal): string { - return $journal->amount(); - } + 'getAmount', + function (TransactionJournal $journal): string { + return $journal->amount(); + } ); } - } diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php index cad069fd36..3998ba15ec 100644 --- a/app/Support/Twig/Journal.php +++ b/app/Support/Twig/Journal.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Twig; - use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Models\Category; @@ -49,31 +48,32 @@ class Journal extends Twig_Extension public function getDestinationAccount(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'destinationAccount', function (TransactionJournal $journal) { - $cache = new CacheProperties; - $cache->addProperty($journal->id); - $cache->addProperty('transaction-journal'); - $cache->addProperty('destination-account-string'); - if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore - } - - $list = $journal->destinationAccountList(); - $array = []; - /** @var Account $entry */ - foreach ($list as $entry) { - if ($entry->accountType->type === AccountType::CASH) { - $array[] = '(cash)'; - continue; + 'destinationAccount', + function (TransactionJournal $journal) { + $cache = new CacheProperties; + $cache->addProperty($journal->id); + $cache->addProperty('transaction-journal'); + $cache->addProperty('destination-account-string'); + if ($cache->has()) { + return $cache->get(); // @codeCoverageIgnore } - $array[] = sprintf('
%1$s', e($entry->name), route('accounts.show', $entry->id)); - } - $array = array_unique($array); - $result = join(', ', $array); - $cache->store($result); - return $result; - } + $list = $journal->destinationAccountList(); + $array = []; + /** @var Account $entry */ + foreach ($list as $entry) { + if ($entry->accountType->type === AccountType::CASH) { + $array[] = '(cash)'; + continue; + } + $array[] = sprintf('%1$s', e($entry->name), route('accounts.show', $entry->id)); + } + $array = array_unique($array); + $result = join(', ', $array); + $cache->store($result); + + return $result; + } ); } @@ -120,34 +120,32 @@ class Journal extends Twig_Extension public function getSourceAccount(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'sourceAccount', function (TransactionJournal $journal): string { - - $cache = new CacheProperties; - $cache->addProperty($journal->id); - $cache->addProperty('transaction-journal'); - $cache->addProperty('source-account-string'); - if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore - } - - $list = $journal->sourceAccountList(); - $array = []; - /** @var Account $entry */ - foreach ($list as $entry) { - if ($entry->accountType->type === AccountType::CASH) { - $array[] = '(cash)'; - continue; + 'sourceAccount', + function (TransactionJournal $journal): string { + $cache = new CacheProperties; + $cache->addProperty($journal->id); + $cache->addProperty('transaction-journal'); + $cache->addProperty('source-account-string'); + if ($cache->has()) { + return $cache->get(); // @codeCoverageIgnore } - $array[] = sprintf('%1$s', e($entry->name), route('accounts.show', $entry->id)); + + $list = $journal->sourceAccountList(); + $array = []; + /** @var Account $entry */ + foreach ($list as $entry) { + if ($entry->accountType->type === AccountType::CASH) { + $array[] = '(cash)'; + continue; + } + $array[] = sprintf('%1$s', e($entry->name), route('accounts.show', $entry->id)); + } + $array = array_unique($array); + $result = join(', ', $array); + $cache->store($result); + + return $result; } - $array = array_unique($array); - $result = join(', ', $array); - $cache->store($result); - - return $result; - - - } ); } @@ -157,34 +155,33 @@ class Journal extends Twig_Extension public function journalBudgets(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'journalBudgets', function (TransactionJournal $journal): string { - $cache = new CacheProperties; - $cache->addProperty($journal->id); - $cache->addProperty('transaction-journal'); - $cache->addProperty('budget-string'); - if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore - } + 'journalBudgets', + function (TransactionJournal $journal): string { + $cache = new CacheProperties; + $cache->addProperty($journal->id); + $cache->addProperty('transaction-journal'); + $cache->addProperty('budget-string'); + if ($cache->has()) { + return $cache->get(); // @codeCoverageIgnore + } - $budgets = []; - // get all budgets: - foreach ($journal->budgets as $budget) { - $budgets[] = sprintf('%1$s', e($budget->name), route('budgets.show', $budget->id)); - } - // and more! - foreach ($journal->transactions as $transaction) { - foreach ($transaction->budgets as $budget) { + $budgets = []; + // get all budgets: + foreach ($journal->budgets as $budget) { $budgets[] = sprintf('%1$s', e($budget->name), route('budgets.show', $budget->id)); } + // and more! + foreach ($journal->transactions as $transaction) { + foreach ($transaction->budgets as $budget) { + $budgets[] = sprintf('%1$s', e($budget->name), route('budgets.show', $budget->id)); + } + } + $string = join(', ', array_unique($budgets)); + $cache->store($string); + + return $string; } - $string = join(', ', array_unique($budgets)); - $cache->store($string); - - return $string; - - - } ); } @@ -194,37 +191,38 @@ class Journal extends Twig_Extension public function journalCategories(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'journalCategories', function (TransactionJournal $journal): string { - $cache = new CacheProperties; - $cache->addProperty($journal->id); - $cache->addProperty('transaction-journal'); - $cache->addProperty('category-string'); - if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore - } - $categories = []; - // get all categories for the journal itself (easy): - foreach ($journal->categories as $category) { - $categories[] = sprintf('%1$s', e($category->name), route('categories.show', $category->id)); - } - if (count($categories) === 0) { - $set = Category::distinct()->leftJoin('category_transaction', 'categories.id', '=', 'category_transaction.category_id') + 'journalCategories', + function (TransactionJournal $journal): string { + $cache = new CacheProperties; + $cache->addProperty($journal->id); + $cache->addProperty('transaction-journal'); + $cache->addProperty('category-string'); + if ($cache->has()) { + return $cache->get(); // @codeCoverageIgnore + } + $categories = []; + // get all categories for the journal itself (easy): + foreach ($journal->categories as $category) { + $categories[] = sprintf('%1$s', e($category->name), route('categories.show', $category->id)); + } + if (count($categories) === 0) { + $set = Category::distinct()->leftJoin('category_transaction', 'categories.id', '=', 'category_transaction.category_id') ->leftJoin('transactions', 'category_transaction.transaction_id', '=', 'transactions.id') ->leftJoin('transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') ->where('categories.user_id', $journal->user_id) ->where('transaction_journals.id', $journal->id) ->get(['categories.*']); - /** @var Category $category */ - foreach ($set as $category) { - $categories[] = sprintf('%1$s', e($category->name), route('categories.show', $category->id)); + /** @var Category $category */ + foreach ($set as $category) { + $categories[] = sprintf('%1$s', e($category->name), route('categories.show', $category->id)); + } } + + $string = join(', ', array_unique($categories)); + $cache->store($string); + + return $string; } - - $string = join(', ', array_unique($categories)); - $cache->store($string); - - return $string; - } ); } } diff --git a/app/Support/Twig/Loader/TransactionJournalLoader.php b/app/Support/Twig/Loader/TransactionJournalLoader.php index a12e6b0763..6e92978c14 100644 --- a/app/Support/Twig/Loader/TransactionJournalLoader.php +++ b/app/Support/Twig/Loader/TransactionJournalLoader.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Twig\Loader; - use FireflyIII\Support\Twig\Extension\TransactionJournal; use Twig_RuntimeLoaderInterface; diff --git a/app/Support/Twig/Loader/TransactionLoader.php b/app/Support/Twig/Loader/TransactionLoader.php index 002c4e70da..4c4b8e9892 100644 --- a/app/Support/Twig/Loader/TransactionLoader.php +++ b/app/Support/Twig/Loader/TransactionLoader.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Twig\Loader; - use FireflyIII\Support\Twig\Extension\Transaction; use Twig_RuntimeLoaderInterface; diff --git a/app/Support/Twig/PiggyBank.php b/app/Support/Twig/PiggyBank.php index a47da054ea..a56a67e2be 100644 --- a/app/Support/Twig/PiggyBank.php +++ b/app/Support/Twig/PiggyBank.php @@ -44,15 +44,17 @@ class PiggyBank extends Twig_Extension $functions = []; $functions[] = new Twig_SimpleFunction( - 'currentRelevantRepAmount', function (PB $piggyBank) { - return $piggyBank->currentRelevantRep()->currentamount; - } + 'currentRelevantRepAmount', + function (PB $piggyBank) { + return $piggyBank->currentRelevantRep()->currentamount; + } ); $functions[] = new Twig_SimpleFunction( - 'suggestedMonthlyAmount', function (PB $piggyBank) { - return $piggyBank->getSuggestedMonthlyAmount(); - } + 'suggestedMonthlyAmount', + function (PB $piggyBank) { + return $piggyBank->getSuggestedMonthlyAmount(); + } ); return $functions; diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php index 7c36b5b8ff..646912c370 100644 --- a/app/Support/Twig/Rule.php +++ b/app/Support/Twig/Rule.php @@ -41,18 +41,19 @@ class Rule extends Twig_Extension public function allActionTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'allRuleActions', function () { - // array of valid values for actions - $ruleActions = array_keys(Config::get('firefly.rule-actions')); - $possibleActions = []; - foreach ($ruleActions as $key) { - $possibleActions[$key] = trans('firefly.rule_action_' . $key . '_choice'); - } - unset($key, $ruleActions); - asort($possibleActions); + 'allRuleActions', + function () { + // array of valid values for actions + $ruleActions = array_keys(Config::get('firefly.rule-actions')); + $possibleActions = []; + foreach ($ruleActions as $key) { + $possibleActions[$key] = trans('firefly.rule_action_' . $key . '_choice'); + } + unset($key, $ruleActions); + asort($possibleActions); - return $possibleActions; - } + return $possibleActions; + } ); } @@ -62,12 +63,13 @@ class Rule extends Twig_Extension public function allJournalTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'allJournalTriggers', function () { - return [ + 'allJournalTriggers', + function () { + return [ 'store-journal' => trans('firefly.rule_trigger_store_journal'), 'update-journal' => trans('firefly.rule_trigger_update_journal'), ]; - } + } ); } @@ -77,22 +79,22 @@ class Rule extends Twig_Extension public function allRuleTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'allRuleTriggers', function () { - $ruleTriggers = array_keys(Config::get('firefly.rule-triggers')); - $possibleTriggers = []; - foreach ($ruleTriggers as $key) { - if ($key !== 'user_action') { - $possibleTriggers[$key] = trans('firefly.rule_trigger_' . $key . '_choice'); + 'allRuleTriggers', + function () { + $ruleTriggers = array_keys(Config::get('firefly.rule-triggers')); + $possibleTriggers = []; + foreach ($ruleTriggers as $key) { + if ($key !== 'user_action') { + $possibleTriggers[$key] = trans('firefly.rule_trigger_' . $key . '_choice'); + } } - } - unset($key, $ruleTriggers); - asort($possibleTriggers); + unset($key, $ruleTriggers); + asort($possibleTriggers); - return $possibleTriggers; - } + return $possibleTriggers; + } ); - } /** @@ -105,7 +107,6 @@ class Rule extends Twig_Extension $this->allRuleTriggers(), $this->allActionTriggers(), ]; - } /** diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php index 95c1456315..3939dd8f3d 100644 --- a/app/Support/Twig/Translation.php +++ b/app/Support/Twig/Translation.php @@ -44,11 +44,11 @@ class Translation extends Twig_Extension $filters = []; $filters[] = new Twig_SimpleFilter( - '_', function ($name) { - - return strval(trans(sprintf('firefly.%s', $name))); - - }, ['is_safe' => ['html']] + '_', + function ($name) { + return strval(trans(sprintf('firefly.%s', $name))); + }, + ['is_safe' => ['html']] ); return $filters; @@ -64,7 +64,6 @@ class Translation extends Twig_Extension $this->journalLinkTranslation(), ]; - } /** @@ -81,17 +80,17 @@ class Translation extends Twig_Extension public function journalLinkTranslation(): Twig_SimpleFunction { return new Twig_SimpleFunction( - 'journalLinkTranslation', function (string $direction, string $original) { - $key = sprintf('firefly.%s_%s', $original, $direction); - $translation = trans($key); - if ($key === $translation) { - return $original; - } + 'journalLinkTranslation', + function (string $direction, string $original) { + $key = sprintf('firefly.%s_%s', $original, $direction); + $translation = trans($key); + if ($key === $translation) { + return $original; + } - return $translation; - - - }, ['is_safe' => ['html']] + return $translation; + }, + ['is_safe' => ['html']] ); } } diff --git a/app/TransactionRules/Actions/AddTag.php b/app/TransactionRules/Actions/AddTag.php index 0886008566..a1f667a459 100644 --- a/app/TransactionRules/Actions/AddTag.php +++ b/app/TransactionRules/Actions/AddTag.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; - use FireflyIII\Models\RuleAction; use FireflyIII\Models\Tag; use FireflyIII\Models\TransactionJournal; diff --git a/app/TransactionRules/Actions/AppendDescription.php b/app/TransactionRules/Actions/AppendDescription.php index 6fd15be25e..12e9d5339f 100644 --- a/app/TransactionRules/Actions/AppendDescription.php +++ b/app/TransactionRules/Actions/AppendDescription.php @@ -34,7 +34,6 @@ use Log; */ class AppendDescription implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/AppendNotes.php b/app/TransactionRules/Actions/AppendNotes.php index b7d09e7b84..ef57c62fbf 100644 --- a/app/TransactionRules/Actions/AppendNotes.php +++ b/app/TransactionRules/Actions/AppendNotes.php @@ -35,7 +35,6 @@ use Log; */ class AppendNotes implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/ClearBudget.php b/app/TransactionRules/Actions/ClearBudget.php index b10e3ff7f7..b666bc9cd1 100644 --- a/app/TransactionRules/Actions/ClearBudget.php +++ b/app/TransactionRules/Actions/ClearBudget.php @@ -34,7 +34,6 @@ use Log; */ class ClearBudget implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/ClearCategory.php b/app/TransactionRules/Actions/ClearCategory.php index 198e9c0218..fee2a49a1a 100644 --- a/app/TransactionRules/Actions/ClearCategory.php +++ b/app/TransactionRules/Actions/ClearCategory.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; - use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; use Log; @@ -35,7 +34,6 @@ use Log; */ class ClearCategory implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/ClearNotes.php b/app/TransactionRules/Actions/ClearNotes.php index b1ed669e6c..f02b3662bc 100644 --- a/app/TransactionRules/Actions/ClearNotes.php +++ b/app/TransactionRules/Actions/ClearNotes.php @@ -35,7 +35,6 @@ use Log; */ class ClearNotes implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/PrependDescription.php b/app/TransactionRules/Actions/PrependDescription.php index dae4a86649..0a1b1c3e49 100644 --- a/app/TransactionRules/Actions/PrependDescription.php +++ b/app/TransactionRules/Actions/PrependDescription.php @@ -34,7 +34,6 @@ use Log; */ class PrependDescription implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/PrependNotes.php b/app/TransactionRules/Actions/PrependNotes.php index ee132f3c2d..2273b59076 100644 --- a/app/TransactionRules/Actions/PrependNotes.php +++ b/app/TransactionRules/Actions/PrependNotes.php @@ -35,7 +35,6 @@ use Log; */ class PrependNotes implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/RemoveAllTags.php b/app/TransactionRules/Actions/RemoveAllTags.php index e7ca077b4c..caebb9e389 100644 --- a/app/TransactionRules/Actions/RemoveAllTags.php +++ b/app/TransactionRules/Actions/RemoveAllTags.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; - use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; use Log; @@ -59,6 +58,5 @@ class RemoveAllTags implements ActionInterface $journal->tags()->detach(); return true; - } } diff --git a/app/TransactionRules/Actions/RemoveTag.php b/app/TransactionRules/Actions/RemoveTag.php index a1d7b32a89..c6b178f255 100644 --- a/app/TransactionRules/Actions/RemoveTag.php +++ b/app/TransactionRules/Actions/RemoveTag.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; - use FireflyIII\Models\RuleAction; use FireflyIII\Models\Tag; use FireflyIII\Models\TransactionJournal; @@ -36,7 +35,6 @@ use Log; */ class RemoveTag implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/SetBudget.php b/app/TransactionRules/Actions/SetBudget.php index 1f91664926..d9fd23f02d 100644 --- a/app/TransactionRules/Actions/SetBudget.php +++ b/app/TransactionRules/Actions/SetBudget.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; - use FireflyIII\Models\Budget; use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; @@ -38,7 +37,6 @@ use Log; */ class SetBudget implements ActionInterface { - private $action; @@ -78,7 +76,9 @@ class SetBudget implements ActionInterface if ($journal->transactionType->type !== TransactionType::WITHDRAWAL) { Log::debug( sprintf( - 'RuleAction SetBudget could not set budget of journal #%d to "%s" because journal is a %s.', $journal->id, $search, + 'RuleAction SetBudget could not set budget of journal #%d to "%s" because journal is a %s.', + $journal->id, + $search, $journal->transactionType->type ) ); diff --git a/app/TransactionRules/Actions/SetCategory.php b/app/TransactionRules/Actions/SetCategory.php index 6644dbb10f..ca540ccdc5 100644 --- a/app/TransactionRules/Actions/SetCategory.php +++ b/app/TransactionRules/Actions/SetCategory.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; - use FireflyIII\Models\Category; use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; @@ -36,7 +35,6 @@ use Log; */ class SetCategory implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/SetDescription.php b/app/TransactionRules/Actions/SetDescription.php index f52a7346b6..f0a29cc896 100644 --- a/app/TransactionRules/Actions/SetDescription.php +++ b/app/TransactionRules/Actions/SetDescription.php @@ -34,7 +34,6 @@ use Log; */ class SetDescription implements ActionInterface { - private $action; @@ -61,7 +60,8 @@ class SetDescription implements ActionInterface Log::debug( sprintf( - 'RuleAction SetDescription changed the description of journal #%d from "%s" to "%s".', $journal->id, + 'RuleAction SetDescription changed the description of journal #%d from "%s" to "%s".', + $journal->id, $oldDescription, $this->action->action_value ) diff --git a/app/TransactionRules/Actions/SetDestinationAccount.php b/app/TransactionRules/Actions/SetDestinationAccount.php index 93b96f9905..58b7eb7f8b 100644 --- a/app/TransactionRules/Actions/SetDestinationAccount.php +++ b/app/TransactionRules/Actions/SetDestinationAccount.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; - use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Models\RuleAction; @@ -39,7 +38,6 @@ use Log; */ class SetDestinationAccount implements ActionInterface { - private $action; /** @var TransactionJournal */ @@ -87,7 +85,8 @@ class SetDestinationAccount implements ActionInterface Log::error( sprintf( 'Cannot change destination account of journal #%d because no asset account with name "%s" exists.', - $journal->id, $this->action->action_value + $journal->id, + $this->action->action_value ) ); diff --git a/app/TransactionRules/Actions/SetNotes.php b/app/TransactionRules/Actions/SetNotes.php index a29e14d0ba..6bed507707 100644 --- a/app/TransactionRules/Actions/SetNotes.php +++ b/app/TransactionRules/Actions/SetNotes.php @@ -35,7 +35,6 @@ use Log; */ class SetNotes implements ActionInterface { - private $action; diff --git a/app/TransactionRules/Actions/SetSourceAccount.php b/app/TransactionRules/Actions/SetSourceAccount.php index 8654646792..f45461f698 100644 --- a/app/TransactionRules/Actions/SetSourceAccount.php +++ b/app/TransactionRules/Actions/SetSourceAccount.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; - use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Models\RuleAction; @@ -39,7 +38,6 @@ use Log; */ class SetSourceAccount implements ActionInterface { - private $action; /** @var TransactionJournal */ @@ -86,7 +84,8 @@ class SetSourceAccount implements ActionInterface Log::error( sprintf( 'Cannot change source account of journal #%d because no asset account with name "%s" exists.', - $journal->id, $this->action->action_value + $journal->id, + $this->action->action_value ) ); diff --git a/app/TransactionRules/Processor.php b/app/TransactionRules/Processor.php index 8aed15f659..e0156162cc 100644 --- a/app/TransactionRules/Processor.php +++ b/app/TransactionRules/Processor.php @@ -193,7 +193,6 @@ final class Processor } return false; - } /** @@ -220,7 +219,6 @@ final class Processor } return false; - } /** @@ -241,7 +239,6 @@ final class Processor Log::debug('Stop processing now and break.'); break; } - } return true; @@ -272,14 +269,10 @@ final class Processor Log::debug('Stop processing this trigger and break.'); break; } - } $result = ($hitTriggers === $foundTriggers && $foundTriggers > 0); Log::debug('Result of triggered()', ['hitTriggers' => $hitTriggers, 'foundTriggers' => $foundTriggers, 'result' => $result]); return $result; - } - - } diff --git a/app/TransactionRules/TransactionMatcher.php b/app/TransactionRules/TransactionMatcher.php index 5e32179a2f..510d4cca84 100644 --- a/app/TransactionRules/TransactionMatcher.php +++ b/app/TransactionRules/TransactionMatcher.php @@ -60,7 +60,6 @@ class TransactionMatcher public function __construct(JournalTaskerInterface $tasker) { $this->tasker = $tasker; - } /** @@ -151,7 +150,6 @@ class TransactionMatcher $this->range = $range; return $this; - } /** @@ -236,11 +234,8 @@ class TransactionMatcher Log::debug(sprintf('reachedEndOfList: %s', var_export($reachedEndOfList, true))); Log::debug(sprintf('foundEnough: %s', var_export($foundEnough, true))); Log::debug(sprintf('searchedEnough: %s', var_export($searchedEnough, true))); - } while (!$reachedEndOfList && !$foundEnough && !$searchedEnough); return $result; } - - } diff --git a/app/TransactionRules/Triggers/AbstractTrigger.php b/app/TransactionRules/Triggers/AbstractTrigger.php index d917dd1a84..e1fd0dc6cb 100644 --- a/app/TransactionRules/Triggers/AbstractTrigger.php +++ b/app/TransactionRules/Triggers/AbstractTrigger.php @@ -53,7 +53,6 @@ class AbstractTrigger */ private function __construct() { - } /** @@ -122,6 +121,4 @@ class AbstractTrigger { return $this->triggerValue; } - - } diff --git a/app/TransactionRules/Triggers/AmountExactly.php b/app/TransactionRules/Triggers/AmountExactly.php index fadc89c159..c6e6262e6e 100644 --- a/app/TransactionRules/Triggers/AmountExactly.php +++ b/app/TransactionRules/Triggers/AmountExactly.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; - use FireflyIII\Models\TransactionJournal; use Log; @@ -79,6 +78,5 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger AmountExactly for journal #%d: %d matches %d NOT exactly, so return false', $journal->id, $amount, $compare)); return false; - } } diff --git a/app/TransactionRules/Triggers/AmountLess.php b/app/TransactionRules/Triggers/AmountLess.php index 3879dd193b..c635859f09 100644 --- a/app/TransactionRules/Triggers/AmountLess.php +++ b/app/TransactionRules/Triggers/AmountLess.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; - use FireflyIII\Models\TransactionJournal; use Log; @@ -80,6 +79,5 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger AmountLess for journal #%d: %d is NOT less than %d, so return false', $journal->id, $amount, $compare)); return false; - } } diff --git a/app/TransactionRules/Triggers/AmountMore.php b/app/TransactionRules/Triggers/AmountMore.php index 3f2c798861..619bd9e5c5 100644 --- a/app/TransactionRules/Triggers/AmountMore.php +++ b/app/TransactionRules/Triggers/AmountMore.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; - use FireflyIII\Models\TransactionJournal; use Log; @@ -86,6 +85,5 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger AmountMore for journal #%d: %d is NOT more than %d, so return false', $journal->id, $amount, $compare)); return false; - } } diff --git a/app/TransactionRules/Triggers/BudgetIs.php b/app/TransactionRules/Triggers/BudgetIs.php index 73b1afe26b..cc234e6636 100644 --- a/app/TransactionRules/Triggers/BudgetIs.php +++ b/app/TransactionRules/Triggers/BudgetIs.php @@ -90,7 +90,10 @@ final class BudgetIs extends AbstractTrigger implements TriggerInterface Log::debug( sprintf( 'RuleTrigger BudgetIs for journal #%d (transaction #%d): "%s" is "%s", return true.', - $journal->id, $transaction->id, $name, $this->triggerValue + $journal->id, + $transaction->id, + $name, + $this->triggerValue ) ); diff --git a/app/TransactionRules/Triggers/CategoryIs.php b/app/TransactionRules/Triggers/CategoryIs.php index d18aa02a24..6b406031d6 100644 --- a/app/TransactionRules/Triggers/CategoryIs.php +++ b/app/TransactionRules/Triggers/CategoryIs.php @@ -90,7 +90,10 @@ final class CategoryIs extends AbstractTrigger implements TriggerInterface Log::debug( sprintf( 'RuleTrigger CategoryIs for journal #%d (transaction #%d): "%s" is "%s", return true.', - $journal->id, $transaction->id, $name, $this->triggerValue + $journal->id, + $transaction->id, + $name, + $this->triggerValue ) ); diff --git a/app/TransactionRules/Triggers/DescriptionContains.php b/app/TransactionRules/Triggers/DescriptionContains.php index 3bc2f0d77d..a81f10f2a2 100644 --- a/app/TransactionRules/Triggers/DescriptionContains.php +++ b/app/TransactionRules/Triggers/DescriptionContains.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; - use FireflyIII\Models\TransactionJournal; use Log; @@ -86,6 +85,5 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf Log::debug(sprintf('RuleTrigger DescriptionContains for journal #%d: "%s" does NOT contain "%s", return false.', $journal->id, $source, $search)); return false; - } } diff --git a/app/TransactionRules/Triggers/DescriptionEnds.php b/app/TransactionRules/Triggers/DescriptionEnds.php index 5bbb6b5d83..1877eb8099 100644 --- a/app/TransactionRules/Triggers/DescriptionEnds.php +++ b/app/TransactionRules/Triggers/DescriptionEnds.php @@ -89,7 +89,6 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface $part = substr($description, $searchLength * -1); if ($part === $search) { - Log::debug(sprintf('RuleTrigger DescriptionEnds for journal #%d: "%s" ends with "%s", return true.', $journal->id, $description, $search)); return true; diff --git a/app/TransactionRules/Triggers/DescriptionIs.php b/app/TransactionRules/Triggers/DescriptionIs.php index bd6be247a5..bcfeb803d6 100644 --- a/app/TransactionRules/Triggers/DescriptionIs.php +++ b/app/TransactionRules/Triggers/DescriptionIs.php @@ -72,7 +72,6 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface $search = strtolower($this->triggerValue); if ($description === $search) { - Log::debug(sprintf('RuleTrigger DescriptionIs for journal #%d: "%s" is "%s", return true.', $journal->id, $description, $search)); return true; diff --git a/app/TransactionRules/Triggers/FromAccountContains.php b/app/TransactionRules/Triggers/FromAccountContains.php index e6d0472264..ae26f69a31 100644 --- a/app/TransactionRules/Triggers/FromAccountContains.php +++ b/app/TransactionRules/Triggers/FromAccountContains.php @@ -84,7 +84,6 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf $strpos = strpos($fromAccountName, $search); if (!($strpos === false)) { - Log::debug(sprintf('RuleTrigger FromAccountContains for journal #%d: "%s" contains "%s", return true.', $journal->id, $fromAccountName, $search)); return true; @@ -93,11 +92,12 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf Log::debug( sprintf( 'RuleTrigger FromAccountContains for journal #%d: "%s" does not contain "%s", return false.', - $journal->id, $fromAccountName, $search + $journal->id, + $fromAccountName, + $search ) ); return false; - } } diff --git a/app/TransactionRules/Triggers/FromAccountEnds.php b/app/TransactionRules/Triggers/FromAccountEnds.php index 6e08f5d0de..1a469a310e 100644 --- a/app/TransactionRules/Triggers/FromAccountEnds.php +++ b/app/TransactionRules/Triggers/FromAccountEnds.php @@ -104,6 +104,5 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger FromAccountEnds for journal #%d: "%s" does not end with "%s", return false.', $journal->id, $name, $search)); return false; - } } diff --git a/app/TransactionRules/Triggers/FromAccountIs.php b/app/TransactionRules/Triggers/FromAccountIs.php index 880cf37072..53787e0910 100644 --- a/app/TransactionRules/Triggers/FromAccountIs.php +++ b/app/TransactionRules/Triggers/FromAccountIs.php @@ -91,6 +91,5 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger FromAccountIs for journal #%d: "%s" is NOT "%s", return false.', $journal->id, $name, $search)); return false; - } } diff --git a/app/TransactionRules/Triggers/HasAnyBudget.php b/app/TransactionRules/Triggers/HasAnyBudget.php index 66b6016ddc..3d1628e461 100644 --- a/app/TransactionRules/Triggers/HasAnyBudget.php +++ b/app/TransactionRules/Triggers/HasAnyBudget.php @@ -86,6 +86,5 @@ final class HasAnyBudget extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger HasAnyBudget for journal #%d: count is %d, return false.', $journal->id, $count)); return false; - } } diff --git a/app/TransactionRules/Triggers/HasAnyCategory.php b/app/TransactionRules/Triggers/HasAnyCategory.php index 65fdb23723..aad3509b8a 100644 --- a/app/TransactionRules/Triggers/HasAnyCategory.php +++ b/app/TransactionRules/Triggers/HasAnyCategory.php @@ -86,6 +86,5 @@ final class HasAnyCategory extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger HasAnyCategory for journal #%d: count is %d, return false.', $journal->id, $count)); return false; - } } diff --git a/app/TransactionRules/Triggers/HasAnyTag.php b/app/TransactionRules/Triggers/HasAnyTag.php index 765f814129..0d83e06adf 100644 --- a/app/TransactionRules/Triggers/HasAnyTag.php +++ b/app/TransactionRules/Triggers/HasAnyTag.php @@ -71,6 +71,5 @@ final class HasAnyTag extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger HasAnyTag for journal #%d: count is %d, return false.', $journal->id, $count)); return false; - } } diff --git a/app/TransactionRules/Triggers/HasAttachment.php b/app/TransactionRules/Triggers/HasAttachment.php index 691197d8b1..54528c65fb 100644 --- a/app/TransactionRules/Triggers/HasAttachment.php +++ b/app/TransactionRules/Triggers/HasAttachment.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; - use FireflyIII\Models\TransactionJournal; use Log; @@ -68,7 +67,10 @@ class HasAttachment extends AbstractTrigger implements TriggerInterface if ($attachments >= $minimum) { Log::debug( sprintf( - 'RuleTrigger HasAttachment for journal #%d: count is %d, is more than or equal to %d, return true.', $journal->id, $attachments, $minimum + 'RuleTrigger HasAttachment for journal #%d: count is %d, is more than or equal to %d, return true.', + $journal->id, + $attachments, + $minimum ) ); diff --git a/app/TransactionRules/Triggers/HasNoBudget.php b/app/TransactionRules/Triggers/HasNoBudget.php index cd35f4ad78..db3a6d66f9 100644 --- a/app/TransactionRules/Triggers/HasNoBudget.php +++ b/app/TransactionRules/Triggers/HasNoBudget.php @@ -79,6 +79,5 @@ final class HasNoBudget extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger HasNoBudget for journal #%d: count is %d, return false.', $journal->id, $count)); return false; - } } diff --git a/app/TransactionRules/Triggers/HasNoCategory.php b/app/TransactionRules/Triggers/HasNoCategory.php index ce3a84b678..76ac645a0b 100644 --- a/app/TransactionRules/Triggers/HasNoCategory.php +++ b/app/TransactionRules/Triggers/HasNoCategory.php @@ -79,6 +79,5 @@ final class HasNoCategory extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger HasNoCategory for journal #%d: count is %d, return false.', $journal->id, $count)); return false; - } } diff --git a/app/TransactionRules/Triggers/HasNoTag.php b/app/TransactionRules/Triggers/HasNoTag.php index b2b610d588..04dc7542f7 100644 --- a/app/TransactionRules/Triggers/HasNoTag.php +++ b/app/TransactionRules/Triggers/HasNoTag.php @@ -71,6 +71,5 @@ final class HasNoTag extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger HasNoTag for journal #%d: count is %d, return false.', $journal->id, $count)); return false; - } } diff --git a/app/TransactionRules/Triggers/NotesAny.php b/app/TransactionRules/Triggers/NotesAny.php index 50c20ca324..e342a98962 100644 --- a/app/TransactionRules/Triggers/NotesAny.php +++ b/app/TransactionRules/Triggers/NotesAny.php @@ -71,7 +71,6 @@ final class NotesAny extends AbstractTrigger implements TriggerInterface } if (strlen($text) > 0) { - Log::debug(sprintf('RuleTrigger NotesEmpty for journal #%d: strlen > 0, return true.', $journal->id)); return true; diff --git a/app/TransactionRules/Triggers/NotesAre.php b/app/TransactionRules/Triggers/NotesAre.php index 25a889390d..ef7362649d 100644 --- a/app/TransactionRules/Triggers/NotesAre.php +++ b/app/TransactionRules/Triggers/NotesAre.php @@ -78,7 +78,6 @@ final class NotesAre extends AbstractTrigger implements TriggerInterface $search = strtolower($this->triggerValue); if ($text === $search && strlen($text) > 0) { - Log::debug(sprintf('RuleTrigger NotesAre for journal #%d: "%s" is "%s", return true.', $journal->id, $text, $search)); return true; diff --git a/app/TransactionRules/Triggers/NotesContain.php b/app/TransactionRules/Triggers/NotesContain.php index 4cbbc3fc88..6b1d04521a 100644 --- a/app/TransactionRules/Triggers/NotesContain.php +++ b/app/TransactionRules/Triggers/NotesContain.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; - use FireflyIII\Models\Note; use FireflyIII\Models\TransactionJournal; use Log; @@ -93,7 +92,6 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface $strpos = strpos($text, $search); if (!($strpos === false)) { - Log::debug(sprintf('RuleTrigger NotesContain for journal #%d: "%s" contains "%s", return true.', $journal->id, $text, $search)); return true; @@ -102,6 +100,5 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger NotesContain for journal #%d: "%s" does NOT contain "%s", return false.', $journal->id, $text, $search)); return false; - } } diff --git a/app/TransactionRules/Triggers/NotesEmpty.php b/app/TransactionRules/Triggers/NotesEmpty.php index d53c642857..5c52cca0b1 100644 --- a/app/TransactionRules/Triggers/NotesEmpty.php +++ b/app/TransactionRules/Triggers/NotesEmpty.php @@ -71,7 +71,6 @@ final class NotesEmpty extends AbstractTrigger implements TriggerInterface } if (strlen($text) === 0) { - Log::debug(sprintf('RuleTrigger NotesEmpty for journal #%d: strlen is 0, return true.', $journal->id)); return true; diff --git a/app/TransactionRules/Triggers/NotesEnd.php b/app/TransactionRules/Triggers/NotesEnd.php index 5e1e3140a6..f4c1546281 100644 --- a/app/TransactionRules/Triggers/NotesEnd.php +++ b/app/TransactionRules/Triggers/NotesEnd.php @@ -95,7 +95,6 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface $part = substr($text, $searchLength * -1); if ($part === $search) { - Log::debug(sprintf('RuleTrigger NotesEnd for journal #%d: "%s" ends with "%s", return true.', $journal->id, $text, $search)); return true; diff --git a/app/TransactionRules/Triggers/NotesStart.php b/app/TransactionRules/Triggers/NotesStart.php index b5a8eadb71..64385a6f7e 100644 --- a/app/TransactionRules/Triggers/NotesStart.php +++ b/app/TransactionRules/Triggers/NotesStart.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; - use FireflyIII\Models\Note; use FireflyIII\Models\TransactionJournal; use Log; @@ -94,6 +93,5 @@ final class NotesStart extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger NotesStart for journal #%d: "%s" does not start with "%s", return false.', $journal->id, $text, $search)); return false; - } } diff --git a/app/TransactionRules/Triggers/ToAccountContains.php b/app/TransactionRules/Triggers/ToAccountContains.php index e0085cf76f..729e1454b9 100644 --- a/app/TransactionRules/Triggers/ToAccountContains.php +++ b/app/TransactionRules/Triggers/ToAccountContains.php @@ -84,7 +84,6 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac $strpos = strpos($toAccountName, $search); if (!($strpos === false)) { - Log::debug(sprintf('RuleTrigger ToAccountContains for journal #%d: "%s" contains "%s", return true.', $journal->id, $toAccountName, $search)); return true; @@ -93,7 +92,9 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac Log::debug( sprintf( 'RuleTrigger ToAccountContains for journal #%d: "%s" does not contain "%s", return false.', - $journal->id, $toAccountName, $search + $journal->id, + $toAccountName, + $search ) ); diff --git a/app/TransactionRules/Triggers/ToAccountIs.php b/app/TransactionRules/Triggers/ToAccountIs.php index c2931cf0f2..457c421da6 100644 --- a/app/TransactionRules/Triggers/ToAccountIs.php +++ b/app/TransactionRules/Triggers/ToAccountIs.php @@ -91,6 +91,5 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface Log::debug(sprintf('RuleTrigger ToAccountIs for journal #%d: "%s" is NOT "%s", return true.', $journal->id, $toAccountName, $search)); return false; - } } diff --git a/app/TransactionRules/Triggers/ToAccountStarts.php b/app/TransactionRules/Triggers/ToAccountStarts.php index e903af5a8a..84f52c24d1 100644 --- a/app/TransactionRules/Triggers/ToAccountStarts.php +++ b/app/TransactionRules/Triggers/ToAccountStarts.php @@ -92,6 +92,5 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface return false; - } } diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 368b9361ae..70290446bc 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -102,7 +102,6 @@ class FireflyValidator extends Validator } return false; - } /** @@ -279,7 +278,6 @@ class FireflyValidator extends Validator $class = $classes[$name]; return !($class::willMatchEverything($value)); - } return false; @@ -363,13 +361,11 @@ class FireflyValidator extends Validator /** @var AccountMeta $entry */ foreach ($set as $entry) { if ($entry->data === $value) { - return false; } } return true; - } /** @@ -447,7 +443,6 @@ class FireflyValidator extends Validator private function getRuleTriggerName($index): string { return $this->data['rule-trigger'][$index] ?? 'invalid'; - } /** @@ -525,7 +520,6 @@ class FireflyValidator extends Validator } return true; - } /** @@ -549,7 +543,6 @@ class FireflyValidator extends Validator } return true; - } /** @@ -575,4 +568,3 @@ class FireflyValidator extends Validator return true; } } - From ef837f20dd8439b402426ec1bcb600283810af7f Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 10:53:17 +0100 Subject: [PATCH 174/258] Code clean up. --- app/User.php | 3 - database/factories/ModelFactory.php | 110 +-- ...016_06_16_000000_create_support_tables.php | 176 ++--- .../2016_06_16_000001_create_users_table.php | 21 +- .../2016_06_16_000002_create_main_tables.php | 659 +++++++++--------- .../2016_08_25_091522_changes_for_3101.php | 7 +- .../2016_09_12_121359_fix_nullables.php | 15 +- ...10_09_150037_expand_transactions_table.php | 7 +- .../2016_10_22_075804_changes_for_v410.php | 20 +- .../2016_11_24_210552_changes_for_v420.php | 7 +- .../2016_12_22_150431_changes_for_v430.php | 25 +- .../2016_12_28_203205_changes_for_v431.php | 60 +- .../2017_04_13_163623_changes_for_v440.php | 39 +- .../2017_06_02_105232_changes_for_v450.php | 16 +- .../2017_08_20_062014_changes_for_v470.php | 49 +- .../2017_11_04_170844_changes_for_v470a.php | 7 +- database/seeds/AccountTypeSeeder.php | 4 +- database/seeds/DatabaseSeeder.php | 1 - database/seeds/LinkTypeSeeder.php | 2 - database/seeds/PermissionSeeder.php | 2 - database/seeds/TransactionCurrencySeeder.php | 3 +- database/seeds/TransactionTypeSeeder.php | 3 +- 22 files changed, 632 insertions(+), 604 deletions(-) diff --git a/app/User.php b/app/User.php index 63ff33060f..92699f32ff 100644 --- a/app/User.php +++ b/app/User.php @@ -167,7 +167,6 @@ class User extends Authenticatable */ public function hasRole(string $name): bool { - foreach ($this->roles as $role) { if ($role->name === $name) { return true; @@ -262,6 +261,4 @@ class User extends Authenticatable { return $this->hasManyThrough('FireflyIII\Models\Transaction', 'FireflyIII\Models\TransactionJournal'); } - - } diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 8669ccf1b3..d42ab2c9b7 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -12,7 +12,6 @@ declare(strict_types=1); use Carbon\Carbon; - /* |-------------------------------------------------------------------------- | Model Factories @@ -25,21 +24,22 @@ use Carbon\Carbon; */ $factory->define( - FireflyIII\User::class, function (Faker\Generator $faker) { - static $password; + FireflyIII\User::class, + function (Faker\Generator $faker) { + static $password; - return [ + return [ 'email' => $faker->safeEmail, 'password' => $password ?: $password = bcrypt('secret'), 'remember_token' => str_random(10), ]; -} + } ); $factory->define( - FireflyIII\Models\CurrencyExchangeRate::class, function (Faker\Generator $faker) { - - return [ + FireflyIII\Models\CurrencyExchangeRate::class, + function (Faker\Generator $faker) { + return [ 'user_id' => 1, 'from_currency_id' => 1, 'to_currency_id' => 2, @@ -47,23 +47,24 @@ $factory->define( 'rate' => '1.5', 'user_rate' => null, ]; -} + } ); $factory->define( - FireflyIII\Models\TransactionCurrency::class, function (Faker\Generator $faker) { - - return [ + FireflyIII\Models\TransactionCurrency::class, + function (Faker\Generator $faker) { + return [ 'name' => $faker->words(1, true), 'code' => 'ABC', 'symbol' => 'x', ]; -} + } ); $factory->define( - FireflyIII\Models\ImportJob::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\ImportJob::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->numberBetween(1, 100), 'user_id' => 1, 'key' => $faker->words(1, true), @@ -78,13 +79,14 @@ $factory->define( 'errors' => [], ], ]; -} + } ); $factory->define( - FireflyIII\Models\TransactionJournal::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\TransactionJournal::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->unique()->numberBetween(1000, 10000), 'user_id' => 1, 'transaction_type_id' => 1, @@ -101,12 +103,13 @@ $factory->define( 'encrypted' => 0, 'completed' => 1, ]; -} + } ); $factory->define( - FireflyIII\Models\Bill::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\Bill::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->numberBetween(1, 10), 'user_id' => 1, 'name' => $faker->words(3, true), @@ -120,24 +123,26 @@ $factory->define( 'name_encrypted' => 0, 'match_encrypted' => 0, ]; -} + } ); $factory->define( - FireflyIII\Models\PiggyBankRepetition::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\PiggyBankRepetition::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->unique()->numberBetween(100, 10000), 'piggy_bank_id' => $faker->numberBetween(1, 10), 'startdate' => '2017-01-01', 'targetdate' => '2020-01-01', 'currentamount' => 10, ]; -} + } ); $factory->define( - FireflyIII\Models\PiggyBank::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\PiggyBank::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->unique()->numberBetween(100, 10000), 'account_id' => $faker->numberBetween(1, 10), 'name' => $faker->words(3, true), @@ -147,53 +152,58 @@ $factory->define( 'active' => 1, 'encrypted' => 0, ]; -} + } ); $factory->define( - FireflyIII\Models\Tag::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\Tag::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->unique()->numberBetween(200, 10000), 'user_id' => 1, 'tagMode' => 'nothing', 'tag' => $faker->words(1, true), ]; -} + } ); $factory->define( - FireflyIII\Models\Category::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\Category::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->numberBetween(1, 10), 'name' => $faker->words(3, true), ]; -} + } ); $factory->define( - FireflyIII\Models\Budget::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\Budget::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->numberBetween(1, 10), 'name' => $faker->words(3, true), ]; -} + } ); $factory->define( - FireflyIII\Models\PiggyBankEvent::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\PiggyBankEvent::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->numberBetween(1, 10), 'piggy_bank_id' => $faker->numberBetween(1, 10), 'transaction_journal_id' => $faker->numberBetween(1, 10), 'date' => $faker->date('Y-m-d'), 'amount' => '100', ]; -} + } ); $factory->define( - FireflyIII\Models\BudgetLimit::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\BudgetLimit::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->numberBetween(1, 10), 'start_date' => '2017-01-01', 'end_date' => '2017-01-31', @@ -201,23 +211,25 @@ $factory->define( 'budget_id' => $faker->numberBetween(1, 6), ]; -} + } ); $factory->define( - FireflyIII\Models\Account::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\Account::class, + function (Faker\Generator $faker) { + return [ 'id' => $faker->unique()->numberBetween(1000, 10000), 'name' => $faker->words(3, true), 'account_type_id' => 1, 'active' => true, ]; -} + } ); $factory->define( - FireflyIII\Models\Transaction::class, function (Faker\Generator $faker) { - return [ + FireflyIII\Models\Transaction::class, + function (Faker\Generator $faker) { + return [ 'transaction_amount' => strval($faker->randomFloat(2, -100, 100)), 'destination_amount' => strval($faker->randomFloat(2, -100, 100)), 'opposing_account_id' => $faker->numberBetween(1, 10), @@ -244,5 +256,5 @@ $factory->define( 'foreign_currency_code' => null, 'foreign_currency_symbol' => null, ]; -} + } ); diff --git a/database/migrations/2016_06_16_000000_create_support_tables.php b/database/migrations/2016_06_16_000000_create_support_tables.php index cd16910972..b3f848bee0 100644 --- a/database/migrations/2016_06_16_000000_create_support_tables.php +++ b/database/migrations/2016_06_16_000000_create_support_tables.php @@ -24,7 +24,6 @@ class CreateSupportTables extends Migration */ public function down() { - Schema::drop('account_types'); Schema::drop('transaction_currencies'); Schema::drop('transaction_types'); @@ -35,7 +34,6 @@ class CreateSupportTables extends Migration Schema::drop('roles'); Schema::drop('sessions'); Schema::drop('configuration'); - } /** @@ -64,14 +62,15 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('account_types')) { Schema::create( - 'account_types', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->string('type', 50); + 'account_types', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->string('type', 50); - // type must be unique. - $table->unique(['type']); - } + // type must be unique. + $table->unique(['type']); + } ); } } @@ -80,15 +79,15 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('configuration')) { Schema::create( - 'configuration', function (Blueprint $table) { - - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->string('name', 50); - $table->text('data'); - $table->unique(['name']); - } + 'configuration', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->string('name', 50); + $table->text('data'); + $table->unique(['name']); + } ); } } @@ -100,18 +99,18 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('transaction_currencies')) { Schema::create( - 'transaction_currencies', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->string('code', 3); - $table->string('name', 255); - $table->string('symbol', 12); + 'transaction_currencies', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->string('code', 3); + $table->string('name', 255); + $table->string('symbol', 12); - // code must be unique. - $table->unique(['code']); - - } + // code must be unique. + $table->unique(['code']); + } ); } } @@ -123,20 +122,20 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('jobs')) { Schema::create( - 'jobs', function (Blueprint $table) { + 'jobs', + function (Blueprint $table) { // straight from Laravel - $table->bigIncrements('id'); - $table->string('queue'); - $table->longText('payload'); - $table->tinyInteger('attempts')->unsigned(); - $table->tinyInteger('reserved')->unsigned(); - $table->unsignedInteger('reserved_at')->nullable(); - $table->unsignedInteger('available_at'); - $table->unsignedInteger('created_at'); - $table->index(['queue', 'reserved', 'reserved_at']); - - } + $table->bigIncrements('id'); + $table->string('queue'); + $table->longText('payload'); + $table->tinyInteger('attempts')->unsigned(); + $table->tinyInteger('reserved')->unsigned(); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + $table->index(['queue', 'reserved', 'reserved_at']); + } ); } } @@ -148,13 +147,13 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('password_resets')) { Schema::create( - 'password_resets', function (Blueprint $table) { - // straight from laravel - $table->string('email')->index(); - $table->string('token')->index(); - $table->timestamp('created_at'); - - } + 'password_resets', + function (Blueprint $table) { + // straight from laravel + $table->string('email')->index(); + $table->string('token')->index(); + $table->timestamp('created_at'); + } ); } } @@ -166,15 +165,16 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('permission_role')) { Schema::create( - 'permission_role', function (Blueprint $table) { - $table->integer('permission_id')->unsigned(); - $table->integer('role_id')->unsigned(); + 'permission_role', + function (Blueprint $table) { + $table->integer('permission_id')->unsigned(); + $table->integer('role_id')->unsigned(); - $table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade'); - $table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade'); - $table->primary(['permission_id', 'role_id']); - } + $table->primary(['permission_id', 'role_id']); + } ); } } @@ -186,13 +186,14 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('permissions')) { Schema::create( - 'permissions', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->string('name')->unique(); - $table->string('display_name')->nullable(); - $table->string('description')->nullable(); - } + 'permissions', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->string('name')->unique(); + $table->string('display_name')->nullable(); + $table->string('description')->nullable(); + } ); } } @@ -204,13 +205,14 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('roles')) { Schema::create( - 'roles', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->string('name')->unique(); - $table->string('display_name')->nullable(); - $table->string('description')->nullable(); - } + 'roles', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->string('name')->unique(); + $table->string('display_name')->nullable(); + $table->string('description')->nullable(); + } ); } } @@ -220,17 +222,17 @@ class CreateSupportTables extends Migration */ private function createSessionsTable() { - if (!Schema::hasTable('sessions')) { Schema::create( - 'sessions', function (Blueprint $table) { - $table->string('id')->unique(); - $table->integer('user_id')->nullable(); - $table->string('ip_address', 45)->nullable(); - $table->text('user_agent')->nullable(); - $table->text('payload'); - $table->integer('last_activity'); - } + 'sessions', + function (Blueprint $table) { + $table->string('id')->unique(); + $table->integer('user_id')->nullable(); + $table->string('ip_address', 45)->nullable(); + $table->text('user_agent')->nullable(); + $table->text('payload'); + $table->integer('last_activity'); + } ); } } @@ -242,16 +244,16 @@ class CreateSupportTables extends Migration { if (!Schema::hasTable('transaction_types')) { Schema::create( - 'transaction_types', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->string('type', 50); + 'transaction_types', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->string('type', 50); - // type must be unique. - $table->unique(['type']); - - } + // type must be unique. + $table->unique(['type']); + } ); } } diff --git a/database/migrations/2016_06_16_000001_create_users_table.php b/database/migrations/2016_06_16_000001_create_users_table.php index 563fbd1584..52573e8b1f 100644 --- a/database/migrations/2016_06_16_000001_create_users_table.php +++ b/database/migrations/2016_06_16_000001_create_users_table.php @@ -35,16 +35,17 @@ class CreateUsersTable extends Migration { if (!Schema::hasTable('users')) { Schema::create( - 'users', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->string('email', 255); - $table->string('password', 60); - $table->string('remember_token', 100)->nullable(); - $table->string('reset', 32)->nullable(); - $table->tinyInteger('blocked', false, true)->default('0'); - $table->string('blocked_code', 25)->nullable(); - } + 'users', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->string('email', 255); + $table->string('password', 60); + $table->string('remember_token', 100)->nullable(); + $table->string('reset', 32)->nullable(); + $table->tinyInteger('blocked', false, true)->default('0'); + $table->string('blocked_code', 25)->nullable(); + } ); } } diff --git a/database/migrations/2016_06_16_000002_create_main_tables.php b/database/migrations/2016_06_16_000002_create_main_tables.php index 300024918a..1eaa6f2fbe 100644 --- a/database/migrations/2016_06_16_000002_create_main_tables.php +++ b/database/migrations/2016_06_16_000002_create_main_tables.php @@ -82,33 +82,35 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('accounts')) { Schema::create( - 'accounts', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->integer('account_type_id', false, true); - $table->string('name', 1024); - $table->decimal('virtual_balance', 22, 12)->nullable(); - $table->string('iban', 255)->nullable(); - $table->boolean('active')->default(1); - $table->boolean('encrypted')->default(0); - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - $table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade'); - } + 'accounts', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->integer('account_type_id', false, true); + $table->string('name', 1024); + $table->decimal('virtual_balance', 22, 12)->nullable(); + $table->string('iban', 255)->nullable(); + $table->boolean('active')->default(1); + $table->boolean('encrypted')->default(0); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade'); + } ); } if (!Schema::hasTable('account_meta')) { Schema::create( - 'account_meta', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('account_id', false, true); - $table->string('name'); - $table->text('data'); - $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); - } + 'account_meta', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('account_id', false, true); + $table->string('name'); + $table->text('data'); + $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); + } ); } } @@ -118,30 +120,28 @@ class CreateMainTables extends Migration */ private function createAttachmentsTable() { - if (!Schema::hasTable('attachments')) { Schema::create( - 'attachments', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->integer('attachable_id', false, true); - $table->string('attachable_type', 255); - $table->string('md5', 32); - $table->string('filename', 1024); - $table->string('title', 1024)->nullable(); - $table->text('description')->nullable(); - $table->text('notes')->nullable(); - $table->string('mime', 1024); - $table->integer('size', false, true); - $table->boolean('uploaded')->default(1); + 'attachments', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->integer('attachable_id', false, true); + $table->string('attachable_type', 255); + $table->string('md5', 32); + $table->string('filename', 1024); + $table->string('title', 1024)->nullable(); + $table->text('description')->nullable(); + $table->text('notes')->nullable(); + $table->string('mime', 1024); + $table->integer('size', false, true); + $table->boolean('uploaded')->default(1); - // link user id to users table - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - - - } + // link user id to users table + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } } @@ -153,26 +153,27 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('bills')) { Schema::create( - 'bills', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->string('name', 1024); - $table->string('match', 1024); - $table->decimal('amount_min', 22, 12); - $table->decimal('amount_max', 22, 12); - $table->date('date'); - $table->string('repeat_freq', 30); - $table->smallInteger('skip', false, true)->default(0); - $table->boolean('automatch')->default(1); - $table->boolean('active')->default(1); - $table->boolean('name_encrypted')->default(0); - $table->boolean('match_encrypted')->default(0); + 'bills', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->string('name', 1024); + $table->string('match', 1024); + $table->decimal('amount_min', 22, 12); + $table->decimal('amount_max', 22, 12); + $table->date('date'); + $table->string('repeat_freq', 30); + $table->smallInteger('skip', false, true)->default(0); + $table->boolean('automatch')->default(1); + $table->boolean('active')->default(1); + $table->boolean('name_encrypted')->default(0); + $table->boolean('match_encrypted')->default(0); - // link user id to users table - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - } + // link user id to users table + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } } @@ -184,46 +185,46 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('budgets')) { Schema::create( - 'budgets', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->string('name', 1024); - $table->boolean('active')->default(1); - $table->boolean('encrypted')->default(0); - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - - - } + 'budgets', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->string('name', 1024); + $table->boolean('active')->default(1); + $table->boolean('encrypted')->default(0); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } if (!Schema::hasTable('budget_limits')) { Schema::create( - 'budget_limits', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('budget_id', false, true); - $table->date('startdate'); - $table->decimal('amount', 22, 12); - $table->string('repeat_freq', 30); - $table->boolean('repeats')->default(0); - $table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade'); - - } + 'budget_limits', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('budget_id', false, true); + $table->date('startdate'); + $table->decimal('amount', 22, 12); + $table->string('repeat_freq', 30); + $table->boolean('repeats')->default(0); + $table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade'); + } ); } if (!Schema::hasTable('limit_repetitions')) { Schema::create( - 'limit_repetitions', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('budget_limit_id', false, true); - $table->date('startdate'); - $table->date('enddate'); - $table->decimal('amount', 22, 12); - $table->foreign('budget_limit_id')->references('id')->on('budget_limits')->onDelete('cascade'); - } + 'limit_repetitions', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('budget_limit_id', false, true); + $table->date('startdate'); + $table->date('enddate'); + $table->decimal('amount', 22, 12); + $table->foreign('budget_limit_id')->references('id')->on('budget_limits')->onDelete('cascade'); + } ); } } @@ -235,18 +236,18 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('categories')) { Schema::create( - 'categories', function (Blueprint $table) { + 'categories', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->string('name', 1024); + $table->boolean('encrypted')->default(0); - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->string('name', 1024); - $table->boolean('encrypted')->default(0); - - // link user id to users table - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - } + // link user id to users table + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } } @@ -258,32 +259,33 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('export_jobs')) { Schema::create( - 'export_jobs', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('user_id', false, true); - $table->string('key', 12); - $table->string('status', 255); - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - } + 'export_jobs', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('user_id', false, true); + $table->string('key', 12); + $table->string('status', 255); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } if (!Schema::hasTable('import_jobs')) { Schema::create( - 'import_jobs', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('user_id')->unsigned(); - $table->string('key', 12)->unique(); - $table->string('file_type', 12); - $table->string('status', 45); - $table->text('configuration')->nullable(); - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - } + 'import_jobs', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('user_id')->unsigned(); + $table->string('key', 12)->unique(); + $table->string('file_type', 12); + $table->string('status', 45); + $table->text('configuration')->nullable(); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } - } /** @@ -293,34 +295,36 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('piggy_banks')) { Schema::create( - 'piggy_banks', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('account_id', false, true); - $table->string('name', 1024); - $table->decimal('targetamount', 22, 12); - $table->date('startdate')->nullable(); - $table->date('targetdate')->nullable(); - $table->integer('order', false, true)->default(0); - $table->boolean('active')->default(0); - $table->boolean('encrypted')->default(1); - $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); - } + 'piggy_banks', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('account_id', false, true); + $table->string('name', 1024); + $table->decimal('targetamount', 22, 12); + $table->date('startdate')->nullable(); + $table->date('targetdate')->nullable(); + $table->integer('order', false, true)->default(0); + $table->boolean('active')->default(0); + $table->boolean('encrypted')->default(1); + $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); + } ); } if (!Schema::hasTable('piggy_bank_repetitions')) { Schema::create( - 'piggy_bank_repetitions', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('piggy_bank_id', false, true); - $table->date('startdate')->nullable(); - $table->date('targetdate')->nullable(); - $table->decimal('currentamount', 22, 12); - $table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade'); - } + 'piggy_bank_repetitions', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('piggy_bank_id', false, true); + $table->date('startdate')->nullable(); + $table->date('targetdate')->nullable(); + $table->decimal('currentamount', 22, 12); + $table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade'); + } ); } } @@ -332,15 +336,16 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('preferences')) { Schema::create( - 'preferences', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('user_id', false, true); - $table->string('name', 1024); - $table->text('data'); + 'preferences', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('user_id', false, true); + $table->string('name', 1024); + $table->text('data'); - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - } + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } } @@ -350,22 +355,20 @@ class CreateMainTables extends Migration */ private function createRoleTable() { - if (!Schema::hasTable('role_user')) { Schema::create( - 'role_user', function (Blueprint $table) { - $table->integer('user_id', false, true); - $table->integer('role_id', false, true); + 'role_user', + function (Blueprint $table) { + $table->integer('user_id', false, true); + $table->integer('role_id', false, true); - $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade'); - $table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade'); - $table->primary(['user_id', 'role_id']); - - } + $table->primary(['user_id', 'role_id']); + } ); } - } /** @@ -376,81 +379,85 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('rule_groups')) { Schema::create( - 'rule_groups', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->string('title', 255); - $table->text('description')->nullable(); - $table->integer('order', false, true)->default(0); - $table->boolean('active')->default(1); + 'rule_groups', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->string('title', 255); + $table->text('description')->nullable(); + $table->integer('order', false, true)->default(0); + $table->boolean('active')->default(1); - // link user id to users table - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - } + // link user id to users table + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } if (!Schema::hasTable('rules')) { Schema::create( - 'rules', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->integer('rule_group_id', false, true); - $table->string('title', 255); - $table->text('description')->nullable(); - $table->integer('order', false, true)->default(0); - $table->boolean('active')->default(1); - $table->boolean('stop_processing')->default(0); + 'rules', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->integer('rule_group_id', false, true); + $table->string('title', 255); + $table->text('description')->nullable(); + $table->integer('order', false, true)->default(0); + $table->boolean('active')->default(1); + $table->boolean('stop_processing')->default(0); - // link user id to users table - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + // link user id to users table + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - // link rule group id to rule group table - $table->foreign('rule_group_id')->references('id')->on('rule_groups')->onDelete('cascade'); - } + // link rule group id to rule group table + $table->foreign('rule_group_id')->references('id')->on('rule_groups')->onDelete('cascade'); + } ); } if (!Schema::hasTable('rule_actions')) { Schema::create( - 'rule_actions', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('rule_id', false, true); + 'rule_actions', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('rule_id', false, true); - $table->string('action_type', 50); - $table->string('action_value', 255); + $table->string('action_type', 50); + $table->string('action_value', 255); - $table->integer('order', false, true)->default(0); - $table->boolean('active')->default(1); - $table->boolean('stop_processing')->default(0); + $table->integer('order', false, true)->default(0); + $table->boolean('active')->default(1); + $table->boolean('stop_processing')->default(0); - // link rule id to rules table - $table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade'); - } + // link rule id to rules table + $table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade'); + } ); } if (!Schema::hasTable('rule_triggers')) { Schema::create( - 'rule_triggers', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('rule_id', false, true); + 'rule_triggers', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('rule_id', false, true); - $table->string('trigger_type', 50); - $table->string('trigger_value', 255); + $table->string('trigger_type', 50); + $table->string('trigger_value', 255); - $table->integer('order', false, true)->default(0); - $table->boolean('active')->default(1); - $table->boolean('stop_processing')->default(0); + $table->integer('order', false, true)->default(0); + $table->boolean('active')->default(1); + $table->boolean('stop_processing')->default(0); - // link rule id to rules table - $table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade'); - } + // link rule id to rules table + $table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade'); + } ); } } @@ -462,24 +469,24 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('tags')) { Schema::create( - 'tags', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); + 'tags', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); - $table->string('tag', 1024); - $table->string('tagMode', 1024); - $table->date('date')->nullable(); - $table->text('description')->nullable(); - $table->decimal('latitude', 24, 12)->nullable(); - $table->decimal('longitude', 24, 12)->nullable(); - $table->smallInteger('zoomLevel', false, true)->nullable(); + $table->string('tag', 1024); + $table->string('tagMode', 1024); + $table->date('date')->nullable(); + $table->text('description')->nullable(); + $table->decimal('latitude', 24, 12)->nullable(); + $table->decimal('longitude', 24, 12)->nullable(); + $table->smallInteger('zoomLevel', false, true)->nullable(); - // link user id to users table - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - - } + // link user id to users table + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } } @@ -493,141 +500,147 @@ class CreateMainTables extends Migration { if (!Schema::hasTable('transaction_journals')) { Schema::create( - 'transaction_journals', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->integer('transaction_type_id', false, true); - $table->integer('bill_id', false, true)->nullable(); - $table->integer('transaction_currency_id', false, true); - $table->string('description', 1024); - $table->date('date'); - $table->date('interest_date')->nullable(); - $table->date('book_date')->nullable(); - $table->date('process_date')->nullable(); - $table->integer('order', false, true)->default(0); - $table->integer('tag_count', false, true); - $table->boolean('encrypted')->default(1); - $table->boolean('completed')->default(1); - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - $table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade'); - $table->foreign('bill_id')->references('id')->on('bills')->onDelete('set null'); - $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); - } + 'transaction_journals', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->integer('transaction_type_id', false, true); + $table->integer('bill_id', false, true)->nullable(); + $table->integer('transaction_currency_id', false, true); + $table->string('description', 1024); + $table->date('date'); + $table->date('interest_date')->nullable(); + $table->date('book_date')->nullable(); + $table->date('process_date')->nullable(); + $table->integer('order', false, true)->default(0); + $table->integer('tag_count', false, true); + $table->boolean('encrypted')->default(1); + $table->boolean('completed')->default(1); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade'); + $table->foreign('bill_id')->references('id')->on('bills')->onDelete('set null'); + $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); + } ); } if (!Schema::hasTable('journal_meta')) { Schema::create( - 'journal_meta', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('transaction_journal_id', false, true); - $table->string('name', 255); - $table->text('data'); - $table->string('hash', 64); - $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); - } + 'journal_meta', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('transaction_journal_id', false, true); + $table->string('name', 255); + $table->text('data'); + $table->string('hash', 64); + $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); + } ); } if (!Schema::hasTable('tag_transaction_journal')) { Schema::create( - 'tag_transaction_journal', function (Blueprint $table) { - $table->increments('id'); - $table->integer('tag_id', false, true); - $table->integer('transaction_journal_id', false, true); - $table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade'); - $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); - - - } + 'tag_transaction_journal', + function (Blueprint $table) { + $table->increments('id'); + $table->integer('tag_id', false, true); + $table->integer('transaction_journal_id', false, true); + $table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade'); + $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); + } ); } if (!Schema::hasTable('budget_transaction_journal')) { Schema::create( - 'budget_transaction_journal', function (Blueprint $table) { - $table->increments('id'); - $table->integer('budget_id', false, true); - $table->integer('transaction_journal_id', false, true); - $table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade'); - $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); - } + 'budget_transaction_journal', + function (Blueprint $table) { + $table->increments('id'); + $table->integer('budget_id', false, true); + $table->integer('transaction_journal_id', false, true); + $table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade'); + $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); + } ); } if (!Schema::hasTable('category_transaction_journal')) { Schema::create( - 'category_transaction_journal', function (Blueprint $table) { - $table->increments('id'); - $table->integer('category_id', false, true); - $table->integer('transaction_journal_id', false, true); - $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); - $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); - } + 'category_transaction_journal', + function (Blueprint $table) { + $table->increments('id'); + $table->integer('category_id', false, true); + $table->integer('transaction_journal_id', false, true); + $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); + $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); + } ); } if (!Schema::hasTable('piggy_bank_events')) { Schema::create( - 'piggy_bank_events', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('piggy_bank_id', false, true); - $table->integer('transaction_journal_id', false, true)->nullable(); - $table->date('date'); - $table->decimal('amount', 22, 12); + 'piggy_bank_events', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('piggy_bank_id', false, true); + $table->integer('transaction_journal_id', false, true)->nullable(); + $table->date('date'); + $table->decimal('amount', 22, 12); - $table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade'); - $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null'); - } + $table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade'); + $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null'); + } ); } if (!Schema::hasTable('transactions')) { Schema::create( - 'transactions', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('account_id', false, true); - $table->integer('transaction_journal_id', false, true); - $table->string('description', 1024)->nullable(); - $table->decimal('amount', 22, 12); + 'transactions', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('account_id', false, true); + $table->integer('transaction_journal_id', false, true); + $table->string('description', 1024)->nullable(); + $table->decimal('amount', 22, 12); - $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); - $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); - - } + $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); + $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); + } ); } if (!Schema::hasTable('budget_transaction')) { Schema::create( - 'budget_transaction', function (Blueprint $table) { - $table->increments('id'); - $table->integer('budget_id', false, true); - $table->integer('transaction_id', false, true); + 'budget_transaction', + function (Blueprint $table) { + $table->increments('id'); + $table->integer('budget_id', false, true); + $table->integer('transaction_id', false, true); - $table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade'); - $table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade'); - } + $table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade'); + $table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade'); + } ); } if (!Schema::hasTable('category_transaction')) { Schema::create( - 'category_transaction', function (Blueprint $table) { - $table->increments('id'); - $table->integer('category_id', false, true); - $table->integer('transaction_id', false, true); + 'category_transaction', + function (Blueprint $table) { + $table->increments('id'); + $table->integer('category_id', false, true); + $table->integer('transaction_id', false, true); - $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); - $table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade'); - } + $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); + $table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade'); + } ); } } diff --git a/database/migrations/2016_08_25_091522_changes_for_3101.php b/database/migrations/2016_08_25_091522_changes_for_3101.php index b317ef163c..06389fba1a 100644 --- a/database/migrations/2016_08_25_091522_changes_for_3101.php +++ b/database/migrations/2016_08_25_091522_changes_for_3101.php @@ -34,9 +34,10 @@ class ChangesFor3101 extends Migration public function up() { Schema::table( - 'import_jobs', function (Blueprint $table) { - $table->text('extended_status')->nullable(); - } + 'import_jobs', + function (Blueprint $table) { + $table->text('extended_status')->nullable(); + } ); } } diff --git a/database/migrations/2016_09_12_121359_fix_nullables.php b/database/migrations/2016_09_12_121359_fix_nullables.php index ba037d328b..d448b84c77 100644 --- a/database/migrations/2016_09_12_121359_fix_nullables.php +++ b/database/migrations/2016_09_12_121359_fix_nullables.php @@ -24,7 +24,6 @@ class FixNullables extends Migration */ public function down() { - } /** @@ -35,15 +34,17 @@ class FixNullables extends Migration public function up() { Schema::table( - 'rule_groups', function (Blueprint $table) { - $table->text('description')->nullable()->change(); - } + 'rule_groups', + function (Blueprint $table) { + $table->text('description')->nullable()->change(); + } ); Schema::table( - 'rules', function (Blueprint $table) { - $table->text('description')->nullable()->change(); - } + 'rules', + function (Blueprint $table) { + $table->text('description')->nullable()->change(); + } ); } } diff --git a/database/migrations/2016_10_09_150037_expand_transactions_table.php b/database/migrations/2016_10_09_150037_expand_transactions_table.php index 6909aaa2a5..4c2b750c4b 100644 --- a/database/migrations/2016_10_09_150037_expand_transactions_table.php +++ b/database/migrations/2016_10_09_150037_expand_transactions_table.php @@ -35,9 +35,10 @@ class ExpandTransactionsTable extends Migration public function up() { Schema::table( - 'transactions', function (Blueprint $table) { - $table->smallInteger('identifier', false, true)->default(0); - } + 'transactions', + function (Blueprint $table) { + $table->smallInteger('identifier', false, true)->default(0); + } ); } } diff --git a/database/migrations/2016_10_22_075804_changes_for_v410.php b/database/migrations/2016_10_22_075804_changes_for_v410.php index 0714fb32e5..308d5e13ba 100644 --- a/database/migrations/2016_10_22_075804_changes_for_v410.php +++ b/database/migrations/2016_10_22_075804_changes_for_v410.php @@ -14,7 +14,6 @@ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; - /** * Class ChangesForV410 */ @@ -36,15 +35,16 @@ class ChangesForV410 extends Migration public function up() { Schema::create( - 'notes', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('noteable_id', false, true); - $table->string('noteable_type'); - $table->string('title')->nullable(); - $table->text('text')->nullable(); - } + 'notes', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('noteable_id', false, true); + $table->string('noteable_type'); + $table->string('title')->nullable(); + $table->text('text')->nullable(); + } ); } } diff --git a/database/migrations/2016_11_24_210552_changes_for_v420.php b/database/migrations/2016_11_24_210552_changes_for_v420.php index 1d0a57e940..c118c12a47 100644 --- a/database/migrations/2016_11_24_210552_changes_for_v420.php +++ b/database/migrations/2016_11_24_210552_changes_for_v420.php @@ -35,9 +35,10 @@ class ChangesForV420 extends Migration public function up() { Schema::table( - 'journal_meta', function (Blueprint $table) { - $table->softDeletes(); - } + 'journal_meta', + function (Blueprint $table) { + $table->softDeletes(); + } ); } } diff --git a/database/migrations/2016_12_22_150431_changes_for_v430.php b/database/migrations/2016_12_22_150431_changes_for_v430.php index ef0747e4f4..69a32f727e 100644 --- a/database/migrations/2016_12_22_150431_changes_for_v430.php +++ b/database/migrations/2016_12_22_150431_changes_for_v430.php @@ -36,20 +36,21 @@ class ChangesForV430 extends Migration public function up() { Schema::create( - 'available_budgets', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->integer('transaction_currency_id', false, true); - $table->decimal('amount', 22, 12); - $table->date('start_date'); - $table->date('end_date'); + 'available_budgets', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->integer('transaction_currency_id', false, true); + $table->decimal('amount', 22, 12); + $table->date('start_date'); + $table->date('end_date'); - $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - } + $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + } ); } } diff --git a/database/migrations/2016_12_28_203205_changes_for_v431.php b/database/migrations/2016_12_28_203205_changes_for_v431.php index 1bac0f7924..7e856c4987 100644 --- a/database/migrations/2016_12_28_203205_changes_for_v431.php +++ b/database/migrations/2016_12_28_203205_changes_for_v431.php @@ -28,24 +28,26 @@ class ChangesForV431 extends Migration { // reinstate "repeats" and "repeat_freq". Schema::table( - 'budget_limits', function (Blueprint $table) { - $table->string('repeat_freq', 30)->nullable(); - } + 'budget_limits', + function (Blueprint $table) { + $table->string('repeat_freq', 30)->nullable(); + } ); Schema::table( - 'budget_limits', function (Blueprint $table) { - $table->boolean('repeats')->default(0); - } + 'budget_limits', + function (Blueprint $table) { + $table->boolean('repeats')->default(0); + } ); // remove date field "end_date" Schema::table( - 'budget_limits', function (Blueprint $table) { - $table->dropColumn('end_date'); - } + 'budget_limits', + function (Blueprint $table) { + $table->dropColumn('end_date'); + } ); - } /** @@ -57,38 +59,40 @@ class ChangesForV431 extends Migration { // add decimal places to "transaction currencies". Schema::table( - 'transaction_currencies', function (Blueprint $table) { - $table->smallInteger('decimal_places', false, true)->default(2); - } + 'transaction_currencies', + function (Blueprint $table) { + $table->smallInteger('decimal_places', false, true)->default(2); + } ); // change field "startdate" to "start_date" Schema::table( - 'budget_limits', function (Blueprint $table) { - $table->renameColumn('startdate', 'start_date'); - } + 'budget_limits', + function (Blueprint $table) { + $table->renameColumn('startdate', 'start_date'); + } ); // add date field "end_date" after "start_date" Schema::table( - 'budget_limits', function (Blueprint $table) { - $table->date('end_date')->nullable()->after('start_date'); - } + 'budget_limits', + function (Blueprint $table) { + $table->date('end_date')->nullable()->after('start_date'); + } ); // drop "repeats" and "repeat_freq". Schema::table( - 'budget_limits', function (Blueprint $table) { - $table->dropColumn('repeats'); - - } + 'budget_limits', + function (Blueprint $table) { + $table->dropColumn('repeats'); + } ); Schema::table( - 'budget_limits', function (Blueprint $table) { - $table->dropColumn('repeat_freq'); - } + 'budget_limits', + function (Blueprint $table) { + $table->dropColumn('repeat_freq'); + } ); - - } } diff --git a/database/migrations/2017_04_13_163623_changes_for_v440.php b/database/migrations/2017_04_13_163623_changes_for_v440.php index 8293836751..bc18523dfc 100644 --- a/database/migrations/2017_04_13_163623_changes_for_v440.php +++ b/database/migrations/2017_04_13_163623_changes_for_v440.php @@ -42,30 +42,31 @@ class ChangesForV440 extends Migration { if (!Schema::hasTable('currency_exchange_rates')) { Schema::create( - 'currency_exchange_rates', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->integer('user_id', false, true); - $table->integer('from_currency_id', false, true); - $table->integer('to_currency_id', false, true); - $table->date('date'); - $table->decimal('rate', 22, 12); - $table->decimal('user_rate', 22, 12)->nullable(); + 'currency_exchange_rates', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('user_id', false, true); + $table->integer('from_currency_id', false, true); + $table->integer('to_currency_id', false, true); + $table->date('date'); + $table->decimal('rate', 22, 12); + $table->decimal('user_rate', 22, 12)->nullable(); - $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - $table->foreign('from_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); - $table->foreign('to_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); - } + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + $table->foreign('from_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); + $table->foreign('to_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); + } ); } // Schema::table( - 'transactions', function (Blueprint $table) { - $table->integer('transaction_currency_id', false, true)->after('description')->nullable(); - $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null'); - } + 'transactions', + function (Blueprint $table) { + $table->integer('transaction_currency_id', false, true)->after('description')->nullable(); + $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null'); + } ); - } } diff --git a/database/migrations/2017_06_02_105232_changes_for_v450.php b/database/migrations/2017_06_02_105232_changes_for_v450.php index 44c2a04dc4..430565399d 100644 --- a/database/migrations/2017_06_02_105232_changes_for_v450.php +++ b/database/migrations/2017_06_02_105232_changes_for_v450.php @@ -39,17 +39,19 @@ class ChangesForV450 extends Migration { // add "foreign_amount" to transactions Schema::table( - 'transactions', function (Blueprint $table) { - $table->decimal('foreign_amount', 22, 12)->nullable()->after('amount'); - } + 'transactions', + function (Blueprint $table) { + $table->decimal('foreign_amount', 22, 12)->nullable()->after('amount'); + } ); // add foreign transaction currency id to transactions (is nullable): Schema::table( - 'transactions', function (Blueprint $table) { - $table->integer('foreign_currency_id', false, true)->default(null)->after('foreign_amount')->nullable(); - $table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null'); - } + 'transactions', + function (Blueprint $table) { + $table->integer('foreign_currency_id', false, true)->default(null)->after('foreign_amount')->nullable(); + $table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null'); + } ); } } diff --git a/database/migrations/2017_08_20_062014_changes_for_v470.php b/database/migrations/2017_08_20_062014_changes_for_v470.php index 942ef5e788..06743a5e3d 100644 --- a/database/migrations/2017_08_20_062014_changes_for_v470.php +++ b/database/migrations/2017_08_20_062014_changes_for_v470.php @@ -20,7 +20,6 @@ class ChangesForV470 extends Migration { Schema::dropIfExists('journal_links'); Schema::dropIfExists('link_types'); - } /** @@ -33,38 +32,38 @@ class ChangesForV470 extends Migration { if (!Schema::hasTable('link_types')) { Schema::create( - 'link_types', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); - $table->string('name'); - $table->string('outward'); - $table->string('inward'); - $table->boolean('editable'); + 'link_types', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->string('name'); + $table->string('outward'); + $table->string('inward'); + $table->boolean('editable'); - $table->unique(['name', 'outward','inward']); - } + $table->unique(['name', 'outward','inward']); + } ); } if (!Schema::hasTable('journal_links')) { Schema::create( - 'journal_links', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - $table->integer('link_type_id', false, true); - $table->integer('source_id', false, true); - $table->integer('destination_id', false, true); - $table->text('comment')->nullable(); + 'journal_links', + function (Blueprint $table) { + $table->increments('id'); + $table->timestamps(); + $table->integer('link_type_id', false, true); + $table->integer('source_id', false, true); + $table->integer('destination_id', false, true); + $table->text('comment')->nullable(); - $table->foreign('link_type_id')->references('id')->on('link_types')->onDelete('cascade'); - $table->foreign('source_id')->references('id')->on('transaction_journals')->onDelete('cascade'); - $table->foreign('destination_id')->references('id')->on('transaction_journals')->onDelete('cascade'); + $table->foreign('link_type_id')->references('id')->on('link_types')->onDelete('cascade'); + $table->foreign('source_id')->references('id')->on('transaction_journals')->onDelete('cascade'); + $table->foreign('destination_id')->references('id')->on('transaction_journals')->onDelete('cascade'); - $table->unique(['link_type_id','source_id','destination_id']); - - - } + $table->unique(['link_type_id','source_id','destination_id']); + } ); } } diff --git a/database/migrations/2017_11_04_170844_changes_for_v470a.php b/database/migrations/2017_11_04_170844_changes_for_v470a.php index 166c17b9d5..4b0e593ece 100644 --- a/database/migrations/2017_11_04_170844_changes_for_v470a.php +++ b/database/migrations/2017_11_04_170844_changes_for_v470a.php @@ -27,9 +27,10 @@ class ChangesForV470a extends Migration public function up() { Schema::table( - 'transactions', function (Blueprint $table) { - $table->boolean('reconciled')->after('deleted_at')->default(0); - } + 'transactions', + function (Blueprint $table) { + $table->boolean('reconciled')->after('deleted_at')->default(0); + } ); } } diff --git a/database/seeds/AccountTypeSeeder.php b/database/seeds/AccountTypeSeeder.php index e98b6b8db7..721dffaafb 100644 --- a/database/seeds/AccountTypeSeeder.php +++ b/database/seeds/AccountTypeSeeder.php @@ -31,6 +31,4 @@ class AccountTypeSeeder extends Seeder AccountType::create(['type' => 'Import account']); AccountType::create(['type' => 'Loan']); } - - -} +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 03adb0669e..47ab443f6d 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -29,6 +29,5 @@ class DatabaseSeeder extends Seeder $this->call(TransactionTypeSeeder::class); $this->call(PermissionSeeder::class); $this->call(LinkTypeSeeder::class); - } } diff --git a/database/seeds/LinkTypeSeeder.php b/database/seeds/LinkTypeSeeder.php index 3b872e4588..8b7fc24e9a 100644 --- a/database/seeds/LinkTypeSeeder.php +++ b/database/seeds/LinkTypeSeeder.php @@ -51,7 +51,5 @@ class LinkTypeSeeder extends Seeder $link->outward = '(partially) reimburses'; $link->editable = false; $link->save(); - } - } diff --git a/database/seeds/PermissionSeeder.php b/database/seeds/PermissionSeeder.php index 94b3e48afa..29871b6122 100644 --- a/database/seeds/PermissionSeeder.php +++ b/database/seeds/PermissionSeeder.php @@ -33,7 +33,5 @@ class PermissionSeeder extends Seeder $demo->display_name = 'Demo User'; $demo->description = 'User is a demo user'; $demo->save(); - } - } diff --git a/database/seeds/TransactionCurrencySeeder.php b/database/seeds/TransactionCurrencySeeder.php index 0d7732e80b..93f63d1e42 100644 --- a/database/seeds/TransactionCurrencySeeder.php +++ b/database/seeds/TransactionCurrencySeeder.php @@ -30,5 +30,4 @@ class TransactionCurrencySeeder extends Seeder TransactionCurrency::create(['code' => 'XBT', 'name' => 'Bitcoin', 'symbol' => 'B', 'decimal_places' => 8]); TransactionCurrency::create(['code' => 'JPY', 'name' => 'Japanese yen', 'symbol' => '¥', 'decimal_places' => 2]); } - -} +} diff --git a/database/seeds/TransactionTypeSeeder.php b/database/seeds/TransactionTypeSeeder.php index 6c1a709bb3..af070ba825 100644 --- a/database/seeds/TransactionTypeSeeder.php +++ b/database/seeds/TransactionTypeSeeder.php @@ -26,5 +26,4 @@ class TransactionTypeSeeder extends Seeder TransactionType::create(['type' => TransactionType::TRANSFER]); TransactionType::create(['type' => TransactionType::OPENING_BALANCE]); } - -} +} From 57dcdfa0c48794d3bd1d834532dfdcd17aa9630c Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 11:33:07 +0100 Subject: [PATCH 175/258] Code clean up. --- .../Report/Tag/MonthReportGenerator.php | 6 +- app/Helpers/Collector/JournalCollector.php | 4 +- .../Account/ReconcileController.php | 6 +- app/Http/Controllers/AccountController.php | 4 +- app/Http/Controllers/Auth/LoginController.php | 8 +- .../Controllers/Auth/RegisterController.php | 6 +- app/Http/Controllers/BudgetController.php | 8 +- app/Http/Controllers/HomeController.php | 4 +- app/Http/Controllers/PiggyBankController.php | 30 +++---- app/Http/Controllers/ReportController.php | 60 ++++++------- app/Http/Controllers/RuleController.php | 6 +- app/Http/breadcrumbs.php | 84 ++++++++++--------- app/Import/Routine/ImportRoutine.php | 1 + app/Import/Storage/ImportSupport.php | 8 +- app/Repositories/Journal/JournalTasker.php | 8 +- app/Support/Twig/AmountFormat.php | 8 +- app/Support/Twig/Extension/Transaction.php | 4 +- app/Support/Twig/General.php | 22 ++--- app/Support/Twig/Journal.php | 10 +-- app/Support/Twig/Rule.php | 6 +- app/TransactionRules/Actions/SetBudget.php | 4 +- config/auth.php | 12 +-- config/broadcasting.php | 10 +-- config/cache.php | 20 ++--- config/queue.php | 24 +++--- config/services.php | 6 +- config/twigbridge.php | 2 +- config/upgrade.php | 4 +- public/css/firefly.css | 2 +- public/css/google-fonts.css | 48 +++++++++++ public/index.php | 4 +- public/js/ff/export/index.js | 2 +- public/js/ff/intro/intro.js | 2 +- public/js/ff/rules/index.js | 2 +- public/js/ff/tags/show.js | 11 ++- public/js/ff/transactions/show.js | 2 +- tests/CreatesApplication.php | 2 +- .../Controllers/BudgetControllerTest.php | 2 +- .../Controllers/ExportControllerTest.php | 2 +- .../Controllers/JsonControllerTest.php | 5 -- .../Transaction/SingleControllerTest.php | 2 +- tests/Feature/ExampleTest.php | 1 - tests/Unit/ExampleTest.php | 1 - .../Actions/ClearCategoryTest.php | 3 +- .../Actions/PrependDescriptionTest.php | 4 +- .../Actions/SetDestinationAccountTest.php | 1 + .../TransactionRules/Actions/SetNotesTest.php | 1 - .../Triggers/AmountLessTest.php | 24 +++--- .../Triggers/DescriptionContainsTest.php | 25 +++--- .../Triggers/DescriptionEndsTest.php | 19 ++--- .../Triggers/DescriptionIsTest.php | 13 ++- .../Triggers/DescriptionStartsTest.php | 19 ++--- .../Triggers/FromAccountIsTest.php | 21 +++-- .../Triggers/FromAccountStartsTest.php | 2 +- .../Triggers/HasAnyTagTest.php | 4 +- .../Triggers/NotesAreTest.php | 32 +++---- .../Triggers/NotesContainTest.php | 64 +++++++------- .../TransactionRules/Triggers/TagIsTest.php | 28 +++---- .../Triggers/ToAccountIsTest.php | 20 ++--- .../Triggers/ToAccountStartsTest.php | 2 +- 60 files changed, 398 insertions(+), 347 deletions(-) diff --git a/app/Generator/Report/Tag/MonthReportGenerator.php b/app/Generator/Report/Tag/MonthReportGenerator.php index 9abd0af38d..cffaf129a6 100644 --- a/app/Generator/Report/Tag/MonthReportGenerator.php +++ b/app/Generator/Report/Tag/MonthReportGenerator.php @@ -89,7 +89,7 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface return view( 'reports.tag.month', compact( - 'accountIds', + 'accountIds', 'tagTags', 'reportType', 'accountSummary', @@ -97,8 +97,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface 'averageExpenses', 'averageIncome', 'topIncome', - 'topExpenses' - ) + 'topExpenses' + ) )->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render(); } diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php index 2a281c1a9b..39e31ba888 100644 --- a/app/Helpers/Collector/JournalCollector.php +++ b/app/Helpers/Collector/JournalCollector.php @@ -785,8 +785,8 @@ class JournalCollector implements JournalCollectorInterface 'transactions as opposing', function (JoinClause $join) { $join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id') - ->where('opposing.identifier', '=', DB::raw('transactions.identifier')) - ->where('opposing.amount', '=', DB::raw('transactions.amount * -1')); + ->where('opposing.identifier', '=', DB::raw('transactions.identifier')) + ->where('opposing.amount', '=', DB::raw('transactions.amount * -1')); } ); $this->query->leftJoin('accounts as opposing_accounts', 'opposing.account_id', '=', 'opposing_accounts.id'); diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php index 0d5f9a58cb..d0c1d1234c 100644 --- a/app/Http/Controllers/Account/ReconcileController.php +++ b/app/Http/Controllers/Account/ReconcileController.php @@ -132,7 +132,7 @@ class ReconcileController extends Controller return view( 'accounts.reconcile.index', compact( - 'account', + 'account', 'currency', 'subTitleIcon', 'start', @@ -141,11 +141,11 @@ class ReconcileController extends Controller 'startBalance', 'endBalance', 'transactionsUri', - 'selectionStart', + 'selectionStart', 'selectionEnd', 'overviewUri', 'indexUri' - ) + ) ); } diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 0162b01c55..1880401794 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -209,7 +209,7 @@ class AccountController extends Controller return view( 'accounts.edit', compact( - 'allCurrencies', + 'allCurrencies', 'currencySelectList', 'account', 'currency', @@ -218,7 +218,7 @@ class AccountController extends Controller 'what', 'roles', 'preFilled' - ) + ) ); } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index f6f1a986a5..2d958b0d94 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -85,14 +85,18 @@ class LoginController extends Controller $hasTable = Schema::hasTable('users'); if (!$hasTable) { - $message = 'Firefly III could not find the "users" table. This is a strong indication your database credentials are wrong or the database has not been initialized. Did you follow the installation instructions correctly?'; + $message + = 'Firefly III could not find the "users" table. This is a strong indication your database credentials are wrong or the database has not been initialized. Did you follow the installation instructions correctly?'; + return view('error', compact('message')); } // check for presence of currency: $currency = TransactionCurrency::where('code', 'EUR')->first(); if (is_null($currency)) { - $message = 'Firefly III could not find the EURO currency. This is a strong indication the database has not been initialized correctly. Did you follow the installation instructions?'; + $message + = 'Firefly III could not find the EURO currency. This is a strong indication the database has not been initialized correctly. Did you follow the installation instructions?'; + return view('error', compact('message')); } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 8bea5e15da..b539028c8d 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -160,9 +160,9 @@ class RegisterController extends Controller return Validator::make( $data, [ - 'email' => 'required|string|email|max:255|unique:users', - 'password' => 'required|string|secure_password|confirmed', - ] + 'email' => 'required|string|email|max:255|unique:users', + 'password' => 'required|string|secure_password|confirmed', + ] ); } } diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index fdcfc77ec6..9f0d5a0519 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -455,10 +455,10 @@ class BudgetController extends Controller $subTitle = trans( 'firefly.budget_in_period', [ - 'name' => $budget->name, - 'start' => $budgetLimit->start_date->formatLocalized($this->monthAndDayFormat), - 'end' => $budgetLimit->end_date->formatLocalized($this->monthAndDayFormat), - ] + 'name' => $budget->name, + 'start' => $budgetLimit->start_date->formatLocalized($this->monthAndDayFormat), + 'end' => $budgetLimit->end_date->formatLocalized($this->monthAndDayFormat), + ] ); // collector: diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index e6f754dc3e..8f8c8f6be5 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -123,7 +123,7 @@ class HomeController extends Controller return view( 'debug', compact( - 'phpVersion', + 'phpVersion', 'extensions', 'carbon', 'now', @@ -136,7 +136,7 @@ class HomeController extends Controller 'isDocker', 'isSandstorm', 'trustedProxies' - ) + ) ); } diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 1d092b25b5..35fe50d4ae 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -291,11 +291,11 @@ class PiggyBankController extends Controller Session::flash( 'success', strval( - trans( - 'firefly.added_amount_to_piggy', - ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] - ) - ) + trans( + 'firefly.added_amount_to_piggy', + ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] + ) + ) ); Preferences::mark(); @@ -306,11 +306,11 @@ class PiggyBankController extends Controller Session::flash( 'error', strval( - trans( - 'firefly.cannot_add_amount_piggy', - ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] - ) - ) + trans( + 'firefly.cannot_add_amount_piggy', + ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] + ) + ) ); return redirect(route('piggy-banks.index')); @@ -348,11 +348,11 @@ class PiggyBankController extends Controller Session::flash( 'error', strval( - trans( - 'firefly.cannot_remove_from_piggy', - ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] - ) - ) + trans( + 'firefly.cannot_remove_from_piggy', + ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] + ) + ) ); return redirect(route('piggy-banks.index')); diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 1b5a9fb89f..3193cad81e 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -90,12 +90,12 @@ class ReportController extends Controller View::share( 'subTitle', trans( - 'firefly.report_audit', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) + 'firefly.report_audit', + [ + 'start' => $start->formatLocalized($this->monthFormat), + 'end' => $end->formatLocalized($this->monthFormat), + ] + ) ); @@ -126,12 +126,12 @@ class ReportController extends Controller View::share( 'subTitle', trans( - 'firefly.report_budget', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) + 'firefly.report_budget', + [ + 'start' => $start->formatLocalized($this->monthFormat), + 'end' => $end->formatLocalized($this->monthFormat), + ] + ) ); $generator = ReportGeneratorFactory::reportGenerator('Budget', $start, $end); @@ -162,12 +162,12 @@ class ReportController extends Controller View::share( 'subTitle', trans( - 'firefly.report_category', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) + 'firefly.report_category', + [ + 'start' => $start->formatLocalized($this->monthFormat), + 'end' => $end->formatLocalized($this->monthFormat), + ] + ) ); $generator = ReportGeneratorFactory::reportGenerator('Category', $start, $end); @@ -198,12 +198,12 @@ class ReportController extends Controller View::share( 'subTitle', trans( - 'firefly.report_default', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) + 'firefly.report_default', + [ + 'start' => $start->formatLocalized($this->monthFormat), + 'end' => $end->formatLocalized($this->monthFormat), + ] + ) ); $generator = ReportGeneratorFactory::reportGenerator('Standard', $start, $end); @@ -344,12 +344,12 @@ class ReportController extends Controller View::share( 'subTitle', trans( - 'firefly.report_tag', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) + 'firefly.report_tag', + [ + 'start' => $start->formatLocalized($this->monthFormat), + 'end' => $end->formatLocalized($this->monthFormat), + ] + ) ); $generator = ReportGeneratorFactory::reportGenerator('Tag', $start, $end); diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php index 12a30e77ed..5335f1a70e 100644 --- a/app/Http/Controllers/RuleController.php +++ b/app/Http/Controllers/RuleController.php @@ -213,15 +213,15 @@ class RuleController extends Controller return view( 'rules.rule.edit', compact( - 'rule', + 'rule', 'subTitle', - 'primaryTrigger', + 'primaryTrigger', 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount', 'ruleGroups' - ) + ) ); } diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index 3dac647c08..ff2b8e7227 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -94,10 +94,10 @@ Breadcrumbs::register( // when is specific period or when empty: if ($moment !== 'all' && $moment !== '(nothing)') { $title = trans( - 'firefly.between_dates_breadcrumb', - ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] - ); + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), + 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + ); $breadcrumbs->push($title, route('accounts.show', [$account->id, $moment, $start, $end])); } } @@ -344,10 +344,10 @@ Breadcrumbs::register( // when is specific period or when empty: if ($moment !== 'all' && $moment !== '(nothing)') { $title = trans( - 'firefly.between_dates_breadcrumb', - ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] - ); + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), + 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + ); $breadcrumbs->push($title, route('budgets.no-budget', [$moment])); } } @@ -369,15 +369,15 @@ Breadcrumbs::register( $breadcrumbs->push(e($budget->name), route('budgets.show', [$budget->id])); $title = trans( - 'firefly.between_dates_breadcrumb', - ['start' => $budgetLimit->start_date->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $budgetLimit->end_date->formatLocalized(strval(trans('config.month_and_day'))),] - ); + 'firefly.between_dates_breadcrumb', + ['start' => $budgetLimit->start_date->formatLocalized(strval(trans('config.month_and_day'))), + 'end' => $budgetLimit->end_date->formatLocalized(strval(trans('config.month_and_day'))),] + ); $breadcrumbs->push( - $title, - route('budgets.show.limit', [$budget->id, $budgetLimit->id]) - ); + $title, + route('budgets.show.limit', [$budget->id, $budgetLimit->id]) + ); } ); @@ -427,10 +427,10 @@ Breadcrumbs::register( // when is specific period or when empty: if ($moment !== 'all' && $moment !== '(nothing)') { $title = trans( - 'firefly.between_dates_breadcrumb', - ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] - ); + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), + 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + ); $breadcrumbs->push($title, route('categories.show', [$category->id, $moment])); } } @@ -450,10 +450,10 @@ Breadcrumbs::register( // when is specific period or when empty: if ($moment !== 'all' && $moment !== '(nothing)') { $title = trans( - 'firefly.between_dates_breadcrumb', - ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] - ); + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), + 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + ); $breadcrumbs->push($title, route('categories.no-category', [$moment])); } } @@ -559,9 +559,9 @@ Breadcrumbs::register( function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) { $breadcrumbs->parent('piggy-banks.show', $piggyBank); $breadcrumbs->push( - trans('firefly.remove_money_from_piggy_title', ['name' => $piggyBank->name]), - route('piggy-banks.remove-money-mobile', [$piggyBank->id]) - ); + trans('firefly.remove_money_from_piggy_title', ['name' => $piggyBank->name]), + route('piggy-banks.remove-money-mobile', [$piggyBank->id]) + ); } ); @@ -795,7 +795,9 @@ Breadcrumbs::register( 'rule-groups.select-transactions', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { $breadcrumbs->parent('rules.index'); - $breadcrumbs->push(trans('firefly.rule_group_select_transactions', ['title' => $ruleGroup->title]), route('rule-groups.select-transactions', [$ruleGroup])); + $breadcrumbs->push( + trans('firefly.rule_group_select_transactions', ['title' => $ruleGroup->title]), route('rule-groups.select-transactions', [$ruleGroup]) + ); } ); @@ -804,9 +806,9 @@ Breadcrumbs::register( function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) { $breadcrumbs->parent('rules.index'); $breadcrumbs->push( - trans('firefly.execute_group_on_existing_transactions', ['title' => $ruleGroup->title]), - route('rule-groups.select_transactions', [$ruleGroup]) - ); + trans('firefly.execute_group_on_existing_transactions', ['title' => $ruleGroup->title]), + route('rule-groups.select_transactions', [$ruleGroup]) + ); } ); @@ -870,10 +872,10 @@ Breadcrumbs::register( // when is specific period or when empty: if ($moment !== 'all' && $moment !== '(nothing)') { $title = trans( - 'firefly.between_dates_breadcrumb', - ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] - ); + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), + 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + ); $breadcrumbs->push($title, route('tags.show', [$tag->id, $moment])); } } @@ -894,10 +896,10 @@ Breadcrumbs::register( // when is specific period or when empty: if ($moment !== 'all' && $moment !== '(nothing)') { $title = trans( - 'firefly.between_dates_breadcrumb', - ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] - ); + 'firefly.between_dates_breadcrumb', + ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), + 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + ); $breadcrumbs->push($title, route('transactions.index', [$what, $moment])); } } @@ -940,9 +942,9 @@ Breadcrumbs::register( function (BreadCrumbGenerator $breadcrumbs, TransactionType $destinationType, TransactionJournal $journal) { $breadcrumbs->parent('transactions.show', $journal); $breadcrumbs->push( - trans('firefly.convert_to_' . $destinationType->type, ['description' => $journal->description]), - route('transactions.convert.index', [strtolower($destinationType->type), $journal->id]) - ); + trans('firefly.convert_to_' . $destinationType->type, ['description' => $journal->description]), + route('transactions.convert.index', [strtolower($destinationType->type), $journal->id]) + ); } ); diff --git a/app/Import/Routine/ImportRoutine.php b/app/Import/Routine/ImportRoutine.php index 304fd3a09e..9fe520e137 100644 --- a/app/Import/Routine/ImportRoutine.php +++ b/app/Import/Routine/ImportRoutine.php @@ -140,6 +140,7 @@ class ImportRoutine if ($this->journals->count() < 1) { Log::info(sprintf('Will not create tag, %d journals imported.', $this->journals->count())); + return new Tag; } diff --git a/app/Import/Storage/ImportSupport.php b/app/Import/Storage/ImportSupport.php index 99ed36614a..b594d27ee8 100644 --- a/app/Import/Storage/ImportSupport.php +++ b/app/Import/Storage/ImportSupport.php @@ -277,10 +277,10 @@ trait ImportSupport 'transactions AS destination', function (JoinClause $join) { $join->on('transaction_journals.id', '=', 'destination.transaction_journal_id')->where( - 'destination.amount', - '>', - 0 - ); + 'destination.amount', + '>', + 0 + ); } ) ->leftJoin('accounts as source_accounts', 'source.account_id', '=', 'source_accounts.id') diff --git a/app/Repositories/Journal/JournalTasker.php b/app/Repositories/Journal/JournalTasker.php index 31fb04e1cb..a0a3928d2a 100644 --- a/app/Repositories/Journal/JournalTasker.php +++ b/app/Repositories/Journal/JournalTasker.php @@ -89,10 +89,10 @@ class JournalTasker implements JournalTaskerInterface 'transactions as destination', function (JoinClause $join) { $join - ->on('transactions.transaction_journal_id', '=', 'destination.transaction_journal_id') - ->where('transactions.amount', '=', DB::raw('destination.amount * -1')) - ->where('transactions.identifier', '=', DB::raw('destination.identifier')) - ->whereNull('destination.deleted_at'); + ->on('transactions.transaction_journal_id', '=', 'destination.transaction_journal_id') + ->where('transactions.amount', '=', DB::raw('destination.amount * -1')) + ->where('transactions.identifier', '=', DB::raw('destination.identifier')) + ->whereNull('destination.deleted_at'); } ) ->with(['budgets', 'categories']) diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.php index 45f30556f2..cd2c528e3c 100644 --- a/app/Support/Twig/AmountFormat.php +++ b/app/Support/Twig/AmountFormat.php @@ -176,7 +176,7 @@ class AmountFormat extends Twig_Extension 'formatDestinationAfter', function (array $transaction): string { - // build fake currency for main amount. + // build fake currency for main amount. $format = new TransactionCurrency; $format->decimal_places = $transaction['transaction_currency_dp']; $format->symbol = $transaction['transaction_currency_symbol']; @@ -207,7 +207,7 @@ class AmountFormat extends Twig_Extension 'formatDestinationBefore', function (array $transaction): string { - // build fake currency for main amount. + // build fake currency for main amount. $format = new TransactionCurrency; $format->decimal_places = $transaction['transaction_currency_dp']; $format->symbol = $transaction['transaction_currency_symbol']; @@ -227,7 +227,7 @@ class AmountFormat extends Twig_Extension 'formatSourceAfter', function (array $transaction): string { - // build fake currency for main amount. + // build fake currency for main amount. $format = new TransactionCurrency; $format->decimal_places = $transaction['transaction_currency_dp']; $format->symbol = $transaction['transaction_currency_symbol']; @@ -258,7 +258,7 @@ class AmountFormat extends Twig_Extension 'formatSourceBefore', function (array $transaction): string { - // build fake currency for main amount. + // build fake currency for main amount. $format = new TransactionCurrency; $format->decimal_places = $transaction['transaction_currency_dp']; $format->symbol = $transaction['transaction_currency_symbol']; diff --git a/app/Support/Twig/Extension/Transaction.php b/app/Support/Twig/Extension/Transaction.php index 8bcde09923..b9d9816859 100644 --- a/app/Support/Twig/Extension/Transaction.php +++ b/app/Support/Twig/Extension/Transaction.php @@ -310,7 +310,7 @@ class Transaction extends Twig_Extension $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where( 'identifier', - $transaction->identifier + $transaction->identifier ) ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') @@ -489,7 +489,7 @@ class Transaction extends Twig_Extension $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where( 'identifier', - $transaction->identifier + $transaction->identifier ) ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index b2d04de926..9b8d524a0b 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -118,8 +118,8 @@ class General extends Twig_Extension function ($context): string { $args = func_get_args(); $route = $args[1]; // name of the route. - $what = $args[2]; // name of the route. - $activeWhat = $context['what'] ?? false; + $what = $args[2]; // name of the route. + $activeWhat = $context['what'] ?? false; if ($what === $activeWhat && !(strpos(Route::getCurrentRoute()->getName(), $route) === false)) { return 'active'; @@ -194,7 +194,7 @@ class General extends Twig_Extension 'filesize', function (int $size): string { - // less than one GB, more than one MB + // less than one GB, more than one MB if ($size < (1024 * 1024 * 2014) && $size >= (1024 * 1024)) { return round($size / (1024 * 1024), 2) . ' MB'; } @@ -245,14 +245,14 @@ class General extends Twig_Extension 'mimeIcon', function (string $string): string { switch ($string) { - default: - return 'fa-file-o'; - case 'application/pdf': - return 'fa-file-pdf-o'; - case 'image/png': - case 'image/jpeg': - return 'fa-file-image-o'; - } + default: + return 'fa-file-o'; + case 'application/pdf': + return 'fa-file-pdf-o'; + case 'image/png': + case 'image/jpeg': + return 'fa-file-image-o'; + } }, ['is_safe' => ['html']] ); diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php index 3998ba15ec..808bf2199d 100644 --- a/app/Support/Twig/Journal.php +++ b/app/Support/Twig/Journal.php @@ -207,11 +207,11 @@ class Journal extends Twig_Extension } if (count($categories) === 0) { $set = Category::distinct()->leftJoin('category_transaction', 'categories.id', '=', 'category_transaction.category_id') - ->leftJoin('transactions', 'category_transaction.transaction_id', '=', 'transactions.id') - ->leftJoin('transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->where('categories.user_id', $journal->user_id) - ->where('transaction_journals.id', $journal->id) - ->get(['categories.*']); + ->leftJoin('transactions', 'category_transaction.transaction_id', '=', 'transactions.id') + ->leftJoin('transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->where('categories.user_id', $journal->user_id) + ->where('transaction_journals.id', $journal->id) + ->get(['categories.*']); /** @var Category $category */ foreach ($set as $category) { $categories[] = sprintf('%1$s', e($category->name), route('categories.show', $category->id)); diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php index 646912c370..8b89b48226 100644 --- a/app/Support/Twig/Rule.php +++ b/app/Support/Twig/Rule.php @@ -66,9 +66,9 @@ class Rule extends Twig_Extension 'allJournalTriggers', function () { return [ - 'store-journal' => trans('firefly.rule_trigger_store_journal'), - 'update-journal' => trans('firefly.rule_trigger_update_journal'), - ]; + 'store-journal' => trans('firefly.rule_trigger_store_journal'), + 'update-journal' => trans('firefly.rule_trigger_update_journal'), + ]; } ); } diff --git a/app/TransactionRules/Actions/SetBudget.php b/app/TransactionRules/Actions/SetBudget.php index d9fd23f02d..932cca045c 100644 --- a/app/TransactionRules/Actions/SetBudget.php +++ b/app/TransactionRules/Actions/SetBudget.php @@ -60,9 +60,9 @@ class SetBudget implements ActionInterface /** @var BudgetRepositoryInterface $repository */ $repository = app(BudgetRepositoryInterface::class); $repository->setUser($journal->user); - $search = $this->action->action_value; + $search = $this->action->action_value; $budgets = $repository->getActiveBudgets(); - $budget = $budgets->filter( + $budget = $budgets->filter( function (Budget $current) use ($search) { return $current->name === $search; } diff --git a/config/auth.php b/config/auth.php index e324d1a6f8..73352da7a0 100644 --- a/config/auth.php +++ b/config/auth.php @@ -36,7 +36,7 @@ return [ */ 'defaults' => [ - 'guard' => 'web', + 'guard' => 'web', 'passwords' => 'users', ], @@ -59,12 +59,12 @@ return [ 'guards' => [ 'web' => [ - 'driver' => 'session', + 'driver' => 'session', 'provider' => 'users', ], 'api' => [ - 'driver' => 'token', + 'driver' => 'token', 'provider' => 'users', ], ], @@ -89,7 +89,7 @@ return [ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => FireflyIII\User::class, + 'model' => FireflyIII\User::class, ], // 'users' => [ @@ -116,8 +116,8 @@ return [ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, + 'table' => 'password_resets', + 'expire' => 60, ], ], diff --git a/config/broadcasting.php b/config/broadcasting.php index 962c603b70..00c45c8caf 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -53,17 +53,17 @@ return [ 'connections' => [ 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), 'options' => [ // ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/cache.php b/config/cache.php index 812128ea27..c3360fdae1 100644 --- a/config/cache.php +++ b/config/cache.php @@ -61,37 +61,37 @@ return [ ], 'database' => [ - 'driver' => 'database', - 'table' => 'cache', + 'driver' => 'database', + 'table' => 'cache', 'connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), + 'path' => storage_path('framework/cache/data'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ + 'sasl' => [ env('MEMCACHED_USERNAME'), env('MEMCACHED_PASSWORD'), ], - 'options' => [ + 'options' => [ // Memcached::OPT_CONNECT_TIMEOUT => 2000, ], - 'servers' => [ + 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/queue.php b/config/queue.php index 7c4b8840a2..171e9babc5 100644 --- a/config/queue.php +++ b/config/queue.php @@ -57,32 +57,32 @@ return [ ], 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', 'retry_after' => 90, ], 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', 'retry_after' => 90, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => 'your-public-key', + 'key' => 'your-public-key', 'secret' => 'your-secret-key', 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', - 'queue' => 'your-queue-name', + 'queue' => 'your-queue-name', 'region' => 'us-east-1', ], 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => 'default', + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => 'default', 'retry_after' => 90, ], @@ -101,7 +101,7 @@ return [ 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 0e0dd3b120..8b9e73ff36 100644 --- a/config/services.php +++ b/config/services.php @@ -42,7 +42,7 @@ return [ ], 'ses' => [ - 'key' => env('SES_KEY'), + 'key' => env('SES_KEY'), 'secret' => env('SES_SECRET'), 'region' => 'us-east-1', ], @@ -52,8 +52,8 @@ return [ ], 'stripe' => [ - 'model' => FireflyIII\User::class, - 'key' => env('STRIPE_KEY'), + 'model' => FireflyIII\User::class, + 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], diff --git a/config/twigbridge.php b/config/twigbridge.php index 601364ccfe..df96c93a2d 100644 --- a/config/twigbridge.php +++ b/config/twigbridge.php @@ -176,7 +176,7 @@ return [ 'is_safe' => [ 'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location', 'multiRadio', 'file', 'multiCheckbox', 'staticText', 'amountSmall', 'password', 'nonSelectableBalance', 'nonSelectableAmount', - 'number' + 'number', ], ], 'Form' => [ diff --git a/config/upgrade.php b/config/upgrade.php index 9d162714ac..d0f6e5b716 100644 --- a/config/upgrade.php +++ b/config/upgrade.php @@ -27,13 +27,13 @@ return [ [ '4.3' => 'Make sure you run the migrations and clear your cache. If you need more help, please check Github or the Firefly III website.', '4.6.3' => 'This will be the last version to require PHP7.0. Future versions will require PHP7.1 minimum.', - '4.6.4' => 'This version of Firefly III requires PHP7.1.' + '4.6.4' => 'This version of Firefly III requires PHP7.1.', ], 'install' => [ '4.3' => 'Welcome to Firefly! Make sure you follow the installation guide. If you need more help, please check Github or the Firefly III website. The installation guide has a FAQ which you should check out as well.', '4.6.3' => 'This will be the last version to require PHP7.0. Future versions will require PHP7.1 minimum.', - '4.6.4' => 'This version of Firefly III requires PHP7.1.' + '4.6.4' => 'This version of Firefly III requires PHP7.1.', ], ], ]; diff --git a/public/css/firefly.css b/public/css/firefly.css index 87489e2b14..2762b01073 100644 --- a/public/css/firefly.css +++ b/public/css/firefly.css @@ -28,7 +28,7 @@ } p.tagcloud .label { - line-height:2; + line-height: 2; } .handle { diff --git a/public/css/google-fonts.css b/public/css/google-fonts.css index ad3e4c6983..3647aa35a3 100644 --- a/public/css/google-fonts.css +++ b/public/css/google-fonts.css @@ -26,6 +26,7 @@ src: local('Source Sans Pro Light Italic'), local('SourceSansPro-LightItalic'), url('../fonts/SourceSansPro-LightItalic-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } + /* cyrillic */ @font-face { font-family: 'Source Sans Pro'; @@ -34,6 +35,7 @@ src: local('Source Sans Pro Light Italic'), local('SourceSansPro-LightItalic'), url('../fonts/SourceSansPro-LightItalic-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -42,6 +44,7 @@ src: local('Source Sans Pro Light Italic'), local('SourceSansPro-LightItalic'), url('../fonts/SourceSansPro-LightItalic-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { font-family: 'Source Sans Pro'; @@ -50,6 +53,7 @@ src: local('Source Sans Pro Light Italic'), local('SourceSansPro-LightItalic'), url('../fonts/SourceSansPro-LightItalic-greek.woff2') format('woff2'); unicode-range: U+0370-03FF; } + /* vietnamese */ @font-face { font-family: 'Source Sans Pro'; @@ -58,6 +62,7 @@ src: local('Source Sans Pro Light Italic'), local('SourceSansPro-LightItalic'), url('../fonts/SourceSansPro-LightItalic-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } + /* latin-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -66,6 +71,7 @@ src: local('Source Sans Pro Light Italic'), local('SourceSansPro-LightItalic'), url('../fonts/SourceSansPro-LightItalic-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } + /* latin */ @font-face { font-family: 'Source Sans Pro'; @@ -74,6 +80,7 @@ src: local('Source Sans Pro Light Italic'), local('SourceSansPro-LightItalic'), url('../fonts/SourceSansPro-LightItalic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } + /* cyrillic-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -82,6 +89,7 @@ src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url('../fonts/SourceSansPro-Italic-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } + /* cyrillic */ @font-face { font-family: 'Source Sans Pro'; @@ -90,6 +98,7 @@ src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url('../fonts/SourceSansPro-Italic-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -98,6 +107,7 @@ src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url('../fonts/SourceSansPro-Italic-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { font-family: 'Source Sans Pro'; @@ -106,6 +116,7 @@ src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url('../fonts/SourceSansPro-Italic-greek.woff2') format('woff2'); unicode-range: U+0370-03FF; } + /* vietnamese */ @font-face { font-family: 'Source Sans Pro'; @@ -114,6 +125,7 @@ src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url('../fonts/SourceSansPro-Italic-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } + /* latin-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -122,6 +134,7 @@ src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url('../fonts/SourceSansPro-Italic-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } + /* latin */ @font-face { font-family: 'Source Sans Pro'; @@ -130,6 +143,7 @@ src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url('../fonts/SourceSansPro-Italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } + /* cyrillic-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -138,6 +152,7 @@ src: local('Source Sans Pro SemiBold Italic'), local('SourceSansPro-SemiBoldItalic'), url('../fonts/SourceSansPro-SemiBoldItalic-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } + /* cyrillic */ @font-face { font-family: 'Source Sans Pro'; @@ -146,6 +161,7 @@ src: local('Source Sans Pro SemiBold Italic'), local('SourceSansPro-SemiBoldItalic'), url('../fonts/SourceSansPro-SemiBoldItalic-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -154,6 +170,7 @@ src: local('Source Sans Pro SemiBold Italic'), local('SourceSansPro-SemiBoldItalic'), url('../fonts/SourceSansPro-SemiBoldItalic-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { font-family: 'Source Sans Pro'; @@ -162,6 +179,7 @@ src: local('Source Sans Pro SemiBold Italic'), local('SourceSansPro-SemiBoldItalic'), url('../fonts/SourceSansPro-SemiBoldItalic-greek.woff2') format('woff2'); unicode-range: U+0370-03FF; } + /* vietnamese */ @font-face { font-family: 'Source Sans Pro'; @@ -170,6 +188,7 @@ src: local('Source Sans Pro SemiBold Italic'), local('SourceSansPro-SemiBoldItalic'), url('../fonts/SourceSansPro-SemiBoldItalic-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } + /* latin-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -178,6 +197,7 @@ src: local('Source Sans Pro SemiBold Italic'), local('SourceSansPro-SemiBoldItalic'), url('../fonts/SourceSansPro-SemiBoldItalic-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } + /* latin */ @font-face { font-family: 'Source Sans Pro'; @@ -186,6 +206,7 @@ src: local('Source Sans Pro SemiBold Italic'), local('SourceSansPro-SemiBoldItalic'), url('../fonts/SourceSansPro-SemiBoldItalic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } + /* cyrillic-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -194,6 +215,7 @@ src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/SourceSansPro-Light-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } + /* cyrillic */ @font-face { font-family: 'Source Sans Pro'; @@ -202,6 +224,7 @@ src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/SourceSansPro-Light-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -210,6 +233,7 @@ src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/SourceSansPro-Light-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { font-family: 'Source Sans Pro'; @@ -218,6 +242,7 @@ src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/SourceSansPro-Light-greek.woff2') format('woff2'); unicode-range: U+0370-03FF; } + /* vietnamese */ @font-face { font-family: 'Source Sans Pro'; @@ -226,6 +251,7 @@ src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/SourceSansPro-Light-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } + /* latin-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -234,6 +260,7 @@ src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/SourceSansPro-Light-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } + /* latin */ @font-face { font-family: 'Source Sans Pro'; @@ -242,6 +269,7 @@ src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/SourceSansPro-Light-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } + /* cyrillic-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -250,6 +278,7 @@ src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url('../fonts/SourceSansPro-Regular-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } + /* cyrillic */ @font-face { font-family: 'Source Sans Pro'; @@ -258,6 +287,7 @@ src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url('../fonts/SourceSansPro-Regular-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -266,6 +296,7 @@ src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url('../fonts/SourceSansPro-Regular-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { font-family: 'Source Sans Pro'; @@ -274,6 +305,7 @@ src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url('../fonts/SourceSansPro-Regular-greek.woff2') format('woff2'); unicode-range: U+0370-03FF; } + /* vietnamese */ @font-face { font-family: 'Source Sans Pro'; @@ -282,6 +314,7 @@ src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url('../fonts/SourceSansPro-Regular-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } + /* latin-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -290,6 +323,7 @@ src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url('../fonts/SourceSansPro-Regular-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } + /* latin */ @font-face { font-family: 'Source Sans Pro'; @@ -298,6 +332,7 @@ src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url('../fonts/SourceSansPro-Regular-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } + /* cyrillic-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -306,6 +341,7 @@ src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url('../fonts/SourceSansPro-SemiBold-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } + /* cyrillic */ @font-face { font-family: 'Source Sans Pro'; @@ -314,6 +350,7 @@ src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url('../fonts/SourceSansPro-SemiBold-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -322,6 +359,7 @@ src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url('../fonts/SourceSansPro-SemiBold-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { font-family: 'Source Sans Pro'; @@ -330,6 +368,7 @@ src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url('../fonts/SourceSansPro-SemiBold-greek.woff2') format('woff2'); unicode-range: U+0370-03FF; } + /* vietnamese */ @font-face { font-family: 'Source Sans Pro'; @@ -338,6 +377,7 @@ src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url('../fonts/SourceSansPro-SemiBold-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } + /* latin-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -346,6 +386,7 @@ src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url('../fonts/SourceSansPro-SemiBold-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } + /* latin */ @font-face { font-family: 'Source Sans Pro'; @@ -354,6 +395,7 @@ src: local('Source Sans Pro SemiBold'), local('SourceSansPro-SemiBold'), url('../fonts/SourceSansPro-SemiBold-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } + /* cyrillic-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -362,6 +404,7 @@ src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../fonts/SourceSansPro-Bold-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } + /* cyrillic */ @font-face { font-family: 'Source Sans Pro'; @@ -370,6 +413,7 @@ src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../fonts/SourceSansPro-Bold-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } + /* greek-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -378,6 +422,7 @@ src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../fonts/SourceSansPro-Bold-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; } + /* greek */ @font-face { font-family: 'Source Sans Pro'; @@ -386,6 +431,7 @@ src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../fonts/SourceSansPro-Bold-greek.woff2') format('woff2'); unicode-range: U+0370-03FF; } + /* vietnamese */ @font-face { font-family: 'Source Sans Pro'; @@ -394,6 +440,7 @@ src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../fonts/SourceSansPro-Bold-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } + /* latin-ext */ @font-face { font-family: 'Source Sans Pro'; @@ -402,6 +449,7 @@ src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../fonts/SourceSansPro-Bold-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } + /* latin */ @font-face { font-family: 'Source Sans Pro'; diff --git a/public/index.php b/public/index.php index fee61b0b1d..abea8072d8 100644 --- a/public/index.php +++ b/public/index.php @@ -40,7 +40,7 @@ define('LARAVEL_START', microtime(true)); | */ -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- @@ -54,7 +54,7 @@ require __DIR__.'/../vendor/autoload.php'; | */ -$app = require_once __DIR__.'/../bootstrap/app.php'; +$app = require_once __DIR__ . '/../bootstrap/app.php'; /* |-------------------------------------------------------------------------- diff --git a/public/js/ff/export/index.js b/public/js/ff/export/index.js index 97bfd5bf67..b446b20f03 100644 --- a/public/js/ff/export/index.js +++ b/public/js/ff/export/index.js @@ -120,7 +120,7 @@ function callExport() { var response = jqXHR.responseJSON; var errorText = 'The export failed. Please check the log files to find out why.'; if (typeof response === 'object') { - errorText =response.message; + errorText = response.message; } showError(errorText); diff --git a/public/js/ff/intro/intro.js b/public/js/ff/intro/intro.js index d4406076fa..582f92251f 100644 --- a/public/js/ff/intro/intro.js +++ b/public/js/ff/intro/intro.js @@ -42,5 +42,5 @@ function setupIntro(steps) { } function reportIntroFinished() { - $.post(routeForFinishedTour, {_token:token}); + $.post(routeForFinishedTour, {_token: token}); } \ No newline at end of file diff --git a/public/js/ff/rules/index.js b/public/js/ff/rules/index.js index 3c975859ea..7e74c5edbc 100644 --- a/public/js/ff/rules/index.js +++ b/public/js/ff/rules/index.js @@ -58,7 +58,7 @@ function testRuleTriggers(e) { var obj = $(e.target); var ruleId = parseInt(obj.data('id')); var icon = obj; - if(obj.prop("tagName") === 'A') { + if (obj.prop("tagName") === 'A') { icon = $('i', obj); } // change icon: diff --git a/public/js/ff/tags/show.js b/public/js/ff/tags/show.js index a8dffd046d..07e0abbf7d 100644 --- a/public/js/ff/tags/show.js +++ b/public/js/ff/tags/show.js @@ -31,7 +31,14 @@ $(function () { */ // make map: - var mymap = L.map('tag_location_map', {zoomControl: false, touchZoom: false, doubleClickZoom: false, scrollWheelZoom: false, boxZoom: false, dragging: false}).setView([latitude, longitude], zoomLevel); + var mymap = L.map('tag_location_map', { + zoomControl: false, + touchZoom: false, + doubleClickZoom: false, + scrollWheelZoom: false, + boxZoom: false, + dragging: false + }).setView([latitude, longitude], zoomLevel); L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', { attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', @@ -40,7 +47,7 @@ $(function () { accessToken: mapboxToken }).addTo(mymap); - if(doPlaceMarker) { + if (doPlaceMarker) { var marker = L.marker([latitude, longitude]).addTo(mymap); } } diff --git a/public/js/ff/transactions/show.js b/public/js/ff/transactions/show.js index f3dfc8cb31..093703bcdb 100644 --- a/public/js/ff/transactions/show.js +++ b/public/js/ff/transactions/show.js @@ -30,7 +30,7 @@ $(function () { source: data, autoSelect: true }); - $input.change(function() { + $input.change(function () { var current = $input.typeahead("getActive"); if (current) { // Some item from your model is active! diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index a473168274..f74c104bda 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -35,7 +35,7 @@ trait CreatesApplication */ public function createApplication() { - $app = require __DIR__.'/../bootstrap/app.php'; + $app = require __DIR__ . '/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); diff --git a/tests/Feature/Controllers/BudgetControllerTest.php b/tests/Feature/Controllers/BudgetControllerTest.php index 5bd106fba6..db039117f3 100644 --- a/tests/Feature/Controllers/BudgetControllerTest.php +++ b/tests/Feature/Controllers/BudgetControllerTest.php @@ -205,7 +205,7 @@ class BudgetControllerTest extends TestCase // mock stuff $budget = factory(Budget::class)->make(); $budgetLimit = factory(BudgetLimit::class)->make(); - $budgetInfo = [ + $budgetInfo = [ $budget->id => [ 'spent' => '0', 'budgeted' => '0', diff --git a/tests/Feature/Controllers/ExportControllerTest.php b/tests/Feature/Controllers/ExportControllerTest.php index a704fdc5db..d4c8f23e71 100644 --- a/tests/Feature/Controllers/ExportControllerTest.php +++ b/tests/Feature/Controllers/ExportControllerTest.php @@ -155,7 +155,7 @@ class ExportControllerTest extends TestCase $processor->shouldReceive('collectOldUploads')->once(); $processor->shouldReceive('collectAttachments')->once(); - $job = new ExportJob; + $job = new ExportJob; $job->user = $this->user(); $repository->shouldReceive('changeStatus')->andReturn(true); diff --git a/tests/Feature/Controllers/JsonControllerTest.php b/tests/Feature/Controllers/JsonControllerTest.php index 78dd8a5a87..510da9a313 100644 --- a/tests/Feature/Controllers/JsonControllerTest.php +++ b/tests/Feature/Controllers/JsonControllerTest.php @@ -23,15 +23,10 @@ declare(strict_types=1); namespace Tests\Feature\Controllers; -use Amount; -use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Models\Budget; use FireflyIII\Models\Category; use FireflyIII\Models\Tag; -use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; -use FireflyIII\Models\TransactionType; -use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; diff --git a/tests/Feature/Controllers/Transaction/SingleControllerTest.php b/tests/Feature/Controllers/Transaction/SingleControllerTest.php index 026e7eea20..a78e15577a 100644 --- a/tests/Feature/Controllers/Transaction/SingleControllerTest.php +++ b/tests/Feature/Controllers/Transaction/SingleControllerTest.php @@ -296,7 +296,7 @@ class SingleControllerTest extends TestCase /** * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::store - * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::groupedActiveAccountList + * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::groupedActiveAccountList */ public function testStoreSuccess() { diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 48cb9dc8b5..910ea86035 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace Tests\Feature; use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; class ExampleTest extends TestCase { diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 9d3fffcb7a..72011a9b73 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace Tests\Unit; use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; class ExampleTest extends TestCase { diff --git a/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php b/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php index ce73265513..fbee3211df 100644 --- a/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php +++ b/tests/Unit/TransactionRules/Actions/ClearCategoryTest.php @@ -22,6 +22,7 @@ declare(strict_types=1); namespace Tests\Unit\TransactionRules\Actions; + use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; use FireflyIII\TransactionRules\Actions\ClearCategory; @@ -41,7 +42,7 @@ class ClearCategoryTest extends TestCase public function testAct() { // associate budget with journal: - $journal = TransactionJournal::find(5); + $journal = TransactionJournal::find(5); $category = $journal->user->categories()->first(); $journal->budgets()->save($category); $this->assertGreaterThan(0, $journal->categories()->count()); diff --git a/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php b/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php index f17d17a1f6..850ecf8c79 100644 --- a/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php +++ b/tests/Unit/TransactionRules/Actions/PrependDescriptionTest.php @@ -55,10 +55,10 @@ class PrependDescriptionTest extends TestCase $action = new PrependDescription($ruleAction); $result = $action->act($journal); $this->assertTrue($result); - $journal = TransactionJournal::find(7); + $journal = TransactionJournal::find(7); // assert result - $this->assertEquals($prepend.$description, $journal->description); + $this->assertEquals($prepend . $description, $journal->description); } } diff --git a/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php b/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php index 89084544e1..dabee5609e 100644 --- a/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php +++ b/tests/Unit/TransactionRules/Actions/SetDestinationAccountTest.php @@ -166,6 +166,7 @@ class SetDestinationAccountTest extends TestCase /** * Test this on a split journal. + * * @covers \FireflyIII\TransactionRules\Actions\SetDestinationAccount::__construct() * @covers \FireflyIII\TransactionRules\Actions\SetDestinationAccount::act() */ diff --git a/tests/Unit/TransactionRules/Actions/SetNotesTest.php b/tests/Unit/TransactionRules/Actions/SetNotesTest.php index 22a5878e59..63884197b7 100644 --- a/tests/Unit/TransactionRules/Actions/SetNotesTest.php +++ b/tests/Unit/TransactionRules/Actions/SetNotesTest.php @@ -27,7 +27,6 @@ namespace Tests\Unit\TransactionRules\Actions; use FireflyIII\Models\Note; use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; -use FireflyIII\TransactionRules\Actions\ClearNotes; use FireflyIII\TransactionRules\Actions\SetNotes; use Tests\TestCase; diff --git a/tests/Unit/TransactionRules/Triggers/AmountLessTest.php b/tests/Unit/TransactionRules/Triggers/AmountLessTest.php index 533d73c5ac..b2dc9c3d0f 100644 --- a/tests/Unit/TransactionRules/Triggers/AmountLessTest.php +++ b/tests/Unit/TransactionRules/Triggers/AmountLessTest.php @@ -35,18 +35,6 @@ use Tests\TestCase; */ class AmountLessTest extends TestCase { - /** - * @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered - */ - public function testTriggeredLess() - { - $journal = new TransactionJournal; - $journal->destination_amount = '12.34'; - $trigger = AmountLess::makeFromStrings('12.50', false); - $result = $trigger->triggered($journal); - $this->assertTrue($result); - } - /** * @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered */ @@ -59,6 +47,18 @@ class AmountLessTest extends TestCase $this->assertFalse($result); } + /** + * @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered + */ + public function testTriggeredLess() + { + $journal = new TransactionJournal; + $journal->destination_amount = '12.34'; + $trigger = AmountLess::makeFromStrings('12.50', false); + $result = $trigger->triggered($journal); + $this->assertTrue($result); + } + /** * @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered */ diff --git a/tests/Unit/TransactionRules/Triggers/DescriptionContainsTest.php b/tests/Unit/TransactionRules/Triggers/DescriptionContainsTest.php index 99bf22574b..b937835cb3 100644 --- a/tests/Unit/TransactionRules/Triggers/DescriptionContainsTest.php +++ b/tests/Unit/TransactionRules/Triggers/DescriptionContainsTest.php @@ -47,19 +47,6 @@ class DescriptionContainsTest extends TestCase $this->assertTrue($result); } - /** - * @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered - */ - public function testTriggeredNot() - { - $journal = new TransactionJournal; - $journal->description = 'Lorem IPSUM bla bla '; - $trigger = DescriptionContains::makeFromStrings('blurb', false); - $result = $trigger->triggered($journal); - $this->assertFalse($result); - } - - /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered */ @@ -84,6 +71,18 @@ class DescriptionContainsTest extends TestCase $this->assertTrue($result); } + /** + * @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered + */ + public function testTriggeredNot() + { + $journal = new TransactionJournal; + $journal->description = 'Lorem IPSUM bla bla '; + $trigger = DescriptionContains::makeFromStrings('blurb', false); + $result = $trigger->triggered($journal); + $this->assertFalse($result); + } + /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered */ diff --git a/tests/Unit/TransactionRules/Triggers/DescriptionEndsTest.php b/tests/Unit/TransactionRules/Triggers/DescriptionEndsTest.php index 994848e3ad..10aa263264 100644 --- a/tests/Unit/TransactionRules/Triggers/DescriptionEndsTest.php +++ b/tests/Unit/TransactionRules/Triggers/DescriptionEndsTest.php @@ -50,16 +50,15 @@ class DescriptionEndsTest extends TestCase /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered */ - public function testTriggeredNot() + public function testTriggeredClose() { $journal = new TransactionJournal; - $journal->description = 'Lorem IPSUM blabla'; - $trigger = DescriptionEnds::makeFromStrings('lorem', false); + $journal->description = 'Something is going to happen'; + $trigger = DescriptionEnds::makeFromStrings('happe', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } - /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered */ @@ -75,11 +74,11 @@ class DescriptionEndsTest extends TestCase /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered */ - public function testTriggeredClose() + public function testTriggeredLongSearch() { $journal = new TransactionJournal; - $journal->description = 'Something is going to happen'; - $trigger = DescriptionEnds::makeFromStrings('happe', false); + $journal->description = 'Something'; + $trigger = DescriptionEnds::makeFromStrings('Something is', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } @@ -99,11 +98,11 @@ class DescriptionEndsTest extends TestCase /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered */ - public function testTriggeredLongSearch() + public function testTriggeredNot() { $journal = new TransactionJournal; - $journal->description = 'Something'; - $trigger = DescriptionEnds::makeFromStrings('Something is', false); + $journal->description = 'Lorem IPSUM blabla'; + $trigger = DescriptionEnds::makeFromStrings('lorem', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } diff --git a/tests/Unit/TransactionRules/Triggers/DescriptionIsTest.php b/tests/Unit/TransactionRules/Triggers/DescriptionIsTest.php index 12b4255e6c..0a8d24ba2c 100644 --- a/tests/Unit/TransactionRules/Triggers/DescriptionIsTest.php +++ b/tests/Unit/TransactionRules/Triggers/DescriptionIsTest.php @@ -50,16 +50,15 @@ class DescriptionIsTest extends TestCase /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::triggered */ - public function testTriggeredNot() + public function testTriggeredClose() { $journal = new TransactionJournal; - $journal->description = 'Lorem IPSUM blabla'; - $trigger = DescriptionIs::makeFromStrings('lorem', false); + $journal->description = 'Something is going to happen'; + $trigger = DescriptionIs::makeFromStrings('Something is going to happe', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } - /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::triggered */ @@ -75,11 +74,11 @@ class DescriptionIsTest extends TestCase /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::triggered */ - public function testTriggeredClose() + public function testTriggeredNot() { $journal = new TransactionJournal; - $journal->description = 'Something is going to happen'; - $trigger = DescriptionIs::makeFromStrings('Something is going to happe', false); + $journal->description = 'Lorem IPSUM blabla'; + $trigger = DescriptionIs::makeFromStrings('lorem', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } diff --git a/tests/Unit/TransactionRules/Triggers/DescriptionStartsTest.php b/tests/Unit/TransactionRules/Triggers/DescriptionStartsTest.php index aa0e3b3042..a2e5faba0e 100644 --- a/tests/Unit/TransactionRules/Triggers/DescriptionStartsTest.php +++ b/tests/Unit/TransactionRules/Triggers/DescriptionStartsTest.php @@ -50,16 +50,15 @@ class DescriptionStartsTest extends TestCase /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered */ - public function testTriggeredNot() + public function testTriggeredClose() { $journal = new TransactionJournal; - $journal->description = 'Lorem IPSUM blabla'; - $trigger = DescriptionStarts::makeFromStrings('blabla', false); + $journal->description = 'Something is going to happen'; + $trigger = DescriptionStarts::makeFromStrings('omething', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } - /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered */ @@ -75,11 +74,11 @@ class DescriptionStartsTest extends TestCase /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered */ - public function testTriggeredClose() + public function testTriggeredLongSearch() { $journal = new TransactionJournal; - $journal->description = 'Something is going to happen'; - $trigger = DescriptionStarts::makeFromStrings('omething', false); + $journal->description = 'Something'; + $trigger = DescriptionStarts::makeFromStrings('Something is', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } @@ -87,11 +86,11 @@ class DescriptionStartsTest extends TestCase /** * @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered */ - public function testTriggeredLongSearch() + public function testTriggeredNot() { $journal = new TransactionJournal; - $journal->description = 'Something'; - $trigger = DescriptionStarts::makeFromStrings('Something is', false); + $journal->description = 'Lorem IPSUM blabla'; + $trigger = DescriptionStarts::makeFromStrings('blabla', false); $result = $trigger->triggered($journal); $this->assertFalse($result); } diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php index 21b3317457..42f2228024 100644 --- a/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php +++ b/tests/Unit/TransactionRules/Triggers/FromAccountIsTest.php @@ -62,6 +62,16 @@ class FromAccountIsTest extends TestCase $this->assertFalse($result); } + /** + * @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::willMatchEverything + */ + public function testWillMatchEverythingEmpty() + { + $value = ''; + $result = FromAccountIs::willMatchEverything($value); + $this->assertTrue($result); + } + /** * @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::willMatchEverything */ @@ -82,15 +92,4 @@ class FromAccountIsTest extends TestCase $this->assertTrue($result); } - - /** - * @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::willMatchEverything - */ - public function testWillMatchEverythingEmpty() - { - $value = ''; - $result = FromAccountIs::willMatchEverything($value); - $this->assertTrue($result); - } - } diff --git a/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php b/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php index 68b49952da..d7bd8883a5 100644 --- a/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php +++ b/tests/Unit/TransactionRules/Triggers/FromAccountStartsTest.php @@ -44,7 +44,7 @@ class FromAccountStartsTest extends TestCase $transaction = $journal->transactions()->where('amount', '<', 0)->first(); $account = $transaction->account; - $trigger = FromAccountStarts::makeFromStrings(substr($account->name,0, -3), false); + $trigger = FromAccountStarts::makeFromStrings(substr($account->name, 0, -3), false); $result = $trigger->triggered($journal); $this->assertTrue($result); } diff --git a/tests/Unit/TransactionRules/Triggers/HasAnyTagTest.php b/tests/Unit/TransactionRules/Triggers/HasAnyTagTest.php index f9bfda041a..6226e386a7 100644 --- a/tests/Unit/TransactionRules/Triggers/HasAnyTagTest.php +++ b/tests/Unit/TransactionRules/Triggers/HasAnyTagTest.php @@ -39,8 +39,8 @@ class HasAnyTagTest extends TestCase */ public function testTriggered() { - $journal = TransactionJournal::find(25); - $tag = $journal->user->tags()->first(); + $journal = TransactionJournal::find(25); + $tag = $journal->user->tags()->first(); $journal->tags()->detach(); $journal->tags()->save($tag); diff --git a/tests/Unit/TransactionRules/Triggers/NotesAreTest.php b/tests/Unit/TransactionRules/Triggers/NotesAreTest.php index 1a32d55599..491d1f74d1 100644 --- a/tests/Unit/TransactionRules/Triggers/NotesAreTest.php +++ b/tests/Unit/TransactionRules/Triggers/NotesAreTest.php @@ -53,22 +53,6 @@ class NotesAreTest extends TestCase $this->assertTrue($result); } - /** - * @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered - */ - public function testTriggeredEmpty() - { - $journal = TransactionJournal::find(40); - $journal->notes()->delete(); - $note = new Note(); - $note->noteable()->associate($journal); - $note->text = ''; - $note->save(); - $trigger = NotesAre::makeFromStrings('', false); - $result = $trigger->triggered($journal); - $this->assertFalse($result); - } - /** * @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered */ @@ -85,6 +69,22 @@ class NotesAreTest extends TestCase $this->assertFalse($result); } + /** + * @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered + */ + public function testTriggeredEmpty() + { + $journal = TransactionJournal::find(40); + $journal->notes()->delete(); + $note = new Note(); + $note->noteable()->associate($journal); + $note->text = ''; + $note->save(); + $trigger = NotesAre::makeFromStrings('', false); + $result = $trigger->triggered($journal); + $this->assertFalse($result); + } + /** * @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered */ diff --git a/tests/Unit/TransactionRules/Triggers/NotesContainTest.php b/tests/Unit/TransactionRules/Triggers/NotesContainTest.php index 3e31ada8bd..7640d57ac2 100644 --- a/tests/Unit/TransactionRules/Triggers/NotesContainTest.php +++ b/tests/Unit/TransactionRules/Triggers/NotesContainTest.php @@ -53,38 +53,6 @@ class NotesContainTest extends TestCase $this->assertTrue($result); } - /** - * @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered - */ - public function testTriggeredEmpty() - { - $journal = TransactionJournal::find(44); - $journal->notes()->delete(); - $note = new Note(); - $note->noteable()->associate($journal); - $note->text = ''; - $note->save(); - $trigger = NotesContain::makeFromStrings('', false); - $result = $trigger->triggered($journal); - $this->assertFalse($result); - } - - /** - * @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered - */ - public function testTriggeredPartial() - { - $journal = TransactionJournal::find(45); - $journal->notes()->delete(); - $note = new Note(); - $note->noteable()->associate($journal); - $note->text = 'Some note'; - $note->save(); - $trigger = NotesContain::makeFromStrings('Some note contains', false); - $result = $trigger->triggered($journal); - $this->assertFalse($result); - } - /** * @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered */ @@ -101,6 +69,22 @@ class NotesContainTest extends TestCase $this->assertFalse($result); } + /** + * @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered + */ + public function testTriggeredEmpty() + { + $journal = TransactionJournal::find(44); + $journal->notes()->delete(); + $note = new Note(); + $note->noteable()->associate($journal); + $note->text = ''; + $note->save(); + $trigger = NotesContain::makeFromStrings('', false); + $result = $trigger->triggered($journal); + $this->assertFalse($result); + } + /** * @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered */ @@ -113,6 +97,22 @@ class NotesContainTest extends TestCase $this->assertFalse($result); } + /** + * @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered + */ + public function testTriggeredPartial() + { + $journal = TransactionJournal::find(45); + $journal->notes()->delete(); + $note = new Note(); + $note->noteable()->associate($journal); + $note->text = 'Some note'; + $note->save(); + $trigger = NotesContain::makeFromStrings('Some note contains', false); + $result = $trigger->triggered($journal); + $this->assertFalse($result); + } + /** * @covers \FireflyIII\TransactionRules\Triggers\NotesContain::willMatchEverything */ diff --git a/tests/Unit/TransactionRules/Triggers/TagIsTest.php b/tests/Unit/TransactionRules/Triggers/TagIsTest.php index 901aece556..b51116a06d 100644 --- a/tests/Unit/TransactionRules/Triggers/TagIsTest.php +++ b/tests/Unit/TransactionRules/Triggers/TagIsTest.php @@ -36,6 +36,20 @@ use Tests\TestCase; class TagIsTest extends TestCase { + /** + * @covers \FireflyIII\TransactionRules\Triggers\TagIs::triggered + */ + public function testNotTriggered() + { + $journal = TransactionJournal::find(58); + $journal->tags()->detach(); + $this->assertEquals(0, $journal->tags()->count()); + + $trigger = TagIs::makeFromStrings('SomeTag', false); + $result = $trigger->triggered($journal); + $this->assertFalse($result); + } + /** * @covers \FireflyIII\TransactionRules\Triggers\TagIs::triggered */ @@ -58,20 +72,6 @@ class TagIsTest extends TestCase $this->assertTrue($result); } - /** - * @covers \FireflyIII\TransactionRules\Triggers\TagIs::triggered - */ - public function testNotTriggered() - { - $journal = TransactionJournal::find(58); - $journal->tags()->detach(); - $this->assertEquals(0, $journal->tags()->count()); - - $trigger = TagIs::makeFromStrings('SomeTag', false); - $result = $trigger->triggered($journal); - $this->assertFalse($result); - } - /** * @covers \FireflyIII\TransactionRules\Triggers\TagIs::willMatchEverything */ diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php index 2d7473f2bd..1f7cc15e27 100644 --- a/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php +++ b/tests/Unit/TransactionRules/Triggers/ToAccountIsTest.php @@ -62,16 +62,6 @@ class ToAccountIsTest extends TestCase $this->assertFalse($result); } - /** - * @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::willMatchEverything - */ - public function testWillMatchEverythingNotNull() - { - $value = 'x'; - $result = ToAccountIs::willMatchEverything($value); - $this->assertFalse($result); - } - /** * @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::willMatchEverything */ @@ -82,6 +72,16 @@ class ToAccountIsTest extends TestCase $this->assertTrue($result); } + /** + * @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::willMatchEverything + */ + public function testWillMatchEverythingNotNull() + { + $value = 'x'; + $result = ToAccountIs::willMatchEverything($value); + $this->assertFalse($result); + } + /** * @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::willMatchEverything */ diff --git a/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php b/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php index d8108e026f..13816f3446 100644 --- a/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php +++ b/tests/Unit/TransactionRules/Triggers/ToAccountStartsTest.php @@ -44,7 +44,7 @@ class ToAccountStartsTest extends TestCase $transaction = $journal->transactions()->where('amount', '>', 0)->first(); $account = $transaction->account; - $trigger = ToAccountStarts::makeFromStrings(substr($account->name,0, -3), false); + $trigger = ToAccountStarts::makeFromStrings(substr($account->name, 0, -3), false); $result = $trigger->triggered($journal); $this->assertTrue($result); } From ffca858b8d7c23860644dc8af99d1a5f7ec6b98c Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 12:25:49 +0100 Subject: [PATCH 176/258] Code clean up. --- app/Console/Commands/CreateExport.php | 11 +- app/Console/Commands/CreateImport.php | 17 +-- app/Console/Commands/DecryptAttachment.php | 12 +- app/Console/Commands/EncryptFile.php | 6 +- app/Console/Commands/Import.php | 12 +- app/Console/Commands/ScanAttachments.php | 6 +- app/Console/Commands/UpgradeDatabase.php | 37 +++-- .../Commands/UpgradeFireflyInstructions.php | 22 ++- app/Console/Commands/UseEncryption.php | 6 +- app/Console/Commands/VerifiesAccessToken.php | 9 +- app/Console/Commands/VerifyDatabase.php | 31 ++-- app/Console/Kernel.php | 8 +- app/Events/AdminRequestedTestMessage.php | 7 +- app/Events/Event.php | 6 +- app/Events/RegisteredUser.php | 7 +- app/Events/RequestedNewPassword.php | 7 +- app/Events/StoredTransactionJournal.php | 6 +- app/Events/UpdatedTransactionJournal.php | 6 +- app/Events/UserChangedEmail.php | 11 +- app/Exceptions/FireflyException.php | 5 +- app/Exceptions/Handler.php | 11 +- app/Exceptions/NotImplementedException.php | 5 +- app/Exceptions/ValidationException.php | 5 +- app/Export/Collector/AttachmentCollector.php | 13 +- app/Export/Collector/BasicCollector.php | 7 +- app/Export/Collector/CollectorInterface.php | 8 +- app/Export/Collector/UploadCollector.php | 7 +- app/Export/Entry/Entry.php | 71 ++++------ app/Export/ExpandedProcessor.php | 25 ++-- app/Export/Exporter/BasicExporter.php | 7 +- app/Export/Exporter/CsvExporter.php | 10 +- app/Export/Exporter/ExporterInterface.php | 8 +- app/Export/ProcessorInterface.php | 6 +- .../Chart/Basic/ChartJsGenerator.php | 17 +-- .../Chart/Basic/GeneratorInterface.php | 12 +- .../Report/Audit/MonthReportGenerator.php | 16 +-- .../Report/Audit/MultiYearReportGenerator.php | 9 +- .../Report/Audit/YearReportGenerator.php | 10 +- .../Report/Budget/MonthReportGenerator.php | 13 +- .../Budget/MultiYearReportGenerator.php | 9 +- .../Report/Budget/YearReportGenerator.php | 10 +- .../Report/Category/MonthReportGenerator.php | 14 +- .../Category/MultiYearReportGenerator.php | 9 +- .../Report/Category/YearReportGenerator.php | 10 +- .../Report/ReportGeneratorFactory.php | 8 +- .../Report/ReportGeneratorInterface.php | 17 +-- .../Report/Standard/MonthReportGenerator.php | 11 +- .../Standard/MultiYearReportGenerator.php | 11 +- .../Report/Standard/YearReportGenerator.php | 11 +- app/Generator/Report/Support.php | 13 +- .../Report/Tag/MonthReportGenerator.php | 11 +- .../Report/Tag/MultiYearReportGenerator.php | 9 +- .../Report/Tag/YearReportGenerator.php | 10 +- app/Handlers/Events/AdminEventHandler.php | 5 +- .../Events/StoredJournalEventHandler.php | 15 +- .../Events/UpdatedJournalEventHandler.php | 5 +- app/Handlers/Events/UserEventHandler.php | 8 +- app/Helpers/Attachments/AttachmentHelper.php | 13 +- .../Attachments/AttachmentHelperInterface.php | 7 +- app/Helpers/Chart/MetaPieChart.php | 34 ++--- app/Helpers/Chart/MetaPieChartInterface.php | 21 ++- app/Helpers/Collection/Balance.php | 11 +- app/Helpers/Collection/BalanceEntry.php | 10 +- app/Helpers/Collection/BalanceHeader.php | 9 +- app/Helpers/Collection/BalanceLine.php | 21 ++- app/Helpers/Collection/Bill.php | 13 +- app/Helpers/Collection/BillLine.php | 23 ++- app/Helpers/Collection/Category.php | 10 +- app/Helpers/Collector/JournalCollector.php | 33 ++--- .../Collector/JournalCollectorInterface.php | 57 ++++---- app/Helpers/Filter/AmountFilter.php | 5 +- app/Helpers/Filter/EmptyFilter.php | 7 +- app/Helpers/Filter/FilterInterface.php | 1 - app/Helpers/Filter/InternalTransferFilter.php | 7 +- app/Helpers/Filter/NegativeAmountFilter.php | 5 +- app/Helpers/Filter/OpposingAccountFilter.php | 5 +- app/Helpers/Filter/PositiveAmountFilter.php | 7 +- app/Helpers/Filter/TransferFilter.php | 7 +- app/Helpers/FiscalHelper.php | 13 +- app/Helpers/FiscalHelperInterface.php | 6 +- app/Helpers/Help/Help.php | 10 +- app/Helpers/Help/HelpInterface.php | 6 +- app/Helpers/Report/BalanceReportHelper.php | 15 +- .../Report/BalanceReportHelperInterface.php | 5 +- app/Helpers/Report/BudgetReportHelper.php | 17 +-- .../Report/BudgetReportHelperInterface.php | 6 +- app/Helpers/Report/PopupReport.php | 14 +- app/Helpers/Report/PopupReportInterface.php | 6 +- app/Helpers/Report/ReportHelper.php | 10 +- app/Helpers/Report/ReportHelperInterface.php | 8 +- .../Account/ReconcileController.php | 16 +-- app/Http/Controllers/AccountController.php | 47 +++--- .../Admin/ConfigurationController.php | 6 +- app/Http/Controllers/Admin/HomeController.php | 5 +- app/Http/Controllers/Admin/LinkController.php | 13 +- app/Http/Controllers/Admin/UserController.php | 16 +-- app/Http/Controllers/AttachmentController.php | 16 +-- .../Auth/ForgotPasswordController.php | 3 - app/Http/Controllers/Auth/LoginController.php | 7 +- .../Controllers/Auth/RegisterController.php | 14 +- .../Auth/ResetPasswordController.php | 3 - .../Controllers/Auth/TwoFactorController.php | 15 +- app/Http/Controllers/BillController.php | 20 +-- app/Http/Controllers/BudgetController.php | 38 +++-- app/Http/Controllers/CategoryController.php | 42 +++--- .../Controllers/Chart/AccountController.php | 16 +-- app/Http/Controllers/Chart/BillController.php | 14 +- .../Controllers/Chart/BudgetController.php | 40 +++--- .../Chart/BudgetReportController.php | 10 +- .../Controllers/Chart/CategoryController.php | 12 +- .../Chart/CategoryReportController.php | 21 +-- .../Controllers/Chart/PiggyBankController.php | 6 +- .../Controllers/Chart/ReportController.php | 24 +--- .../Controllers/Chart/TagReportController.php | 15 +- app/Http/Controllers/Controller.php | 18 +-- app/Http/Controllers/CurrencyController.php | 21 +-- app/Http/Controllers/ExportController.php | 34 ++--- app/Http/Controllers/HelpController.php | 12 +- app/Http/Controllers/HomeController.php | 15 +- .../Controllers/Import/BankController.php | 4 +- .../Controllers/Import/FileController.php | 22 ++- app/Http/Controllers/ImportController.php | 7 +- app/Http/Controllers/JavascriptController.php | 14 +- .../Json/AutoCompleteController.php | 10 +- app/Http/Controllers/Json/BoxController.php | 8 +- .../Controllers/Json/ExchangeController.php | 9 +- .../Controllers/Json/FrontpageController.php | 8 +- app/Http/Controllers/Json/IntroController.php | 13 +- .../Json/TransactionController.php | 5 +- app/Http/Controllers/JsonController.php | 9 +- app/Http/Controllers/NewUserController.php | 9 +- app/Http/Controllers/PiggyBankController.php | 44 ++---- .../Controllers/Popup/ReportController.php | 33 +++-- .../Controllers/PreferencesController.php | 22 +-- app/Http/Controllers/ProfileController.php | 20 ++- .../Controllers/Report/AccountController.php | 6 +- .../Controllers/Report/BalanceController.php | 8 +- .../Controllers/Report/BudgetController.php | 14 +- .../Controllers/Report/CategoryController.php | 14 +- .../Report/OperationsController.php | 6 +- app/Http/Controllers/ReportController.php | 15 +- app/Http/Controllers/RuleController.php | 44 +++--- app/Http/Controllers/RuleGroupController.php | 19 +-- app/Http/Controllers/SearchController.php | 5 +- app/Http/Controllers/TagController.php | 36 +++-- .../Transaction/ConvertController.php | 15 +- .../Transaction/LinkController.php | 14 +- .../Transaction/MassController.php | 23 ++- .../Transaction/SingleController.php | 50 ++++--- .../Transaction/SplitController.php | 29 ++-- .../Controllers/TransactionController.php | 20 +-- app/Http/Kernel.php | 5 - app/Http/Middleware/Authenticate.php | 15 +- app/Http/Middleware/AuthenticateTwoFactor.php | 18 +-- app/Http/Middleware/Binder.php | 9 +- app/Http/Middleware/EncryptCookies.php | 3 - app/Http/Middleware/IsAdmin.php | 11 +- app/Http/Middleware/IsLimitedUser.php | 13 +- app/Http/Middleware/Range.php | 20 +-- .../Middleware/RedirectIfAuthenticated.php | 8 +- .../RedirectIfTwoFactorAuthenticated.php | 15 +- app/Http/Middleware/Sandstorm.php | 22 ++- app/Http/Middleware/StartFireflySession.php | 17 +-- app/Http/Middleware/TrimStrings.php | 2 - app/Http/Middleware/TrustProxies.php | 4 +- app/Http/Middleware/VerifyCsrfToken.php | 3 - app/Http/Requests/AccountFormRequest.php | 8 +- app/Http/Requests/AttachmentFormRequest.php | 6 +- app/Http/Requests/BillFormRequest.php | 6 +- app/Http/Requests/BudgetFormRequest.php | 8 +- app/Http/Requests/BudgetIncomeRequest.php | 6 +- app/Http/Requests/CategoryFormRequest.php | 8 +- app/Http/Requests/ConfigurationRequest.php | 6 +- app/Http/Requests/CurrencyFormRequest.php | 6 +- .../Requests/DeleteAccountFormRequest.php | 6 +- app/Http/Requests/EmailFormRequest.php | 6 +- app/Http/Requests/ExportFormRequest.php | 6 +- app/Http/Requests/ImportUploadRequest.php | 6 +- app/Http/Requests/JournalFormRequest.php | 10 +- app/Http/Requests/JournalLinkRequest.php | 8 +- app/Http/Requests/LinkTypeFormRequest.php | 8 +- .../Requests/MassDeleteJournalRequest.php | 6 +- app/Http/Requests/MassEditJournalRequest.php | 6 +- app/Http/Requests/NewUserFormRequest.php | 6 +- app/Http/Requests/PiggyBankFormRequest.php | 8 +- app/Http/Requests/ProfileFormRequest.php | 6 +- app/Http/Requests/ReportFormRequest.php | 20 ++- app/Http/Requests/Request.php | 7 +- app/Http/Requests/RuleFormRequest.php | 10 +- app/Http/Requests/RuleGroupFormRequest.php | 8 +- .../Requests/SelectTransactionsRequest.php | 6 +- app/Http/Requests/SplitJournalFormRequest.php | 5 +- app/Http/Requests/TagFormRequest.php | 10 +- app/Http/Requests/TestRuleFormRequest.php | 6 +- app/Http/Requests/TokenFormRequest.php | 6 +- app/Http/Requests/UserFormRequest.php | 8 +- app/Http/Requests/UserRegistrationRequest.php | 7 +- app/Http/breadcrumbs.php | 134 ++++++------------ .../Configurator/ConfiguratorInterface.php | 7 +- app/Import/Configurator/CsvConfigurator.php | 21 +-- app/Import/Converter/Amount.php | 24 ++-- app/Import/Converter/ConverterInterface.php | 6 +- app/Import/Converter/INGDebetCredit.php | 8 +- app/Import/Converter/RabobankDebetCredit.php | 8 +- app/Import/FileProcessor/CsvProcessor.php | 17 +-- .../FileProcessor/FileProcessorInterface.php | 9 +- app/Import/Logging/CommandHandler.php | 14 +- app/Import/Mapper/AssetAccountIbans.php | 8 +- app/Import/Mapper/AssetAccounts.php | 6 +- app/Import/Mapper/Bills.php | 6 +- app/Import/Mapper/Budgets.php | 6 +- app/Import/Mapper/Categories.php | 6 +- app/Import/Mapper/MapperInterface.php | 6 +- app/Import/Mapper/OpposingAccountIbans.php | 9 +- app/Import/Mapper/OpposingAccounts.php | 6 +- app/Import/Mapper/Tags.php | 6 +- app/Import/Mapper/TransactionCurrencies.php | 6 +- .../PreProcessorInterface.php | 5 +- app/Import/MapperPreProcess/TagsComma.php | 6 +- app/Import/MapperPreProcess/TagsSpace.php | 5 +- app/Import/Object/ImportAccount.php | 47 +++--- app/Import/Object/ImportBill.php | 34 ++--- app/Import/Object/ImportBudget.php | 32 ++--- app/Import/Object/ImportCategory.php | 27 ++-- app/Import/Object/ImportCurrency.php | 29 ++-- app/Import/Object/ImportJournal.php | 24 ++-- app/Import/Routine/ImportRoutine.php | 15 +- app/Import/Specifics/AbnAmroDescription.php | 24 ++-- app/Import/Specifics/IngDescription.php | 15 +- app/Import/Specifics/PresidentsChoice.php | 8 +- app/Import/Specifics/RabobankDescription.php | 5 +- app/Import/Specifics/SnsDescription.php | 7 +- app/Import/Specifics/SpecificInterface.php | 5 +- app/Import/Storage/ImportStorage.php | 38 +++-- app/Import/Storage/ImportSupport.php | 44 +++--- ...ExecuteRuleGroupOnExistingTransactions.php | 21 +-- .../ExecuteRuleOnExistingTransactions.php | 25 ++-- app/Jobs/Job.php | 5 +- app/Jobs/MailError.php | 18 +-- app/Mail/AdminTestMail.php | 9 +- app/Mail/ConfirmEmailChangeMail.php | 9 +- app/Mail/RegisteredUser.php | 6 +- app/Mail/RequestedNewPassword.php | 6 +- app/Mail/UndoEmailChangeMail.php | 9 +- app/Models/Account.php | 46 +++--- app/Models/AccountMeta.php | 8 +- app/Models/AccountType.php | 6 +- app/Models/Attachment.php | 19 +-- app/Models/AvailableBudget.php | 5 +- app/Models/Bill.php | 13 +- app/Models/Budget.php | 10 +- app/Models/BudgetLimit.php | 7 +- app/Models/Category.php | 11 +- app/Models/Configuration.php | 5 +- app/Models/CurrencyExchangeRate.php | 6 +- app/Models/ExportJob.php | 8 +- app/Models/ImportJob.php | 15 +- app/Models/LimitRepetition.php | 9 +- app/Models/LinkType.php | 6 +- app/Models/Note.php | 7 +- app/Models/PiggyBank.php | 22 ++- app/Models/PiggyBankEvent.php | 6 +- app/Models/PiggyBankRepetition.php | 6 +- app/Models/Preference.php | 9 +- app/Models/Role.php | 6 +- app/Models/Rule.php | 7 +- app/Models/RuleAction.php | 5 +- app/Models/RuleGroup.php | 7 +- app/Models/RuleTrigger.php | 5 +- app/Models/Tag.php | 23 +-- app/Models/Transaction.php | 91 +++++------- app/Models/TransactionCurrency.php | 7 +- app/Models/TransactionJournal.php | 49 +++---- app/Models/TransactionJournalLink.php | 13 +- app/Models/TransactionJournalMeta.php | 6 +- app/Models/TransactionType.php | 17 +-- app/Providers/AccountServiceProvider.php | 11 +- app/Providers/AdminServiceProvider.php | 5 - app/Providers/AppServiceProvider.php | 9 +- app/Providers/AttachmentServiceProvider.php | 11 +- app/Providers/AuthServiceProvider.php | 6 - app/Providers/BillServiceProvider.php | 11 +- app/Providers/BroadcastServiceProvider.php | 4 - app/Providers/BudgetServiceProvider.php | 11 +- app/Providers/CategoryServiceProvider.php | 11 +- app/Providers/CurrencyServiceProvider.php | 11 +- app/Providers/EventServiceProvider.php | 44 +++--- app/Providers/ExportJobServiceProvider.php | 10 +- app/Providers/FireflyServiceProvider.php | 5 +- app/Providers/FireflySessionProvider.php | 7 - app/Providers/JournalServiceProvider.php | 12 +- app/Providers/LogServiceProvider.php | 13 +- app/Providers/PiggyBankServiceProvider.php | 11 +- app/Providers/RouteServiceProvider.php | 14 -- app/Providers/RuleGroupServiceProvider.php | 11 +- app/Providers/RuleServiceProvider.php | 11 +- app/Providers/SearchServiceProvider.php | 11 +- app/Providers/SessionServiceProvider.php | 7 +- app/Providers/TagServiceProvider.php | 11 +- .../Account/AccountRepository.php | 53 +++---- .../Account/AccountRepositoryInterface.php | 6 +- app/Repositories/Account/AccountTasker.php | 12 +- .../Account/AccountTaskerInterface.php | 5 +- .../Account/FindAccountsTrait.php | 5 +- .../Attachment/AttachmentRepository.php | 9 +- .../AttachmentRepositoryInterface.php | 6 +- app/Repositories/Bill/BillRepository.php | 35 ++--- .../Bill/BillRepositoryInterface.php | 5 +- app/Repositories/Budget/BudgetRepository.php | 29 ++-- .../Budget/BudgetRepositoryInterface.php | 8 +- .../Category/CategoryRepository.php | 42 +++--- .../Category/CategoryRepositoryInterface.php | 9 +- .../Currency/CurrencyRepository.php | 27 ++-- .../Currency/CurrencyRepositoryInterface.php | 13 +- .../ExportJob/ExportJobRepository.php | 11 +- .../ExportJobRepositoryInterface.php | 5 +- .../ImportJob/ImportJobRepository.php | 15 +- .../ImportJobRepositoryInterface.php | 5 +- .../Journal/CreateJournalsTrait.php | 28 ++-- .../Journal/JournalRepository.php | 32 ++--- .../Journal/JournalRepositoryInterface.php | 10 +- app/Repositories/Journal/JournalTasker.php | 21 +-- .../Journal/JournalTaskerInterface.php | 5 +- .../Journal/SupportJournalsTrait.php | 16 +-- .../Journal/UpdateJournalsTrait.php | 19 +-- .../LinkType/LinkTypeRepository.php | 11 +- .../LinkType/LinkTypeRepositoryInterface.php | 5 +- .../PiggyBank/PiggyBankRepository.php | 23 ++- .../PiggyBankRepositoryInterface.php | 5 +- app/Repositories/Rule/RuleRepository.php | 33 ++--- .../Rule/RuleRepositoryInterface.php | 6 +- .../RuleGroup/RuleGroupRepository.php | 18 +-- .../RuleGroupRepositoryInterface.php | 8 +- app/Repositories/Tag/TagRepository.php | 56 +++----- .../Tag/TagRepositoryInterface.php | 6 +- app/Repositories/User/UserRepository.php | 12 +- .../User/UserRepositoryInterface.php | 6 +- app/Services/Bunq/Id/BunqId.php | 5 +- app/Services/Bunq/Id/DeviceServerId.php | 5 +- app/Services/Bunq/Id/DeviceSessionId.php | 5 +- app/Services/Bunq/Id/InstallationId.php | 5 +- app/Services/Bunq/Object/Alias.php | 5 +- app/Services/Bunq/Object/Amount.php | 5 +- app/Services/Bunq/Object/Avatar.php | 5 +- app/Services/Bunq/Object/BunqObject.php | 5 +- app/Services/Bunq/Object/DeviceServer.php | 13 +- .../Bunq/Object/MonetaryAccountBank.php | 19 ++- .../Bunq/Object/MonetaryAccountProfile.php | 7 +- .../Bunq/Object/MonetaryAccountSetting.php | 5 +- .../Bunq/Object/NotificationFilter.php | 5 +- app/Services/Bunq/Object/ServerPublicKey.php | 5 +- app/Services/Bunq/Object/UserCompany.php | 7 +- app/Services/Bunq/Object/UserLight.php | 7 +- app/Services/Bunq/Object/UserPerson.php | 7 +- app/Services/Bunq/Request/BunqRequest.php | 42 +++--- .../Request/DeleteDeviceSessionRequest.php | 7 +- .../Bunq/Request/DeviceServerRequest.php | 9 +- .../Bunq/Request/DeviceSessionRequest.php | 18 +-- .../Bunq/Request/InstallationTokenRequest.php | 9 +- .../Bunq/Request/ListDeviceServerRequest.php | 7 +- .../Request/ListMonetaryAccountRequest.php | 9 +- app/Services/Bunq/Request/ListUserRequest.php | 14 +- app/Services/Bunq/Token/BunqToken.php | 9 +- app/Services/Bunq/Token/InstallationToken.php | 5 +- app/Services/Bunq/Token/SessionToken.php | 5 +- .../Currency/ExchangeRateInterface.php | 1 - app/Services/Currency/FixerIO.php | 13 +- app/Services/Password/PwndVerifier.php | 8 +- app/Services/Password/Verifier.php | 5 +- app/Support/Amount.php | 19 ++- app/Support/Binder/AccountList.php | 6 +- app/Support/Binder/BinderInterface.php | 5 +- app/Support/Binder/BudgetList.php | 6 +- app/Support/Binder/CategoryList.php | 6 +- app/Support/Binder/CurrencyCode.php | 8 +- app/Support/Binder/Date.php | 8 +- app/Support/Binder/JournalList.php | 8 +- app/Support/Binder/TagList.php | 6 +- app/Support/Binder/UnfinishedJournal.php | 7 +- app/Support/CacheProperties.php | 11 +- app/Support/ChartColour.php | 5 +- app/Support/Domain.php | 5 +- app/Support/Events/BillScanner.php | 5 +- app/Support/ExpandedForm.php | 37 ++--- app/Support/Facades/Amount.php | 5 +- app/Support/Facades/ExpandedForm.php | 5 +- app/Support/Facades/FireflyConfig.php | 5 +- app/Support/Facades/Navigation.php | 5 +- app/Support/Facades/Preferences.php | 5 +- app/Support/Facades/Steam.php | 5 +- app/Support/FireflyConfig.php | 10 +- .../Configuration/ConfigurationInterface.php | 5 +- .../Import/Configuration/Csv/Initial.php | 14 +- app/Support/Import/Configuration/Csv/Map.php | 24 ++-- .../Import/Configuration/Csv/Roles.php | 37 +++-- .../Import/Information/BunqInformation.php | 11 +- .../Information/InformationInterface.php | 6 +- .../Prerequisites/BunqPrerequisites.php | 23 ++- .../Prerequisites/PrerequisitesInterface.php | 1 - .../Models/TransactionJournalTrait.php | 24 ++-- app/Support/Navigation.php | 33 ++--- app/Support/Preferences.php | 22 ++- app/Support/Search/Modifier.php | 12 +- app/Support/Search/Search.php | 25 ++-- app/Support/Search/SearchInterface.php | 6 +- app/Support/SingleCacheProperties.php | 5 +- app/Support/Steam.php | 32 ++--- app/Support/Twig/AmountFormat.php | 20 +-- app/Support/Twig/Extension/Transaction.php | 44 +++--- .../Twig/Extension/TransactionJournal.php | 6 +- app/Support/Twig/General.php | 22 +-- app/Support/Twig/Journal.php | 14 +- .../Twig/Loader/TransactionJournalLoader.php | 6 +- app/Support/Twig/Loader/TransactionLoader.php | 6 +- app/Support/Twig/PiggyBank.php | 7 +- app/Support/Twig/Rule.php | 9 +- app/Support/Twig/Transaction.php | 5 +- app/Support/Twig/Translation.php | 13 +- .../Actions/ActionInterface.php | 5 +- app/TransactionRules/Actions/AddTag.php | 9 +- .../Actions/AppendDescription.php | 6 +- app/TransactionRules/Actions/AppendNotes.php | 8 +- app/TransactionRules/Actions/ClearBudget.php | 6 +- .../Actions/ClearCategory.php | 6 +- app/TransactionRules/Actions/ClearNotes.php | 6 +- .../Actions/PrependDescription.php | 7 +- app/TransactionRules/Actions/PrependNotes.php | 8 +- .../Actions/RemoveAllTags.php | 6 +- app/TransactionRules/Actions/RemoveTag.php | 8 +- app/TransactionRules/Actions/SetBudget.php | 11 +- app/TransactionRules/Actions/SetCategory.php | 6 +- .../Actions/SetDescription.php | 6 +- .../Actions/SetDestinationAccount.php | 18 +-- app/TransactionRules/Actions/SetNotes.php | 8 +- .../Actions/SetSourceAccount.php | 18 +-- .../Factory/ActionFactory.php | 10 +- .../Factory/TriggerFactory.php | 10 +- app/TransactionRules/Processor.php | 28 ++-- app/TransactionRules/TransactionMatcher.php | 25 ++-- .../Triggers/AbstractTrigger.php | 13 +- .../Triggers/AmountExactly.php | 10 +- app/TransactionRules/Triggers/AmountLess.php | 8 +- app/TransactionRules/Triggers/AmountMore.php | 14 +- app/TransactionRules/Triggers/BudgetIs.php | 14 +- app/TransactionRules/Triggers/CategoryIs.php | 14 +- .../Triggers/DescriptionContains.php | 14 +- .../Triggers/DescriptionEnds.php | 12 +- .../Triggers/DescriptionIs.php | 8 +- .../Triggers/DescriptionStarts.php | 12 +- .../Triggers/FromAccountContains.php | 14 +- .../Triggers/FromAccountEnds.php | 13 +- .../Triggers/FromAccountIs.php | 12 +- .../Triggers/FromAccountStarts.php | 12 +- .../Triggers/HasAnyBudget.php | 6 +- .../Triggers/HasAnyCategory.php | 6 +- app/TransactionRules/Triggers/HasAnyTag.php | 6 +- .../Triggers/HasAttachment.php | 2 - app/TransactionRules/Triggers/HasNoBudget.php | 8 +- .../Triggers/HasNoCategory.php | 8 +- app/TransactionRules/Triggers/HasNoTag.php | 8 +- app/TransactionRules/Triggers/NotesAny.php | 8 +- app/TransactionRules/Triggers/NotesAre.php | 10 +- .../Triggers/NotesContain.php | 19 +-- app/TransactionRules/Triggers/NotesEmpty.php | 10 +- app/TransactionRules/Triggers/NotesEnd.php | 14 +- app/TransactionRules/Triggers/NotesStart.php | 14 +- app/TransactionRules/Triggers/TagIs.php | 8 +- .../Triggers/ToAccountContains.php | 14 +- .../Triggers/ToAccountEnds.php | 13 +- app/TransactionRules/Triggers/ToAccountIs.php | 12 +- .../Triggers/ToAccountStarts.php | 13 +- .../Triggers/TransactionType.php | 10 +- .../Triggers/TriggerInterface.php | 6 +- app/TransactionRules/Triggers/UserAction.php | 6 +- app/User.php | 10 +- app/Validation/FireflyValidator.php | 54 ++++--- 476 files changed, 2055 insertions(+), 4181 deletions(-) diff --git a/app/Console/Commands/CreateExport.php b/app/Console/Commands/CreateExport.php index c991d086cd..0d55833af7 100644 --- a/app/Console/Commands/CreateExport.php +++ b/app/Console/Commands/CreateExport.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Console\Commands; use Carbon\Carbon; @@ -35,11 +33,9 @@ use Illuminate\Console\Command; use Storage; /** - * Class CreateExport + * Class CreateExport. * * Generates export from the command line. - * - * @package FireflyIII\Console\Commands */ class CreateExport extends Command { @@ -65,7 +61,6 @@ class CreateExport extends Command /** * Create a new command instance. - * */ public function __construct() { @@ -73,7 +68,6 @@ class CreateExport extends Command } /** - * * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine. * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @@ -108,7 +102,7 @@ class CreateExport extends Command // first date $firstJournal = $journalRepository->first(); $first = new Carbon; - if (!is_null($firstJournal->id)) { + if (null !== $firstJournal->id) { $first = $firstJournal->date; } @@ -124,7 +118,6 @@ class CreateExport extends Command 'job' => $job, ]; - /** @var ProcessorInterface $processor */ $processor = app(ProcessorInterface::class); $processor->setSettings($settings); diff --git a/app/Console/Commands/CreateImport.php b/app/Console/Commands/CreateImport.php index d0cc7136dc..69b034ac7d 100644 --- a/app/Console/Commands/CreateImport.php +++ b/app/Console/Commands/CreateImport.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -35,9 +34,7 @@ use Monolog\Formatter\LineFormatter; use Preferences; /** - * Class CreateImport - * - * @package FireflyIII\Console\Commands + * Class CreateImport. */ class CreateImport extends Command { @@ -65,7 +62,6 @@ class CreateImport extends Command /** * Create a new command instance. - * */ public function __construct() { @@ -98,7 +94,7 @@ class CreateImport extends Command } $configurationData = json_decode(file_get_contents($configuration)); - if (is_null($configurationData)) { + if (null === $configurationData) { $this->error(sprintf('Firefly III cannot read the contents of configuration file "%s" (working directory: "%s").', $configuration, $cwd)); return; @@ -109,25 +105,21 @@ class CreateImport extends Command $this->line(sprintf('Import into user: #%d (%s)', $user->id, $user->email)); $this->line(sprintf('Type of import: %s', $type)); - /** @var ImportJobRepositoryInterface $jobRepository */ $jobRepository = app(ImportJobRepositoryInterface::class); $jobRepository->setUser($user); $job = $jobRepository->create($type); $this->line(sprintf('Created job "%s"', $job->key)); - Artisan::call('firefly:encrypt-file', ['file' => $file, 'key' => $job->key]); $this->line('Stored import data...'); - $job->configuration = $configurationData; $job->status = 'configured'; $job->save(); $this->line('Stored configuration...'); - - if ($this->option('start') === true) { + if (true === $this->option('start')) { $this->line('The import will start in a moment. This process is not visible...'); Log::debug('Go for import!'); @@ -138,7 +130,6 @@ class CreateImport extends Command $handler->setFormatter($formatter); $monolog->pushHandler($handler); - // start the actual routine: /** @var ImportRoutine $routine */ $routine = app(ImportRoutine::class); @@ -177,7 +168,7 @@ class CreateImport extends Command $cwd = getcwd(); $validTypes = array_keys(config('firefly.import_formats')); $type = strtolower($this->option('type')); - if (is_null($user->id)) { + if (null === $user->id) { $this->error(sprintf('There is no user with ID %d.', $this->option('user'))); return false; diff --git a/app/Console/Commands/DecryptAttachment.php b/app/Console/Commands/DecryptAttachment.php index 226c66c9fd..e574a9cd00 100644 --- a/app/Console/Commands/DecryptAttachment.php +++ b/app/Console/Commands/DecryptAttachment.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -28,9 +27,7 @@ use Illuminate\Console\Command; use Log; /** - * Class DecryptAttachment - * - * @package FireflyIII\Console\Commands + * Class DecryptAttachment. */ class DecryptAttachment extends Command { @@ -50,10 +47,8 @@ class DecryptAttachment extends Command = 'firefly:decrypt-attachment {id:The ID of the attachment.} {name:The file name of the attachment.} {directory:Where the file must be stored.}'; - /** * Create a new command instance. - * */ public function __construct() { @@ -65,7 +60,6 @@ class DecryptAttachment extends Command * * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine. * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - * */ public function handle() { @@ -75,7 +69,7 @@ class DecryptAttachment extends Command $attachment = $repository->findWithoutUser($attachmentId); $attachmentName = trim($this->argument('name')); $storagePath = realpath(trim($this->argument('directory'))); - if (is_null($attachment->id)) { + if (null === $attachment->id) { $this->error(sprintf('No attachment with id #%d', $attachmentId)); Log::error(sprintf('DecryptAttachment: No attachment with id #%d', $attachmentId)); @@ -107,7 +101,7 @@ class DecryptAttachment extends Command $content = $repository->getContent($attachment); $this->line(sprintf('Going to write content for attachment #%d into file "%s"', $attachment->id, $fullPath)); $result = file_put_contents($fullPath, $content); - if ($result === false) { + if (false === $result) { $this->error('Could not write to file.'); return; diff --git a/app/Console/Commands/EncryptFile.php b/app/Console/Commands/EncryptFile.php index acd355060c..a90d9e819b 100644 --- a/app/Console/Commands/EncryptFile.php +++ b/app/Console/Commands/EncryptFile.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -27,9 +26,7 @@ use Crypt; use Illuminate\Console\Command; /** - * Class EncryptFile - * - * @package FireflyIII\Console\Commands + * Class EncryptFile. */ class EncryptFile extends Command { @@ -49,7 +46,6 @@ class EncryptFile extends Command /** * Create a new command instance. - * */ public function __construct() { diff --git a/app/Console/Commands/Import.php b/app/Console/Commands/Import.php index 0e1f861a55..d4208dea70 100644 --- a/app/Console/Commands/Import.php +++ b/app/Console/Commands/Import.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -31,9 +30,7 @@ use Illuminate\Support\MessageBag; use Log; /** - * Class Import - * - * @package FireflyIII\Console\Commands + * Class Import. */ class Import extends Command { @@ -53,7 +50,6 @@ class Import extends Command /** * Create a new command instance. - * */ public function __construct() { @@ -68,7 +64,7 @@ class Import extends Command Log::debug('Start start-import command'); $jobKey = $this->argument('key'); $job = ImportJob::where('key', $jobKey)->first(); - if (is_null($job)) { + if (null === $job) { $this->error(sprintf('No job found with key "%s"', $jobKey)); return; @@ -109,14 +105,14 @@ class Import extends Command */ private function isValid(ImportJob $job): bool { - if (is_null($job)) { + if (null === $job) { Log::error('This job does not seem to exist.'); $this->error('This job does not seem to exist.'); return false; } - if ($job->status !== 'configured') { + if ('configured' !== $job->status) { Log::error(sprintf('This job is not ready to be imported (status is %s).', $job->status)); $this->error('This job is not ready to be imported.'); diff --git a/app/Console/Commands/ScanAttachments.php b/app/Console/Commands/ScanAttachments.php index e6dd31b0e0..53d84e9663 100644 --- a/app/Console/Commands/ScanAttachments.php +++ b/app/Console/Commands/ScanAttachments.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -31,9 +30,7 @@ use Illuminate\Contracts\Filesystem\FileNotFoundException; use Storage; /** - * Class ScanAttachments - * - * @package FireflyIII\Console\Commands + * Class ScanAttachments. */ class ScanAttachments extends Command { @@ -53,7 +50,6 @@ class ScanAttachments extends Command /** * Create a new command instance. - * */ public function __construct() { diff --git a/app/Console/Commands/UpgradeDatabase.php b/app/Console/Commands/UpgradeDatabase.php index 5a97b618f6..c50664836d 100644 --- a/app/Console/Commands/UpgradeDatabase.php +++ b/app/Console/Commands/UpgradeDatabase.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -44,17 +43,15 @@ use Preferences; use Schema; /** - * Class UpgradeDatabase + * Class UpgradeDatabase. * * Upgrade user database. * * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // it just touches a lot of things. - * @package FireflyIII\Console\Commands */ class UpgradeDatabase extends Command { - /** * The console command description. * @@ -105,7 +102,7 @@ class UpgradeDatabase extends Command foreach ($set as $budgetLimit) { /** @var LimitRepetition $repetition */ $repetition = $budgetLimit->limitrepetitions()->first(); - if (!is_null($repetition)) { + if (null !== $repetition) { $budgetLimit->end_date = $repetition->enddate; $budgetLimit->save(); $this->line(sprintf('Updated budget limit #%d', $budgetLimit->id)); @@ -170,7 +167,7 @@ class UpgradeDatabase extends Command $obCurrency = intval($openingBalance->transaction_currency_id); // both 0? set to default currency: - if ($accountCurrency === 0 && $obCurrency === 0) { + if (0 === $accountCurrency && 0 === $obCurrency) { AccountMeta::create(['account_id' => $account->id, 'name' => 'currency_id', 'data' => $defaultCurrency->id]); $this->line(sprintf('Account #%d ("%s") now has a currency setting (%s).', $account->id, $account->name, $defaultCurrencyCode)); @@ -178,7 +175,7 @@ class UpgradeDatabase extends Command } // account is set to 0, opening balance is not? - if ($accountCurrency === 0 && $obCurrency > 0) { + if (0 === $accountCurrency && $obCurrency > 0) { AccountMeta::create(['account_id' => $account->id, 'name' => 'currency_id', 'data' => $obCurrency]); $this->line(sprintf('Account #%d ("%s") now has a currency setting (%s).', $account->id, $account->name, $defaultCurrencyCode)); @@ -228,7 +225,7 @@ class UpgradeDatabase extends Command ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->first(['transactions.*']); - if (is_null($transaction)) { + if (null === $transaction) { return; } /** @var Account $account */ @@ -237,7 +234,7 @@ class UpgradeDatabase extends Command $transactions = $journal->transactions()->get(); $transactions->each( function (Transaction $transaction) use ($currency) { - if (is_null($transaction->transaction_currency_id)) { + if (null === $transaction->transaction_currency_id) { $transaction->transaction_currency_id = $currency->id; $transaction->save(); } @@ -302,7 +299,7 @@ class UpgradeDatabase extends Command foreach ($set as $meta) { $journal = $meta->transactionJournal; $note = $journal->notes()->first(); - if (is_null($note)) { + if (null === $note) { $note = new Note; $note->noteable()->associate($journal); } @@ -314,7 +311,6 @@ class UpgradeDatabase extends Command } } - /** * This method makes sure that the transaction journal uses the currency given in the transaction. * @@ -375,7 +371,7 @@ class UpgradeDatabase extends Command return; } - if (!is_null($opposing)) { + if (null !== $opposing) { // give both a new identifier: $transaction->identifier = $identifier; $opposing->identifier = $identifier; @@ -384,7 +380,7 @@ class UpgradeDatabase extends Command $processed[] = $transaction->id; $processed[] = $opposing->id; } - $identifier++; + ++$identifier; } return; @@ -411,7 +407,7 @@ class UpgradeDatabase extends Command $currency = $repository->find(intval($transaction->account->getMeta('currency_id'))); // has no currency ID? Must have, so fill in using account preference: - if (is_null($transaction->transaction_currency_id)) { + if (null === $transaction->transaction_currency_id) { $transaction->transaction_currency_id = $currency->id; Log::debug(sprintf('Transaction #%d has no currency setting, now set to %s', $transaction->id, $currency->code)); $transaction->save(); @@ -419,7 +415,7 @@ class UpgradeDatabase extends Command // does not match the source account (see above)? Can be fixed // when mismatch in transaction and NO foreign amount is set: - if ($transaction->transaction_currency_id !== $currency->id && is_null($transaction->foreign_amount)) { + if ($transaction->transaction_currency_id !== $currency->id && null === $transaction->foreign_amount) { Log::debug( sprintf( 'Transaction #%d has a currency setting (#%d) that should be #%d. Amount remains %s, currency is changed.', @@ -440,7 +436,7 @@ class UpgradeDatabase extends Command $opposing = $journal->transactions()->where('amount', '>', 0)->where('identifier', $transaction->identifier)->first(); $opposingCurrency = $repository->find(intval($opposing->account->getMeta('currency_id'))); - if (is_null($opposingCurrency->id)) { + if (null === $opposingCurrency->id) { Log::error(sprintf('Account #%d ("%s") must have currency preference but has none.', $opposing->account->id, $opposing->account->name)); return; @@ -470,23 +466,23 @@ class UpgradeDatabase extends Command } // if foreign amount of one is null and the other is not, use this to restore: - if (is_null($transaction->foreign_amount) && !is_null($opposing->foreign_amount)) { + if (null === $transaction->foreign_amount && null !== $opposing->foreign_amount) { $transaction->foreign_amount = bcmul(strval($opposing->foreign_amount), '-1'); $transaction->save(); Log::debug(sprintf('Restored foreign amount of transaction (1) #%d to %s', $transaction->id, $transaction->foreign_amount)); } // if foreign amount of one is null and the other is not, use this to restore (other way around) - if (is_null($opposing->foreign_amount) && !is_null($transaction->foreign_amount)) { + if (null === $opposing->foreign_amount && null !== $transaction->foreign_amount) { $opposing->foreign_amount = bcmul(strval($transaction->foreign_amount), '-1'); $opposing->save(); Log::debug(sprintf('Restored foreign amount of transaction (2) #%d to %s', $opposing->id, $opposing->foreign_amount)); } // when both are zero, try to grab it from journal: - if (is_null($opposing->foreign_amount) && is_null($transaction->foreign_amount)) { + if (null === $opposing->foreign_amount && null === $transaction->foreign_amount) { $foreignAmount = $journal->getMeta('foreign_amount'); - if (is_null($foreignAmount)) { + if (null === $foreignAmount) { Log::debug(sprintf('Journal #%d has missing foreign currency data, forced to do 1:1 conversion :(.', $transaction->transaction_journal_id)); $transaction->foreign_amount = bcmul(strval($transaction->amount), '-1'); $opposing->foreign_amount = bcmul(strval($opposing->amount), '-1'); @@ -509,7 +505,6 @@ class UpgradeDatabase extends Command $opposing->save(); } - return; } } diff --git a/app/Console/Commands/UpgradeFireflyInstructions.php b/app/Console/Commands/UpgradeFireflyInstructions.php index 18464559ef..1daafe93ec 100644 --- a/app/Console/Commands/UpgradeFireflyInstructions.php +++ b/app/Console/Commands/UpgradeFireflyInstructions.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -26,9 +25,7 @@ namespace FireflyIII\Console\Commands; use Illuminate\Console\Command; /** - * Class UpgradeFireflyInstructions - * - * @package FireflyIII\Console\Commands + * Class UpgradeFireflyInstructions. */ class UpgradeFireflyInstructions extends Command { @@ -47,7 +44,6 @@ class UpgradeFireflyInstructions extends Command /** * Create a new command instance. - * */ public function __construct() { @@ -59,16 +55,16 @@ class UpgradeFireflyInstructions extends Command */ public function handle() { - if ($this->argument('task') === 'update') { + if ('update' === $this->argument('task')) { $this->updateInstructions(); } - if ($this->argument('task') === 'install') { + if ('install' === $this->argument('task')) { $this->installInstructions(); } } /** - * Show a nice box + * Show a nice box. * * @param string $text */ @@ -81,7 +77,7 @@ class UpgradeFireflyInstructions extends Command } /** - * Show a nice info box + * Show a nice info box. * * @param string $text */ @@ -111,7 +107,7 @@ class UpgradeFireflyInstructions extends Command } $this->showLine(); $this->boxed(''); - if (is_null($text)) { + if (null === $text) { $this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version)); $this->boxedInfo('There are no extra installation instructions.'); $this->boxed('Firefly III should be ready for use.'); @@ -128,12 +124,12 @@ class UpgradeFireflyInstructions extends Command } /** - * Show a line + * Show a line. */ private function showLine() { $line = '+'; - for ($i = 0; $i < 78; $i++) { + for ($i = 0; $i < 78; ++$i) { $line .= '-'; } $line .= '+'; @@ -158,7 +154,7 @@ class UpgradeFireflyInstructions extends Command } $this->showLine(); $this->boxed(''); - if (is_null($text)) { + if (null === $text) { $this->boxed(sprintf('Thank you for updating to Firefly III, v%s', $version)); $this->boxedInfo('There are no extra upgrade instructions.'); $this->boxed('Firefly III should be ready for use.'); diff --git a/app/Console/Commands/UseEncryption.php b/app/Console/Commands/UseEncryption.php index 7a7b5b3eea..648533fa20 100644 --- a/app/Console/Commands/UseEncryption.php +++ b/app/Console/Commands/UseEncryption.php @@ -19,7 +19,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); /** @@ -36,9 +35,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Str; /** - * Class UseEncryption - * - * @package FireflyIII\Console\Commands + * Class UseEncryption. */ class UseEncryption extends Command { @@ -57,7 +54,6 @@ class UseEncryption extends Command /** * Create a new command instance. - * */ public function __construct() { diff --git a/app/Console/Commands/VerifiesAccessToken.php b/app/Console/Commands/VerifiesAccessToken.php index 9d1b13b863..15b2ae5658 100644 --- a/app/Console/Commands/VerifiesAccessToken.php +++ b/app/Console/Commands/VerifiesAccessToken.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -28,11 +27,9 @@ use Log; use Preferences; /** - * Trait VerifiesAccessToken + * Trait VerifiesAccessToken. * * Verifies user access token for sensitive commands. - * - * @package FireflyIII\Console\Commands */ trait VerifiesAccessToken { @@ -58,13 +55,13 @@ trait VerifiesAccessToken $repository = app(UserRepositoryInterface::class); $user = $repository->find($userId); - if (is_null($user->id)) { + if (null === $user->id) { Log::error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId)); return false; } $accessToken = Preferences::getForUser($user, 'access_token', null); - if (is_null($accessToken)) { + if (null === $accessToken) { Log::error(sprintf('User #%d has no access token, so cannot access command line options.', $userId)); return false; diff --git a/app/Console/Commands/VerifyDatabase.php b/app/Console/Commands/VerifyDatabase.php index 693f2f53cc..79e07b02ea 100644 --- a/app/Console/Commands/VerifyDatabase.php +++ b/app/Console/Commands/VerifyDatabase.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Console\Commands; @@ -42,11 +41,9 @@ use Schema; use stdClass; /** - * Class VerifyDatabase + * Class VerifyDatabase. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * - * @package FireflyIII\Console\Commands */ class VerifyDatabase extends Command { @@ -107,7 +104,7 @@ class VerifyDatabase extends Command /** @var User $user */ foreach ($users as $user) { $pref = Preferences::getForUser($user, 'access_token', null); - if (is_null($pref)) { + if (null === $pref) { $token = $user->generateAccessToken(); Preferences::setForUser($user, 'access_token', $token); $this->line(sprintf('Generated access token for user %s', $user->email)); @@ -128,7 +125,7 @@ class VerifyDatabase extends Command ]; foreach ($set as $name => $values) { $link = LinkType::where('name', $name)->where('outward', $values[0])->where('inward', $values[1])->first(); - if (is_null($link)) { + if (null === $link) { $link = new LinkType; $link->name = $name; $link->outward = $values[0]; @@ -147,17 +144,17 @@ class VerifyDatabase extends Command $set = PiggyBankEvent::with(['PiggyBank', 'TransactionJournal', 'TransactionJournal.TransactionType'])->get(); $set->each( function (PiggyBankEvent $event) { - if (is_null($event->transaction_journal_id)) { + if (null === $event->transaction_journal_id) { return true; } /** @var TransactionJournal $journal */ $journal = $event->transactionJournal()->first(); - if (is_null($journal)) { + if (null === $journal) { return true; } $type = $journal->transactionType->type; - if ($type !== TransactionType::TRANSFER) { + if (TransactionType::TRANSFER !== $type) { $event->transaction_journal_id = null; $event->save(); $this->line(sprintf('Piggy bank #%d was referenced by an invalid event. This has been fixed.', $event->piggy_bank_id)); @@ -234,11 +231,11 @@ class VerifyDatabase extends Command ->get( ['accounts.id as account_id', 'accounts.deleted_at as account_deleted_at', 'transactions.id as transaction_id', 'transactions.deleted_at as transaction_deleted_at', 'transaction_journals.id as journal_id', - 'transaction_journals.deleted_at as journal_deleted_at'] + 'transaction_journals.deleted_at as journal_deleted_at',] ); /** @var stdClass $entry */ foreach ($set as $entry) { - $date = is_null($entry->transaction_deleted_at) ? $entry->journal_deleted_at : $entry->transaction_deleted_at; + $date = null === $entry->transaction_deleted_at ? $entry->journal_deleted_at : $entry->transaction_deleted_at; $this->error( 'Error: Account #' . $entry->account_id . ' should have been deleted, but has not.' . ' Find it in the table called "accounts" and change the "deleted_at" field to: "' . $date . '"' @@ -270,7 +267,7 @@ class VerifyDatabase extends Command ->whereNull('transaction_journals.deleted_at') ->get( ['transaction_journals.id', 'transaction_journals.user_id', 'users.email', 'account_types.type as a_type', - 'transaction_types.type'] + 'transaction_types.type',] ); foreach ($set as $entry) { $this->error( @@ -289,7 +286,7 @@ class VerifyDatabase extends Command } /** - * Any deleted transaction journals that have transactions that are NOT deleted: + * Any deleted transaction journals that have transactions that are NOT deleted:. */ private function reportJournals() { @@ -303,7 +300,7 @@ class VerifyDatabase extends Command 'transaction_journals.description', 'transaction_journals.deleted_at as journal_deleted', 'transactions.id as transaction_id', - 'transactions.deleted_at as transaction_deleted_at'] + 'transactions.deleted_at as transaction_deleted_at',] ); /** @var stdClass $entry */ foreach ($set as $entry) { @@ -340,7 +337,7 @@ class VerifyDatabase extends Command { $plural = str_plural($name); $class = sprintf('FireflyIII\Models\%s', ucfirst($name)); - $field = $name === 'tag' ? 'tag' : 'name'; + $field = 'tag' === $name ? 'tag' : 'name'; $set = $class::leftJoin($name . '_transaction_journal', $plural . '.id', '=', $name . '_transaction_journal.' . $name . '_id') ->leftJoin('users', $plural . '.user_id', '=', 'users.id') ->distinct() @@ -380,7 +377,7 @@ class VerifyDatabase extends Command /** @var User $user */ foreach ($userRepository->all() as $user) { $sum = strval($user->transactions()->sum('amount')); - if (bccomp($sum, '0') !== 0) { + if (0 !== bccomp($sum, '0')) { $this->error('Error: Transactions for user #' . $user->id . ' (' . $user->email . ') are off by ' . $sum . '!'); } } @@ -396,7 +393,7 @@ class VerifyDatabase extends Command ->whereNull('transaction_journals.deleted_at') ->get( ['transactions.id as transaction_id', 'transactions.deleted_at as transaction_deleted', 'transaction_journals.id as journal_id', - 'transaction_journals.deleted_at'] + 'transaction_journals.deleted_at',] ); /** @var stdClass $entry */ foreach ($set as $entry) { diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 4e6511ba43..b444bbef42 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * Kernel.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -48,13 +46,10 @@ class Kernel extends ConsoleKernel */ protected $commands = [ - // ]; /** * Register the commands for the application. - * - * @return void */ protected function commands() { @@ -66,9 +61,8 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule + * @param \Illuminate\Console\Scheduling\Schedule $schedule * - * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function schedule(Schedule $schedule) diff --git a/app/Events/AdminRequestedTestMessage.php b/app/Events/AdminRequestedTestMessage.php index 0a54637908..5406ca4bc9 100644 --- a/app/Events/AdminRequestedTestMessage.php +++ b/app/Events/AdminRequestedTestMessage.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Events; @@ -28,9 +27,7 @@ use Illuminate\Queue\SerializesModels; use Log; /** - * Class AdminRequestedTestMessage - * - * @package FireflyIII\Events + * Class AdminRequestedTestMessage. */ class AdminRequestedTestMessage extends Event { @@ -42,7 +39,7 @@ class AdminRequestedTestMessage extends Event /** * Create a new event instance. * - * @param User $user + * @param User $user * @param string $ipAddress */ public function __construct(User $user, string $ipAddress) diff --git a/app/Events/Event.php b/app/Events/Event.php index cc0b01595d..4efa51dfce 100644 --- a/app/Events/Event.php +++ b/app/Events/Event.php @@ -18,17 +18,13 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Events; /** - * Class Event - * - * @package FireflyIII\Events + * Class Event. */ abstract class Event { - // } diff --git a/app/Events/RegisteredUser.php b/app/Events/RegisteredUser.php index 271ff0bfa5..3886edd432 100644 --- a/app/Events/RegisteredUser.php +++ b/app/Events/RegisteredUser.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Events; @@ -27,9 +26,7 @@ use FireflyIII\User; use Illuminate\Queue\SerializesModels; /** - * Class RegisteredUser - * - * @package FireflyIII\Events + * Class RegisteredUser. */ class RegisteredUser extends Event { @@ -41,7 +38,7 @@ class RegisteredUser extends Event /** * Create a new event instance. This event is triggered when a new user registers. * - * @param User $user + * @param User $user * @param string $ipAddress */ public function __construct(User $user, string $ipAddress) diff --git a/app/Events/RequestedNewPassword.php b/app/Events/RequestedNewPassword.php index 154eb22647..e8031e316e 100644 --- a/app/Events/RequestedNewPassword.php +++ b/app/Events/RequestedNewPassword.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Events; @@ -27,9 +26,7 @@ use FireflyIII\User; use Illuminate\Queue\SerializesModels; /** - * Class RequestedNewPassword - * - * @package FireflyIII\Events + * Class RequestedNewPassword. */ class RequestedNewPassword extends Event { @@ -42,7 +39,7 @@ class RequestedNewPassword extends Event /** * Create a new event instance. This event is triggered when a users tries to reset his or her password. * - * @param User $user + * @param User $user * @param string $token * @param string $ipAddress */ diff --git a/app/Events/StoredTransactionJournal.php b/app/Events/StoredTransactionJournal.php index 07a18f8cdf..deab148be0 100644 --- a/app/Events/StoredTransactionJournal.php +++ b/app/Events/StoredTransactionJournal.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Events; @@ -27,9 +26,7 @@ use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; /** - * Class StoredTransactionJournal - * - * @package FireflyIII\Events + * Class StoredTransactionJournal. */ class StoredTransactionJournal extends Event { @@ -48,7 +45,6 @@ class StoredTransactionJournal extends Event */ public function __construct(TransactionJournal $journal, int $piggyBankId) { - // $this->journal = $journal; $this->piggyBankId = $piggyBankId; } diff --git a/app/Events/UpdatedTransactionJournal.php b/app/Events/UpdatedTransactionJournal.php index f83ca87595..9f365929e8 100644 --- a/app/Events/UpdatedTransactionJournal.php +++ b/app/Events/UpdatedTransactionJournal.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Events; @@ -27,9 +26,7 @@ use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; /** - * Class UpdatedTransactionJournal - * - * @package FireflyIII\Events + * Class UpdatedTransactionJournal. */ class UpdatedTransactionJournal extends Event { @@ -45,7 +42,6 @@ class UpdatedTransactionJournal extends Event */ public function __construct(TransactionJournal $journal) { - // $this->journal = $journal; } } diff --git a/app/Events/UserChangedEmail.php b/app/Events/UserChangedEmail.php index d858c903b4..2c75145d34 100644 --- a/app/Events/UserChangedEmail.php +++ b/app/Events/UserChangedEmail.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Events; @@ -27,19 +26,17 @@ use FireflyIII\User; use Illuminate\Queue\SerializesModels; /** - * Class UserChangedEmail - * - * @package FireflyIII\Events + * Class UserChangedEmail. */ class UserChangedEmail extends Event { use SerializesModels; - /** @var string */ + /** @var string */ public $ipAddress; - /** @var string */ + /** @var string */ public $newEmail; - /** @var string */ + /** @var string */ public $oldEmail; /** @var User */ public $user; diff --git a/app/Exceptions/FireflyException.php b/app/Exceptions/FireflyException.php index 5bcde065a7..313ea77b7f 100644 --- a/app/Exceptions/FireflyException.php +++ b/app/Exceptions/FireflyException.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Exceptions; /** - * Class FireflyException - * - * @package FireflyIII\Exceptions + * Class FireflyException. */ class FireflyException extends \Exception { diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 1dc47c3053..322ae31e26 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * Handler.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -58,14 +56,13 @@ class Handler extends ExceptionHandler */ protected $dontReport = [ - // ]; /** * Render an exception into an HTTP response. * - * @param \Illuminate\Http\Request $request - * @param \Exception $exception + * @param \Illuminate\Http\Request $request + * @param \Exception $exception * * @return \Illuminate\Http\Response */ @@ -86,9 +83,8 @@ class Handler extends ExceptionHandler * This is a great spot to send exceptions to Sentry, Bugsnag, etc. * * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine. - * @param \Exception $exception * - * @return void + * @param \Exception $exception */ public function report(Exception $exception) { @@ -119,7 +115,6 @@ class Handler extends ExceptionHandler dispatch($job); } - parent::report($exception); } } diff --git a/app/Exceptions/NotImplementedException.php b/app/Exceptions/NotImplementedException.php index d6decc2bc7..f3fe68d8de 100644 --- a/app/Exceptions/NotImplementedException.php +++ b/app/Exceptions/NotImplementedException.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Exceptions; /** - * Class NotImplementedException - * - * @package FireflyIII\Exceptions + * Class NotImplementedException. */ class NotImplementedException extends \Exception { diff --git a/app/Exceptions/ValidationException.php b/app/Exceptions/ValidationException.php index f46b5b1588..dba608fa1a 100644 --- a/app/Exceptions/ValidationException.php +++ b/app/Exceptions/ValidationException.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Exceptions; /** - * Class ValidationExceptions - * - * @package FireflyIII\Exception + * Class ValidationExceptions. */ class ValidationException extends \Exception { diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php index 0fe6ec7f9b..c3f76d2274 100644 --- a/app/Export/Collector/AttachmentCollector.php +++ b/app/Export/Collector/AttachmentCollector.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export\Collector; @@ -33,19 +32,17 @@ use Log; use Storage; /** - * Class AttachmentCollector - * - * @package FireflyIII\Export\Collector + * Class AttachmentCollector. */ class AttachmentCollector extends BasicCollector implements CollectorInterface { - /** @var Carbon */ + /** @var Carbon */ private $end; /** @var \Illuminate\Contracts\Filesystem\Filesystem */ private $exportDisk; - /** @var AttachmentRepositoryInterface */ + /** @var AttachmentRepositoryInterface */ private $repository; - /** @var Carbon */ + /** @var Carbon */ private $start; /** @var \Illuminate\Contracts\Filesystem\Filesystem */ private $uploadDisk; @@ -55,7 +52,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface */ public function __construct() { - /** @var AttachmentRepositoryInterface repository */ + // @var AttachmentRepositoryInterface repository $this->repository = app(AttachmentRepositoryInterface::class); // make storage: $this->uploadDisk = Storage::disk('upload'); diff --git a/app/Export/Collector/BasicCollector.php b/app/Export/Collector/BasicCollector.php index 80bb64ba37..0aa688ae30 100644 --- a/app/Export/Collector/BasicCollector.php +++ b/app/Export/Collector/BasicCollector.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export\Collector; @@ -28,15 +27,13 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Class BasicCollector - * - * @package FireflyIII\Export\Collector + * Class BasicCollector. */ class BasicCollector { /** @var ExportJob */ protected $job; - /** @var User */ + /** @var User */ protected $user; /** @var Collection */ private $entries; diff --git a/app/Export/Collector/CollectorInterface.php b/app/Export/Collector/CollectorInterface.php index d36a76c202..362692f247 100644 --- a/app/Export/Collector/CollectorInterface.php +++ b/app/Export/Collector/CollectorInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export\Collector; @@ -27,9 +26,7 @@ use FireflyIII\Models\ExportJob; use Illuminate\Support\Collection; /** - * Interface CollectorInterface - * - * @package FireflyIII\Export\Collector + * Interface CollectorInterface. */ interface CollectorInterface { @@ -45,9 +42,6 @@ interface CollectorInterface /** * @param Collection $entries - * - * @return void - * */ public function setEntries(Collection $entries); diff --git a/app/Export/Collector/UploadCollector.php b/app/Export/Collector/UploadCollector.php index 732b04e750..9bb5dd20fb 100644 --- a/app/Export/Collector/UploadCollector.php +++ b/app/Export/Collector/UploadCollector.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export\Collector; @@ -30,9 +29,7 @@ use Log; use Storage; /** - * Class UploadCollector - * - * @package FireflyIII\Export\Collector + * Class UploadCollector. */ class UploadCollector extends BasicCollector implements CollectorInterface { @@ -94,7 +91,7 @@ class UploadCollector extends BasicCollector implements CollectorInterface { // find job associated with import file: $job = $this->job->user->importJobs()->where('key', $key)->first(); - if (is_null($job)) { + if (null === $job) { return false; } diff --git a/app/Export/Entry/Entry.php b/app/Export/Entry/Entry.php index 43246627f0..44271130f1 100644 --- a/app/Export/Entry/Entry.php +++ b/app/Export/Entry/Entry.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export\Entry; @@ -27,7 +26,7 @@ use FireflyIII\Models\Transaction; /** * To extend the exported object, in case of new features in Firefly III for example, - * do the following: + * do the following:. * * - Add the field(s) to this class. If you add more than one related field, add a new object. * - Make sure the "fromJournal"-routine fills these fields. @@ -39,52 +38,42 @@ use FireflyIII\Models\Transaction; * * * Class Entry + * * @SuppressWarnings(PHPMD.LongVariable) * @SuppressWarnings(PHPMD.TooManyFields) - * - * @package FireflyIII\Export\Entry */ final class Entry { // @formatter:off - public $journal_id; - public $transaction_id = 0; - - public $date; - public $description; - - public $currency_code; public $amount; - public $foreign_currency_code = ''; - public $foreign_amount = '0'; - - public $transaction_type; - + public $asset_account_bic; + public $asset_account_iban; public $asset_account_id; public $asset_account_name; - public $asset_account_iban; - public $asset_account_bic; public $asset_account_number; public $asset_currency_code; - - public $opposing_account_id; - public $opposing_account_name; - public $opposing_account_iban; - public $opposing_account_bic; - public $opposing_account_number; - public $opposing_currency_code; - - public $budget_id; - public $budget_name; - - public $category_id; - public $category_name; - public $bill_id; public $bill_name; - + public $budget_id; + public $budget_name; + public $category_id; + public $category_name; + public $currency_code; + public $date; + public $description; + public $foreign_amount = '0'; + public $foreign_currency_code = ''; + public $journal_id; public $notes; + public $opposing_account_bic; + public $opposing_account_iban; + public $opposing_account_id; + public $opposing_account_name; + public $opposing_account_number; + public $opposing_currency_code; public $tags; + public $transaction_id = 0; + public $transaction_type; // @formatter:on /** @@ -104,7 +93,7 @@ final class Entry * * @return Entry */ - public static function fromTransaction(Transaction $transaction): Entry + public static function fromTransaction(Transaction $transaction): self { $entry = new self; $entry->journal_id = $transaction->journal_id; @@ -117,8 +106,8 @@ final class Entry $entry->currency_code = $transaction->transactionCurrency->code; $entry->amount = round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places); - $entry->foreign_currency_code = is_null($transaction->foreign_currency_id) ? null : $transaction->foreignCurrency->code; - $entry->foreign_amount = is_null($transaction->foreign_currency_id) + $entry->foreign_currency_code = null === $transaction->foreign_currency_id ? null : $transaction->foreignCurrency->code; + $entry->foreign_amount = null === $transaction->foreign_currency_id ? null : strval( round( @@ -142,23 +131,23 @@ final class Entry $entry->opposing_account_bic = $transaction->opposing_account_bic; $entry->opposing_currency_code = $transaction->opposing_currency_code; - /** budget */ + // budget $entry->budget_id = $transaction->transaction_budget_id; $entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_budget_name); - if (is_null($transaction->transaction_budget_id)) { + if (null === $transaction->transaction_budget_id) { $entry->budget_id = $transaction->transaction_journal_budget_id; $entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_journal_budget_name); } - /** category */ + // category $entry->category_id = $transaction->transaction_category_id; $entry->category_name = app('steam')->tryDecrypt($transaction->transaction_category_name); - if (is_null($transaction->transaction_category_id)) { + if (null === $transaction->transaction_category_id) { $entry->category_id = $transaction->transaction_journal_category_id; $entry->category_name = app('steam')->tryDecrypt($transaction->transaction_journal_category_name); } - /** budget */ + // budget $entry->bill_id = $transaction->bill_id; $entry->bill_name = app('steam')->tryDecrypt($transaction->bill_name); diff --git a/app/Export/ExpandedProcessor.php b/app/Export/ExpandedProcessor.php index bafd575006..11504e2267 100644 --- a/app/Export/ExpandedProcessor.php +++ b/app/Export/ExpandedProcessor.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export; @@ -42,32 +41,29 @@ use Storage; use ZipArchive; /** - * Class ExpandedProcessor + * Class ExpandedProcessor. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // its doing a lot. - * - * @package FireflyIII\Export */ class ExpandedProcessor implements ProcessorInterface { - /** @var Collection */ public $accounts; - /** @var string */ + /** @var string */ public $exportFormat; - /** @var bool */ + /** @var bool */ public $includeAttachments; - /** @var bool */ + /** @var bool */ public $includeOldUploads; - /** @var ExportJob */ + /** @var ExportJob */ public $job; /** @var array */ public $settings; - /** @var Collection */ + /** @var Collection */ private $exportEntries; - /** @var Collection */ + /** @var Collection */ private $files; - /** @var Collection */ + /** @var Collection */ private $journals; /** @@ -175,6 +171,7 @@ class ExpandedProcessor implements ProcessorInterface /** * @return bool + * * @throws FireflyException */ public function createZipFile(): bool @@ -183,7 +180,7 @@ class ExpandedProcessor implements ProcessorInterface $file = $this->job->key . '.zip'; $fullPath = storage_path('export') . '/' . $file; - if ($zip->open($fullPath, ZipArchive::CREATE) !== true) { + if (true !== $zip->open($fullPath, ZipArchive::CREATE)) { throw new FireflyException('Cannot store zip file.'); } // for each file in the collection, add it to the zip file. @@ -278,7 +275,7 @@ class ExpandedProcessor implements ProcessorInterface } /** - * Get all IBAN / SWIFT / account numbers + * Get all IBAN / SWIFT / account numbers. * * @param array $array * diff --git a/app/Export/Exporter/BasicExporter.php b/app/Export/Exporter/BasicExporter.php index c04869286c..ece94d3703 100644 --- a/app/Export/Exporter/BasicExporter.php +++ b/app/Export/Exporter/BasicExporter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export\Exporter; @@ -27,13 +26,11 @@ use FireflyIII\Models\ExportJob; use Illuminate\Support\Collection; /** - * Class BasicExporter - * - * @package FireflyIII\Export\Exporter + * Class BasicExporter. */ class BasicExporter { - /** @var ExportJob */ + /** @var ExportJob */ protected $job; /** @var Collection */ private $entries; diff --git a/app/Export/Exporter/CsvExporter.php b/app/Export/Exporter/CsvExporter.php index d9e337b0fc..2799f7902f 100644 --- a/app/Export/Exporter/CsvExporter.php +++ b/app/Export/Exporter/CsvExporter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export\Exporter; @@ -28,13 +27,11 @@ use League\Csv\Writer; use SplFileObject; /** - * Class CsvExporter - * - * @package FireflyIII\Export\Exporter + * Class CsvExporter. */ class CsvExporter extends BasicExporter implements ExporterInterface { - /** @var string */ + /** @var string */ private $fileName; /** @@ -69,7 +66,7 @@ class CsvExporter extends BasicExporter implements ExporterInterface // get field names for header row: $first = $this->getEntries()->first(); $headers = []; - if (!is_null($first)) { + if (null !== $first) { $headers = array_keys(get_object_vars($first)); } @@ -88,7 +85,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface return true; } - private function tempFile() { $this->fileName = $this->job->key . '-records.csv'; diff --git a/app/Export/Exporter/ExporterInterface.php b/app/Export/Exporter/ExporterInterface.php index 0ef9fb12c6..50790b3c92 100644 --- a/app/Export/Exporter/ExporterInterface.php +++ b/app/Export/Exporter/ExporterInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export\Exporter; @@ -27,9 +26,7 @@ use FireflyIII\Models\ExportJob; use Illuminate\Support\Collection; /** - * Interface ExporterInterface - * - * @package FireflyIII\Export\Exporter + * Interface ExporterInterface. */ interface ExporterInterface { @@ -50,9 +47,6 @@ interface ExporterInterface /** * @param Collection $entries - * - * @return void - * */ public function setEntries(Collection $entries); diff --git a/app/Export/ProcessorInterface.php b/app/Export/ProcessorInterface.php index 90dd471efa..3d24a91f1f 100644 --- a/app/Export/ProcessorInterface.php +++ b/app/Export/ProcessorInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Export; @@ -26,13 +25,10 @@ namespace FireflyIII\Export; use Illuminate\Support\Collection; /** - * Interface ProcessorInterface - * - * @package FireflyIII\Export + * Interface ProcessorInterface. */ interface ProcessorInterface { - /** * Processor constructor. */ diff --git a/app/Generator/Chart/Basic/ChartJsGenerator.php b/app/Generator/Chart/Basic/ChartJsGenerator.php index 75b1b4bd38..e366db9587 100644 --- a/app/Generator/Chart/Basic/ChartJsGenerator.php +++ b/app/Generator/Chart/Basic/ChartJsGenerator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Chart\Basic; @@ -27,15 +26,12 @@ use FireflyIII\Support\ChartColour; use Steam; /** - * Class ChartJsGenerator - * - * @package FireflyIII\Generator\Chart\Basic + * Class ChartJsGenerator. */ class ChartJsGenerator implements GeneratorInterface { - /** - * Will generate a Chart JS compatible array from the given input. Expects this format + * Will generate a Chart JS compatible array from the given input. Expects this format. * * Will take labels for all from first set. * @@ -102,7 +98,7 @@ class ChartJsGenerator implements GeneratorInterface } /** - * Expects data as: + * Expects data as:. * * key => value * @@ -123,7 +119,7 @@ class ChartJsGenerator implements GeneratorInterface // different sort when values are positive and when they're negative. asort($data); $next = next($data); - if (!is_bool($next) && bccomp($next, '0') === 1) { + if (!is_bool($next) && 1 === bccomp($next, '0')) { // next is positive, sort other way around. arsort($data); } @@ -131,19 +127,18 @@ class ChartJsGenerator implements GeneratorInterface $index = 0; foreach ($data as $key => $value) { - // make larger than 0 $chartData['datasets'][0]['data'][] = floatval(Steam::positive($value)); $chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index); $chartData['labels'][] = $key; - $index++; + ++$index; } return $chartData; } /** - * Will generate a (ChartJS) compatible array from the given input. Expects this format: + * Will generate a (ChartJS) compatible array from the given input. Expects this format:. * * 'label-of-entry' => value * 'label-of-entry' => value diff --git a/app/Generator/Chart/Basic/GeneratorInterface.php b/app/Generator/Chart/Basic/GeneratorInterface.php index 37b089d903..68753e1276 100644 --- a/app/Generator/Chart/Basic/GeneratorInterface.php +++ b/app/Generator/Chart/Basic/GeneratorInterface.php @@ -18,21 +18,17 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Chart\Basic; /** - * Interface GeneratorInterface - * - * @package FireflyIII\Generator\Chart\Basic + * Interface GeneratorInterface. */ interface GeneratorInterface { - /** - * Will generate a Chart JS compatible array from the given input. Expects this format + * Will generate a Chart JS compatible array from the given input. Expects this format. * * Will take labels for all from first set. * @@ -66,7 +62,7 @@ interface GeneratorInterface public function multiSet(array $data): array; /** - * Expects data as: + * Expects data as:. * * key => value * @@ -77,7 +73,7 @@ interface GeneratorInterface public function pieChart(array $data): array; /** - * Will generate a (ChartJS) compatible array from the given input. Expects this format: + * Will generate a (ChartJS) compatible array from the given input. Expects this format:. * * 'label-of-entry' => value * 'label-of-entry' => value diff --git a/app/Generator/Report/Audit/MonthReportGenerator.php b/app/Generator/Report/Audit/MonthReportGenerator.php index 809e047b6f..f944874ea4 100644 --- a/app/Generator/Report/Audit/MonthReportGenerator.php +++ b/app/Generator/Report/Audit/MonthReportGenerator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Audit; @@ -27,23 +26,20 @@ use Carbon\Carbon; use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Models\Account; -use FireflyIII\Models\Transaction; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use Illuminate\Support\Collection; use Steam; /** - * Class MonthReportGenerator - * - * @package FireflyIII\Generator\Report\Audit + * Class MonthReportGenerator. */ class MonthReportGenerator implements ReportGeneratorInterface { - /** @var Collection */ + /** @var Collection */ private $accounts; - /** @var Carbon */ + /** @var Carbon */ private $end; - /** @var Carbon */ + /** @var Carbon */ private $start; /** @@ -74,7 +70,6 @@ class MonthReportGenerator implements ReportGeneratorInterface 'create_date', 'update_date', ]; - return view('reports.audit.report', compact('reportType', 'accountIds', 'auditData', 'hideable', 'defaultShow')) ->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts) ->render(); @@ -153,7 +148,6 @@ class MonthReportGenerator implements ReportGeneratorInterface * @return array * * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // not that long - * */ private function getAuditReport(Account $account, Carbon $date): array { @@ -169,7 +163,7 @@ class MonthReportGenerator implements ReportGeneratorInterface $startBalance = $dayBeforeBalance; $currency = $currencyRepos->find(intval($account->getMeta('currency_id'))); - /** @var Transaction $journal */ + // @var Transaction $journal foreach ($journals as $transaction) { $transaction->before = $startBalance; $transactionAmount = $transaction->transaction_amount; diff --git a/app/Generator/Report/Audit/MultiYearReportGenerator.php b/app/Generator/Report/Audit/MultiYearReportGenerator.php index 42e06b1349..93629d0c55 100644 --- a/app/Generator/Report/Audit/MultiYearReportGenerator.php +++ b/app/Generator/Report/Audit/MultiYearReportGenerator.php @@ -18,19 +18,14 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Audit; /** - * Class MultiYearReportGenerator - * - * @package FireflyIII\Generator\Report\Audit + * Class MultiYearReportGenerator. */ class MultiYearReportGenerator extends MonthReportGenerator { - /** - * Doesn't do anything different. - */ + // Doesn't do anything different. } diff --git a/app/Generator/Report/Audit/YearReportGenerator.php b/app/Generator/Report/Audit/YearReportGenerator.php index d5a7d8eb82..2cd93c9b01 100644 --- a/app/Generator/Report/Audit/YearReportGenerator.php +++ b/app/Generator/Report/Audit/YearReportGenerator.php @@ -18,20 +18,14 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Audit; /** - * Class YearReportGenerator - * - * @package FireflyIII\Generator\Report\Audit + * Class YearReportGenerator. */ class YearReportGenerator extends MonthReportGenerator { - - /** - * Doesn't do anything different. - */ + // Doesn't do anything different. } diff --git a/app/Generator/Report/Budget/MonthReportGenerator.php b/app/Generator/Report/Budget/MonthReportGenerator.php index 59edfe32ab..1295061e6b 100644 --- a/app/Generator/Report/Budget/MonthReportGenerator.php +++ b/app/Generator/Report/Budget/MonthReportGenerator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Budget; @@ -36,23 +35,21 @@ use Illuminate\Support\Collection; use Log; /** - * Class MonthReportGenerator - * - * @package FireflyIII\Generator\Report\Budget + * Class MonthReportGenerator. */ class MonthReportGenerator extends Support implements ReportGeneratorInterface { - /** @var Collection */ + /** @var Collection */ private $accounts; - /** @var Collection */ + /** @var Collection */ private $budgets; - /** @var Carbon */ + /** @var Carbon */ private $end; /** @var Collection */ private $expenses; /** @var Collection */ private $income; - /** @var Carbon */ + /** @var Carbon */ private $start; /** diff --git a/app/Generator/Report/Budget/MultiYearReportGenerator.php b/app/Generator/Report/Budget/MultiYearReportGenerator.php index 2f49d7bd7f..956968075f 100644 --- a/app/Generator/Report/Budget/MultiYearReportGenerator.php +++ b/app/Generator/Report/Budget/MultiYearReportGenerator.php @@ -18,19 +18,14 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Budget; /** - * Class MultiYearReportGenerator - * - * @package FireflyIII\Generator\Report\Budget + * Class MultiYearReportGenerator. */ class MultiYearReportGenerator extends MonthReportGenerator { - /** - * Doesn't do anything different. - */ + // Doesn't do anything different. } diff --git a/app/Generator/Report/Budget/YearReportGenerator.php b/app/Generator/Report/Budget/YearReportGenerator.php index 3ac751cbc6..649636f91b 100644 --- a/app/Generator/Report/Budget/YearReportGenerator.php +++ b/app/Generator/Report/Budget/YearReportGenerator.php @@ -18,20 +18,14 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Budget; /** - * Class YearReportGenerator - * - * @package FireflyIII\Generator\Report\Budget + * Class YearReportGenerator. */ class YearReportGenerator extends MonthReportGenerator { - - /** - * Doesn't do anything different. - */ + // Doesn't do anything different. } diff --git a/app/Generator/Report/Category/MonthReportGenerator.php b/app/Generator/Report/Category/MonthReportGenerator.php index 58f110627c..24370c6be0 100644 --- a/app/Generator/Report/Category/MonthReportGenerator.php +++ b/app/Generator/Report/Category/MonthReportGenerator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Category; @@ -37,23 +36,21 @@ use Illuminate\Support\Collection; use Log; /** - * Class MonthReportGenerator - * - * @package FireflyIII\Generator\Report\Category + * Class MonthReportGenerator. */ class MonthReportGenerator extends Support implements ReportGeneratorInterface { - /** @var Collection */ + /** @var Collection */ private $accounts; - /** @var Collection */ + /** @var Collection */ private $categories; - /** @var Carbon */ + /** @var Carbon */ private $end; /** @var Collection */ private $expenses; /** @var Collection */ private $income; - /** @var Carbon */ + /** @var Carbon */ private $start; /** @@ -82,7 +79,6 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface $topExpenses = $this->getTopExpenses(); $topIncome = $this->getTopIncome(); - // render! return view( 'reports.category.month', diff --git a/app/Generator/Report/Category/MultiYearReportGenerator.php b/app/Generator/Report/Category/MultiYearReportGenerator.php index c3112ce681..d18dc47c0d 100644 --- a/app/Generator/Report/Category/MultiYearReportGenerator.php +++ b/app/Generator/Report/Category/MultiYearReportGenerator.php @@ -18,19 +18,14 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Category; /** - * Class MultiYearReportGenerator - * - * @package FireflyIII\Generator\Report\Category + * Class MultiYearReportGenerator. */ class MultiYearReportGenerator extends MonthReportGenerator { - /** - * Doesn't do anything different. - */ + // Doesn't do anything different. } diff --git a/app/Generator/Report/Category/YearReportGenerator.php b/app/Generator/Report/Category/YearReportGenerator.php index 5186ec9f50..7a3f15a484 100644 --- a/app/Generator/Report/Category/YearReportGenerator.php +++ b/app/Generator/Report/Category/YearReportGenerator.php @@ -18,20 +18,14 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Category; /** - * Class YearReportGenerator - * - * @package FireflyIII\Generator\Report\Category + * Class YearReportGenerator. */ class YearReportGenerator extends MonthReportGenerator { - - /** - * Doesn't do anything different. - */ + // Doesn't do anything different. } diff --git a/app/Generator/Report/ReportGeneratorFactory.php b/app/Generator/Report/ReportGeneratorFactory.php index 0b96aee968..f6d7956a60 100644 --- a/app/Generator/Report/ReportGeneratorFactory.php +++ b/app/Generator/Report/ReportGeneratorFactory.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report; @@ -27,19 +26,17 @@ use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; /** - * Class ReportGeneratorFactory - * - * @package FireflyIII\Generator\Report + * Class ReportGeneratorFactory. */ class ReportGeneratorFactory { - /** * @param string $type * @param Carbon $start * @param Carbon $end * * @return ReportGeneratorInterface + * * @throws FireflyException */ public static function reportGenerator(string $type, Carbon $start, Carbon $end): ReportGeneratorInterface @@ -55,7 +52,6 @@ class ReportGeneratorFactory $period = 'MultiYear'; } - $class = sprintf('FireflyIII\Generator\Report\%s\%sReportGenerator', $type, $period); if (class_exists($class)) { /** @var ReportGeneratorInterface $obj */ diff --git a/app/Generator/Report/ReportGeneratorInterface.php b/app/Generator/Report/ReportGeneratorInterface.php index 5fecbf0e91..f4ff815cc1 100644 --- a/app/Generator/Report/ReportGeneratorInterface.php +++ b/app/Generator/Report/ReportGeneratorInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report; @@ -27,9 +26,7 @@ use Carbon\Carbon; use Illuminate\Support\Collection; /** - * Interface ReportGeneratorInterface - * - * @package FireflyIII\Generator\Report + * Interface ReportGeneratorInterface. */ interface ReportGeneratorInterface { @@ -43,40 +40,40 @@ interface ReportGeneratorInterface * * @return ReportGeneratorInterface */ - public function setAccounts(Collection $accounts): ReportGeneratorInterface; + public function setAccounts(Collection $accounts): self; /** * @param Collection $budgets * * @return ReportGeneratorInterface */ - public function setBudgets(Collection $budgets): ReportGeneratorInterface; + public function setBudgets(Collection $budgets): self; /** * @param Collection $categories * * @return ReportGeneratorInterface */ - public function setCategories(Collection $categories): ReportGeneratorInterface; + public function setCategories(Collection $categories): self; /** * @param Carbon $date * * @return ReportGeneratorInterface */ - public function setEndDate(Carbon $date): ReportGeneratorInterface; + public function setEndDate(Carbon $date): self; /** * @param Carbon $date * * @return ReportGeneratorInterface */ - public function setStartDate(Carbon $date): ReportGeneratorInterface; + public function setStartDate(Carbon $date): self; /** * @param Collection $tags * * @return ReportGeneratorInterface */ - public function setTags(Collection $tags): ReportGeneratorInterface; + public function setTags(Collection $tags): self; } diff --git a/app/Generator/Report/Standard/MonthReportGenerator.php b/app/Generator/Report/Standard/MonthReportGenerator.php index c042e3ac13..74c005b0ab 100644 --- a/app/Generator/Report/Standard/MonthReportGenerator.php +++ b/app/Generator/Report/Standard/MonthReportGenerator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Standard; @@ -29,17 +28,15 @@ use FireflyIII\Helpers\Report\ReportHelperInterface; use Illuminate\Support\Collection; /** - * Class MonthReportGenerator - * - * @package FireflyIII\Generator\Report\Standard + * Class MonthReportGenerator. */ class MonthReportGenerator implements ReportGeneratorInterface { - /** @var Collection */ + /** @var Collection */ private $accounts; - /** @var Carbon */ + /** @var Carbon */ private $end; - /** @var Carbon */ + /** @var Carbon */ private $start; /** diff --git a/app/Generator/Report/Standard/MultiYearReportGenerator.php b/app/Generator/Report/Standard/MultiYearReportGenerator.php index d625767dfd..7bc83c6dc7 100644 --- a/app/Generator/Report/Standard/MultiYearReportGenerator.php +++ b/app/Generator/Report/Standard/MultiYearReportGenerator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Standard; @@ -28,17 +27,15 @@ use FireflyIII\Generator\Report\ReportGeneratorInterface; use Illuminate\Support\Collection; /** - * Class MonthReportGenerator - * - * @package FireflyIII\Generator\Report\Standard + * Class MonthReportGenerator. */ class MultiYearReportGenerator implements ReportGeneratorInterface { - /** @var Collection */ + /** @var Collection */ private $accounts; - /** @var Carbon */ + /** @var Carbon */ private $end; - /** @var Carbon */ + /** @var Carbon */ private $start; /** diff --git a/app/Generator/Report/Standard/YearReportGenerator.php b/app/Generator/Report/Standard/YearReportGenerator.php index 8209e6bfc8..fc591c0e97 100644 --- a/app/Generator/Report/Standard/YearReportGenerator.php +++ b/app/Generator/Report/Standard/YearReportGenerator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Standard; @@ -28,17 +27,15 @@ use FireflyIII\Generator\Report\ReportGeneratorInterface; use Illuminate\Support\Collection; /** - * Class MonthReportGenerator - * - * @package FireflyIII\Generator\Report\Standard + * Class MonthReportGenerator. */ class YearReportGenerator implements ReportGeneratorInterface { - /** @var Collection */ + /** @var Collection */ private $accounts; - /** @var Carbon */ + /** @var Carbon */ private $end; - /** @var Carbon */ + /** @var Carbon */ private $start; /** diff --git a/app/Generator/Report/Support.php b/app/Generator/Report/Support.php index c4749d1cc6..71cc298307 100644 --- a/app/Generator/Report/Support.php +++ b/app/Generator/Report/Support.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report; @@ -27,9 +26,7 @@ use FireflyIII\Models\Transaction; use Illuminate\Support\Collection; /** - * Class Support - * - * @package FireflyIII\Generator\Report\Category + * Class Support. */ class Support { @@ -79,7 +76,7 @@ class Support ]; continue; } - $result[$opposingId]['count']++; + ++$result[$opposingId]['count']; $result[$opposingId]['sum'] = bcadd($result[$opposingId]['sum'], $transaction->transaction_amount); $result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], strval($result[$opposingId]['count'])); } @@ -97,6 +94,7 @@ class Support /** * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five. + * * @param array $spent * @param array $earned * @@ -107,7 +105,7 @@ class Support $return = []; /** - * @var int $accountId + * @var int * @var string $entry */ foreach ($spent as $objectId => $entry) { @@ -120,7 +118,7 @@ class Support unset($entry); /** - * @var int $accountId + * @var int * @var string $entry */ foreach ($earned as $objectId => $entry) { @@ -131,7 +129,6 @@ class Support $return[$objectId]['earned'] = $entry; } - return $return; } diff --git a/app/Generator/Report/Tag/MonthReportGenerator.php b/app/Generator/Report/Tag/MonthReportGenerator.php index cffaf129a6..418b05dd16 100644 --- a/app/Generator/Report/Tag/MonthReportGenerator.php +++ b/app/Generator/Report/Tag/MonthReportGenerator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Tag; @@ -38,22 +37,19 @@ use Illuminate\Support\Collection; use Log; /** - * Class MonthReportGenerator - * - * @package FireflyIII\Generator\Report\Tag + * Class MonthReportGenerator. */ class MonthReportGenerator extends Support implements ReportGeneratorInterface { - /** @var Collection */ private $accounts; - /** @var Carbon */ + /** @var Carbon */ private $end; /** @var Collection */ private $expenses; /** @var Collection */ private $income; - /** @var Carbon */ + /** @var Carbon */ private $start; /** @var Collection */ private $tags; @@ -84,7 +80,6 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface $topExpenses = $this->getTopExpenses(); $topIncome = $this->getTopIncome(); - // render! return view( 'reports.tag.month', diff --git a/app/Generator/Report/Tag/MultiYearReportGenerator.php b/app/Generator/Report/Tag/MultiYearReportGenerator.php index 4be4f8a7dc..7687cf9d0e 100644 --- a/app/Generator/Report/Tag/MultiYearReportGenerator.php +++ b/app/Generator/Report/Tag/MultiYearReportGenerator.php @@ -18,19 +18,14 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Tag; /** - * Class MultiYearReportGenerator - * - * @package FireflyIII\Generator\Report\Tag + * Class MultiYearReportGenerator. */ class MultiYearReportGenerator extends MonthReportGenerator { - /** - * Doesn't do anything different. - */ + // Doesn't do anything different. } diff --git a/app/Generator/Report/Tag/YearReportGenerator.php b/app/Generator/Report/Tag/YearReportGenerator.php index 5e362745dc..2e72c8d252 100644 --- a/app/Generator/Report/Tag/YearReportGenerator.php +++ b/app/Generator/Report/Tag/YearReportGenerator.php @@ -18,20 +18,14 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Generator\Report\Tag; /** - * Class YearReportGenerator - * - * @package FireflyIII\Generator\Report\Tag + * Class YearReportGenerator. */ class YearReportGenerator extends MonthReportGenerator { - - /** - * Doesn't do anything different. - */ + // Doesn't do anything different. } diff --git a/app/Handlers/Events/AdminEventHandler.php b/app/Handlers/Events/AdminEventHandler.php index c08a81b9ed..b7f999fe19 100644 --- a/app/Handlers/Events/AdminEventHandler.php +++ b/app/Handlers/Events/AdminEventHandler.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Handlers\Events; @@ -31,9 +30,7 @@ use Session; use Swift_TransportException; /** - * Class AdminEventHandler - * - * @package FireflyIII\Handlers\Events + * Class AdminEventHandler. */ class AdminEventHandler { diff --git a/app/Handlers/Events/StoredJournalEventHandler.php b/app/Handlers/Events/StoredJournalEventHandler.php index 51cb16b375..e02146f253 100644 --- a/app/Handlers/Events/StoredJournalEventHandler.php +++ b/app/Handlers/Events/StoredJournalEventHandler.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Handlers\Events; @@ -37,17 +36,15 @@ use Log; * @codeCoverageIgnore * * Class StoredJournalEventHandler - * - * @package FireflyIII\Handlers\Events */ class StoredJournalEventHandler { - /** @var JRI */ + /** @var JRI */ public $journalRepository; - /** @var PRI */ + /** @var PRI */ public $repository; - /** @var RGRI */ + /** @var RGRI */ public $ruleGroupRepository; /** @@ -88,7 +85,7 @@ class StoredJournalEventHandler } // piggy exists? - if (is_null($piggyBank->id)) { + if (null === $piggyBank->id) { Log::error(sprintf('There is no piggy bank with ID #%d', $piggyBankId)); return true; @@ -96,7 +93,7 @@ class StoredJournalEventHandler // repetition exists? $repetition = $this->repository->getRepetition($piggyBank, $journal->date); - if (is_null($repetition->id)) { + if (null === $repetition->id) { Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d'))); return true; @@ -104,7 +101,7 @@ class StoredJournalEventHandler // get the amount $amount = $this->repository->getExactAmount($piggyBank, $repetition, $journal); - if (bccomp($amount, '0') === 0) { + if (0 === bccomp($amount, '0')) { Log::debug('Amount is zero, will not create event.'); return true; diff --git a/app/Handlers/Events/UpdatedJournalEventHandler.php b/app/Handlers/Events/UpdatedJournalEventHandler.php index beca510fd2..13f2af4b01 100644 --- a/app/Handlers/Events/UpdatedJournalEventHandler.php +++ b/app/Handlers/Events/UpdatedJournalEventHandler.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Handlers\Events; @@ -34,12 +33,10 @@ use FireflyIII\TransactionRules\Processor; * @codeCoverageIgnore * * Class UpdatedJournalEventHandler - * - * @package FireflyIII\Handlers\Events */ class UpdatedJournalEventHandler { - /** @var RuleGroupRepositoryInterface */ + /** @var RuleGroupRepositoryInterface */ public $repository; /** diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index 8f3379f2c5..d1c2186811 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Handlers\Events; @@ -37,17 +36,14 @@ use Preferences; use Swift_TransportException; /** - * Class UserEventHandler + * Class UserEventHandler. * * This class responds to any events that have anything to do with the User object. * * The method name reflects what is being done. This is in the present tense. - * - * @package FireflyIII\Handlers\Events */ class UserEventHandler { - /** * This method will bestow upon a user the "owner" role if he is the first user in the system. * @@ -61,7 +57,7 @@ class UserEventHandler $repository = app(UserRepositoryInterface::class); // first user ever? - if ($repository->count() === 1) { + if (1 === $repository->count()) { $repository->attachRole($event->user, 'owner'); } diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index aab22e613f..d36a840063 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Attachments; @@ -33,14 +32,11 @@ use Storage; use Symfony\Component\HttpFoundation\File\UploadedFile; /** - * Class AttachmentHelper - * - * @package FireflyIII\Helpers\Attachments + * Class AttachmentHelper. */ class AttachmentHelper implements AttachmentHelperInterface { - - /** @var Collection */ + /** @var Collection */ public $attachments; /** @var MessageBag */ public $errors; @@ -114,7 +110,7 @@ class AttachmentHelper implements AttachmentHelperInterface if (is_array($files)) { /** @var UploadedFile $entry */ foreach ($files as $entry) { - if (!is_null($entry)) { + if (null !== $entry) { $this->processFile($entry, $model); } } @@ -152,7 +148,6 @@ class AttachmentHelper implements AttachmentHelperInterface } /** - * * @param UploadedFile $file * @param Model $model * @@ -161,7 +156,7 @@ class AttachmentHelper implements AttachmentHelperInterface protected function processFile(UploadedFile $file, Model $model): Attachment { $validation = $this->validateUpload($file, $model); - if ($validation === false) { + if (false === $validation) { return new Attachment; } diff --git a/app/Helpers/Attachments/AttachmentHelperInterface.php b/app/Helpers/Attachments/AttachmentHelperInterface.php index 4d398739dd..e292b29539 100644 --- a/app/Helpers/Attachments/AttachmentHelperInterface.php +++ b/app/Helpers/Attachments/AttachmentHelperInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Attachments; @@ -29,13 +28,10 @@ use Illuminate\Support\Collection; use Illuminate\Support\MessageBag; /** - * Interface AttachmentHelperInterface - * - * @package FireflyIII\Helpers\Attachments + * Interface AttachmentHelperInterface. */ interface AttachmentHelperInterface { - /** * @param Attachment $attachment * @@ -60,7 +56,6 @@ interface AttachmentHelperInterface /** * @param Model $model - * * @param null|array $files * * @return bool diff --git a/app/Helpers/Chart/MetaPieChart.php b/app/Helpers/Chart/MetaPieChart.php index 4950e9f855..65d11c52d4 100644 --- a/app/Helpers/Chart/MetaPieChart.php +++ b/app/Helpers/Chart/MetaPieChart.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Chart; @@ -41,23 +40,19 @@ use Illuminate\Support\Collection; use Steam; /** - * Class MetaPieChart - * - * @package FireflyIII\Helpers\Chart - * - * + * Class MetaPieChart. */ class MetaPieChart implements MetaPieChartInterface { - /** @var Collection */ + /** @var Collection */ protected $accounts; - /** @var Collection */ + /** @var Collection */ protected $budgets; - /** @var Collection */ + /** @var Collection */ protected $categories; /** @var bool */ protected $collectOtherObjects = false; - /** @var Carbon */ + /** @var Carbon */ protected $end; /** @var array */ protected $grouping @@ -75,13 +70,13 @@ class MetaPieChart implements MetaPieChartInterface 'category' => CategoryRepositoryInterface::class, 'tag' => TagRepositoryInterface::class, ]; - /** @var Carbon */ + /** @var Carbon */ protected $start; - /** @var Collection */ + /** @var Collection */ protected $tags; - /** @var string */ + /** @var string */ protected $total = '0'; - /** @var User */ + /** @var User */ protected $user; public function __construct() @@ -108,7 +103,7 @@ class MetaPieChart implements MetaPieChartInterface $key = strval(trans('firefly.everything_else')); // also collect all other transactions - if ($this->collectOtherObjects && $direction === 'expense') { + if ($this->collectOtherObjects && 'expense' === $direction) { /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setUser($this->user); @@ -121,7 +116,7 @@ class MetaPieChart implements MetaPieChartInterface $chartData[$key] = $sum; } - if ($this->collectOtherObjects && $direction === 'income') { + if ($this->collectOtherObjects && 'income' === $direction) { /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setUser($this->user); @@ -258,7 +253,7 @@ class MetaPieChart implements MetaPieChartInterface $collector = app(JournalCollectorInterface::class); $types = [TransactionType::DEPOSIT, TransactionType::TRANSFER]; $collector->addFilter(NegativeAmountFilter::class); - if ($direction === 'expense') { + if ('expense' === $direction) { $types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER]; $collector->addFilter(PositiveAmountFilter::class); $collector->removeFilter(NegativeAmountFilter::class); @@ -271,7 +266,7 @@ class MetaPieChart implements MetaPieChartInterface $collector->withOpposingAccount(); $collector->addFilter(OpposingAccountFilter::class); - if ($direction === 'income') { + if ('income' === $direction) { $collector->removeFilter(TransferFilter::class); } @@ -294,11 +289,10 @@ class MetaPieChart implements MetaPieChartInterface * @return array * * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * */ protected function groupByFields(Collection $set, array $fields): array { - if (count($fields) === 0 && $this->tags->count() > 0) { + if (0 === count($fields) && $this->tags->count() > 0) { // do a special group on tags: return $this->groupByTag($set); } diff --git a/app/Helpers/Chart/MetaPieChartInterface.php b/app/Helpers/Chart/MetaPieChartInterface.php index cc15e17308..250b13c7bc 100644 --- a/app/Helpers/Chart/MetaPieChartInterface.php +++ b/app/Helpers/Chart/MetaPieChartInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Chart; @@ -28,9 +27,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface MetaPieChartInterface - * - * @package FireflyIII\Helpers\Chart + * Interface MetaPieChartInterface. */ interface MetaPieChartInterface { @@ -47,54 +44,54 @@ interface MetaPieChartInterface * * @return MetaPieChartInterface */ - public function setAccounts(Collection $accounts): MetaPieChartInterface; + public function setAccounts(Collection $accounts): self; /** * @param Collection $budgets * * @return MetaPieChartInterface */ - public function setBudgets(Collection $budgets): MetaPieChartInterface; + public function setBudgets(Collection $budgets): self; /** * @param Collection $categories * * @return MetaPieChartInterface */ - public function setCategories(Collection $categories): MetaPieChartInterface; + public function setCategories(Collection $categories): self; /** * @param bool $collectOtherObjects * * @return MetaPieChartInterface */ - public function setCollectOtherObjects(bool $collectOtherObjects): MetaPieChartInterface; + public function setCollectOtherObjects(bool $collectOtherObjects): self; /** * @param Carbon $end * * @return MetaPieChartInterface */ - public function setEnd(Carbon $end): MetaPieChartInterface; + public function setEnd(Carbon $end): self; /** * @param Carbon $start * * @return MetaPieChartInterface */ - public function setStart(Carbon $start): MetaPieChartInterface; + public function setStart(Carbon $start): self; /** * @param Collection $tags * * @return MetaPieChartInterface */ - public function setTags(Collection $tags): MetaPieChartInterface; + public function setTags(Collection $tags): self; /** * @param User $user * * @return MetaPieChartInterface */ - public function setUser(User $user): MetaPieChartInterface; + public function setUser(User $user): self; } diff --git a/app/Helpers/Collection/Balance.php b/app/Helpers/Collection/Balance.php index aef2709026..b1ecf5c206 100644 --- a/app/Helpers/Collection/Balance.php +++ b/app/Helpers/Collection/Balance.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collection; @@ -26,18 +25,14 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * - * Class Balance - * - * @package FireflyIII\Helpers\Collection + * Class Balance. */ class Balance { - - /** @var BalanceHeader */ + /** @var BalanceHeader */ protected $balanceHeader; - /** @var Collection */ + /** @var Collection */ protected $balanceLines; /** diff --git a/app/Helpers/Collection/BalanceEntry.php b/app/Helpers/Collection/BalanceEntry.php index e67a11e7de..5037b3d421 100644 --- a/app/Helpers/Collection/BalanceEntry.php +++ b/app/Helpers/Collection/BalanceEntry.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collection; @@ -26,16 +25,11 @@ namespace FireflyIII\Helpers\Collection; use FireflyIII\Models\Account as AccountModel; /** - * - * Class BalanceEntry - * - * @package FireflyIII\Helpers\Collection + * Class BalanceEntry. */ class BalanceEntry { - - - /** @var AccountModel */ + /** @var AccountModel */ protected $account; /** @var string */ protected $left = '0'; diff --git a/app/Helpers/Collection/BalanceHeader.php b/app/Helpers/Collection/BalanceHeader.php index 7a6746997c..84d9844b89 100644 --- a/app/Helpers/Collection/BalanceHeader.php +++ b/app/Helpers/Collection/BalanceHeader.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collection; @@ -27,15 +26,11 @@ use FireflyIII\Models\Account as AccountModel; use Illuminate\Support\Collection; /** - * - * Class BalanceHeader - * - * @package FireflyIII\Helpers\Collection + * Class BalanceHeader. */ class BalanceHeader { - - /** @var Collection */ + /** @var Collection */ protected $accounts; /** diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index e9673eb680..2f8f8f729f 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collection; @@ -29,10 +28,7 @@ use FireflyIII\Models\BudgetLimit; use Illuminate\Support\Collection; /** - * - * Class BalanceLine - * - * @package FireflyIII\Helpers\Collection + * Class BalanceLine. */ class BalanceLine { @@ -40,12 +36,12 @@ class BalanceLine const ROLE_TAGROLE = 2; const ROLE_DIFFROLE = 3; - /** @var Collection */ + /** @var Collection */ protected $balanceEntries; /** @var BudgetModel */ protected $budget; - /** @var BudgetLimit */ + /** @var BudgetLimit */ protected $budgetLimit; /** @var int */ protected $role = self::ROLE_DEFAULTROLE; @@ -148,20 +144,21 @@ class BalanceLine /** * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * * @return string */ public function getTitle(): string { - if ($this->getBudget() instanceof BudgetModel && !is_null($this->getBudget()->id)) { + if ($this->getBudget() instanceof BudgetModel && null !== $this->getBudget()->id) { return $this->getBudget()->name; } - if ($this->getRole() === self::ROLE_DEFAULTROLE) { + if (self::ROLE_DEFAULTROLE === $this->getRole()) { return strval(trans('firefly.no_budget')); } - if ($this->getRole() === self::ROLE_TAGROLE) { + if (self::ROLE_TAGROLE === $this->getRole()) { return strval(trans('firefly.coveredWithTags')); } - if ($this->getRole() === self::ROLE_DIFFROLE) { + if (self::ROLE_DIFFROLE === $this->getRole()) { return strval(trans('firefly.leftUnbalanced')); } @@ -172,7 +169,7 @@ class BalanceLine * If a BalanceLine has a budget/repetition, each BalanceEntry in this BalanceLine * should have a "spent" value, which is the amount of money that has been spent * on the given budget/repetition. If you subtract all those amounts from the budget/repetition's - * total amount, this is returned: + * total amount, this is returned:. * * @return string */ diff --git a/app/Helpers/Collection/Bill.php b/app/Helpers/Collection/Bill.php index e79ce41076..16a4730863 100644 --- a/app/Helpers/Collection/Bill.php +++ b/app/Helpers/Collection/Bill.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collection; @@ -29,20 +28,17 @@ use Illuminate\Support\Collection; use Log; /** - * Class Bill - * - * @package FireflyIII\Helpers\Collection + * Class Bill. */ class Bill { - /** * @var Collection */ private $bills; - /** @var Carbon */ + /** @var Carbon */ private $endDate; - /** @var Carbon */ + /** @var Carbon */ private $startDate; /** @@ -105,14 +101,13 @@ class Bill { $set = $this->bills->sortBy( function (BillLine $bill) { - $active = intval($bill->getBill()->active) === 0 ? 1 : 0; + $active = 0 === intval($bill->getBill()->active) ? 1 : 0; $name = $bill->getBill()->name; return $active . $name; } ); - return $set; } diff --git a/app/Helpers/Collection/BillLine.php b/app/Helpers/Collection/BillLine.php index a82f8fb289..ed5dde7fe7 100644 --- a/app/Helpers/Collection/BillLine.php +++ b/app/Helpers/Collection/BillLine.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collection; @@ -27,27 +26,23 @@ use Carbon\Carbon; use FireflyIII\Models\Bill as BillModel; /** - * - * Class BillLine - * - * @package FireflyIII\Helpers\Collection + * Class BillLine. */ class BillLine { - - /** @var string */ + /** @var string */ protected $amount; - /** @var BillModel */ + /** @var BillModel */ protected $bill; - /** @var bool */ + /** @var bool */ protected $hit; - /** @var string */ + /** @var string */ protected $max; - /** @var string */ + /** @var string */ protected $min; - /** @var Carbon */ + /** @var Carbon */ private $lastHitDate; - /** @var int */ + /** @var int */ private $transactionJournalId; /** @@ -159,7 +154,7 @@ class BillLine */ public function isActive(): bool { - return intval($this->bill->active) === 1; + return 1 === intval($this->bill->active); } /** diff --git a/app/Helpers/Collection/Category.php b/app/Helpers/Collection/Category.php index 9bb918cb5e..60bd436add 100644 --- a/app/Helpers/Collection/Category.php +++ b/app/Helpers/Collection/Category.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collection; @@ -27,15 +26,11 @@ use FireflyIII\Models\Category as CategoryModel; use Illuminate\Support\Collection; /** - * - * Class Category - * - * @package FireflyIII\Helpers\Collection + * Class Category. */ class Category { - - /** @var Collection */ + /** @var Collection */ protected $categories; /** @var string */ protected $total = '0'; @@ -79,7 +74,6 @@ class Category } ); - return $set; } diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php index 39e31ba888..4219a13068 100644 --- a/app/Helpers/Collector/JournalCollector.php +++ b/app/Helpers/Collector/JournalCollector.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collector; @@ -51,7 +50,6 @@ use Steam; * * Class JournalCollector * - * @package FireflyIII\Helpers\Collector * * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -59,10 +57,9 @@ use Steam; */ class JournalCollector implements JournalCollectorInterface { - /** @var array */ private $accountIds = []; - /** @var int */ + /** @var int */ private $count = 0; /** @var array */ private $fields @@ -101,22 +98,21 @@ class JournalCollector implements JournalCollectorInterface 'accounts.encrypted as account_encrypted', 'accounts.iban as account_iban', 'account_types.type as account_type', - ]; /** @var array */ private $filters = [InternalTransferFilter::class]; - /** @var bool */ + /** @var bool */ private $joinedBudget = false; - /** @var bool */ + /** @var bool */ private $joinedCategory = false; /** @var bool */ private $joinedOpposing = false; /** @var bool */ private $joinedTag = false; - /** @var int */ + /** @var int */ private $limit; - /** @var int */ + /** @var int */ private $offset; /** @var int */ private $page = 1; @@ -218,11 +214,12 @@ class JournalCollector implements JournalCollectorInterface /** * @return int + * * @throws FireflyException */ public function count(): int { - if ($this->run === true) { + if (true === $this->run) { throw new FireflyException('Cannot count after run in JournalCollector.'); } @@ -258,7 +255,7 @@ class JournalCollector implements JournalCollectorInterface $transaction->date = new Carbon($transaction->date); $transaction->description = Steam::decrypt(intval($transaction->encrypted), $transaction->description); - if (!is_null($transaction->bill_name)) { + if (null !== $transaction->bill_name) { $transaction->bill_name = Steam::decrypt(intval($transaction->bill_name_encrypted), $transaction->bill_name); } $transaction->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name); @@ -272,11 +269,12 @@ class JournalCollector implements JournalCollectorInterface /** * @return LengthAwarePaginator + * * @throws FireflyException */ public function getPaginatedJournals(): LengthAwarePaginator { - if ($this->run === true) { + if (true === $this->run) { throw new FireflyException('Cannot getPaginatedJournals after run in JournalCollector.'); } $this->count(); @@ -294,7 +292,7 @@ class JournalCollector implements JournalCollectorInterface public function removeFilter(string $filter): JournalCollectorInterface { $key = array_search($filter, $this->filters, true); - if (!($key === false)) { + if (!(false === $key)) { Log::debug(sprintf('Removed filter %s', $filter)); unset($this->filters[$key]); } @@ -320,7 +318,6 @@ class JournalCollector implements JournalCollectorInterface $this->addFilter(TransferFilter::class); } - return $this; } @@ -416,7 +413,7 @@ class JournalCollector implements JournalCollectorInterface public function setBudgets(Collection $budgets): JournalCollectorInterface { $budgetIds = $budgets->pluck('id')->toArray(); - if (count($budgetIds) === 0) { + if (0 === count($budgetIds)) { return $this; } $this->joinBudgetTables(); @@ -440,7 +437,7 @@ class JournalCollector implements JournalCollectorInterface public function setCategories(Collection $categories): JournalCollectorInterface { $categoryIds = $categories->pluck('id')->toArray(); - if (count($categoryIds) === 0) { + if (0 === count($categoryIds)) { return $this; } $this->joinCategoryTables(); @@ -514,11 +511,11 @@ class JournalCollector implements JournalCollectorInterface $this->page = $page; if ($page > 0) { - $page--; + --$page; } Log::debug(sprintf('Page is %d', $page)); - if (!is_null($this->limit)) { + if (null !== $this->limit) { $offset = ($this->limit * $page); $this->offset = $offset; $this->query->skip($offset); diff --git a/app/Helpers/Collector/JournalCollectorInterface.php b/app/Helpers/Collector/JournalCollectorInterface.php index cb9dbe444f..d6a7793572 100644 --- a/app/Helpers/Collector/JournalCollectorInterface.php +++ b/app/Helpers/Collector/JournalCollectorInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Collector; @@ -32,9 +31,7 @@ use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; /** - * Interface JournalCollectorInterface - * - * @package FireflyIII\Helpers\Collector + * Interface JournalCollectorInterface. */ interface JournalCollectorInterface { @@ -43,28 +40,28 @@ interface JournalCollectorInterface * * @return JournalCollectorInterface */ - public function addFilter(string $filter): JournalCollectorInterface; + public function addFilter(string $filter): self; /** * @param string $amount * * @return JournalCollectorInterface */ - public function amountIs(string $amount): JournalCollectorInterface; + public function amountIs(string $amount): self; /** * @param string $amount * * @return JournalCollectorInterface */ - public function amountLess(string $amount): JournalCollectorInterface; + public function amountLess(string $amount): self; /** * @param string $amount * * @return JournalCollectorInterface */ - public function amountMore(string $amount): JournalCollectorInterface; + public function amountMore(string $amount): self; /** * @return int @@ -86,89 +83,89 @@ interface JournalCollectorInterface * * @return JournalCollectorInterface */ - public function removeFilter(string $filter): JournalCollectorInterface; + public function removeFilter(string $filter): self; /** * @param Collection $accounts * * @return JournalCollectorInterface */ - public function setAccounts(Collection $accounts): JournalCollectorInterface; + public function setAccounts(Collection $accounts): self; /** * @param Carbon $after * * @return JournalCollectorInterface */ - public function setAfter(Carbon $after): JournalCollectorInterface; + public function setAfter(Carbon $after): self; /** * @return JournalCollectorInterface */ - public function setAllAssetAccounts(): JournalCollectorInterface; + public function setAllAssetAccounts(): self; /** * @param Carbon $before * * @return JournalCollectorInterface */ - public function setBefore(Carbon $before): JournalCollectorInterface; + public function setBefore(Carbon $before): self; /** * @param Collection $bills * * @return JournalCollectorInterface */ - public function setBills(Collection $bills): JournalCollectorInterface; + public function setBills(Collection $bills): self; /** * @param Budget $budget * * @return JournalCollectorInterface */ - public function setBudget(Budget $budget): JournalCollectorInterface; + public function setBudget(Budget $budget): self; /** * @param Collection $budgets * * @return JournalCollectorInterface */ - public function setBudgets(Collection $budgets): JournalCollectorInterface; + public function setBudgets(Collection $budgets): self; /** * @param Collection $categories * * @return JournalCollectorInterface */ - public function setCategories(Collection $categories): JournalCollectorInterface; + public function setCategories(Collection $categories): self; /** * @param Category $category * * @return JournalCollectorInterface */ - public function setCategory(Category $category): JournalCollectorInterface; + public function setCategory(Category $category): self; /** * @param int $limit * * @return JournalCollectorInterface */ - public function setLimit(int $limit): JournalCollectorInterface; + public function setLimit(int $limit): self; /** * @param int $offset * * @return JournalCollectorInterface */ - public function setOffset(int $offset): JournalCollectorInterface; + public function setOffset(int $offset): self; /** * @param int $page * * @return JournalCollectorInterface */ - public function setPage(int $page): JournalCollectorInterface; + public function setPage(int $page): self; /** * @param Carbon $start @@ -176,28 +173,28 @@ interface JournalCollectorInterface * * @return JournalCollectorInterface */ - public function setRange(Carbon $start, Carbon $end): JournalCollectorInterface; + public function setRange(Carbon $start, Carbon $end): self; /** * @param Tag $tag * * @return JournalCollectorInterface */ - public function setTag(Tag $tag): JournalCollectorInterface; + public function setTag(Tag $tag): self; /** * @param Collection $tags * * @return JournalCollectorInterface */ - public function setTags(Collection $tags): JournalCollectorInterface; + public function setTags(Collection $tags): self; /** * @param array $types * * @return JournalCollectorInterface */ - public function setTypes(array $types): JournalCollectorInterface; + public function setTypes(array $types): self; public function setUser(User $user); @@ -209,25 +206,25 @@ interface JournalCollectorInterface /** * @return JournalCollectorInterface */ - public function withBudgetInformation(): JournalCollectorInterface; + public function withBudgetInformation(): self; /** * @return JournalCollectorInterface */ - public function withCategoryInformation(): JournalCollectorInterface; + public function withCategoryInformation(): self; /** * @return JournalCollectorInterface */ - public function withOpposingAccount(): JournalCollectorInterface; + public function withOpposingAccount(): self; /** * @return JournalCollectorInterface */ - public function withoutBudget(): JournalCollectorInterface; + public function withoutBudget(): self; /** * @return JournalCollectorInterface */ - public function withoutCategory(): JournalCollectorInterface; + public function withoutCategory(): self; } diff --git a/app/Helpers/Filter/AmountFilter.php b/app/Helpers/Filter/AmountFilter.php index 2c5439928c..970bbefa49 100644 --- a/app/Helpers/Filter/AmountFilter.php +++ b/app/Helpers/Filter/AmountFilter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Filter; @@ -28,12 +27,10 @@ use Illuminate\Support\Collection; use Log; /** - * Class AmountFilter + * Class AmountFilter. * * This filter removes transactions with either a positive amount ($parameters = 1) or a negative amount * ($parameter = -1). This is helpful when a Collection has you with both transactions in a journal. - * - * @package FireflyIII\Helpers\Filter */ class AmountFilter implements FilterInterface { diff --git a/app/Helpers/Filter/EmptyFilter.php b/app/Helpers/Filter/EmptyFilter.php index a9a0aaa5f6..7c8c16313c 100644 --- a/app/Helpers/Filter/EmptyFilter.php +++ b/app/Helpers/Filter/EmptyFilter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Filter; @@ -26,14 +25,10 @@ namespace FireflyIII\Helpers\Filter; use Illuminate\Support\Collection; /** - * Class EmptyFilter - * - * @package FireflyIII\Helpers\Filter + * Class EmptyFilter. */ class EmptyFilter implements FilterInterface { - - /** * @param Collection $set * diff --git a/app/Helpers/Filter/FilterInterface.php b/app/Helpers/Filter/FilterInterface.php index 24e3362a32..229864ad8f 100644 --- a/app/Helpers/Filter/FilterInterface.php +++ b/app/Helpers/Filter/FilterInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Filter; diff --git a/app/Helpers/Filter/InternalTransferFilter.php b/app/Helpers/Filter/InternalTransferFilter.php index 2f72d22f30..1113977ceb 100644 --- a/app/Helpers/Filter/InternalTransferFilter.php +++ b/app/Helpers/Filter/InternalTransferFilter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Filter; @@ -28,13 +27,11 @@ use Illuminate\Support\Collection; use Log; /** - * Class InternalTransferFilter + * Class InternalTransferFilter. * * This filter removes any filters that are from A to B or from B to A given a set of * account id's (in $parameters) where A and B are mentioned. So transfers between the mentioned * accounts will be removed. - * - * @package FireflyIII\Helpers\Filter */ class InternalTransferFilter implements FilterInterface { @@ -60,7 +57,7 @@ class InternalTransferFilter implements FilterInterface { return $set->filter( function (Transaction $transaction) { - if (is_null($transaction->opposing_account_id)) { + if (null === $transaction->opposing_account_id) { return $transaction; } // both id's in $parameters? diff --git a/app/Helpers/Filter/NegativeAmountFilter.php b/app/Helpers/Filter/NegativeAmountFilter.php index 730f9717b1..65e95f9fe5 100644 --- a/app/Helpers/Filter/NegativeAmountFilter.php +++ b/app/Helpers/Filter/NegativeAmountFilter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Filter; @@ -28,11 +27,9 @@ use Illuminate\Support\Collection; use Log; /** - * Class NegativeAmountFilter + * Class NegativeAmountFilter. * * This filter removes entries with a negative amount (the original modifier is -1). - * - * @package FireflyIII\Helpers\Filter */ class NegativeAmountFilter implements FilterInterface { diff --git a/app/Helpers/Filter/OpposingAccountFilter.php b/app/Helpers/Filter/OpposingAccountFilter.php index df02f9405a..1539b86bde 100644 --- a/app/Helpers/Filter/OpposingAccountFilter.php +++ b/app/Helpers/Filter/OpposingAccountFilter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Filter; @@ -28,12 +27,10 @@ use Illuminate\Support\Collection; use Log; /** - * Class OpposingAccountFilter + * Class OpposingAccountFilter. * * This filter is similar to the internal transfer filter but only removes transactions when the opposing account is * amongst $parameters (list of account ID's). - * - * @package FireflyIII\Helpers\Filter */ class OpposingAccountFilter implements FilterInterface { diff --git a/app/Helpers/Filter/PositiveAmountFilter.php b/app/Helpers/Filter/PositiveAmountFilter.php index e5464d9253..1a6b5383d3 100644 --- a/app/Helpers/Filter/PositiveAmountFilter.php +++ b/app/Helpers/Filter/PositiveAmountFilter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Filter; @@ -28,14 +27,12 @@ use Illuminate\Support\Collection; use Log; /** - * Class PositiveAmountFilter + * Class PositiveAmountFilter. * * This filter removes entries with a negative amount (the original modifier is -1). * * This filter removes transactions with either a positive amount ($parameters = 1) or a negative amount * ($parameter = -1). This is helpful when a Collection has you with both transactions in a journal. - * - * @package FireflyIII\Helpers\Filter */ class PositiveAmountFilter implements FilterInterface { @@ -49,7 +46,7 @@ class PositiveAmountFilter implements FilterInterface return $set->filter( function (Transaction $transaction) { // remove by amount - if (bccomp($transaction->transaction_amount, '0') === 1) { + if (1 === bccomp($transaction->transaction_amount, '0')) { Log::debug(sprintf('Filtered #%d because amount is %f.', $transaction->id, $transaction->transaction_amount)); return null; diff --git a/app/Helpers/Filter/TransferFilter.php b/app/Helpers/Filter/TransferFilter.php index 732e9dee6b..4d3e6877ef 100644 --- a/app/Helpers/Filter/TransferFilter.php +++ b/app/Helpers/Filter/TransferFilter.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Filter; @@ -29,11 +28,9 @@ use Illuminate\Support\Collection; use Steam; /** - * Class TransferFilter + * Class TransferFilter. * * This filter removes any transfers that are in the collection twice (from A to B and from B to A). - * - * @package FireflyIII\Helpers\Filter */ class TransferFilter implements FilterInterface { @@ -48,7 +45,7 @@ class TransferFilter implements FilterInterface $new = new Collection; /** @var Transaction $transaction */ foreach ($set as $transaction) { - if ($transaction->transaction_type_type !== TransactionType::TRANSFER) { + if (TransactionType::TRANSFER !== $transaction->transaction_type_type) { $new->push($transaction); continue; } diff --git a/app/Helpers/FiscalHelper.php b/app/Helpers/FiscalHelper.php index 45b2280ca6..4624f5aac2 100644 --- a/app/Helpers/FiscalHelper.php +++ b/app/Helpers/FiscalHelper.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers; @@ -27,20 +26,15 @@ use Carbon\Carbon; use Preferences; /** - * Class FiscalHelper - * - * @package FireflyIII\Helpers + * Class FiscalHelper. */ class FiscalHelper implements FiscalHelperInterface { - /** @var bool */ protected $useCustomFiscalYear; /** * FiscalHelper constructor. - * - * */ public function __construct() { @@ -56,7 +50,7 @@ class FiscalHelper implements FiscalHelperInterface { // get start of fiscal year for passed date $endDate = $this->startOfFiscalYear($date); - if ($this->useCustomFiscalYear === true) { + if (true === $this->useCustomFiscalYear) { // add 1 year and sub 1 day $endDate->addYear(); $endDate->subDay(); @@ -65,7 +59,6 @@ class FiscalHelper implements FiscalHelperInterface } $endDate->endOfYear(); - return $endDate; } @@ -78,7 +71,7 @@ class FiscalHelper implements FiscalHelperInterface { // get start mm-dd. Then create a start date in the year passed. $startDate = clone $date; - if ($this->useCustomFiscalYear === true) { + if (true === $this->useCustomFiscalYear) { $prefStartStr = Preferences::get('fiscalYearStart', '01-01')->data; list($mth, $day) = explode('-', $prefStartStr); $startDate->month(intval($mth))->day(intval($day)); diff --git a/app/Helpers/FiscalHelperInterface.php b/app/Helpers/FiscalHelperInterface.php index 152ba48262..c6a4764da0 100644 --- a/app/Helpers/FiscalHelperInterface.php +++ b/app/Helpers/FiscalHelperInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers; @@ -26,13 +25,10 @@ namespace FireflyIII\Helpers; use Carbon\Carbon; /** - * Interface FiscalHelperInterface - * - * @package FireflyIII\Helpers + * Interface FiscalHelperInterface. */ interface FiscalHelperInterface { - /** * This method produces a clone of the Carbon date object passed, checks preferences * and calculates the last day of the fiscal year. diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index 9a27a368c4..265a642d5e 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Help; @@ -31,9 +30,7 @@ use Requests_Exception; use Route; /** - * Class Help - * - * @package FireflyIII\Helpers\Help + * Class Help. */ class Help implements HelpInterface { @@ -76,7 +73,7 @@ class Help implements HelpInterface Log::debug(sprintf('Status code is %d', $result->status_code)); - if ($result->status_code === 200) { + if (200 === $result->status_code) { $content = trim($result->body); } @@ -90,7 +87,6 @@ class Help implements HelpInterface } /** - * * @param string $route * * @return bool @@ -121,11 +117,9 @@ class Help implements HelpInterface } /** - * * @param string $route * @param string $language * @param string $content - * */ public function putInCache(string $route, string $language, string $content) { diff --git a/app/Helpers/Help/HelpInterface.php b/app/Helpers/Help/HelpInterface.php index 5b97799697..4768e3fd40 100644 --- a/app/Helpers/Help/HelpInterface.php +++ b/app/Helpers/Help/HelpInterface.php @@ -18,19 +18,15 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Help; /** - * Interface HelpInterface - * - * @package FireflyIII\Helpers\Help + * Interface HelpInterface. */ interface HelpInterface { - /** * @param string $route * @param string $language diff --git a/app/Helpers/Report/BalanceReportHelper.php b/app/Helpers/Report/BalanceReportHelper.php index 244ab9be70..3222c1f1f5 100644 --- a/app/Helpers/Report/BalanceReportHelper.php +++ b/app/Helpers/Report/BalanceReportHelper.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Report; @@ -34,15 +33,13 @@ use Illuminate\Support\Collection; use Log; /** - * Class BalanceReportHelper + * Class BalanceReportHelper. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // I can't really help it. - * @package FireflyIII\Helpers\Report */ class BalanceReportHelper implements BalanceReportHelperInterface { - - /** @var BudgetRepositoryInterface */ + /** @var BudgetRepositoryInterface */ protected $budgetRepository; /** @@ -56,7 +53,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface $this->budgetRepository = $budgetRepository; } - /** * @param Collection $accounts * @param Carbon $start @@ -77,7 +73,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface /** @var BudgetLimit $budgetLimit */ foreach ($budgetLimits as $budgetLimit) { - if (!is_null($budgetLimit->budget)) { + if (null !== $budgetLimit->budget) { $line = $this->createBalanceLine($budgetLimit, $accounts); $balance->addBalanceLine($line); } @@ -96,7 +92,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface return $balance; } - /** * @param BudgetLimit $budgetLimit * @param Collection $accounts @@ -126,7 +121,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface return $line; } - /** * @param Collection $accounts * @param Carbon $start @@ -150,7 +144,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface return $empty; } - /** * @param Balance $balance * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5. @@ -162,7 +155,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface $set = $balance->getBalanceLines(); $newSet = new Collection; foreach ($set as $entry) { - if (!is_null($entry->getBudget()->id)) { + if (null !== $entry->getBudget()->id) { $sum = '0'; foreach ($entry->getBalanceEntries() as $balanceEntry) { $sum = bcadd($sum, $balanceEntry->getSpent()); diff --git a/app/Helpers/Report/BalanceReportHelperInterface.php b/app/Helpers/Report/BalanceReportHelperInterface.php index 9aa17f589f..66e7b23e89 100644 --- a/app/Helpers/Report/BalanceReportHelperInterface.php +++ b/app/Helpers/Report/BalanceReportHelperInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Report; @@ -28,9 +27,7 @@ use FireflyIII\Helpers\Collection\Balance; use Illuminate\Support\Collection; /** - * Interface BalanceReportHelperInterface - * - * @package FireflyIII\Helpers\Report + * Interface BalanceReportHelperInterface. */ interface BalanceReportHelperInterface { diff --git a/app/Helpers/Report/BudgetReportHelper.php b/app/Helpers/Report/BudgetReportHelper.php index 07d4cda721..995932ce73 100644 --- a/app/Helpers/Report/BudgetReportHelper.php +++ b/app/Helpers/Report/BudgetReportHelper.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Report; @@ -30,9 +29,7 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Illuminate\Support\Collection; /** - * Class BudgetReportHelper - * - * @package FireflyIII\Helpers\Report + * Class BudgetReportHelper. */ class BudgetReportHelper implements BudgetReportHelperInterface { @@ -52,6 +49,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface /** * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5. * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // all the arrays make it long. + * * @param Carbon $start * @param Carbon $end * @param Collection $accounts @@ -66,9 +64,8 @@ class BudgetReportHelper implements BudgetReportHelperInterface /** @var Budget $budget */ foreach ($set as $budget) { $budgetLimits = $this->repository->getBudgetLimits($budget, $start, $end); - if ($budgetLimits->count() === 0) { // no budget limit(s) for this budget - - $spent = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end);// spent for budget in time range + if (0 === $budgetLimits->count()) { // no budget limit(s) for this budget + $spent = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end); // spent for budget in time range if (bccomp($spent, '0') === -1) { $line = [ 'type' => 'budget', @@ -156,9 +153,9 @@ class BudgetReportHelper implements BudgetReportHelperInterface { $array = []; $expenses = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $budgetLimit->start_date, $budgetLimit->end_date); - $array['left'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? bcadd($budgetLimit->amount, $expenses) : '0'; - $array['spent'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? $expenses : '0'; - $array['overspent'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? '0' : bcadd($expenses, $budgetLimit->amount); + $array['left'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? bcadd($budgetLimit->amount, $expenses) : '0'; + $array['spent'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? $expenses : '0'; + $array['overspent'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? '0' : bcadd($expenses, $budgetLimit->amount); $array['expenses'] = $expenses; return $array; diff --git a/app/Helpers/Report/BudgetReportHelperInterface.php b/app/Helpers/Report/BudgetReportHelperInterface.php index 3c86a0fd12..7c4a7ccf2f 100644 --- a/app/Helpers/Report/BudgetReportHelperInterface.php +++ b/app/Helpers/Report/BudgetReportHelperInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Report; @@ -27,13 +26,10 @@ use Carbon\Carbon; use Illuminate\Support\Collection; /** - * Interface BudgetReportHelperInterface - * - * @package FireflyIII\Helpers\Report + * Interface BudgetReportHelperInterface. */ interface BudgetReportHelperInterface { - /** * @param Carbon $start * @param Carbon $end diff --git a/app/Helpers/Report/PopupReport.php b/app/Helpers/Report/PopupReport.php index 49b4014354..65c9164d0c 100644 --- a/app/Helpers/Report/PopupReport.php +++ b/app/Helpers/Report/PopupReport.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Report; @@ -32,14 +31,10 @@ use FireflyIII\Models\TransactionType; use Illuminate\Support\Collection; /** - * Class PopupReport - * - * @package FireflyIII\Helpers\Report + * Class PopupReport. */ class PopupReport implements PopupReportInterface { - - /** * @param $account * @param $attributes @@ -58,11 +53,10 @@ class PopupReport implements PopupReportInterface ->withoutBudget(); $journals = $collector->getJournals(); - return $journals->filter( function (Transaction $transaction) { $tags = $transaction->transactionJournal->tags()->where('tagMode', 'balancingAct')->count(); - if ($tags === 0) { + if (0 === $tags) { return true; } @@ -120,10 +114,10 @@ class PopupReport implements PopupReportInterface $collector->setAccounts($attributes['accounts'])->setRange($attributes['startDate'], $attributes['endDate']); - if (is_null($budget->id)) { + if (null === $budget->id) { $collector->setTypes([TransactionType::WITHDRAWAL])->withoutBudget(); } - if (!is_null($budget->id)) { + if (null !== $budget->id) { $collector->setBudget($budget); } $journals = $collector->getJournals(); diff --git a/app/Helpers/Report/PopupReportInterface.php b/app/Helpers/Report/PopupReportInterface.php index 288c53a72e..4b19f54661 100644 --- a/app/Helpers/Report/PopupReportInterface.php +++ b/app/Helpers/Report/PopupReportInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Report; @@ -29,13 +28,10 @@ use FireflyIII\Models\Category; use Illuminate\Support\Collection; /** - * Interface PopupReportInterface - * - * @package FireflyIII\Helpers\Report + * Interface PopupReportInterface. */ interface PopupReportInterface { - /** * @param $account * @param $attributes diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index c355f65821..3b812533da 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Report; @@ -35,14 +34,11 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Illuminate\Support\Collection; /** - * Class ReportHelper - * - * @package FireflyIII\Helpers\Report + * Class ReportHelper. */ class ReportHelper implements ReportHelperInterface { - - /** @var BudgetRepositoryInterface */ + /** @var BudgetRepositoryInterface */ protected $budgetRepository; /** @@ -95,7 +91,7 @@ class ReportHelper implements ReportHelperInterface } ); $first = $entry->first(); - if (!is_null($first)) { + if (null !== $first) { $billLine->setTransactionJournalId($first->id); $billLine->setAmount($first->transaction_amount); $billLine->setLastHitDate($first->date); diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php index 98e26667ad..dafd0105ae 100644 --- a/app/Helpers/Report/ReportHelperInterface.php +++ b/app/Helpers/Report/ReportHelperInterface.php @@ -18,25 +18,19 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Helpers\Report; use Carbon\Carbon; use FireflyIII\Helpers\Collection\Bill as BillCollection; -use FireflyIII\Helpers\Collection\Expense; -use FireflyIII\Helpers\Collection\Income; use Illuminate\Support\Collection; /** - * Interface ReportHelperInterface - * - * @package FireflyIII\Helpers\Report + * Interface ReportHelperInterface. */ interface ReportHelperInterface { - /** * This method generates a full report for the given period on all * the users bills and their payments. diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php index d0c1d1234c..37746ccdde 100644 --- a/app/Http/Controllers/Account/ReconcileController.php +++ b/app/Http/Controllers/Account/ReconcileController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; @@ -37,9 +36,7 @@ use Response; use View; /** - * Class ReconcileController - * - * @package FireflyIII\Http\Controllers\Account + * Class ReconcileController. */ class ReconcileController extends Controller { @@ -94,14 +91,14 @@ class ReconcileController extends Controller */ public function reconcile(Account $account, Carbon $start = null, Carbon $end = null) { - if ($account->accountType->type === AccountType::INITIAL_BALANCE) { + if (AccountType::INITIAL_BALANCE === $account->accountType->type) { return $this->redirectToOriginalAccount($account); } /** @var CurrencyRepositoryInterface $currencyRepos */ $currencyRepos = app(CurrencyRepositoryInterface::class); $currencyId = intval($account->getMeta('currency_id')); $currency = $currencyRepos->find($currencyId); - if ($currencyId === 0) { + if (0 === $currencyId) { $currency = app('amount')->getDefaultCurrency(); } @@ -109,11 +106,11 @@ class ReconcileController extends Controller $range = Preferences::get('viewRange', '1M')->data; // get start and end - if (is_null($start) && is_null($end)) { + if (null === $start && null === $end) { $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); $end = clone session('end', Navigation::endOfPeriod(new Carbon, $range)); } - if (is_null($end)) { + if (null === $end) { $end = Navigation::endOfPeriod($start, $range); } @@ -158,7 +155,7 @@ class ReconcileController extends Controller */ public function transactions(Account $account, Carbon $start, Carbon $end) { - if ($account->accountType->type === AccountType::INITIAL_BALANCE) { + if (AccountType::INITIAL_BALANCE === $account->accountType->type) { return $this->redirectToOriginalAccount($account); } @@ -168,7 +165,6 @@ class ReconcileController extends Controller $selectionEnd = clone $end; $selectionEnd->addDays(3); - // grab transactions: /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 1880401794..ebbd721bbe 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -45,9 +44,8 @@ use Steam; use View; /** - * Class AccountController + * Class AccountController. * - * @package FireflyIII\Http\Controllers * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class AccountController extends Controller @@ -90,12 +88,11 @@ class AccountController extends Controller $roles[$role] = strval(trans('firefly.account_role_' . $role)); } - // pre fill some data - $request->session()->flash('preFilled', ['currency_id' => $defaultCurrency->id,]); + $request->session()->flash('preFilled', ['currency_id' => $defaultCurrency->id]); // put previous url in session if not redirect from store (not "create another"). - if (session('accounts.create.fromStore') !== true) { + if (true !== session('accounts.create.fromStore')) { $this->rememberPreviousUri('accounts.create.uri'); } $request->session()->forget('accounts.create.fromStore'); @@ -174,9 +171,8 @@ class AccountController extends Controller $roles[$role] = strval(trans('firefly.account_role_' . $role)); } - // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('accounts.edit.fromUpdate') !== true) { + if (true !== session('accounts.edit.fromUpdate')) { $this->rememberPreviousUri('accounts.edit.uri'); } $request->session()->forget('accounts.edit.fromUpdate'); @@ -185,9 +181,9 @@ class AccountController extends Controller // the opening balance is tricky: $openingBalanceAmount = $account->getOpeningBalanceAmount(); - $openingBalanceAmount = $account->getOpeningBalanceAmount() === '0' ? '' : $openingBalanceAmount; + $openingBalanceAmount = '0' === $account->getOpeningBalanceAmount() ? '' : $openingBalanceAmount; $openingBalanceDate = $account->getOpeningBalanceDate(); - $openingBalanceDate = $openingBalanceDate->year === 1900 ? null : $openingBalanceDate->format('Y-m-d'); + $openingBalanceDate = 1900 === $openingBalanceDate->year ? null : $openingBalanceDate->format('Y-m-d'); $currency = $repository->find(intval($account->getMeta('currency_id'))); $preFilled = [ @@ -200,7 +196,6 @@ class AccountController extends Controller 'openingBalance' => $openingBalanceAmount, 'virtualBalance' => $account->virtual_balance, 'currency_id' => $currency->id, - ]; $request->session()->flash('preFilled', $preFilled); $request->session()->flash('gaEventCategory', 'accounts'); @@ -273,7 +268,7 @@ class AccountController extends Controller */ public function show(Request $request, JournalRepositoryInterface $repository, Account $account, string $moment = '') { - if ($account->accountType->type === AccountType::INITIAL_BALANCE) { + if (AccountType::INITIAL_BALANCE === $account->accountType->type) { return $this->redirectToOriginalAccount($account); } /** @var CurrencyRepositoryInterface $currencyRepos */ @@ -288,13 +283,12 @@ class AccountController extends Controller $periods = new Collection; $currencyId = intval($account->getMeta('currency_id')); $currency = $currencyRepos->find($currencyId); - if ($currencyId === 0) { + if (0 === $currencyId) { $currency = app('amount')->getDefaultCurrency(); } - // prep for "all" view. - if ($moment === 'all') { + if ('all' === $moment) { $subTitle = trans('firefly.all_journals_for_account', ['name' => $account->name]); $chartUri = route('chart.account.all', [$account->id]); $first = $repository->first(); @@ -303,7 +297,7 @@ class AccountController extends Controller } // prep for "specific date" view. - if (strlen($moment) > 0 && $moment !== 'all') { + if (strlen($moment) > 0 && 'all' !== $moment) { $start = new Carbon($moment); $end = Navigation::endOfPeriod($start, $range); $fStart = $start->formatLocalized($this->monthAndDayFormat); @@ -314,7 +308,7 @@ class AccountController extends Controller } // prep for current period view - if (strlen($moment) === 0) { + if (0 === strlen($moment)) { $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); $end = clone session('end', Navigation::endOfPeriod(new Carbon, $range)); $fStart = $start->formatLocalized($this->monthAndDayFormat); @@ -326,7 +320,7 @@ class AccountController extends Controller // grab journals: $collector = app(JournalCollectorInterface::class); $collector->setAccounts(new Collection([$account]))->setLimit($pageSize)->setPage($page); - if (!is_null($start)) { + if (null !== $start) { $collector->setRange($start, $end); } $transactions = $collector->getPaginatedJournals(); @@ -343,7 +337,6 @@ class AccountController extends Controller * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * */ public function store(AccountFormRequest $request, AccountRepositoryInterface $repository) { @@ -354,12 +347,12 @@ class AccountController extends Controller // update preferences if necessary: $frontPage = Preferences::get('frontPageAccounts', [])->data; - if (count($frontPage) > 0 && $account->accountType->type === AccountType::ASSET) { + if (count($frontPage) > 0 && AccountType::ASSET === $account->accountType->type) { $frontPage[] = $account->id; Preferences::set('frontPageAccounts', $frontPage); } - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // set value so create routine will not overwrite URL: $request->session()->put('accounts.create.fromStore', true); @@ -385,7 +378,7 @@ class AccountController extends Controller $request->session()->flash('success', strval(trans('firefly.updated_account', ['name' => $account->name]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // set value so edit routine will not overwrite URL: $request->session()->put('accounts.edit.fromUpdate', true); @@ -396,7 +389,6 @@ class AccountController extends Controller return redirect($this->getPreviousUri('accounts.edit.uri')); } - /** * @param array $array * @param int $entryId @@ -468,10 +460,10 @@ class AccountController extends Controller 'name' => $dateName, 'spent' => $spent, 'earned' => $earned, - 'date' => clone $end] + 'date' => clone $end,] ); $end = Navigation::subtractPeriod($end, $range, 1); - $count++; + ++$count; } $cache->store($entries); @@ -482,13 +474,14 @@ class AccountController extends Controller * @param Account $account * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + * * @throws FireflyException */ private function redirectToOriginalAccount(Account $account) { /** @var Transaction $transaction */ $transaction = $account->transactions()->first(); - if (is_null($transaction)) { + if (null === $transaction) { throw new FireflyException('Expected a transaction. This account has none. BEEP, error.'); } @@ -496,7 +489,7 @@ class AccountController extends Controller /** @var Transaction $opposingTransaction */ $opposingTransaction = $journal->transactions()->where('transactions.id', '!=', $transaction->id)->first(); - if (is_null($opposingTransaction)) { + if (null === $opposingTransaction) { throw new FireflyException('Expected an opposing transaction. This account has none. BEEP, error.'); // @codeCoverageIgnore } diff --git a/app/Http/Controllers/Admin/ConfigurationController.php b/app/Http/Controllers/Admin/ConfigurationController.php index 1be473766c..fa4b3ab1d5 100644 --- a/app/Http/Controllers/Admin/ConfigurationController.php +++ b/app/Http/Controllers/Admin/ConfigurationController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; @@ -32,9 +31,7 @@ use Session; use View; /** - * Class ConfigurationController - * - * @package FireflyIII\Http\Controllers\Admin + * Class ConfigurationController. */ class ConfigurationController extends Controller { @@ -45,7 +42,6 @@ class ConfigurationController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', strval(trans('firefly.administration'))); diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index 1c25ae67d1..4fa7948909 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; @@ -30,9 +29,7 @@ use Log; use Session; /** - * Class HomeController - * - * @package FireflyIII\Http\Controllers\Admin + * Class HomeController. */ class HomeController extends Controller { diff --git a/app/Http/Controllers/Admin/LinkController.php b/app/Http/Controllers/Admin/LinkController.php index ee25cab6a7..06c8146e37 100644 --- a/app/Http/Controllers/Admin/LinkController.php +++ b/app/Http/Controllers/Admin/LinkController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; @@ -32,9 +31,7 @@ use Preferences; use View; /** - * Class LinkController - * - * @package FireflyIII\Http\Controllers\Admin + * Class LinkController. */ class LinkController extends Controller { @@ -64,7 +61,7 @@ class LinkController extends Controller $subTitleIcon = 'fa-link'; // put previous url in session if not redirect from store (not "create another"). - if (session('link_types.create.fromStore') !== true) { + if (true !== session('link_types.create.fromStore')) { $this->rememberPreviousUri('link_types.create.uri'); } @@ -139,7 +136,7 @@ class LinkController extends Controller $subTitleIcon = 'fa-link'; // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('link_types.edit.fromUpdate') !== true) { + if (true !== session('link_types.edit.fromUpdate')) { $this->rememberPreviousUri('link_types.edit.uri'); } $request->session()->forget('link_types.edit.fromUpdate'); @@ -196,7 +193,7 @@ class LinkController extends Controller $linkType = $repository->store($data); $request->session()->flash('success', strval(trans('firefly.stored_new_link_type', ['name' => $linkType->name]))); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // set value so create routine will not overwrite URL: $request->session()->put('link_types.create.fromStore', true); @@ -225,7 +222,7 @@ class LinkController extends Controller $request->session()->flash('success', strval(trans('firefly.updated_link_type', ['name' => $linkType->name]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // set value so edit routine will not overwrite URL: $request->session()->put('link_types.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index e8cf8288cf..8670e95e90 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; @@ -33,9 +32,7 @@ use Session; use View; /** - * Class UserController - * - * @package FireflyIII\Http\Controllers\Admin + * Class UserController. */ class UserController extends Controller { @@ -46,7 +43,6 @@ class UserController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', strval(trans('firefly.administration'))); @@ -91,7 +87,7 @@ class UserController extends Controller public function edit(User $user) { // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('users.edit.fromUpdate') !== true) { + if (true !== session('users.edit.fromUpdate')) { $this->rememberPreviousUri('users.edit.uri'); } Session::forget('users.edit.fromUpdate'); @@ -125,14 +121,13 @@ class UserController extends Controller $list = ['twoFactorAuthEnabled', 'twoFactorAuthSecret']; $preferences = Preferences::getArrayForUser($user, $list); $user->isAdmin = $user->hasRole('owner'); - $is2faEnabled = $preferences['twoFactorAuthEnabled'] === true; - $has2faSecret = !is_null($preferences['twoFactorAuthSecret']); + $is2faEnabled = true === $preferences['twoFactorAuthEnabled']; + $has2faSecret = null !== $preferences['twoFactorAuthSecret']; $user->has2FA = ($is2faEnabled && $has2faSecret) ? true : false; $user->prefs = $preferences; } ); - return view('admin.users.index', compact('subTitle', 'subTitleIcon', 'users')); } @@ -166,7 +161,6 @@ class UserController extends Controller /** * @param UserFormRequest $request * @param User $user - * * @param UserRepositoryInterface $repository * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector @@ -187,7 +181,7 @@ class UserController extends Controller Session::flash('success', strval(trans('firefly.updated_user', ['email' => $user->email]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart Session::put('users.edit.fromUpdate', true); diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index e09f8cb8d5..b2ef0b7875 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -35,15 +34,12 @@ use Response; use View; /** - * Class AttachmentController + * Class AttachmentController. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // it's 13. - * - * @package FireflyIII\Http\Controllers */ class AttachmentController extends Controller { - /** * */ @@ -104,6 +100,7 @@ class AttachmentController extends Controller * @param Attachment $attachment * * @return mixed + * * @throws FireflyException */ public function download(AttachmentRepositoryInterface $repository, Attachment $attachment) @@ -112,7 +109,6 @@ class AttachmentController extends Controller $content = $repository->getContent($attachment); $quoted = sprintf('"%s"', addcslashes(basename($attachment->filename), '"\\')); - /** @var LaravelResponse $response */ $response = response($content, 200); $response @@ -143,7 +139,7 @@ class AttachmentController extends Controller $subTitle = trans('firefly.edit_attachment', ['name' => $attachment->filename]); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('attachments.edit.fromUpdate') !== true) { + if (true !== session('attachments.edit.fromUpdate')) { $this->rememberPreviousUri('attachments.edit.uri'); } $request->session()->forget('attachments.edit.fromUpdate'); @@ -160,8 +156,7 @@ class AttachmentController extends Controller { $image = 'images/page_green.png'; - - if ($attachment->mime === 'application/pdf') { + if ('application/pdf' === $attachment->mime) { $image = 'images/page_white_acrobat.png'; } $file = public_path($image); @@ -171,7 +166,6 @@ class AttachmentController extends Controller return $response; } - /** * @param AttachmentFormRequest $request * @param AttachmentRepositoryInterface $repository @@ -187,7 +181,7 @@ class AttachmentController extends Controller $request->session()->flash('success', strval(trans('firefly.attachment_updated', ['name' => $attachment->filename]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart $request->session()->put('attachments.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 82f1f40c44..e969737770 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * ForgotPasswordController.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -53,7 +51,6 @@ class ForgotPasswordController extends Controller /** * Create a new controller instance. - * */ public function __construct() { diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 2d958b0d94..1a4aa09918 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * LoginController.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -66,7 +64,6 @@ class LoginController extends Controller /** * Create a new controller instance. - * */ public function __construct() { @@ -93,7 +90,7 @@ class LoginController extends Controller // check for presence of currency: $currency = TransactionCurrency::where('code', 'EUR')->first(); - if (is_null($currency)) { + if (null === $currency) { $message = 'Firefly III could not find the EURO currency. This is a strong indication the database has not been initialized correctly. Did you follow the installation instructions?'; @@ -107,7 +104,7 @@ class LoginController extends Controller $singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data; $userCount = User::count(); $allowRegistration = true; - if ($singleUserMode === true && $userCount > 0) { + if (true === $singleUserMode && $userCount > 0) { $allowRegistration = false; } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index b539028c8d..7125a0de68 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * RegisterController.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -66,7 +64,6 @@ class RegisterController extends Controller /** * Create a new controller instance. - * */ public function __construct() { @@ -77,7 +74,7 @@ class RegisterController extends Controller /** * Handle a registration request for the application. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * * @return \Illuminate\Http\Response */ @@ -86,7 +83,7 @@ class RegisterController extends Controller // is allowed to? $singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data; $userCount = User::count(); - if ($singleUserMode === true && $userCount > 0) { + if (true === $singleUserMode && $userCount > 0) { $message = 'Registration is currently not available.'; return view('error', compact('message')); @@ -119,7 +116,7 @@ class RegisterController extends Controller // is allowed to? $singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data; $userCount = User::count(); - if ($singleUserMode === true && $userCount > 0) { + if (true === $singleUserMode && $userCount > 0) { $message = 'Registration is currently not available.'; return view('error', compact('message')); @@ -127,14 +124,13 @@ class RegisterController extends Controller $email = $request->old('email'); - return view('auth.register', compact('isDemoSite', 'email')); } /** * Create a new user instance after a valid registration. * - * @param array $data + * @param array $data * * @return \FireflyIII\User */ @@ -151,7 +147,7 @@ class RegisterController extends Controller /** * Get a validator for an incoming registration request. * - * @param array $data + * @param array $data * * @return \Illuminate\Contracts\Validation\Validator */ diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 60913a0822..9009af2485 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * ResetPasswordController.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -60,7 +58,6 @@ class ResetPasswordController extends Controller /** * Create a new controller instance. - * */ public function __construct() { diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index 2a9fd275c3..79bc49041e 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Auth; @@ -32,17 +31,15 @@ use Log; use Preferences; /** - * Class TwoFactorController - * - * @package FireflyIII\Http\Controllers\Auth + * Class TwoFactorController. */ class TwoFactorController extends Controller { - /** * @param Request $request * * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View + * * @throws FireflyException * * @SuppressWarnings(PHPMD.CyclomaticComplexity) @@ -53,16 +50,16 @@ class TwoFactorController extends Controller // to make sure the validator in the next step gets the secret, we push it in session $secretPreference = Preferences::get('twoFactorAuthSecret', null); - $secret = is_null($secretPreference) ? null : $secretPreference->data; + $secret = null === $secretPreference ? null : $secretPreference->data; $title = strval(trans('firefly.two_factor_title')); // make sure the user has two factor configured: $has2FA = Preferences::get('twoFactorAuthEnabled', false)->data; - if (is_null($has2FA) || $has2FA === false) { + if (null === $has2FA || false === $has2FA) { return redirect(route('index')); } - if (strlen(strval($secret)) === 0) { + if (0 === strlen(strval($secret))) { throw new FireflyException('Your two factor authentication secret is empty, which it cannot be at this point. Please check the log files.'); } $request->session()->flash('two-factor-secret', $secret); @@ -72,6 +69,7 @@ class TwoFactorController extends Controller /** * @return mixed + * * @throws FireflyException */ public function lostTwoFactor() @@ -95,7 +93,6 @@ class TwoFactorController extends Controller * * @return mixed * @SuppressWarnings(PHPMD.UnusedFormalParameter) // it's unused but the class does some validation. - * */ public function postIndex(TokenFormRequest $request, CookieJar $cookieJar) { diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index 55bbbaba06..548f127766 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -36,13 +35,10 @@ use URL; use View; /** - * Class BillController - * - * @package FireflyIII\Http\Controllers + * Class BillController. */ class BillController extends Controller { - /** * */ @@ -50,7 +46,6 @@ class BillController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.bills')); @@ -74,9 +69,8 @@ class BillController extends Controller } $subTitle = trans('firefly.create_new_bill'); - // put previous url in session if not redirect from store (not "create another"). - if (session('bills.create.fromStore') !== true) { + if (true !== session('bills.create.fromStore')) { $this->rememberPreviousUri('bills.create.uri'); } $request->session()->forget('bills.create.fromStore'); @@ -136,7 +130,7 @@ class BillController extends Controller $subTitle = trans('firefly.edit_bill', ['name' => $bill->name]); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('bills.edit.fromUpdate') !== true) { + if (true !== session('bills.edit.fromUpdate')) { $this->rememberPreviousUri('bills.edit.uri'); } @@ -166,7 +160,6 @@ class BillController extends Controller $bills = $repository->getBills(); $bills->each( function (Bill $bill) use ($repository, $start, $end) { - // paid in this period? $bill->paidDates = $repository->getPaidDatesInRange($bill, $start, $end); $bill->payDates = $repository->getPayDatesInRange($bill, $start, $end); @@ -190,7 +183,7 @@ class BillController extends Controller */ public function rescan(Request $request, BillRepositoryInterface $repository, Bill $bill) { - if (intval($bill->active) === 0) { + if (0 === intval($bill->active)) { $request->session()->flash('warning', strval(trans('firefly.cannot_scan_inactive_bill'))); return redirect(URL::previous()); @@ -202,7 +195,6 @@ class BillController extends Controller $repository->scan($bill, $journal); } - $request->session()->flash('success', strval(trans('firefly.rescanned_bill'))); Preferences::mark(); @@ -254,7 +246,7 @@ class BillController extends Controller $request->session()->flash('success', strval(trans('firefly.stored_new_bill', ['name' => $bill->name]))); Preferences::mark(); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // @codeCoverageIgnoreStart $request->session()->put('bills.create.fromStore', true); @@ -281,7 +273,7 @@ class BillController extends Controller $request->session()->flash('success', strval(trans('firefly.updated_bill', ['name' => $bill->name]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart $request->session()->put('bills.edit.fromUpdate', true); diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index 9f0d5a0519..63b12faeaa 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -44,16 +43,14 @@ use Response; use View; /** - * Class BudgetController + * Class BudgetController. * - * @package FireflyIII\Http\Controllers * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyPublicMethods) */ class BudgetController extends Controller { - - /** @var BudgetRepositoryInterface */ + /** @var BudgetRepositoryInterface */ private $repository; /** @@ -88,7 +85,7 @@ class BudgetController extends Controller $start = Carbon::createFromFormat('Y-m-d', $request->get('start')); $end = Carbon::createFromFormat('Y-m-d', $request->get('end')); $budgetLimit = $this->repository->updateLimitAmount($budget, $start, $end, $amount); - if ($amount === 0) { + if (0 === $amount) { $budgetLimit = null; } Preferences::mark(); @@ -104,7 +101,7 @@ class BudgetController extends Controller public function create(Request $request) { // put previous url in session if not redirect from store (not "create another"). - if (session('budgets.create.fromStore') !== true) { + if (true !== session('budgets.create.fromStore')) { $this->rememberPreviousUri('budgets.create.uri'); } $request->session()->forget('budgets.create.fromStore'); @@ -160,7 +157,7 @@ class BudgetController extends Controller $subTitle = trans('firefly.edit_budget', ['name' => $budget->name]); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('budgets.edit.fromUpdate') !== true) { + if (true !== session('budgets.edit.fromUpdate')) { $this->rememberPreviousUri('budgets.edit.uri'); } $request->session()->forget('budgets.edit.fromUpdate'); @@ -185,7 +182,7 @@ class BudgetController extends Controller $end = session('end', new Carbon); // make date if present: - if (!is_null($moment) || strlen(strval($moment)) !== 0) { + if (null !== $moment || 0 !== strlen(strval($moment))) { try { $start = new Carbon($moment); $end = Navigation::endOfPeriod($start, $range); @@ -218,7 +215,7 @@ class BudgetController extends Controller $previousDate = Navigation::startOfPeriod($previousDate, $range); $format = $previousDate->format('Y-m-d'); $previousLoop[$format] = Navigation::periodShow($previousDate, $range); - $count++; + ++$count; } // select thing for next 12 periods: @@ -231,7 +228,7 @@ class BudgetController extends Controller $format = $nextDate->format('Y-m-d'); $nextLoop[$format] = Navigation::periodShow($nextDate, $range); $nextDate = Navigation::endOfPeriod($nextDate, $range); - $count++; + ++$count; $nextDate->addDay(); } @@ -301,7 +298,7 @@ class BudgetController extends Controller $currentEnd = Navigation::endOfPeriod($currentStart, $range); $total = bcadd($total, $this->repository->getAvailableBudget($currency, $currentStart, $currentEnd)); $currentStart = Navigation::addPeriod($currentStart, $range, 0); - $count++; + ++$count; } $result['available'] = bcdiv($total, strval($count)); @@ -320,12 +317,11 @@ class BudgetController extends Controller $result['spent'] = bcdiv(strval($collector->getJournals()->sum('transaction_amount')), strval($count)); // suggestion starts with the amount spent $result['suggested'] = bcmul($result['spent'], '-1'); - $result['suggested'] = bccomp($result['suggested'], $result['earned']) === 1 ? $result['earned'] : $result['suggested']; + $result['suggested'] = 1 === bccomp($result['suggested'], $result['earned']) ? $result['earned'] : $result['suggested']; // unless it's more than you earned. So min() of suggested/earned $cache->store($result); - return view('budgets.info', compact('result', 'begin', 'currentEnd')); } @@ -348,7 +344,7 @@ class BudgetController extends Controller $periods = new Collection; // prep for "all" view. - if ($moment === 'all') { + if ('all' === $moment) { $subTitle = trans('firefly.all_journals_without_budget'); $first = $repository->first(); $start = $first->date ?? new Carbon; @@ -356,7 +352,7 @@ class BudgetController extends Controller } // prep for "specific date" view. - if (strlen($moment) > 0 && $moment !== 'all') { + if (strlen($moment) > 0 && 'all' !== $moment) { $start = new Carbon($moment); $end = Navigation::endOfPeriod($start, $range); $subTitle = trans( @@ -367,7 +363,7 @@ class BudgetController extends Controller } // prep for current period - if (strlen($moment) === 0) { + if (0 === strlen($moment)) { $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); $end = clone session('end', Navigation::endOfPeriod(new Carbon, $range)); $periods = $this->getPeriodOverview(); @@ -430,7 +426,6 @@ class BudgetController extends Controller $transactions = $collector->getPaginatedJournals(); $transactions->setPath(route('budgets.show', [$budget->id])); - $subTitle = trans('firefly.all_journals_for_budget', ['name' => $budget->name]); return view('budgets.show', compact('limits', 'budget', 'repetition', 'transactions', 'subTitle')); @@ -442,6 +437,7 @@ class BudgetController extends Controller * @param BudgetLimit $budgetLimit * * @return View + * * @throws FireflyException */ public function showByBudgetLimit(Request $request, Budget $budget, BudgetLimit $budgetLimit) @@ -488,7 +484,7 @@ class BudgetController extends Controller $request->session()->flash('success', strval(trans('firefly.stored_new_budget', ['name' => $budget->name]))); Preferences::mark(); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // @codeCoverageIgnoreStart $request->session()->put('budgets.create.fromStore', true); @@ -513,7 +509,7 @@ class BudgetController extends Controller $request->session()->flash('success', strval(trans('firefly.updated_budget', ['name' => $budget->name]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart $request->session()->put('budgets.edit.fromUpdate', true); @@ -605,7 +601,7 @@ class BudgetController extends Controller $journals = $set->count(); $dateStr = $end->format('Y-m-d'); $dateName = Navigation::periodShow($end, $range); - $entries->push(['string' => $dateStr, 'name' => $dateName, 'count' => $journals, 'sum' => $sum, 'date' => clone $end,]); + $entries->push(['string' => $dateStr, 'name' => $dateName, 'count' => $journals, 'sum' => $sum, 'date' => clone $end]); $end = Navigation::subtractPeriod($end, $range, 1); } $cache->store($entries); diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 2ebd43efa6..1ea9509027 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -43,13 +42,10 @@ use Steam; use View; /** - * Class CategoryController - * - * @package FireflyIII\Http\Controllers + * Class CategoryController. */ class CategoryController extends Controller { - /** * */ @@ -57,7 +53,6 @@ class CategoryController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.categories')); @@ -75,7 +70,7 @@ class CategoryController extends Controller */ public function create(Request $request) { - if (session('categories.create.fromStore') !== true) { + if (true !== session('categories.create.fromStore')) { $this->rememberPreviousUri('categories.create.uri'); } $request->session()->forget('categories.create.fromStore'); @@ -104,7 +99,6 @@ class CategoryController extends Controller return view('categories.delete', compact('category', 'subTitle')); } - /** * @param Request $request * @param CategoryRepositoryInterface $repository @@ -134,7 +128,7 @@ class CategoryController extends Controller $subTitle = trans('firefly.edit_category', ['name' => $category->name]); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('categories.edit.fromUpdate') !== true) { + if (true !== session('categories.edit.fromUpdate')) { $this->rememberPreviousUri('categories.edit.uri'); } $request->session()->forget('categories.edit.fromUpdate'); @@ -180,7 +174,7 @@ class CategoryController extends Controller $pageSize = intval(Preferences::get('transactionPageSize', 50)->data); // prep for "all" view. - if ($moment === 'all') { + if ('all' === $moment) { $subTitle = trans('firefly.all_journals_without_category'); $first = $repository->first(); $start = $first->date ?? new Carbon; @@ -188,7 +182,7 @@ class CategoryController extends Controller } // prep for "specific date" view. - if (strlen($moment) > 0 && $moment !== 'all') { + if (strlen($moment) > 0 && 'all' !== $moment) { $start = new Carbon($moment); $end = Navigation::endOfPeriod($start, $range); $subTitle = trans( @@ -199,7 +193,7 @@ class CategoryController extends Controller } // prep for current period - if (strlen($moment) === 0) { + if (0 === strlen($moment)) { $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); $end = clone session('end', Navigation::endOfPeriod(new Carbon, $range)); $periods = $this->getNoCategoryPeriodOverview(); @@ -209,7 +203,6 @@ class CategoryController extends Controller ); } - /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setAllAssetAccounts()->setRange($start, $end)->setLimit($pageSize)->setPage($page)->withoutCategory()->withOpposingAccount() @@ -242,28 +235,28 @@ class CategoryController extends Controller $periods = new Collection; // prep for "all" view. - if ($moment === 'all') { + if ('all' === $moment) { $subTitle = trans('firefly.all_journals_for_category', ['name' => $category->name]); $first = $repository->firstUseDate($category); /** @var Carbon $start */ - $start = is_null($first) ? new Carbon : $first; + $start = null === $first ? new Carbon : $first; $end = new Carbon; } // prep for "specific date" view. - if (strlen($moment) > 0 && $moment !== 'all') { + if (strlen($moment) > 0 && 'all' !== $moment) { $start = new Carbon($moment); $end = Navigation::endOfPeriod($start, $range); $subTitle = trans( 'firefly.journals_in_period_for_category', ['name' => $category->name, - 'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)] + 'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat),] ); $periods = $this->getPeriodOverview($category); } // prep for current period - if (strlen($moment) === 0) { + if (0 === strlen($moment)) { /** @var Carbon $start */ $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); /** @var Carbon $end */ @@ -272,7 +265,7 @@ class CategoryController extends Controller $subTitle = trans( 'firefly.journals_in_period_for_category', ['name' => $category->name, 'start' => $start->formatLocalized($this->monthAndDayFormat), - 'end' => $end->formatLocalized($this->monthAndDayFormat)] + 'end' => $end->formatLocalized($this->monthAndDayFormat),] ); } @@ -284,11 +277,9 @@ class CategoryController extends Controller $transactions = $collector->getPaginatedJournals(); $transactions->setPath(route('categories.show', [$category->id])); - return view('categories.show', compact('category', 'moment', 'transactions', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end')); } - /** * @param CategoryFormRequest $request * @param CategoryRepositoryInterface $repository @@ -303,7 +294,7 @@ class CategoryController extends Controller $request->session()->flash('success', strval(trans('firefly.stored_category', ['name' => $category->name]))); Preferences::mark(); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // @codeCoverageIgnoreStart $request->session()->put('categories.create.fromStore', true); @@ -314,7 +305,6 @@ class CategoryController extends Controller return redirect(route('categories.index')); } - /** * @param CategoryFormRequest $request * @param CategoryRepositoryInterface $repository @@ -330,7 +320,7 @@ class CategoryController extends Controller $request->session()->flash('success', strval(trans('firefly.updated_category', ['name' => $category->name]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart $request->session()->put('categories.edit.fromUpdate', true); @@ -432,7 +422,7 @@ class CategoryController extends Controller $accountRepository = app(AccountRepositoryInterface::class); $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $first = $repository->firstUseDate($category); - if (is_null($first)) { + if (null === $first) { $first = new Carbon; } $range = Preferences::get('viewRange', '1M')->data; @@ -479,7 +469,7 @@ class CategoryController extends Controller ] ); $end = Navigation::subtractPeriod($end, $range, 1); - $count++; + ++$count; } $cache->store($entries); diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 04981b69cb..a814be6e1b 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -45,14 +44,11 @@ use Response; use Steam; /** checked - * Class AccountController - * - * @package FireflyIII\Http\Controllers\Chart + * Class AccountController. */ class AccountController extends Controller { - - /** @var GeneratorInterface */ + /** @var GeneratorInterface */ protected $generator; /** @@ -133,7 +129,7 @@ class AccountController extends Controller $startBalance = $startBalances[$id] ?? '0'; $endBalance = $endBalances[$id] ?? '0'; $diff = bcsub($endBalance, $startBalance); - if (bccomp($diff, '0') !== 0) { + if (0 !== bccomp($diff, '0')) { $chartData[$account->name] = $diff; } } @@ -274,7 +270,7 @@ class AccountController extends Controller Log::debug('Default set is ', $defaultSet); $frontPage = Preferences::get('frontPageAccounts', $defaultSet); Log::debug('Frontpage preference set is ', $frontPage->data); - if (count($frontPage->data) === 0) { + if (0 === count($frontPage->data)) { $frontPage->data = $defaultSet; Log::debug('frontpage set is empty!'); $frontPage->save(); @@ -346,6 +342,7 @@ class AccountController extends Controller * @param Carbon $start * * @return \Illuminate\Http\JsonResponse + * * @throws FireflyException */ public function period(Account $account, Carbon $start) @@ -427,7 +424,7 @@ class AccountController extends Controller $endBalance = $endBalances[$id] ?? '0'; $diff = bcsub($endBalance, $startBalance); $diff = bcmul($diff, '-1'); - if (bccomp($diff, '0') !== 0) { + if (0 !== bccomp($diff, '0')) { $chartData[$account->name] = $diff; } } @@ -539,7 +536,6 @@ class AccountController extends Controller */ private function getBudgetNames(array $budgetIds): array { - /** @var BudgetRepositoryInterface $repository */ $repository = app(BudgetRepositoryInterface::class); $budgets = $repository->getBudgets(); diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index f81f761686..34e0ca9641 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -35,18 +34,15 @@ use Illuminate\Support\Collection; use Response; /** - * Class BillController - * - * @package FireflyIII\Http\Controllers\Chart + * Class BillController. */ class BillController extends Controller { - /** @var GeneratorInterface */ protected $generator; /** - * checked + * checked. */ public function __construct() { @@ -108,9 +104,9 @@ class BillController extends Controller } ); $chartData = [ - ['type' => 'bar', 'label' => trans('firefly.min-amount'), 'entries' => [],], - ['type' => 'bar', 'label' => trans('firefly.max-amount'), 'entries' => [],], - ['type' => 'line', 'label' => trans('firefly.journal-amount'), 'entries' => [],], + ['type' => 'bar', 'label' => trans('firefly.min-amount'), 'entries' => []], + ['type' => 'bar', 'label' => trans('firefly.max-amount'), 'entries' => []], + ['type' => 'line', 'label' => trans('firefly.journal-amount'), 'entries' => []], ]; /** @var Transaction $entry */ diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 6ebb6222bb..0fbc20571a 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -44,19 +43,16 @@ use Response; use Steam; /** - * Class BudgetController + * Class BudgetController. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // can't realy be helped. - * - * @package FireflyIII\Http\Controllers\Chart */ class BudgetController extends Controller { - /** @var GeneratorInterface */ protected $generator; - /** @var BudgetRepositoryInterface */ + /** @var BudgetRepositoryInterface */ protected $repository; /** @@ -77,7 +73,6 @@ class BudgetController extends Controller } /** - * * @param Budget $budget * * @return \Symfony\Component\HttpFoundation\Response @@ -125,10 +120,12 @@ class BudgetController extends Controller * Shows the amount left in a specific budget limit. * * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five. + * * @param Budget $budget * @param BudgetLimit $budgetLimit * * @return \Symfony\Component\HttpFoundation\Response + * * @throws FireflyException */ public function budgetLimit(Budget $budget, BudgetLimit $budgetLimit) @@ -185,7 +182,7 @@ class BudgetController extends Controller /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setAllAssetAccounts()->setBudget($budget); - if (!is_null($budgetLimit->id)) { + if (null !== $budgetLimit->id) { $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date); } @@ -229,7 +226,7 @@ class BudgetController extends Controller /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setAllAssetAccounts()->setBudget($budget)->withCategoryInformation(); - if (!is_null($budgetLimit->id)) { + if (null !== $budgetLimit->id) { $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date); } @@ -275,7 +272,7 @@ class BudgetController extends Controller /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setAllAssetAccounts()->setTypes([TransactionType::WITHDRAWAL])->setBudget($budget)->withOpposingAccount(); - if (!is_null($budgetLimit->id)) { + if (null !== $budgetLimit->id) { $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date); } @@ -303,6 +300,7 @@ class BudgetController extends Controller /** * Shows a budget list with spent/left/overspent. + * * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five. * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // 46 lines, I'm fine with this. * @@ -322,9 +320,9 @@ class BudgetController extends Controller } $budgets = $this->repository->getActiveBudgets(); $chartData = [ - ['label' => strval(trans('firefly.spent_in_budget')), 'entries' => [], 'type' => 'bar',], - ['label' => strval(trans('firefly.left_to_spend')), 'entries' => [], 'type' => 'bar',], - ['label' => strval(trans('firefly.overspent')), 'entries' => [], 'type' => 'bar',], + ['label' => strval(trans('firefly.spent_in_budget')), 'entries' => [], 'type' => 'bar'], + ['label' => strval(trans('firefly.left_to_spend')), 'entries' => [], 'type' => 'bar'], + ['label' => strval(trans('firefly.overspent')), 'entries' => [], 'type' => 'bar'], ]; /** @var Budget $budget */ @@ -342,7 +340,7 @@ class BudgetController extends Controller // for no budget: $spent = $this->spentInPeriodWithout($start, $end); $name = strval(trans('firefly.no_budget')); - if (bccomp($spent, '0') !== 0) { + if (0 !== bccomp($spent, '0')) { $chartData[0]['entries'][$name] = bcmul($spent, '-1'); $chartData[1]['entries'][$name] = '0'; $chartData[2]['entries'][$name] = '0'; @@ -354,7 +352,6 @@ class BudgetController extends Controller return Response::json($data); } - /** * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five. * @@ -383,8 +380,8 @@ class BudgetController extends Controller // join them into one set of data: $chartData = [ - ['label' => strval(trans('firefly.spent')), 'type' => 'bar', 'entries' => [],], - ['label' => strval(trans('firefly.budgeted')), 'type' => 'bar', 'entries' => [],], + ['label' => strval(trans('firefly.spent')), 'type' => 'bar', 'entries' => []], + ['label' => strval(trans('firefly.budgeted')), 'type' => 'bar', 'entries' => []], ]; foreach (array_keys($periods) as $period) { @@ -509,7 +506,6 @@ class BudgetController extends Controller } /** - * * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's 6 but ok. * * @param Collection $limits @@ -522,9 +518,9 @@ class BudgetController extends Controller private function getExpensesForBudget(Collection $limits, Budget $budget, Carbon $start, Carbon $end): array { $return = []; - if ($limits->count() === 0) { + if (0 === $limits->count()) { $spent = $this->repository->spentInPeriod(new Collection([$budget]), new Collection, $start, $end); - if (bccomp($spent, '0') !== 0) { + if (0 !== bccomp($spent, '0')) { $return[$budget->name]['spent'] = bcmul($spent, '-1'); $return[$budget->name]['left'] = 0; $return[$budget->name]['overspent'] = 0; @@ -535,7 +531,7 @@ class BudgetController extends Controller $rows = $this->spentInPeriodMulti($budget, $limits); foreach ($rows as $name => $row) { - if (bccomp($row['spent'], '0') !== 0 || bccomp($row['left'], '0') !== 0) { + if (0 !== bccomp($row['spent'], '0') || 0 !== bccomp($row['left'], '0')) { $return[$name] = $row; } } @@ -607,7 +603,7 @@ class BudgetController extends Controller * 'name' => "no budget" in local language * 'repetition_left' => left in budget repetition (always zero) * 'repetition_overspent' => spent more than budget repetition? (always zero) - * 'spent' => actually spent in period for budget + * 'spent' => actually spent in period for budget. * * @param Carbon $start * @param Carbon $end diff --git a/app/Http/Controllers/Chart/BudgetReportController.php b/app/Http/Controllers/Chart/BudgetReportController.php index 62b3b07f3a..60ee052df1 100644 --- a/app/Http/Controllers/Chart/BudgetReportController.php +++ b/app/Http/Controllers/Chart/BudgetReportController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -45,15 +44,12 @@ use Response; * Separate controller because many helper functions are shared. * * Class BudgetReportController - * - * @package FireflyIII\Http\Controllers\Chart */ class BudgetReportController extends Controller { - /** @var BudgetRepositoryInterface */ private $budgetRepository; - /** @var GeneratorInterface */ + /** @var GeneratorInterface */ private $generator; /** @@ -89,7 +85,7 @@ class BudgetReportController extends Controller $helper->setBudgets($budgets); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('expense', 'account'); $data = $this->generator->pieChart($chartData); @@ -113,7 +109,7 @@ class BudgetReportController extends Controller $helper->setBudgets($budgets); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('expense', 'budget'); $data = $this->generator->pieChart($chartData); diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 83b5cbd656..f354244d2d 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -37,13 +36,11 @@ use Preferences; use Response; /** - * Class CategoryController - * - * @package FireflyIII\Http\Controllers\Chart + * Class CategoryController. */ class CategoryController extends Controller { - /** @var GeneratorInterface */ + /** @var GeneratorInterface */ protected $generator; /** @@ -76,7 +73,7 @@ class CategoryController extends Controller $start = $repository->firstUseDate($category); - if (is_null($start)) { + if (null === $start) { $start = new Carbon; } @@ -277,7 +274,6 @@ class CategoryController extends Controller /** * @param CategoryRepositoryInterface $repository * @param Category $category - * * @param $date * * @return \Symfony\Component\HttpFoundation\Response @@ -292,7 +288,6 @@ class CategoryController extends Controller return Response::json($data); } - /** * @param CategoryRepositoryInterface $repository * @param Category $category @@ -347,7 +342,6 @@ class CategoryController extends Controller $chartData[1]['entries'][$label] = round($earned, 12); $chartData[2]['entries'][$label] = round($sum, 12); - $start->addDay(); } diff --git a/app/Http/Controllers/Chart/CategoryReportController.php b/app/Http/Controllers/Chart/CategoryReportController.php index 1fea301d5a..5c59817706 100644 --- a/app/Http/Controllers/Chart/CategoryReportController.php +++ b/app/Http/Controllers/Chart/CategoryReportController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -44,13 +43,10 @@ use Response; * Separate controller because many helper functions are shared. * * Class CategoryReportController - * - * @package FireflyIII\Http\Controllers\Chart */ class CategoryReportController extends Controller { - - /** @var GeneratorInterface */ + /** @var GeneratorInterface */ private $generator; /** @@ -81,7 +77,7 @@ class CategoryReportController extends Controller { /** @var MetaPieChartInterface $helper */ $helper = app(MetaPieChartInterface::class); - $helper->setAccounts($accounts)->setCategories($categories)->setStart($start)->setEnd($end)->setCollectOtherObjects(intval($others) === 1); + $helper->setAccounts($accounts)->setCategories($categories)->setStart($start)->setEnd($end)->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('expense', 'account'); $data = $this->generator->pieChart($chartData); @@ -106,7 +102,7 @@ class CategoryReportController extends Controller $helper->setCategories($categories); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('income', 'account'); $data = $this->generator->pieChart($chartData); @@ -130,7 +126,7 @@ class CategoryReportController extends Controller $helper->setCategories($categories); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('expense', 'category'); $data = $this->generator->pieChart($chartData); @@ -148,14 +144,13 @@ class CategoryReportController extends Controller */ public function categoryIncome(Collection $accounts, Collection $categories, Carbon $start, Carbon $end, string $others) { - /** @var MetaPieChartInterface $helper */ $helper = app(MetaPieChartInterface::class); $helper->setAccounts($accounts); $helper->setCategories($categories); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('income', 'category'); $data = $this->generator->pieChart($chartData); @@ -236,7 +231,6 @@ class CategoryReportController extends Controller $currentIncome = $income[$category->id] ?? '0'; $currentExpense = $expenses[$category->id] ?? '0'; - // add to sum: $sumOfIncome[$category->id] = $sumOfIncome[$category->id] ?? '0'; $sumOfExpense[$category->id] = $sumOfExpense[$category->id] ?? '0'; @@ -255,11 +249,11 @@ class CategoryReportController extends Controller // remove all empty entries to prevent cluttering: $newSet = []; foreach ($chartData as $key => $entry) { - if (!array_sum($entry['entries']) === 0) { + if (0 === !array_sum($entry['entries'])) { $newSet[$key] = $chartData[$key]; } } - if (count($newSet) === 0) { + if (0 === count($newSet)) { $newSet = $chartData; } $data = $this->generator->multiSet($newSet); @@ -268,7 +262,6 @@ class CategoryReportController extends Controller return Response::json($data); } - /** * @param Collection $accounts * @param Collection $categories diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index 275fab7f68..303f239008 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -32,13 +31,10 @@ use FireflyIII\Support\CacheProperties; use Response; /** - * Class PiggyBankController - * - * @package FireflyIII\Http\Controllers\Chart + * Class PiggyBankController. */ class PiggyBankController extends Controller { - /** @var GeneratorInterface */ protected $generator; diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 5ffe130df5..d54697bfa5 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -35,13 +34,10 @@ use Response; use Steam; /** - * Class ReportController - * - * @package FireflyIII\Http\Controllers\Chart + * Class ReportController. */ class ReportController extends Controller { - /** @var GeneratorInterface */ protected $generator; @@ -92,15 +88,13 @@ class ReportController extends Controller return Response::json($data); } - /** - * Shows income and expense, debet/credit: operations + * Shows income and expense, debet/credit: operations. * * @param Collection $accounts * @param Carbon $start * @param Carbon $end * - * * @return \Illuminate\Http\JsonResponse */ public function operations(Collection $accounts, Carbon $start, Carbon $end) @@ -143,7 +137,6 @@ class ReportController extends Controller $chartData[1]['entries'][$label] = bcadd($spent, $amount); } - $data = $this->generator->multiSet($chartData); $cache->store($data); @@ -151,7 +144,7 @@ class ReportController extends Controller } /** - * Shows sum income and expense, debet/credit: operations + * Shows sum income and expense, debet/credit: operations. * * @param Carbon $start * @param Carbon $end @@ -161,8 +154,6 @@ class ReportController extends Controller */ public function sum(Collection $accounts, Carbon $start, Carbon $end) { - - // chart properties for cache: $cache = new CacheProperties; $cache->addProperty('chart.report.sum'); @@ -173,7 +164,6 @@ class ReportController extends Controller return Response::json($cache->get()); // @codeCoverageIgnore } - $source = $this->getChartData($accounts, $start, $end); $numbers = [ 'sum_earned' => '0', @@ -185,14 +175,14 @@ class ReportController extends Controller ]; foreach ($source['earned'] as $amount) { $numbers['sum_earned'] = bcadd($amount, $numbers['sum_earned']); - $numbers['count_earned']++; + ++$numbers['count_earned']; } if ($numbers['count_earned'] > 0) { $numbers['avg_earned'] = $numbers['sum_earned'] / $numbers['count_earned']; } foreach ($source['spent'] as $amount) { $numbers['sum_spent'] = bcadd($amount, $numbers['sum_spent']); - $numbers['count_spent']++; + ++$numbers['count_spent']; } if ($numbers['count_spent'] > 0) { $numbers['avg_spent'] = $numbers['sum_spent'] / $numbers['count_spent']; @@ -217,7 +207,6 @@ class ReportController extends Controller ], ]; - $data = $this->generator->multiSet($chartData); $cache->store($data); @@ -240,7 +229,7 @@ class ReportController extends Controller } /** - * Collects the incomes and expenses for the given periods, grouped per month. Will cache its results + * Collects the incomes and expenses for the given periods, grouped per month. Will cache its results. * * @param Collection $accounts * @param Carbon $start @@ -290,7 +279,6 @@ class ReportController extends Controller ) ); - $label = $currentStart->format('Y-m') . '-01'; $spentArray[$label] = bcmul($spent, '-1'); $earnedArray[$label] = $earned; diff --git a/app/Http/Controllers/Chart/TagReportController.php b/app/Http/Controllers/Chart/TagReportController.php index 6aead89388..de4daf03dc 100644 --- a/app/Http/Controllers/Chart/TagReportController.php +++ b/app/Http/Controllers/Chart/TagReportController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; @@ -72,7 +71,7 @@ class TagReportController extends Controller $helper->setTags($tags); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('expense', 'account'); $data = $this->generator->pieChart($chartData); @@ -96,7 +95,7 @@ class TagReportController extends Controller $helper->setTags($tags); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('income', 'account'); $data = $this->generator->pieChart($chartData); @@ -223,7 +222,6 @@ class TagReportController extends Controller $currentIncome = $income[$tag->id] ?? '0'; $currentExpense = $expenses[$tag->id] ?? '0'; - // add to sum: $sumOfIncome[$tag->id] = $sumOfIncome[$tag->id] ?? '0'; $sumOfExpense[$tag->id] = $sumOfExpense[$tag->id] ?? '0'; @@ -242,11 +240,11 @@ class TagReportController extends Controller // remove all empty entries to prevent cluttering: $newSet = []; foreach ($chartData as $key => $entry) { - if (!array_sum($entry['entries']) === 0) { + if (0 === !array_sum($entry['entries'])) { $newSet[$key] = $chartData[$key]; } } - if (count($newSet) === 0) { + if (0 === count($newSet)) { $newSet = $chartData; // @codeCoverageIgnore } $data = $this->generator->multiSet($newSet); @@ -272,7 +270,7 @@ class TagReportController extends Controller $helper->setTags($tags); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('expense', 'tag'); $data = $this->generator->pieChart($chartData); @@ -290,14 +288,13 @@ class TagReportController extends Controller */ public function tagIncome(Collection $accounts, Collection $tags, Carbon $start, Carbon $end, string $others) { - /** @var MetaPieChartInterface $helper */ $helper = app(MetaPieChartInterface::class); $helper->setAccounts($accounts); $helper->setTags($tags); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(intval($others) === 1); + $helper->setCollectOtherObjects(1 === intval($others)); $chartData = $helper->generate('income', 'tag'); $data = $this->generator->pieChart($chartData); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 3d7e3e0999..3d08e5d0b0 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -40,15 +39,13 @@ use URL; use View; /** - * Class Controller - * - * @package FireflyIII\Http\Controllers + * Class Controller. */ class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; - /** @var string */ + /** @var string */ protected $dateTimeFormat; /** @var string */ protected $monthAndDayFormat; @@ -75,7 +72,6 @@ class Controller extends BaseController View::share('DEMO_PASSWORD', env('DEMO_PASSWORD', '')); View::share('FF_VERSION', config('firefly.version')); - $this->middleware( function ($request, $next) { // translations for specific strings: @@ -86,7 +82,7 @@ class Controller extends BaseController // get shown-intro-preference: if (auth()->check()) { // some routes have a "what" parameter, which indicates a special page: - $specificPage = is_null(Route::current()->parameter('what')) ? '' : '_' . Route::current()->parameter('what'); + $specificPage = null === Route::current()->parameter('what') ? '' : '_' . Route::current()->parameter('what'); $page = str_replace('.', '_', Route::currentRouteName()); // indicator if user has seen the help for this page ( + special page): @@ -113,7 +109,7 @@ class Controller extends BaseController } /** - * Functionality: + * Functionality:. * * - If the $identifier contains the word "delete" then a remembered uri with the text "/show/" in it will not be returned but instead the index (/) * will be returned. @@ -126,10 +122,10 @@ class Controller extends BaseController protected function getPreviousUri(string $identifier): string { $uri = strval(session($identifier)); - if (!(strpos($identifier, 'delete') === false) && !(strpos($uri, '/show/') === false)) { + if (!(false === strpos($identifier, 'delete')) && !(false === strpos($uri, '/show/'))) { $uri = $this->redirectUri; } - if (!(strpos($uri, 'jscript') === false)) { + if (!(false === strpos($uri, 'jscript'))) { $uri = $this->redirectUri; } @@ -143,7 +139,7 @@ class Controller extends BaseController */ protected function isOpeningBalance(TransactionJournal $journal): bool { - return $journal->transactionTypeStr() === TransactionType::OPENING_BALANCE; + return TransactionType::OPENING_BALANCE === $journal->transactionTypeStr(); } /** diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php index 62c8e519f9..40026c295a 100644 --- a/app/Http/Controllers/CurrencyController.php +++ b/app/Http/Controllers/CurrencyController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -34,17 +33,14 @@ use Preferences; use View; /** - * Class CurrencyController - * - * @package FireflyIII\Http\Controllers + * Class CurrencyController. */ class CurrencyController extends Controller { - /** @var CurrencyRepositoryInterface */ protected $repository; - /** @var UserRepositoryInterface */ + /** @var UserRepositoryInterface */ protected $userRepository; /** @@ -54,7 +50,6 @@ class CurrencyController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.currencies')); @@ -84,7 +79,7 @@ class CurrencyController extends Controller $subTitle = trans('firefly.create_currency'); // put previous url in session if not redirect from store (not "create another"). - if (session('currencies.create.fromStore') !== true) { + if (true !== session('currencies.create.fromStore')) { $this->rememberPreviousUri('currencies.create.uri'); } $request->session()->forget('currencies.create.fromStore'); @@ -112,7 +107,6 @@ class CurrencyController extends Controller return redirect(route('currencies.index')); } - /** * @param Request $request * @param TransactionCurrency $currency @@ -135,14 +129,12 @@ class CurrencyController extends Controller return redirect(route('currencies.index')); } - // put previous url in session $this->rememberPreviousUri('currencies.delete.uri'); $request->session()->flash('gaEventCategory', 'currency'); $request->session()->flash('gaEventAction', 'delete'); $subTitle = trans('form.delete_currency', ['name' => $currency->name]); - return view('currencies.delete', compact('currency', 'subTitle')); } @@ -195,7 +187,7 @@ class CurrencyController extends Controller $currency->symbol = htmlentities($currency->symbol); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('currencies.edit.fromUpdate') !== true) { + if (true !== session('currencies.edit.fromUpdate')) { $this->rememberPreviousUri('currencies.edit.uri'); } $request->session()->forget('currencies.edit.fromUpdate'); @@ -242,7 +234,7 @@ class CurrencyController extends Controller $currency = $this->repository->store($data); $request->session()->flash('success', trans('firefly.created_currency', ['name' => $currency->name])); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // @codeCoverageIgnoreStart $request->session()->put('currencies.create.fromStore', true); @@ -274,8 +266,7 @@ class CurrencyController extends Controller $request->session()->flash('success', trans('firefly.updated_currency', ['name' => $currency->name])); Preferences::mark(); - - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart $request->session()->put('currencies.edit.fromUpdate', true); diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index 025de96265..fa746b8145 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Http\Controllers; use Carbon\Carbon; @@ -39,9 +37,7 @@ use Response; use View; /** - * Class ExportController - * - * @package FireflyIII\Http\Controllers + * Class ExportController. */ class ExportController extends Controller { @@ -52,7 +48,6 @@ class ExportController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('mainTitleIcon', 'fa-file-archive-o'); @@ -68,6 +63,7 @@ class ExportController extends Controller * @param ExportJob $job * * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response + * * @throws FireflyException */ public function download(ExportJobRepositoryInterface $repository, ExportJob $job) @@ -82,7 +78,6 @@ class ExportController extends Controller } $content = $repository->getContent($job); - $job->change('export_downloaded'); /** @var LaravelResponse $response */ $response = response($content, 200); @@ -162,48 +157,35 @@ class ExportController extends Controller $processor = app(ProcessorInterface::class); $processor->setSettings($settings); - /* - * Collect journals: - */ + // Collect journals: $jobs->changeStatus($job, 'export_status_collecting_journals'); $processor->collectJournals(); $jobs->changeStatus($job, 'export_status_collected_journals'); - /* - * Transform to exportable entries: - */ + // Transform to exportable entries: $jobs->changeStatus($job, 'export_status_converting_to_export_format'); $processor->convertJournals(); $jobs->changeStatus($job, 'export_status_converted_to_export_format'); - /* - * Transform to (temporary) file: - */ + // Transform to (temporary) file: $jobs->changeStatus($job, 'export_status_creating_journal_file'); $processor->exportJournals(); $jobs->changeStatus($job, 'export_status_created_journal_file'); - /* - * Collect attachments, if applicable. - */ + // Collect attachments, if applicable. if ($settings['includeAttachments']) { $jobs->changeStatus($job, 'export_status_collecting_attachments'); $processor->collectAttachments(); $jobs->changeStatus($job, 'export_status_collected_attachments'); } - - /* - * Collect old uploads - */ + // Collect old uploads if ($settings['includeOldUploads']) { $jobs->changeStatus($job, 'export_status_collecting_old_uploads'); $processor->collectOldUploads(); $jobs->changeStatus($job, 'export_status_collected_old_uploads'); } - /* - * Create ZIP file: - */ + // Create ZIP file: $jobs->changeStatus($job, 'export_status_creating_zip_file'); $processor->createZipFile(); $jobs->changeStatus($job, 'export_status_created_zip_file'); diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php index 05d3d256f1..9dbc65a8e8 100644 --- a/app/Http/Controllers/HelpController.php +++ b/app/Http/Controllers/HelpController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -29,13 +28,10 @@ use Preferences; use Response; /** - * Class HelpController - * - * @package FireflyIII\Http\Controllers + * Class HelpController. */ class HelpController extends Controller { - /** @var HelpInterface */ private $help; @@ -56,7 +52,7 @@ class HelpController extends Controller } /** - * @param $route + * @param $route * * @return \Illuminate\Http\JsonResponse */ @@ -99,7 +95,7 @@ class HelpController extends Controller $content = $this->help->getFromGithub($route, $language); // content will have 0 length when Github failed. Try en_US when it does: - if (strlen($content) === 0) { + if (0 === strlen($content)) { $language = 'en_US'; // also check cache first: @@ -114,7 +110,7 @@ class HelpController extends Controller } // help still empty? - if (strlen($content) !== 0) { + if (0 !== strlen($content)) { $this->help->putInCache($route, $language, $content); return $content; diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 8f8c8f6be5..d24313062a 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -42,9 +41,7 @@ use Session; use View; /** - * Class HomeController - * - * @package FireflyIII\Http\Controllers + * Class HomeController. */ class HomeController extends Controller { @@ -112,7 +109,7 @@ class HomeController extends Controller foreach ($handlers as $handler) { if ($handler instanceof RotatingFileHandler) { $logFile = $handler->getUrl(); - if (!is_null($logFile)) { + if (null !== $logFile) { $logContent = file_get_contents($logFile); } } @@ -180,7 +177,7 @@ class HomeController extends Controller $types = config('firefly.accountTypesByIdentifier.asset'); $count = $repository->count($types); - if ($count === 0) { + if (0 === $count) { return redirect(route('new-user.index')); } @@ -202,7 +199,6 @@ class HomeController extends Controller $billRepository = app(BillRepositoryInterface::class); $billCount = $billRepository->getBills()->count(); - foreach ($accounts as $account) { $collector = app(JournalCollectorInterface::class); $collector->setAccounts(new Collection([$account]))->setRange($start, $end)->setLimit(10)->setPage(1); @@ -225,16 +221,15 @@ class HomeController extends Controller 'register', 'report.options', 'routes', 'rule-groups.down', 'rule-groups.up', 'rules.up', 'rules.down', 'rules.select', 'search.search', 'test-flash', 'transactions.link.delete', 'transactions.link.switch', 'two-factor.lost', 'report.options', - ]; /** @var Route $route */ foreach ($set as $route) { $name = $route->getName(); - if (!is_null($name) && in_array('GET', $route->methods()) && strlen($name) > 0) { + if (null !== $name && in_array('GET', $route->methods()) && strlen($name) > 0) { $found = false; foreach ($ignore as $string) { - if (strpos($name, $string) !== false) { + if (false !== strpos($name, $string)) { $found = true; } } diff --git a/app/Http/Controllers/Import/BankController.php b/app/Http/Controllers/Import/BankController.php index 0018673cac..2fbefc0d7b 100644 --- a/app/Http/Controllers/Import/BankController.php +++ b/app/Http/Controllers/Import/BankController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Import; @@ -32,7 +31,6 @@ use Session; class BankController extends Controller { - /** * This method must ask the user all parameters necessary to start importing data. This may not be enough * to finish the import itself (ie. mapping) but it should be enough to begin: accounts to import from, @@ -82,7 +80,7 @@ class BankController extends Controller return redirect(route('import.bank.prerequisites', [$bank])); } $remoteAccounts = $request->get('do_import'); - if (!is_array($remoteAccounts) || count($remoteAccounts) === 0) { + if (!is_array($remoteAccounts) || 0 === count($remoteAccounts)) { Session::flash('error', 'Must select accounts'); return redirect(route('import.bank.form', [$bank])); diff --git a/app/Http/Controllers/Import/FileController.php b/app/Http/Controllers/Import/FileController.php index 93950180d3..ff6c86b48c 100644 --- a/app/Http/Controllers/Import/FileController.php +++ b/app/Http/Controllers/Import/FileController.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Http\Controllers\Import; use FireflyIII\Exceptions\FireflyException; @@ -41,12 +39,10 @@ use View; /** * Class FileController. - * - * @package FireflyIII\Http\Controllers\Import */ class FileController extends Controller { - /** @var ImportJobRepositoryInterface */ + /** @var ImportJobRepositoryInterface */ public $repository; /** @@ -73,6 +69,7 @@ class FileController extends Controller * @param ImportJob $job * * @return View + * * @throws FireflyException */ public function configure(ImportJob $job) @@ -110,7 +107,7 @@ class FileController extends Controller $config['column-roles-complete'] = false; $config['column-mapping-complete'] = false; $config['initial-config-complete'] = false; - $config['delimiter'] = $config['delimiter'] === "\t" ? 'tab' : $config['delimiter']; + $config['delimiter'] = "\t" === $config['delimiter'] ? 'tab' : $config['delimiter']; $result = json_encode($config, JSON_PRETTY_PRINT); $name = sprintf('"%s"', addcslashes('import-configuration-' . date('Y-m-d') . '.json', '"\\')); @@ -177,9 +174,7 @@ class FileController extends Controller return redirect(route('import.file.configure', [$job->key])); } - /** - * * Show status of import job in JSON. * * @param ImportJob $job @@ -202,12 +197,12 @@ class FileController extends Controller 'finishedText' => '', ]; - if ($job->extended_status['steps'] !== 0) { + if (0 !== $job->extended_status['steps']) { $result['percentage'] = round(($job->extended_status['done'] / $job->extended_status['steps']) * 100, 0); $result['show_percentage'] = true; } - if ($job->status === 'finished') { + if ('finished' === $job->status) { $tagId = $job->extended_status['tag']; /** @var TagRepositoryInterface $repository */ $repository = app(TagRepositoryInterface::class); @@ -216,7 +211,7 @@ class FileController extends Controller $result['finishedText'] = trans('firefly.import_status_finished_job', ['link' => route('tags.show', [$tag->id, 'all']), 'tag' => $tag->tag]); } - if ($job->status === 'running') { + if ('running' === $job->status) { $result['started'] = true; $result['running'] = true; } @@ -259,6 +254,7 @@ class FileController extends Controller * @param ImportJob $job * * @return \Illuminate\Http\JsonResponse + * * @throws FireflyException */ public function start(ImportJob $job) @@ -295,6 +291,7 @@ class FileController extends Controller * @param ImportJob $job * * @return ConfiguratorInterface + * * @throws FireflyException */ private function makeConfigurator(ImportJob $job): ConfiguratorInterface @@ -302,14 +299,13 @@ class FileController extends Controller $type = $job->file_type; $key = sprintf('firefly.import_configurators.%s', $type); $className = config($key); - if (is_null($className)) { + if (null === $className) { throw new FireflyException('Cannot find configurator class for this job.'); // @codeCoverageIgnore } /** @var ConfiguratorInterface $configurator */ $configurator = app($className); $configurator->setJob($job); - return $configurator; } } diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index aa1720146a..8d513b1e91 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -27,12 +27,10 @@ use View; /** * Class ImportController. - * - * @package FireflyIII\Http\Controllers */ class ImportController extends Controller { - /** @var ImportJobRepositoryInterface */ + /** @var ImportJobRepositoryInterface */ public $repository; /** @@ -53,9 +51,8 @@ class ImportController extends Controller ); } - /** - * General import index + * General import index. * * @return View */ diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index 5cff2e72f3..2e4ea3b92b 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -35,9 +34,7 @@ use Navigation; use Preferences; /** - * Class JavascriptController - * - * @package FireflyIII\Http\Controllers + * Class JavascriptController. */ class JavascriptController extends Controller { @@ -53,19 +50,17 @@ class JavascriptController extends Controller $preference = Preferences::get('currencyPreference', config('firefly.default_currency', 'EUR')); $default = $currencyRepository->findByCode($preference->data); - $data = ['accounts' => [],]; - + $data = ['accounts' => []]; /** @var Account $account */ foreach ($accounts as $account) { $accountId = $account->id; $currency = intval($account->getMeta('currency_id')); - $currency = $currency === 0 ? $default->id : $currency; + $currency = 0 === $currency ? $default->id : $currency; $entry = ['preferredCurrency' => $currency, 'name' => $account->name]; $data['accounts'][$accountId] = $entry; } - return response() ->view('javascript.accounts', $data, 200) ->header('Content-Type', 'text/javascript'); @@ -79,7 +74,7 @@ class JavascriptController extends Controller public function currencies(CurrencyRepositoryInterface $repository) { $currencies = $repository->get(); - $data = ['currencies' => [],]; + $data = ['currencies' => []]; /** @var TransactionCurrency $currency */ foreach ($currencies as $currency) { $currencyId = $currency->id; @@ -180,7 +175,6 @@ class JavascriptController extends Controller ], ]; - return $return; } } diff --git a/app/Http/Controllers/Json/AutoCompleteController.php b/app/Http/Controllers/Json/AutoCompleteController.php index bdb54ce2b0..1cbd9c26e2 100644 --- a/app/Http/Controllers/Json/AutoCompleteController.php +++ b/app/Http/Controllers/Json/AutoCompleteController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; @@ -33,20 +32,16 @@ use FireflyIII\Support\CacheProperties; use Response; /** - * Class AutoCompleteController - * - * @package FireflyIII\Http\Controllers\Json + * Class AutoCompleteController. */ class AutoCompleteController extends Controller { - /** * Returns a JSON list of all accounts. * * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\JsonResponse - * */ public function allAccounts(AccountRepositoryInterface $repository) { @@ -80,7 +75,6 @@ class AutoCompleteController extends Controller * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\JsonResponse - * */ public function expenseAccounts(AccountRepositoryInterface $repository) { @@ -103,7 +97,6 @@ class AutoCompleteController extends Controller /** * @param JournalCollectorInterface $collector - * * @param TransactionJournal $except * * @return \Illuminate\Http\JsonResponse|mixed @@ -139,7 +132,6 @@ class AutoCompleteController extends Controller * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\JsonResponse - * */ public function revenueAccounts(AccountRepositoryInterface $repository) { diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php index c971426085..29ecc6bdf7 100644 --- a/app/Http/Controllers/Json/BoxController.php +++ b/app/Http/Controllers/Json/BoxController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; @@ -35,9 +34,7 @@ use FireflyIII\Support\CacheProperties; use Response; /** - * Class BoxController - * - * @package FireflyIII\Http\Controllers\Json + * Class BoxController. */ class BoxController extends Controller { @@ -63,7 +60,6 @@ class BoxController extends Controller $currency = app('amount')->getDefaultCurrency(); $available = $repository->getAvailableBudget($currency, $start, $end); - // get spent amount: $budgets = $repository->getActiveBudgets(); $budgetInformation = $repository->collectBudgetInformation($budgets, $start, $end); @@ -75,7 +71,7 @@ class BoxController extends Controller } $days = $today->diffInDays($end) + 1; $perDay = '0'; - if ($days !== 0) { + if (0 !== $days) { $perDay = bcdiv($left, strval($days)); } diff --git a/app/Http/Controllers/Json/ExchangeController.php b/app/Http/Controllers/Json/ExchangeController.php index 38c8a696dd..096398caa8 100644 --- a/app/Http/Controllers/Json/ExchangeController.php +++ b/app/Http/Controllers/Json/ExchangeController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; @@ -33,9 +32,7 @@ use Log; use Response; /** - * Class ExchangeController - * - * @package FireflyIII\Http\Controllers\Json + * Class ExchangeController. */ class ExchangeController extends Controller { @@ -52,7 +49,7 @@ class ExchangeController extends Controller /** @var CurrencyRepositoryInterface $repository */ $repository = app(CurrencyRepositoryInterface::class); $rate = $repository->getExchangeRate($fromCurrency, $toCurrency, $date); - if (is_null($rate->id)) { + if (null === $rate->id) { Log::debug(sprintf('No cached exchange rate in database for %s to %s on %s', $fromCurrency->code, $toCurrency->code, $date->format('Y-m-d'))); $preferred = env('EXCHANGE_RATE_SERVICE', config('firefly.preferred_exchange_service')); $class = config('firefly.currency_exchange_services.' . $preferred); @@ -63,7 +60,7 @@ class ExchangeController extends Controller } $return = $rate->toArray(); $return['amount'] = null; - if (!is_null($request->get('amount'))) { + if (null !== $request->get('amount')) { // assume amount is in "from" currency: $return['amount'] = bcmul($request->get('amount'), strval($rate->rate), 12); // round to toCurrency decimal places: diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index 00af0970ea..4f187f4eab 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; @@ -29,9 +28,7 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Response; /** - * Class FrontpageController - * - * @package FireflyIII\Http\Controllers\Json + * Class FrontpageController. */ class FrontpageController extends Controller { @@ -46,8 +43,7 @@ class FrontpageController extends Controller foreach ($set as $piggyBank) { $rep = $piggyBank->currentRelevantRep(); $amount = strval($rep->currentamount); - if (!is_null($rep->id) && bccomp($amount, '0') === 1) { - + if (null !== $rep->id && 1 === bccomp($amount, '0')) { // percentage! $pct = round(($amount / $piggyBank->targetamount) * 100); diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index df89f71a19..78f10480a0 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; @@ -28,13 +27,10 @@ use Log; use Response; /** - * Class IntroController - * - * @package FireflyIII\Http\Controllers\Json + * Class IntroController. */ class IntroController { - /** * @param string $route * @param string $specificPage @@ -45,7 +41,7 @@ class IntroController { $steps = $this->getBasicSteps($route); $specificSteps = $this->getSpecificSteps($route, $specificPage); - if (count($specificSteps) === 0) { + if (0 === count($specificSteps)) { return Response::json($steps); } if ($this->hasOutroStep($route)) { @@ -91,7 +87,7 @@ class IntroController { $route = str_replace('.', '_', $route); $key = 'shown_demo_' . $route; - if ($specialPage !== '') { + if ('' !== $specialPage) { $key .= '_' . $specialPage; } Log::debug(sprintf('Going to mark the following route as NOT done: %s with special "%s" (%s)', $route, $specialPage, $key)); @@ -109,7 +105,7 @@ class IntroController public function postFinished(string $route, string $specialPage = '') { $key = 'shown_demo_' . $route; - if ($specialPage !== '') { + if ('' !== $specialPage) { $key .= '_' . $specialPage; } Log::debug(sprintf('Going to mark the following route as done: %s with special "%s" (%s)', $route, $specialPage, $key)); @@ -135,7 +131,6 @@ class IntroController // get the text: $currentStep['intro'] = trans('intro.' . $route . '_' . $key); - // save in array: $steps[] = $currentStep; } diff --git a/app/Http/Controllers/Json/TransactionController.php b/app/Http/Controllers/Json/TransactionController.php index 5de85266ab..f9292661cc 100644 --- a/app/Http/Controllers/Json/TransactionController.php +++ b/app/Http/Controllers/Json/TransactionController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; @@ -62,7 +61,7 @@ class TransactionController extends Controller $totals[$currencyId]['amount'] = bcadd($totals[$currencyId]['amount'], app('steam')->positive($transaction->amount)); // foreign amount: - if (!is_null($transaction->foreign_amount)) { + if (null !== $transaction->foreign_amount) { $currencyId = $transaction->foreign_currency_id; if (!isset($totals[$currencyId])) { $totals[$currencyId] = [ @@ -78,7 +77,7 @@ class TransactionController extends Controller $entries = []; foreach ($totals as $entry) { $amount = $entry['amount']; - if ($entry['type'] === TransactionType::WITHDRAWAL) { + if (TransactionType::WITHDRAWAL === $entry['type']) { $amount = bcmul($entry['amount'], '-1'); } $entries[] = app('amount')->formatAnything($entry['currency'], $amount, false); diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index 1194d4d599..a9239d71c1 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -31,9 +30,7 @@ use Illuminate\Http\Request; use Response; /** - * Class JsonController - * - * @package FireflyIII\Http\Controllers + * Class JsonController. */ class JsonController extends Controller { @@ -60,7 +57,6 @@ class JsonController extends Controller } $view = view('rules.partials.action', compact('actions', 'count'))->render(); - return Response::json(['html' => $view]); } @@ -131,7 +127,7 @@ class JsonController extends Controller $keys = array_keys(config('firefly.rule-triggers')); $triggers = []; foreach ($keys as $key) { - if ($key !== 'user_action') { + if ('user_action' !== $key) { $triggers[$key] = trans('firefly.rule_trigger_' . $key . '_choice'); } } @@ -139,7 +135,6 @@ class JsonController extends Controller $view = view('rules.partials.trigger', compact('triggers', 'count'))->render(); - return Response::json(['html' => $view]); } } diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index cc7a1f8838..6589f22769 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -32,9 +31,7 @@ use Session; use View; /** - * Class NewUserController - * - * @package FireflyIII\Http\Controllers + * Class NewUserController. */ class NewUserController extends Controller { @@ -52,7 +49,6 @@ class NewUserController extends Controller ); } - /** * @param AccountRepositoryInterface $repository * @@ -90,13 +86,12 @@ class NewUserController extends Controller // also store currency preference from input: $currency = $currencyRepository->find(intval($request->input('amount_currency_id_bank_balance'))); - if (!is_null($currency->id)) { + if (null !== $currency->id) { // store currency preference: Preferences::set('currencyPreference', $currency->code); Preferences::mark(); } - Session::flash('success', strval(trans('firefly.stored_new_accounts_new_user'))); Preferences::mark(); diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 35fe50d4ae..1f419a9e97 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -40,15 +39,10 @@ use Steam; use View; /** - * - * - * Class PiggyBankController - * - * @package FireflyIII\Http\Controllers + * Class PiggyBankController. */ class PiggyBankController extends Controller { - /** * */ @@ -56,7 +50,6 @@ class PiggyBankController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.piggyBanks')); @@ -68,7 +61,7 @@ class PiggyBankController extends Controller } /** - * Add money to piggy bank + * Add money to piggy bank. * * @param PiggyBank $piggyBank * @@ -87,7 +80,7 @@ class PiggyBankController extends Controller } /** - * Add money to piggy bank (for mobile devices) + * Add money to piggy bank (for mobile devices). * * @param PiggyBank $piggyBank * @@ -109,7 +102,6 @@ class PiggyBankController extends Controller * @param AccountRepositoryInterface $repository * * @return View - * */ public function create(AccountRepositoryInterface $repository) { @@ -117,14 +109,14 @@ class PiggyBankController extends Controller $subTitle = trans('firefly.new_piggy_bank'); $subTitleIcon = 'fa-plus'; - if (count($accounts) === 0) { + if (0 === count($accounts)) { Session::flash('error', strval(trans('firefly.need_at_least_one_account'))); return redirect(route('new-user.index')); } // put previous url in session if not redirect from store (not "create another"). - if (session('piggy-banks.create.fromStore') !== true) { + if (true !== session('piggy-banks.create.fromStore')) { $this->rememberPreviousUri('piggy-banks.create.uri'); } Session::forget('piggy-banks.create.fromStore'); @@ -179,10 +171,8 @@ class PiggyBankController extends Controller $subTitleIcon = 'fa-pencil'; $targetDate = null; $note = $piggyBank->notes()->first(); - /* - * Flash some data to fill the form. - */ - if (!is_null($piggyBank->targetdate)) { + // Flash some data to fill the form. + if (null !== $piggyBank->targetdate) { $targetDate = $piggyBank->targetdate->format('Y-m-d'); } @@ -190,14 +180,14 @@ class PiggyBankController extends Controller 'account_id' => $piggyBank->account_id, 'targetamount' => $piggyBank->targetamount, 'targetdate' => $targetDate, - 'note' => is_null($note) ? '' : $note->text, + 'note' => null === $note ? '' : $note->text, ]; Session::flash('preFilled', $preFilled); Session::flash('gaEventCategory', 'piggy-banks'); Session::flash('gaEventAction', 'edit'); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('piggy-banks.edit.fromUpdate') !== true) { + if (true !== session('piggy-banks.edit.fromUpdate')) { $this->rememberPreviousUri('piggy-banks.edit.uri'); } Session::forget('piggy-banks.edit.fromUpdate'); @@ -222,13 +212,11 @@ class PiggyBankController extends Controller /** @var PiggyBank $piggyBank */ foreach ($piggyBanks as $piggyBank) { $piggyBank->savedSoFar = $piggyBank->currentRelevantRep()->currentamount ?? '0'; - $piggyBank->percentage = bccomp('0', $piggyBank->savedSoFar) !== 0 ? intval($piggyBank->savedSoFar / $piggyBank->targetamount * 100) : 0; + $piggyBank->percentage = 0 !== bccomp('0', $piggyBank->savedSoFar) ? intval($piggyBank->savedSoFar / $piggyBank->targetamount * 100) : 0; $piggyBank->leftToSave = bcsub($piggyBank->targetamount, strval($piggyBank->savedSoFar)); $piggyBank->percentage = $piggyBank->percentage > 100 ? 100 : $piggyBank->percentage; - /* - * Fill account information: - */ + // Fill account information: $account = $piggyBank->account; $new = false; if (!isset($accounts[$account->id])) { @@ -242,7 +230,7 @@ class PiggyBankController extends Controller 'leftToSave' => $piggyBank->leftToSave, ]; } - if (isset($accounts[$account->id]) && $new === false) { + if (isset($accounts[$account->id]) && false === $new) { $accounts[$account->id]['sumOfSaved'] = bcadd($accounts[$account->id]['sumOfSaved'], strval($piggyBank->savedSoFar)); $accounts[$account->id]['sumOfTargets'] = bcadd($accounts[$account->id]['sumOfTargets'], $piggyBank->targetamount); $accounts[$account->id]['leftToSave'] = bcadd($accounts[$account->id]['leftToSave'], $piggyBank->leftToSave); @@ -265,7 +253,6 @@ class PiggyBankController extends Controller // set all users piggy banks to zero: $repository->reset(); - if (is_array($data)) { foreach ($data as $order => $id) { $repository->setOrder(intval($id), ($order + 1)); @@ -361,7 +348,6 @@ class PiggyBankController extends Controller /** * @param PiggyBank $piggyBank * - * * @return View */ public function remove(PiggyBank $piggyBank) @@ -370,7 +356,7 @@ class PiggyBankController extends Controller } /** - * Remove money from piggy bank (for mobile devices) + * Remove money from piggy bank (for mobile devices). * * @param PiggyBank $piggyBank * @@ -410,7 +396,7 @@ class PiggyBankController extends Controller Session::flash('success', strval(trans('firefly.stored_piggy_bank', ['name' => $piggyBank->name]))); Preferences::mark(); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // @codeCoverageIgnoreStart Session::put('piggy-banks.create.fromStore', true); @@ -436,7 +422,7 @@ class PiggyBankController extends Controller Session::flash('success', strval(trans('firefly.updated_piggy_bank', ['name' => $piggyBank->name]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart Session::put('piggy-banks.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php index 4eeafb197a..1b08f49932 100644 --- a/app/Http/Controllers/Popup/ReportController.php +++ b/app/Http/Controllers/Popup/ReportController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Popup; @@ -38,13 +37,10 @@ use Response; use View; /** - * Class ReportController - * - * @package FireflyIII\Http\Controllers\Popup + * Class ReportController. */ class ReportController extends Controller { - /** @var AccountRepositoryInterface */ private $accountRepository; /** @var BudgetRepositoryInterface */ @@ -54,7 +50,6 @@ class ReportController extends Controller /** @var PopupReportInterface */ private $popupHelper; - /** * */ @@ -63,17 +58,16 @@ class ReportController extends Controller parent::__construct(); $this->middleware( function ($request, $next) { - - /** @var AccountRepositoryInterface $repository */ + // @var AccountRepositoryInterface $repository $this->accountRepository = app(AccountRepositoryInterface::class); - /** @var BudgetRepositoryInterface $repository */ + // @var BudgetRepositoryInterface $repository $this->budgetRepository = app(BudgetRepositoryInterface::class); - /** @var CategoryRepositoryInterface categoryRepository */ + // @var CategoryRepositoryInterface categoryRepository $this->categoryRepository = app(CategoryRepositoryInterface::class); - /** @var PopupReportInterface popupHelper */ + // @var PopupReportInterface popupHelper $this->popupHelper = app(PopupReportInterface::class); return $next($request); @@ -81,11 +75,11 @@ class ReportController extends Controller ); } - /** * @param Request $request * * @return \Illuminate\Http\JsonResponse + * * @throws FireflyException */ public function general(Request $request) @@ -123,6 +117,7 @@ class ReportController extends Controller * @param $attributes * * @return string + * * @throws FireflyException */ private function balanceAmount(array $attributes): string @@ -132,20 +127,20 @@ class ReportController extends Controller $account = $this->accountRepository->find(intval($attributes['accountId'])); switch (true) { - case ($role === BalanceLine::ROLE_DEFAULTROLE && !is_null($budget->id)): + case BalanceLine::ROLE_DEFAULTROLE === $role && null !== $budget->id: // normal row with a budget: $journals = $this->popupHelper->balanceForBudget($budget, $account, $attributes); break; - case ($role === BalanceLine::ROLE_DEFAULTROLE && is_null($budget->id)): + case BalanceLine::ROLE_DEFAULTROLE === $role && null === $budget->id: // normal row without a budget: $journals = $this->popupHelper->balanceForNoBudget($account, $attributes); $budget->name = strval(trans('firefly.no_budget')); break; - case ($role === BalanceLine::ROLE_DIFFROLE): + case BalanceLine::ROLE_DIFFROLE === $role: $journals = $this->popupHelper->balanceDifference($account, $attributes); $budget->name = strval(trans('firefly.leftUnbalanced')); break; - case ($role === BalanceLine::ROLE_TAGROLE): + case BalanceLine::ROLE_TAGROLE === $role: // row with tag info. throw new FireflyException('Firefly cannot handle this type of info-button (BalanceLine::TagRole)'); } @@ -160,6 +155,7 @@ class ReportController extends Controller * @param array $attributes * * @return string + * * @throws FireflyException */ private function budgetSpentAmount(array $attributes): string @@ -177,6 +173,7 @@ class ReportController extends Controller * @param $attributes * * @return string + * * @throws FireflyException */ private function categoryEntry(array $attributes): string @@ -194,6 +191,7 @@ class ReportController extends Controller * @param $attributes * * @return string + * * @throws FireflyException */ private function expenseEntry(array $attributes): string @@ -211,6 +209,7 @@ class ReportController extends Controller * @param $attributes * * @return string + * * @throws FireflyException */ private function incomeEntry(array $attributes): string @@ -226,6 +225,7 @@ class ReportController extends Controller * @param array $attributes * * @return array + * * @throws FireflyException */ private function parseAttributes(array $attributes): array @@ -244,7 +244,6 @@ class ReportController extends Controller throw new FireflyException('Could not parse start date "' . e($attributes['endDate']) . '".'); } - return $attributes; } } diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 30b0a6135a..4dfa42d049 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -34,13 +33,10 @@ use Session; use View; /** - * Class PreferencesController - * - * @package FireflyIII\Http\Controllers + * Class PreferencesController. */ class PreferencesController extends Controller { - /** * */ @@ -48,7 +44,6 @@ class PreferencesController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.preferences')); @@ -71,7 +66,6 @@ class PreferencesController extends Controller Session::flash('two-factor-secret', $secret); $image = $google2fa->getQRCodeInline($domain, auth()->user()->email, $secret, 200); - return view('preferences.code', compact('image')); } @@ -107,8 +101,8 @@ class PreferencesController extends Controller $fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr; $tjOptionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; $is2faEnabled = Preferences::get('twoFactorAuthEnabled', 0)->data; // twoFactorAuthEnabled - $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); // hasTwoFactorAuthSecret - $showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', false) === true; + $has2faSecret = null !== Preferences::get('twoFactorAuthSecret'); // hasTwoFactorAuthSecret + $showIncomplete = true === env('SHOW_INCOMPLETE_TRANSLATIONS', false); return view( 'preferences.index', @@ -148,7 +142,6 @@ class PreferencesController extends Controller /** * @param Request $request - * * @param UserRepositoryInterface $repository * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector @@ -172,13 +165,13 @@ class PreferencesController extends Controller Session::forget('range'); // custom fiscal year - $customFiscalYear = intval($request->get('customFiscalYear')) === 1; + $customFiscalYear = 1 === intval($request->get('customFiscalYear')); $fiscalYearStart = date('m-d', strtotime(strval($request->get('fiscalYearStart')))); Preferences::set('customFiscalYear', $customFiscalYear); Preferences::set('fiscalYearStart', $fiscalYearStart); // show deposits frontpage: - $showDepositsFrontpage = intval($request->get('showDepositsFrontpage')) === 1; + $showDepositsFrontpage = 1 === intval($request->get('showDepositsFrontpage')); Preferences::set('showDepositsFrontpage', $showDepositsFrontpage); // save page size: @@ -193,7 +186,7 @@ class PreferencesController extends Controller if (!$repository->hasRole(auth()->user(), 'demo')) { // two factor auth $twoFactorAuthEnabled = intval($request->get('twoFactorAuthEnabled')); - $hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret')); + $hasTwoFactorAuthSecret = null !== Preferences::get('twoFactorAuthSecret'); // If we already have a secret, just set the two factor auth enabled to 1, and let the user continue with the existing secret. if ($hasTwoFactorAuthSecret) { @@ -222,13 +215,12 @@ class PreferencesController extends Controller ]; Preferences::set('transaction_journal_optional_fields', $optionalTj); - Session::flash('success', strval(trans('firefly.saved_preferences'))); Preferences::mark(); // if we don't have a valid secret yet, redirect to the code page. // AND USER HAS ACTUALLY ENABLED 2FA - if (!$hasTwoFactorAuthSecret && $twoFactorAuthEnabled === 1) { + if (!$hasTwoFactorAuthSecret && 1 === $twoFactorAuthEnabled) { return redirect(route('preferences.code')); } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 9c4a398968..c8fe9ed92e 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -41,9 +40,7 @@ use Session; use View; /** - * Class ProfileController - * - * @package FireflyIII\Http\Controllers + * Class ProfileController. */ class ProfileController extends Controller { @@ -54,7 +51,6 @@ class ProfileController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.profile')); @@ -95,6 +91,7 @@ class ProfileController extends Controller * @param string $token * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + * * @throws FireflyException */ public function confirmEmailChange(string $token) @@ -109,7 +106,7 @@ class ProfileController extends Controller } } // update user to clear blocked and blocked_code. - if (is_null($user)) { + if (null === $user) { throw new FireflyException('Invalid token.'); } $user->blocked = 0; @@ -136,7 +133,6 @@ class ProfileController extends Controller /** * @return View - * */ public function index() { @@ -145,7 +141,7 @@ class ProfileController extends Controller // get access token or create one. $accessToken = Preferences::get('access_token', null); - if (is_null($accessToken)) { + if (null === $accessToken) { $token = auth()->user()->generateAccessToken(); $accessToken = Preferences::set('access_token', $token); } @@ -171,7 +167,7 @@ class ProfileController extends Controller return redirect(route('profile.change-email'))->withInput(); } $existing = $repository->findByEmail($newEmail); - if (!is_null($existing)) { + if (null !== $existing) { // force user logout. $this->guard()->logout(); $request->session()->invalidate(); @@ -245,7 +241,6 @@ class ProfileController extends Controller Session::flash('gaEventCategory', 'user'); Session::flash('gaEventAction', 'delete-account'); - return redirect(route('index')); } @@ -278,7 +273,7 @@ class ProfileController extends Controller $user = $preference->user; } } - if (is_null($user)) { + if (null === $user) { throw new FireflyException('Invalid token.'); } @@ -293,7 +288,7 @@ class ProfileController extends Controller break; } } - if (is_null($match)) { + if (null === $match) { throw new FireflyException('Invalid token.'); } // change user back @@ -314,6 +309,7 @@ class ProfileController extends Controller * @param string $new * * @return bool + * * @throws ValidationException */ protected function validatePassword(User $user, string $current, string $new): bool diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php index 1ab913d8df..56215699f4 100644 --- a/app/Http/Controllers/Report/AccountController.php +++ b/app/Http/Controllers/Report/AccountController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; @@ -30,13 +29,10 @@ use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; /** - * Class AccountController - * - * @package FireflyIII\Http\Controllers\Report + * Class AccountController. */ class AccountController extends Controller { - /** * @param Collection $accounts * @param Carbon $start diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 7cb28859fa..af4a0a629d 100644 --- a/app/Http/Controllers/Report/BalanceController.php +++ b/app/Http/Controllers/Report/BalanceController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; @@ -30,13 +29,10 @@ use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; /** - * Class BalanceController - * - * @package FireflyIII\Http\Controllers\Report + * Class BalanceController. */ class BalanceController extends Controller { - /** * @param BalanceReportHelperInterface $helper * @param Collection $accounts @@ -47,8 +43,6 @@ class BalanceController extends Controller */ public function general(BalanceReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end) { - - // chart properties for cache: $cache = new CacheProperties; $cache->addProperty($start); diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index 0f82aa54f0..60532b58fc 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; @@ -32,14 +31,10 @@ use Illuminate\Support\Collection; use Navigation; /** - * Class BudgetController - * - * @package FireflyIII\Http\Controllers\Report + * Class BudgetController. */ class BudgetController extends Controller { - - /** * @param BudgetReportHelperInterface $helper * @param Collection $accounts @@ -50,7 +45,6 @@ class BudgetController extends Controller */ public function general(BudgetReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end) { - // chart properties for cache: $cache = new CacheProperties; $cache->addProperty($start); @@ -103,7 +97,7 @@ class BudgetController extends Controller } /** - * Filters empty results from getBudgetPeriodReport + * Filters empty results from getBudgetPeriodReport. * * @param array $data * @@ -112,7 +106,7 @@ class BudgetController extends Controller private function filterBudgetPeriodReport(array $data): array { /** - * @var int $budgetId + * @var int * @var array $set */ foreach ($data as $budgetId => $set) { @@ -121,7 +115,7 @@ class BudgetController extends Controller $sum = bcadd($amount, $sum); } $data[$budgetId]['sum'] = $sum; - if (bccomp('0', $sum) === 0) { + if (0 === bccomp('0', $sum)) { unset($data[$budgetId]); } } diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php index 9f681fc7c9..929b9eb0eb 100644 --- a/app/Http/Controllers/Report/CategoryController.php +++ b/app/Http/Controllers/Report/CategoryController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; @@ -32,9 +31,7 @@ use Illuminate\Support\Collection; use Navigation; /** - * Class CategoryController - * - * @package FireflyIII\Http\Controllers\Report + * Class CategoryController. */ class CategoryController extends Controller { @@ -70,7 +67,6 @@ class CategoryController extends Controller } /** - * * @param Carbon $start * @param Carbon $end * @param Collection $accounts @@ -107,6 +103,7 @@ class CategoryController extends Controller * @param Carbon $end * * @return mixed|string + * * @internal param ReportHelperInterface $helper */ public function operations(Collection $accounts, Carbon $start, Carbon $end) @@ -128,7 +125,7 @@ class CategoryController extends Controller /** @var Category $category */ foreach ($categories as $category) { $spent = $repository->spentInPeriod(new Collection([$category]), $accounts, $start, $end); - if (bccomp($spent, '0') !== 0) { + if (0 !== bccomp($spent, '0')) { $report[$category->id] = ['name' => $category->name, 'spent' => $spent, 'id' => $category->id]; } } @@ -149,7 +146,7 @@ class CategoryController extends Controller } /** - * Filters empty results from category period report + * Filters empty results from category period report. * * @param array $data * @@ -163,12 +160,11 @@ class CategoryController extends Controller $sum = bcadd($amount, $sum); } $data[$categoryId]['sum'] = $sum; - if (bccomp('0', $sum) === 0) { + if (0 === bccomp('0', $sum)) { unset($data[$categoryId]); } } - return $data; } } diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php index 3e33e3c28b..860734891a 100644 --- a/app/Http/Controllers/Report/OperationsController.php +++ b/app/Http/Controllers/Report/OperationsController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; @@ -30,13 +29,10 @@ use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; /** - * Class OperationsController - * - * @package FireflyIII\Http\Controllers\Report + * Class OperationsController. */ class OperationsController extends Controller { - /** * @param AccountTaskerInterface $tasker * @param Collection $accounts diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 3193cad81e..9a6d131f8b 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -42,9 +41,7 @@ use Session; use View; /** - * Class ReportController - * - * @package FireflyIII\Http\Controllers + * Class ReportController. */ class ReportController extends Controller { @@ -98,7 +95,6 @@ class ReportController extends Controller ) ); - $generator = ReportGeneratorFactory::reportGenerator('Audit', $start, $end); $generator->setAccounts($accounts); $result = $generator->generate(); @@ -227,7 +223,6 @@ class ReportController extends Controller $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $accountList = join(',', $accounts->pluck('id')->toArray()); - return view('reports.index', compact('months', 'accounts', 'start', 'accountList', 'customFiscalYear')); } @@ -274,26 +269,26 @@ class ReportController extends Controller $tags = join(',', $request->getTagList()->pluck('tag')->toArray()); $uri = route('reports.index'); - if ($request->getAccountList()->count() === 0) { + if (0 === $request->getAccountList()->count()) { Log::debug('Account count is zero'); Session::flash('error', trans('firefly.select_more_than_one_account')); return redirect(route('reports.index')); } - if ($request->getCategoryList()->count() === 0 && $reportType === 'category') { + if (0 === $request->getCategoryList()->count() && 'category' === $reportType) { Session::flash('error', trans('firefly.select_more_than_one_category')); return redirect(route('reports.index')); } - if ($request->getBudgetList()->count() === 0 && $reportType === 'budget') { + if (0 === $request->getBudgetList()->count() && 'budget' === $reportType) { Session::flash('error', trans('firefly.select_more_than_one_budget')); return redirect(route('reports.index')); } - if ($request->getTagList()->count() === 0 && $reportType === 'tag') { + if (0 === $request->getTagList()->count() && 'tag' === $reportType) { Session::flash('error', trans('firefly.select_more_than_one_tag')); return redirect(route('reports.index')); diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php index 5335f1a70e..aeec282409 100644 --- a/app/Http/Controllers/RuleController.php +++ b/app/Http/Controllers/RuleController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -45,9 +44,7 @@ use Session; use View; /** - * Class RuleController - * - * @package FireflyIII\Http\Controllers + * Class RuleController. */ class RuleController extends Controller { @@ -58,7 +55,6 @@ class RuleController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.rules')); @@ -102,7 +98,7 @@ class RuleController extends Controller $subTitle = trans('firefly.make_new_rule', ['title' => $ruleGroup->title]); // put previous url in session if not redirect from store (not "create another"). - if (session('rules.create.fromStore') !== true) { + if (true !== session('rules.create.fromStore')) { $this->rememberPreviousUri('rules.create.uri'); } Session::forget('rules.create.fromStore'); @@ -191,7 +187,7 @@ class RuleController extends Controller } // overrule old input when it as no rule data: - if ($triggerCount === 0 && $actionCount === 0) { + if (0 === $triggerCount && 0 === $actionCount) { $oldTriggers = $this->getCurrentTriggers($rule); $triggerCount = count($oldTriggers); $oldActions = $this->getCurrentActions($rule); @@ -203,7 +199,7 @@ class RuleController extends Controller $subTitle = trans('firefly.edit_rule', ['title' => $rule->title]); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('rules.edit.fromUpdate') !== true) { + if (true !== session('rules.edit.fromUpdate')) { $this->rememberPreviousUri('rules.edit.uri'); } Session::forget('rules.edit.fromUpdate'); @@ -226,13 +222,14 @@ class RuleController extends Controller } /** - * Execute the given rule on a set of existing transactions + * Execute the given rule on a set of existing transactions. * * @param SelectTransactionsRequest $request * @param AccountRepositoryInterface $repository * @param Rule $rule * * @return \Illuminate\Http\RedirectResponse + * * @internal param RuleGroup $ruleGroup */ public function execute(SelectTransactionsRequest $request, AccountRepositoryInterface $repository, Rule $rule) @@ -343,7 +340,7 @@ class RuleController extends Controller Session::flash('success', trans('firefly.stored_new_rule', ['title' => $rule->title])); Preferences::mark(); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // @codeCoverageIgnoreStart Session::put('rules.create.fromStore', true); @@ -371,7 +368,7 @@ class RuleController extends Controller // build trigger array from response $triggers = $this->getValidTriggerList($request); - if (count($triggers) === 0) { + if (0 === count($triggers)) { return Response::json(['html' => '', 'warning' => trans('firefly.warning_no_valid_triggers')]); } @@ -390,7 +387,7 @@ class RuleController extends Controller if (count($matchingTransactions) === $limit) { $warning = trans('firefly.warning_transaction_subset', ['max_num_transactions' => $limit]); } - if (count($matchingTransactions) === 0) { + if (0 === count($matchingTransactions)) { $warning = trans('firefly.warning_no_matching_transactions', ['num_transactions' => $range]); } @@ -417,7 +414,7 @@ class RuleController extends Controller { $triggers = $rule->ruleTriggers; - if (count($triggers) === 0) { + if (0 === count($triggers)) { return Response::json(['html' => '', 'warning' => trans('firefly.warning_no_valid_triggers')]); } @@ -436,7 +433,7 @@ class RuleController extends Controller if (count($matchingTransactions) === $limit) { $warning = trans('firefly.warning_transaction_subset', ['max_num_transactions' => $limit]); } - if (count($matchingTransactions) === 0) { + if (0 === count($matchingTransactions)) { $warning = trans('firefly.warning_no_matching_transactions', ['num_transactions' => $range]); } @@ -474,7 +471,7 @@ class RuleController extends Controller Session::flash('success', trans('firefly.updated_rule', ['title' => $rule->title])); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart Session::put('rules.edit.fromUpdate', true); @@ -490,7 +487,7 @@ class RuleController extends Controller /** @var RuleRepositoryInterface $repository */ $repository = app(RuleRepositoryInterface::class); - if ($repository->count() === 0) { + if (0 === $repository->count()) { $data = [ 'rule_group_id' => $repository->getFirstRuleGroup()->id, 'stop_processing' => 0, @@ -519,11 +516,10 @@ class RuleController extends Controller */ private function createDefaultRuleGroup() { - /** @var RuleGroupRepositoryInterface $repository */ $repository = app(RuleGroupRepositoryInterface::class); - if ($repository->count() === 0) { + if (0 === $repository->count()) { $data = [ 'title' => trans('firefly.default_rule_group_name'), 'description' => trans('firefly.default_rule_group_description'), @@ -555,7 +551,7 @@ class RuleController extends Controller 'count' => $count, ] )->render(); - $index++; + ++$index; } return $actions; @@ -573,7 +569,7 @@ class RuleController extends Controller /** @var RuleTrigger $entry */ foreach ($rule->ruleTriggers as $entry) { - if ($entry->trigger_type !== 'user_action') { + if ('user_action' !== $entry->trigger_type) { $count = ($index + 1); $triggers[] = view( 'rules.partials.trigger', @@ -584,7 +580,7 @@ class RuleController extends Controller 'count' => $count, ] )->render(); - $index++; + ++$index; } } @@ -614,7 +610,7 @@ class RuleController extends Controller 'count' => $count, ] )->render(); - $newIndex++; + ++$newIndex; } return $actions; @@ -643,7 +639,7 @@ class RuleController extends Controller 'count' => $count, ] )->render(); - $newIndex++; + ++$newIndex; } return $triggers; @@ -668,7 +664,7 @@ class RuleController extends Controller $triggers[] = [ 'type' => $triggerType, 'value' => $data['rule-trigger-values'][$index], - 'stopProcessing' => intval($data['rule-trigger-stop'][$index]) === 1 ? true : false, + 'stopProcessing' => 1 === intval($data['rule-trigger-stop'][$index]) ? true : false, ]; } } diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php index ff7859cbdb..0ba9141041 100644 --- a/app/Http/Controllers/RuleGroupController.php +++ b/app/Http/Controllers/RuleGroupController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -38,9 +37,7 @@ use Session; use View; /** - * Class RuleGroupController - * - * @package FireflyIII\Http\Controllers + * Class RuleGroupController. */ class RuleGroupController extends Controller { @@ -51,7 +48,6 @@ class RuleGroupController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.rules')); @@ -71,7 +67,7 @@ class RuleGroupController extends Controller $subTitle = trans('firefly.make_new_rule_group'); // put previous url in session if not redirect from store (not "create another"). - if (session('rule-groups.create.fromStore') !== true) { + if (true !== session('rule-groups.create.fromStore')) { $this->rememberPreviousUri('rule-groups.create.uri'); } Session::forget('rule-groups.create.fromStore'); @@ -116,7 +112,6 @@ class RuleGroupController extends Controller $repository->destroy($ruleGroup, $moveTo); - Session::flash('success', strval(trans('firefly.deleted_rule_group', ['title' => $title]))); Preferences::mark(); @@ -146,7 +141,7 @@ class RuleGroupController extends Controller $subTitle = trans('firefly.edit_rule_group', ['title' => $ruleGroup->title]); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('rule-groups.edit.fromUpdate') !== true) { + if (true !== session('rule-groups.edit.fromUpdate')) { $this->rememberPreviousUri('rule-groups.edit.uri'); } Session::forget('rule-groups.edit.fromUpdate'); @@ -157,7 +152,7 @@ class RuleGroupController extends Controller } /** - * Execute the given rulegroup on a set of existing transactions + * Execute the given rulegroup on a set of existing transactions. * * @param SelectTransactionsRequest $request * @param AccountRepositoryInterface $repository @@ -223,7 +218,7 @@ class RuleGroupController extends Controller Session::flash('success', strval(trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title]))); Preferences::mark(); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // @codeCoverageIgnoreStart Session::put('rule-groups.create.fromStore', true); @@ -259,7 +254,7 @@ class RuleGroupController extends Controller $data = [ 'title' => $request->input('title'), 'description' => $request->input('description'), - 'active' => intval($request->input('active')) === 1, + 'active' => 1 === intval($request->input('active')), ]; $repository->update($ruleGroup, $data); @@ -267,7 +262,7 @@ class RuleGroupController extends Controller Session::flash('success', strval(trans('firefly.updated_rule_group', ['title' => $ruleGroup->title]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart Session::put('rule-groups.edit.fromUpdate', true); diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index f6c1d62ba6..48cf6e9159 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -30,9 +29,7 @@ use Response; use View; /** - * Class SearchController - * - * @package FireflyIII\Http\Controllers + * Class SearchController. */ class SearchController extends Controller { diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index c3f7a310cb..550b67574d 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -38,7 +37,7 @@ use Session; use View; /** - * Class TagController + * Class TagController. * * Remember: a balancingAct takes at most one expense and one transfer. * an advancePayment takes at most one expense, infinite deposits and NO transfers. @@ -47,13 +46,10 @@ use View; * Other attempts to put in such a tag are blocked. * also show an error when editing a tag and it becomes either * of these two types. Or rather, block editing of the tag. - * - * @package FireflyIII\Http\Controllers */ class TagController extends Controller { - - /** @var TagRepositoryInterface */ + /** @var TagRepositoryInterface */ protected $repository; /** @@ -88,7 +84,7 @@ class TagController extends Controller $apiKey = env('GOOGLE_MAPS_API_KEY', ''); // put previous url in session if not redirect from store (not "create another"). - if (session('tags.create.fromStore') !== true) { + if (true !== session('tags.create.fromStore')) { $this->rememberPreviousUri('tags.create.uri'); } Session::forget('tags.create.fromStore'); @@ -99,7 +95,7 @@ class TagController extends Controller } /** - * Delete a tag + * Delete a tag. * * @param Tag $tag * @@ -134,7 +130,7 @@ class TagController extends Controller } /** - * Edit a tag + * Edit a tag. * * @param Tag $tag * @@ -147,7 +143,7 @@ class TagController extends Controller $apiKey = env('GOOGLE_MAPS_API_KEY', ''); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('tags.edit.fromUpdate') !== true) { + if (true !== session('tags.edit.fromUpdate')) { $this->rememberPreviousUri('tags.edit.uri'); } Session::forget('tags.edit.fromUpdate'); @@ -158,7 +154,7 @@ class TagController extends Controller } /** - * View all tags + * View all tags. * * @param TagRepositoryInterface $repository * @@ -170,13 +166,13 @@ class TagController extends Controller $oldestTag = $repository->oldestTag(); /** @var Carbon $start */ $start = new Carbon; - if (!is_null($oldestTag)) { + if (null !== $oldestTag) { /** @var Carbon $start */ $start = $oldestTag->date; } - if (is_null($oldestTag)) { + if (null === $oldestTag) { /** @var Carbon $start */ - $start = clone(session('first')); + $start = clone session('first'); } $now = new Carbon; @@ -216,7 +212,7 @@ class TagController extends Controller $path = route('tags.show', [$tag->id]); // prep for "all" view. - if ($moment === 'all') { + if ('all' === $moment) { $subTitle = trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]); $start = $repository->firstUseDate($tag); $end = new Carbon; @@ -224,20 +220,20 @@ class TagController extends Controller } // prep for "specific date" view. - if (strlen($moment) > 0 && $moment !== 'all') { + if (strlen($moment) > 0 && 'all' !== $moment) { $start = new Carbon($moment); $end = Navigation::endOfPeriod($start, $range); $subTitle = trans( 'firefly.journals_in_period_for_tag', ['tag' => $tag->tag, - 'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)] + 'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat),] ); $periods = $this->getPeriodOverview($tag); $path = route('tags.show', [$tag->id, $moment]); } // prep for current period - if (strlen($moment) === 0) { + if (0 === strlen($moment)) { /** @var Carbon $start */ $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); /** @var Carbon $end */ @@ -274,7 +270,7 @@ class TagController extends Controller Session::flash('success', strval(trans('firefly.created_tag', ['tag' => $data['tag']]))); Preferences::mark(); - if (intval($request->get('create_another')) === 1) { + if (1 === intval($request->get('create_another'))) { // @codeCoverageIgnoreStart Session::put('tags.create.fromStore', true); @@ -299,7 +295,7 @@ class TagController extends Controller Session::flash('success', strval(trans('firefly.updated_tag', ['tag' => $data['tag']]))); Preferences::mark(); - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // @codeCoverageIgnoreStart Session::put('tags.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php index aea7f98d97..c6c2b62b1f 100644 --- a/app/Http/Controllers/Transaction/ConvertController.php +++ b/app/Http/Controllers/Transaction/ConvertController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; @@ -37,13 +36,11 @@ use Session; use View; /** - * Class ConvertController - * - * @package FireflyIII\Http\Controllers\Transaction + * Class ConvertController. */ class ConvertController extends Controller { - /** @var AccountRepositoryInterface */ + /** @var AccountRepositoryInterface */ private $accounts; /** @@ -117,11 +114,9 @@ class ConvertController extends Controller 'sourceType', 'subTitle', 'subTitleIcon' - ) ); - // convert withdrawal to deposit requires a new source account () // or to transfer requires } @@ -178,6 +173,7 @@ class ConvertController extends Controller * @param array $data * * @return Account + * * @throws FireflyException */ private function getDestinationAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account @@ -202,7 +198,7 @@ class ConvertController extends Controller case TransactionType::DEPOSIT . '-' . TransactionType::WITHDRAWAL: case TransactionType::TRANSFER . '-' . TransactionType::WITHDRAWAL: // three and five - if ($data['destination_account_expense'] === '' || is_null($data['destination_account_expense'])) { + if ('' === $data['destination_account_expense'] || null === $data['destination_account_expense']) { // destination is a cash account. $destination = $accountRepository->getCashAccount(); @@ -233,6 +229,7 @@ class ConvertController extends Controller * @param array $data * * @return Account + * * @throws FireflyException */ private function getSourceAccount(TransactionJournal $journal, TransactionType $destinationType, array $data): Account @@ -249,7 +246,7 @@ class ConvertController extends Controller case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT: case TransactionType::TRANSFER . '-' . TransactionType::DEPOSIT: - if ($data['source_account_revenue'] === '' || is_null($data['source_account_revenue'])) { + if ('' === $data['source_account_revenue'] || null === $data['source_account_revenue']) { // destination is a cash account. $destination = $accountRepository->getCashAccount(); diff --git a/app/Http/Controllers/Transaction/LinkController.php b/app/Http/Controllers/Transaction/LinkController.php index 42cc68786b..ca4f85e350 100644 --- a/app/Http/Controllers/Transaction/LinkController.php +++ b/app/Http/Controllers/Transaction/LinkController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; @@ -36,14 +35,10 @@ use URL; use View; /** - * Class LinkController - * - * @package FireflyIII\Http\Controllers\Transaction + * Class LinkController. */ class LinkController extends Controller { - - /** * */ @@ -61,7 +56,6 @@ class LinkController extends Controller ); } - /** * @param TransactionJournalLink $link * @@ -107,7 +101,7 @@ class LinkController extends Controller TransactionJournal $journal ) { $linkInfo = $request->getLinkInfo(); - if ($linkInfo['transaction_journal_id'] === 0) { + if (0 === $linkInfo['transaction_journal_id']) { Session::flash('error', trans('firefly.invalid_link_selection')); return redirect(route('transactions.show', [$journal->id])); @@ -124,13 +118,13 @@ class LinkController extends Controller $journalLink = new TransactionJournalLink; $journalLink->linkType()->associate($linkType); - if ($linkInfo['direction'] === 'inward') { + if ('inward' === $linkInfo['direction']) { Log::debug(sprintf('Link type is inwards ("%s"), so %d is source and %d is destination.', $linkType->inward, $other->id, $journal->id)); $journalLink->source()->associate($other); $journalLink->destination()->associate($journal); } - if ($linkInfo['direction'] === 'outward') { + if ('outward' === $linkInfo['direction']) { Log::debug(sprintf('Link type is inwards ("%s"), so %d is source and %d is destination.', $linkType->outward, $journal->id, $other->id)); $journalLink->source()->associate($journal); $journalLink->destination()->associate($other); diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index 1add0b245e..d7dc44935b 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; @@ -39,9 +38,7 @@ use Session; use View; /** - * Class MassController - * - * @package FireflyIII\Http\Controllers\Transaction + * Class MassController. */ class MassController extends Controller { @@ -52,7 +49,6 @@ class MassController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.transactions')); @@ -95,7 +91,7 @@ class MassController extends Controller foreach ($ids as $journalId) { /** @var TransactionJournal $journal */ $journal = $repository->find(intval($journalId)); - if (!is_null($journal->id) && intval($journalId) === $journal->id) { + if (null !== $journal->id && intval($journalId) === $journal->id) { $set->push($journal); } } @@ -106,7 +102,7 @@ class MassController extends Controller /** @var TransactionJournal $journal */ foreach ($set as $journal) { $repository->delete($journal); - $count++; + ++$count; } Preferences::mark(); @@ -116,7 +112,6 @@ class MassController extends Controller return redirect($this->getPreviousUri('transactions.mass-delete.uri')); } - /** * @param Collection $journals * @@ -139,7 +134,7 @@ class MassController extends Controller $filtered = new Collection; $messages = []; /** - * @var TransactionJournal $journal + * @var TransactionJournal */ foreach ($journals as $journal) { $sources = $journal->sourceAccountList(); @@ -153,7 +148,7 @@ class MassController extends Controller $messages[] = trans('firefly.cannot_edit_multiple_dest', ['description' => $journal->description, 'id' => $journal->id]); continue; } - if ($journal->transactionType->type === TransactionType::OPENING_BALANCE) { + if (TransactionType::OPENING_BALANCE === $journal->transactionType->type) { $messages[] = trans('firefly.cannot_edit_opening_balance'); continue; } @@ -191,18 +186,18 @@ class MassController extends Controller $journal->foreign_amount = floatval($transaction->foreign_amount); $journal->foreign_currency = $transaction->foreignCurrency; - if (!is_null($sources->first())) { + if (null !== $sources->first()) { $journal->source_account_id = $sources->first()->id; $journal->source_account_name = $sources->first()->editname; } - if (!is_null($destinations->first())) { + if (null !== $destinations->first()) { $journal->destination_account_id = $destinations->first()->id; $journal->destination_account_name = $destinations->first()->editname; } } ); - if ($filtered->count() === 0) { + if (0 === $filtered->count()) { Session::flash('error', trans('firefly.no_edit_multiple_left')); } @@ -265,7 +260,7 @@ class MassController extends Controller // call repository update function. $repository->update($journal, $data); - $count++; + ++$count; } } } diff --git a/app/Http/Controllers/Transaction/SingleController.php b/app/Http/Controllers/Transaction/SingleController.php index ba260c7e1c..7d6f23f26c 100644 --- a/app/Http/Controllers/Transaction/SingleController.php +++ b/app/Http/Controllers/Transaction/SingleController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; @@ -48,26 +47,24 @@ use Steam; use View; /** - * Class SingleController - * - * @package FireflyIII\Http\Controllers\Transaction + * Class SingleController. */ class SingleController extends Controller { - /** @var AccountRepositoryInterface */ + /** @var AccountRepositoryInterface */ private $accounts; /** @var AttachmentHelperInterface */ private $attachments; - /** @var BudgetRepositoryInterface */ + /** @var BudgetRepositoryInterface */ private $budgets; - /** @var CurrencyRepositoryInterface */ + /** @var CurrencyRepositoryInterface */ private $currency; - /** @var PiggyBankRepositoryInterface */ + /** @var PiggyBankRepositoryInterface */ private $piggyBanks; - /** @var JournalRepositoryInterface */ + /** @var JournalRepositoryInterface */ private $repository; /** @@ -105,14 +102,14 @@ class SingleController extends Controller $source = $journal->sourceAccountList()->first(); $destination = $journal->destinationAccountList()->first(); $budget = $journal->budgets()->first(); - $budgetId = is_null($budget) ? 0 : $budget->id; + $budgetId = null === $budget ? 0 : $budget->id; $category = $journal->categories()->first(); - $categoryName = is_null($category) ? '' : $category->name; + $categoryName = null === $category ? '' : $category->name; $tags = join(',', $journal->tags()->get()->pluck('tag')->toArray()); /** @var Transaction $transaction */ $transaction = $journal->transactions()->first(); $amount = Steam::positive($transaction->amount); - $foreignAmount = is_null($transaction->foreign_amount) ? null : Steam::positive($transaction->foreign_amount); + $foreignAmount = null === $transaction->foreign_amount ? null : Steam::positive($transaction->foreign_amount); $preFilled = [ 'description' => $journal->description, @@ -142,7 +139,7 @@ class SingleController extends Controller /** @var Note $note */ $note = $journal->notes()->first(); - if (!is_null($note)) { + if (null !== $note) { $preFilled['notes'] = $note->text; } @@ -172,7 +169,7 @@ class SingleController extends Controller Session::put('preFilled', $preFilled); // put previous url in session if not redirect from store (not "create another"). - if (session('transactions.create.fromStore') !== true) { + if (true !== session('transactions.create.fromStore')) { $this->rememberPreviousUri('transactions.create.uri'); } Session::forget('transactions.create.fromStore'); @@ -218,6 +215,7 @@ class SingleController extends Controller * @param TransactionJournal $transactionJournal * * @return \Illuminate\Http\RedirectResponse + * * @internal param JournalRepositoryInterface $repository */ public function destroy(TransactionJournal $transactionJournal) @@ -265,7 +263,7 @@ class SingleController extends Controller $destinationAccounts = $journal->destinationAccountList(); $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; $pTransaction = $journal->positiveTransaction(); - $foreignCurrency = !is_null($pTransaction->foreignCurrency) ? $pTransaction->foreignCurrency : $pTransaction->transactionCurrency; + $foreignCurrency = null !== $pTransaction->foreignCurrency ? $pTransaction->foreignCurrency : $pTransaction->transactionCurrency; $preFilled = [ 'date' => $journal->dateAsString(), 'interest_date' => $journal->dateAsString('interest_date'), @@ -299,13 +297,13 @@ class SingleController extends Controller ]; /** @var Note $note */ $note = $journal->notes()->first(); - if (!is_null($note)) { + if (null !== $note) { $preFilled['notes'] = $note->text; } // amounts for withdrawals and deposits: // amount, native_amount, source_amount, destination_amount - if (($journal->isWithdrawal() || $journal->isDeposit()) && !is_null($pTransaction->foreign_amount)) { + if (($journal->isWithdrawal() || $journal->isDeposit()) && null !== $pTransaction->foreign_amount) { $preFilled['amount'] = $pTransaction->foreign_amount; $preFilled['currency'] = $pTransaction->foreignCurrency; } @@ -315,7 +313,7 @@ class SingleController extends Controller Session::flash('gaEventAction', 'edit-' . $what); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('transactions.edit.fromUpdate') !== true) { + if (true !== session('transactions.edit.fromUpdate')) { $this->rememberPreviousUri('transactions.edit.uri'); } Session::forget('transactions.edit.fromUpdate'); @@ -334,11 +332,11 @@ class SingleController extends Controller */ public function store(JournalFormRequest $request, JournalRepositoryInterface $repository) { - $doSplit = intval($request->get('split_journal')) === 1; - $createAnother = intval($request->get('create_another')) === 1; + $doSplit = 1 === intval($request->get('split_journal')); + $createAnother = 1 === intval($request->get('create_another')); $data = $request->getJournalData(); $journal = $repository->store($data); - if (is_null($journal->id)) { + if (null === $journal->id) { // error! Log::error('Could not store transaction journal: ', $journal->getErrors()->toArray()); Session::flash('error', $journal->getErrors()->first()); @@ -366,13 +364,13 @@ class SingleController extends Controller Preferences::mark(); // @codeCoverageIgnoreStart - if ($createAnother === true) { + if (true === $createAnother) { Session::put('transactions.create.fromStore', true); return redirect(route('transactions.create', [$request->input('what')]))->withInput(); } - if ($doSplit === true) { + if (true === $doSplit) { return redirect(route('transactions.split.edit', [$journal->id])); } @@ -419,7 +417,7 @@ class SingleController extends Controller Preferences::mark(); // @codeCoverageIgnoreStart - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { Session::put('transactions.edit.fromUpdate', true); return redirect(route('transactions.edit', [$journal->id]))->withInput(['return_to_edit' => 1]); @@ -440,7 +438,7 @@ class SingleController extends Controller /** @var Account $account */ foreach ($accounts as $account) { $type = $account->getMeta('accountRole'); - if (strlen($type) === 0) { + if (0 === strlen($type)) { $type = 'no_account_type'; } $key = strval(trans('firefly.opt_group_' . $type)); @@ -460,7 +458,7 @@ class SingleController extends Controller /** @var Account $account */ foreach ($accounts as $account) { $type = $account->getMeta('accountRole'); - if (strlen($type) === 0) { + if (0 === strlen($type)) { $type = 'no_account_type'; } $key = strval(trans('firefly.opt_group_' . $type)); diff --git a/app/Http/Controllers/Transaction/SplitController.php b/app/Http/Controllers/Transaction/SplitController.php index 1a0e994b9c..a5fe0a63ef 100644 --- a/app/Http/Controllers/Transaction/SplitController.php +++ b/app/Http/Controllers/Transaction/SplitController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; @@ -45,21 +44,17 @@ use Steam; use View; /** - * Class SplitController - * - * @package FireflyIII\Http\Controllers\Transaction - * + * Class SplitController. */ class SplitController extends Controller { - - /** @var AccountRepositoryInterface */ + /** @var AccountRepositoryInterface */ private $accounts; /** @var AttachmentHelperInterface */ private $attachments; - /** @var BudgetRepositoryInterface */ + /** @var BudgetRepositoryInterface */ private $budgets; /** @var CurrencyRepositoryInterface */ @@ -75,7 +70,6 @@ class SplitController extends Controller { parent::__construct(); - // some useful repositories: $this->middleware( function ($request, $next) { @@ -122,12 +116,11 @@ class SplitController extends Controller $accountArray[$account->id]['currency_id'] = intval($account->getMeta('currency_id')); } - Session::flash('gaEventCategory', 'transactions'); Session::flash('gaEventAction', 'edit-split-' . $preFilled['what']); // put previous url in session if not redirect from store (not "return_to_edit"). - if (session('transactions.edit-split.fromUpdate') !== true) { + if (true !== session('transactions.edit-split.fromUpdate')) { $this->rememberPreviousUri('transactions.edit-split.uri'); } Session::forget('transactions.edit-split.fromUpdate'); @@ -150,7 +143,6 @@ class SplitController extends Controller ); } - /** * @param SplitJournalFormRequest $request * @param JournalRepositoryInterface $repository @@ -183,7 +175,7 @@ class SplitController extends Controller Preferences::mark(); // @codeCoverageIgnoreStart - if (intval($request->get('return_to_edit')) === 1) { + if (1 === intval($request->get('return_to_edit'))) { // set value so edit routine will not overwrite URL: Session::put('transactions.edit-split.fromUpdate', true); @@ -202,7 +194,7 @@ class SplitController extends Controller */ private function arrayFromInput(SplitJournalFormRequest $request): array { - $tags = is_null($request->get('tags')) ? '' : $request->get('tags'); + $tags = null === $request->get('tags') ? '' : $request->get('tags'); $array = [ 'journal_description' => $request->get('journal_description'), 'journal_source_account_id' => $request->get('journal_source_account_id'), @@ -225,7 +217,6 @@ class SplitController extends Controller 'transactions' => $this->getTransactionDataFromRequest($request), ]; - return $array; } @@ -242,7 +233,7 @@ class SplitController extends Controller $notes = ''; /** @var Note $note */ $note = $journal->notes()->first(); - if (!is_null($note)) { + if (null !== $note) { $notes = $note->text; } $array = [ @@ -303,11 +294,10 @@ class SplitController extends Controller 'foreign_currency_id' => $transaction['foreign_currency_id'], 'foreign_currency_code' => $transaction['foreign_currency_code'], 'foreign_currency_symbol' => $transaction['foreign_currency_symbol'], - ]; // set initial category and/or budget: - if (count($transactions) === 1 && $index === 0) { + if (1 === count($transactions) && 0 === $index) { $set['budget_id'] = $journal->budgetId(); $set['category'] = $journal->categoryAsString(); } @@ -340,7 +330,6 @@ class SplitController extends Controller 'category' => $transaction['category'] ?? '', 'transaction_currency_id' => intval($transaction['transaction_currency_id']), 'foreign_currency_id' => $transaction['foreign_currency_id'] ?? null, - ]; } Log::debug(sprintf('Found %d splits in request data.', count($return))); @@ -356,7 +345,7 @@ class SplitController extends Controller */ private function updateWithPrevious($array, $old): array { - if (count($old) === 0 || !isset($old['transactions'])) { + if (0 === count($old) || !isset($old['transactions'])) { return $array; } $old = $old['transactions']; diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 9e64cb5c10..ed2cf98897 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -42,9 +41,7 @@ use Response; use View; /** - * Class TransactionController - * - * @package FireflyIII\Http\Controllers + * Class TransactionController. */ class TransactionController extends Controller { @@ -55,7 +52,6 @@ class TransactionController extends Controller { parent::__construct(); - $this->middleware( function ($request, $next) { View::share('title', trans('firefly.transactions')); @@ -70,7 +66,6 @@ class TransactionController extends Controller * @param Request $request * @param JournalRepositoryInterface $repository * @param string $what - * * @param string $moment * * @return View @@ -89,7 +84,7 @@ class TransactionController extends Controller $path = route('transactions.index', [$what]); // prep for "all" view. - if ($moment === 'all') { + if ('all' === $moment) { $subTitle = trans('firefly.all_' . $what); $first = $repository->first(); $start = $first->date ?? new Carbon; @@ -98,7 +93,7 @@ class TransactionController extends Controller } // prep for "specific date" view. - if (strlen($moment) > 0 && $moment !== 'all') { + if (strlen($moment) > 0 && 'all' !== $moment) { $start = new Carbon($moment); $end = Navigation::endOfPeriod($start, $range); $path = route('transactions.index', [$what, $moment]); @@ -110,7 +105,7 @@ class TransactionController extends Controller } // prep for current period - if (strlen($moment) === 0) { + if (0 === strlen($moment)) { $start = clone session('start', Navigation::startOfPeriod(new Carbon, $range)); $end = clone session('end', Navigation::endOfPeriod(new Carbon, $range)); $periods = $this->getPeriodOverview($what); @@ -127,7 +122,6 @@ class TransactionController extends Controller $transactions = $collector->getPaginatedJournals(); $transactions->setPath($path); - return view('transactions.index', compact('subTitle', 'what', 'subTitleIcon', 'transactions', 'periods', 'start', 'end', 'moment')); } @@ -163,7 +157,7 @@ class TransactionController extends Controller $journal = $repository->find(intval($id)); if ($journal && $journal->date->isSameDay($date)) { $repository->setOrder($journal, $order); - $order++; + ++$order; } } } @@ -175,7 +169,6 @@ class TransactionController extends Controller /** * @param TransactionJournal $journal * @param JournalTaskerInterface $tasker - * * @param LinkTypeRepositoryInterface $linkTypeRepository * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View @@ -199,6 +192,7 @@ class TransactionController extends Controller * @param string $what * * @return Collection + * * @throws FireflyException */ private function getPeriodOverview(string $what): Collection @@ -290,7 +284,7 @@ class TransactionController extends Controller } // save amount: $return[$currencyId]['sum'] = bcadd($return[$currencyId]['sum'], $transaction->transaction_amount); - $return[$currencyId]['count']++; + ++$return[$currencyId]['count']; } asort($return); diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 8f2808c3d8..d1e66021d3 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * Kernel.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -95,7 +93,6 @@ class Kernel extends HttpKernel SubstituteBindings::class, ], - // MUST NOT be logged in. Does not care about 2FA or confirmation. 'user-not-logged-in' => [ Sandstorm::class, @@ -173,14 +170,12 @@ class Kernel extends HttpKernel Binder::class, ], - 'api' => [ 'throttle:60,1', 'bindings', ], ]; - /** * The application's route middleware. * diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 015770f866..bd07886e0a 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -29,18 +28,16 @@ use Illuminate\Support\Facades\Auth; use Session; /** - * Class Authenticate - * - * @package FireflyIII\Http\Middleware + * Class Authenticate. */ class Authenticate { /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * * @return mixed */ @@ -53,9 +50,9 @@ class Authenticate return redirect()->guest('login'); } - if (intval(auth()->user()->blocked) === 1) { + if (1 === intval(auth()->user()->blocked)) { $message = strval(trans('firefly.block_account_logout')); - if (auth()->user()->blocked_code === 'email_changed') { + if ('email_changed' === auth()->user()->blocked_code) { $message = strval(trans('firefly.email_changed_logout')); } diff --git a/app/Http/Middleware/AuthenticateTwoFactor.php b/app/Http/Middleware/AuthenticateTwoFactor.php index 57aba99e62..970e834cbc 100644 --- a/app/Http/Middleware/AuthenticateTwoFactor.php +++ b/app/Http/Middleware/AuthenticateTwoFactor.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -32,24 +31,21 @@ use Preferences; use Session; /** - * Class AuthenticateTwoFactor - * - * @package FireflyIII\Http\Middleware + * Class AuthenticateTwoFactor. */ class AuthenticateTwoFactor { /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * * @return mixed */ public function handle(Request $request, Closure $next, $guard = null) { - // do the usual auth, again: if (Auth::guard($guard)->guest()) { if ($request->ajax()) { @@ -59,17 +55,17 @@ class AuthenticateTwoFactor return redirect()->guest('login'); } - if (intval(auth()->user()->blocked) === 1) { + if (1 === intval(auth()->user()->blocked)) { Auth::guard($guard)->logout(); Session::flash('logoutMessage', trans('firefly.block_account_logout')); return redirect()->guest('login'); } $is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; - $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); + $has2faSecret = null !== Preferences::get('twoFactorAuthSecret'); // grab 2auth information from cookie, not from session. - $is2faAuthed = Cookie::get('twoFactorAuthenticated') === 'true'; + $is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated'); if ($is2faEnabled && $has2faSecret && !$is2faAuthed) { Log::debug('Does not seem to be 2 factor authed, redirect.'); diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.php index 35b14b4fe1..056fff3f9a 100644 --- a/app/Http/Middleware/Binder.php +++ b/app/Http/Middleware/Binder.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -28,9 +27,7 @@ use FireflyIII\Support\Domain; use Illuminate\Http\Request; /** - * Class Binder - * - * @package FireflyIII\Http\Middleware + * Class Binder. */ class Binder { @@ -47,8 +44,8 @@ class Binder /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next + * @param \Illuminate\Http\Request $request + * @param \Closure $next * * @return mixed */ diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 168e27c01b..ef7bcceca5 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * EncryptCookies.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -44,6 +42,5 @@ class EncryptCookies extends Middleware */ protected $except = [ - // ]; } diff --git a/app/Http/Middleware/IsAdmin.php b/app/Http/Middleware/IsAdmin.php index 887ecd0713..3fb6dbdd8e 100644 --- a/app/Http/Middleware/IsAdmin.php +++ b/app/Http/Middleware/IsAdmin.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -29,18 +28,16 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; /** - * Class IsAdmin - * - * @package FireflyIII\Http\Middleware + * Class IsAdmin. */ class IsAdmin { /** * Handle an incoming request. Must be admin. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * * @return mixed */ diff --git a/app/Http/Middleware/IsLimitedUser.php b/app/Http/Middleware/IsLimitedUser.php index ba998b8e20..01fc8163ea 100644 --- a/app/Http/Middleware/IsLimitedUser.php +++ b/app/Http/Middleware/IsLimitedUser.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -30,18 +29,16 @@ use Illuminate\Support\Facades\Auth; use Session; /** - * Class IsAdmin - * - * @package FireflyIII\Http\Middleware + * Class IsAdmin. */ class IsLimitedUser { /** * Handle an incoming request. May not be a limited user (ie. Sandstorm env. or demo user). * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * * @return mixed */ @@ -62,7 +59,7 @@ class IsLimitedUser return redirect(route('index')); } - if (intval(getenv('SANDSTORM')) === 1) { + if (1 === intval(getenv('SANDSTORM'))) { Session::flash('warning', strval(trans('firefly.sandstorm_not_available'))); return redirect(route('index')); diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 6e55ff3c56..8f5a9badcc 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -36,9 +35,7 @@ use Session; use View; /** - * Class SessionFilter - * - * @package FireflyIII\Http\Middleware + * Class SessionFilter. */ class Range { @@ -52,8 +49,7 @@ class Range /** * Create a new filter instance. * - * @param Guard $auth - * + * @param Guard $auth */ public function __construct(Guard $auth) { @@ -63,16 +59,15 @@ class Range /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param Closure $next + * @param string|null $guard * * @return mixed */ public function handle(Request $request, Closure $next, $guard = null) { if (!Auth::guard($guard)->guest()) { - // set start, end and finish: $this->setRange(); @@ -108,11 +103,10 @@ class Range $moneyResult = setlocale(LC_MONETARY, $locale); // send error to view if could not set money format - if ($moneyResult === false) { + if (false === $moneyResult) { View::share('invalidMonetaryLocale', true); } - // save some formats: $monthAndDayFormat = (string)trans('config.month_and_day'); $dateTimeFormat = (string)trans('config.date_time'); @@ -144,7 +138,7 @@ class Range $journal = $repository->first(); $first = Carbon::now()->startOfYear(); - if (!is_null($journal->id)) { + if (null !== $journal->id) { $first = $journal->date; } Session::put('first', $first); diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 1794d539c5..8b6e5232fb 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * RedirectIfAuthenticated.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -41,9 +39,9 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * * @return mixed */ diff --git a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php index 31fc050329..1e63bb21da 100644 --- a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php +++ b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -29,18 +28,16 @@ use Illuminate\Support\Facades\Auth; use Preferences; /** - * Class RedirectIfTwoFactorAuthenticated - * - * @package FireflyIII\Http\Middleware + * Class RedirectIfTwoFactorAuthenticated. */ class RedirectIfTwoFactorAuthenticated { /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * * @return mixed */ @@ -48,10 +45,10 @@ class RedirectIfTwoFactorAuthenticated { if (Auth::guard($guard)->check()) { $is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; - $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); + $has2faSecret = null !== Preferences::get('twoFactorAuthSecret'); // grab 2auth information from cookie - $is2faAuthed = Cookie::get('twoFactorAuthenticated') === 'true'; + $is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated'); if ($is2faEnabled && $has2faSecret && $is2faAuthed) { return redirect('/'); diff --git a/app/Http/Middleware/Sandstorm.php b/app/Http/Middleware/Sandstorm.php index b714853bd4..83759a0c96 100644 --- a/app/Http/Middleware/Sandstorm.php +++ b/app/Http/Middleware/Sandstorm.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -33,9 +32,7 @@ use Illuminate\Http\Request; use View; /** - * Class Sandstorm - * - * @package FireflyIII\Http\Middleware + * Class Sandstorm. */ class Sandstorm { @@ -43,18 +40,19 @@ class Sandstorm * Detects if is using Sandstorm, and responds by logging the user * in and/or creating an account. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * * @return mixed + * * @throws FireflyException * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function handle(Request $request, Closure $next, $guard = null) { // is in Sandstorm environment? - $sandstorm = intval(getenv('SANDSTORM')) === 1; + $sandstorm = 1 === intval(getenv('SANDSTORM')); View::share('SANDSTORM', $sandstorm); if (!$sandstorm) { return $next($request); @@ -72,7 +70,7 @@ class Sandstorm // access the same data so we have no choice but to simply login // the new user to the same account and just forget about Bob and Alice // and any other differences there may be between these users. - if ($count === 1 && strlen($userId) > 0) { + if (1 === $count && strlen($userId) > 0) { // login as first user user. $user = User::first(); Auth::guard($guard)->login($user); @@ -81,7 +79,7 @@ class Sandstorm return $next($request); } - if ($count === 1 && strlen($userId) === 0) { + if (1 === $count && 0 === strlen($userId)) { // login but indicate anonymous $user = User::first(); Auth::guard($guard)->login($user); @@ -90,7 +88,7 @@ class Sandstorm return $next($request); } - if ($count === 0 && strlen($userId) > 0) { + if (0 === $count && strlen($userId) > 0) { // create new user. $email = $userId . '@firefly'; /** @var User $user */ @@ -110,7 +108,7 @@ class Sandstorm return $next($request); } - if ($count === 0 && strlen($userId) === 0) { + if (0 === $count && 0 === strlen($userId)) { throw new FireflyException('The first visit to a new Firefly III administration cannot be by a guest user.'); } diff --git a/app/Http/Middleware/StartFireflySession.php b/app/Http/Middleware/StartFireflySession.php index a4e8604482..2653c10f0f 100644 --- a/app/Http/Middleware/StartFireflySession.php +++ b/app/Http/Middleware/StartFireflySession.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Middleware; @@ -28,17 +27,15 @@ use Illuminate\Http\Request; use Illuminate\Session\Middleware\StartSession; /** - * Class StartFireflySession - * - * @package FireflyIII\Http\Middleware + * Class StartFireflySession. */ class StartFireflySession extends StartSession { /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param Closure $next + * @param \Illuminate\Http\Request $request + * @param Closure $next * * @return mixed */ @@ -50,16 +47,14 @@ class StartFireflySession extends StartSession /** * Store the current URL for the request if necessary. * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Contracts\Session\Session $session - * - * @return void + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Contracts\Session\Session $session */ protected function storeCurrentUrl(Request $request, $session) { $uri = $request->fullUrl(); $strpos = strpos($uri, 'jscript'); - if ($request->method() === 'GET' && $request->route() && !$request->ajax() && $strpos === false) { + if ('GET' === $request->method() && $request->route() && !$request->ajax() && false === $strpos) { $session->setPreviousUrl($uri); } } diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php index 7ad3a2e0fa..21d5495130 100644 --- a/app/Http/Middleware/TrimStrings.php +++ b/app/Http/Middleware/TrimStrings.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * TrimStrings.php * Copyright (c) 2017 thegrumpydictator@gmail.com diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 878aa0ea98..68e8599322 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * TrustProxies.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -67,7 +65,7 @@ class TrustProxies extends Middleware public function __construct(Repository $config) { $trustedProxies = env('TRUSTED_PROXIES', null); - if (!is_null($trustedProxies) && strlen($trustedProxies) > 0) { + if (null !== $trustedProxies && strlen($trustedProxies) > 0) { $this->proxies = $trustedProxies; } diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 869a532515..838f340dcc 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * VerifyCsrfToken.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -44,6 +42,5 @@ class VerifyCsrfToken extends Middleware */ protected $except = [ - // ]; } diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index 4f2b0d9f4d..eff6e1240f 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use FireflyIII\Repositories\Account\AccountRepositoryInterface; /** - * Class AccountFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class AccountFormRequest. */ class AccountFormRequest extends Request { @@ -77,7 +73,7 @@ class AccountFormRequest extends Request $nameRule = 'required|min:1|uniqueAccountForUser'; $idRule = ''; - if (!is_null($repository->find(intval($this->get('id')))->id)) { + if (null !== $repository->find(intval($this->get('id')))->id) { $idRule = 'belongsToUser:accounts'; $nameRule = 'required|min:1|uniqueAccountForUser:' . intval($this->get('id')); } diff --git a/app/Http/Requests/AttachmentFormRequest.php b/app/Http/Requests/AttachmentFormRequest.php index 6acf0ad729..7797903735 100644 --- a/app/Http/Requests/AttachmentFormRequest.php +++ b/app/Http/Requests/AttachmentFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class AttachmentFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class AttachmentFormRequest. */ class AttachmentFormRequest extends Request { diff --git a/app/Http/Requests/BillFormRequest.php b/app/Http/Requests/BillFormRequest.php index 5cddd73f60..c7d416064e 100644 --- a/app/Http/Requests/BillFormRequest.php +++ b/app/Http/Requests/BillFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class BillFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class BillFormRequest. */ class BillFormRequest extends Request { diff --git a/app/Http/Requests/BudgetFormRequest.php b/app/Http/Requests/BudgetFormRequest.php index 428a766ed9..a7f8266aac 100644 --- a/app/Http/Requests/BudgetFormRequest.php +++ b/app/Http/Requests/BudgetFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; /** - * Class BudgetFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class BudgetFormRequest. */ class BudgetFormRequest extends Request { @@ -61,7 +57,7 @@ class BudgetFormRequest extends Request /** @var BudgetRepositoryInterface $repository */ $repository = app(BudgetRepositoryInterface::class); $nameRule = 'required|between:1,100|uniqueObjectForUser:budgets,name'; - if (!is_null($repository->find(intval($this->get('id')))->id)) { + if (null !== $repository->find(intval($this->get('id')))->id) { $nameRule = 'required|between:1,100|uniqueObjectForUser:budgets,name,' . intval($this->get('id')); } diff --git a/app/Http/Requests/BudgetIncomeRequest.php b/app/Http/Requests/BudgetIncomeRequest.php index 9dd7ce13cf..94fd15117a 100644 --- a/app/Http/Requests/BudgetIncomeRequest.php +++ b/app/Http/Requests/BudgetIncomeRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class BudgetIncomeRequest - * - * - * @package FireflyIII\Http\Requests + * Class BudgetIncomeRequest. */ class BudgetIncomeRequest extends Request { diff --git a/app/Http/Requests/CategoryFormRequest.php b/app/Http/Requests/CategoryFormRequest.php index 6b412ec859..316076b85f 100644 --- a/app/Http/Requests/CategoryFormRequest.php +++ b/app/Http/Requests/CategoryFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; /** - * Class CategoryFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class CategoryFormRequest. */ class CategoryFormRequest extends Request { @@ -60,7 +56,7 @@ class CategoryFormRequest extends Request /** @var CategoryRepositoryInterface $repository */ $repository = app(CategoryRepositoryInterface::class); $nameRule = 'required|between:1,100|uniqueObjectForUser:categories,name'; - if (!is_null($repository->find(intval($this->get('id')))->id)) { + if (null !== $repository->find(intval($this->get('id')))->id) { $nameRule = 'required|between:1,100|uniqueObjectForUser:categories,name,' . intval($this->get('id')); } diff --git a/app/Http/Requests/ConfigurationRequest.php b/app/Http/Requests/ConfigurationRequest.php index 51b12a7efb..facdf0652d 100644 --- a/app/Http/Requests/ConfigurationRequest.php +++ b/app/Http/Requests/ConfigurationRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class ConfigurationRequest - * - * - * @package FireflyIII\Http\Requests + * Class ConfigurationRequest. */ class ConfigurationRequest extends Request { diff --git a/app/Http/Requests/CurrencyFormRequest.php b/app/Http/Requests/CurrencyFormRequest.php index 7fc18f86ee..54f0a742de 100644 --- a/app/Http/Requests/CurrencyFormRequest.php +++ b/app/Http/Requests/CurrencyFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class BillFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class BillFormRequest. */ class CurrencyFormRequest extends Request { diff --git a/app/Http/Requests/DeleteAccountFormRequest.php b/app/Http/Requests/DeleteAccountFormRequest.php index e14d0e9159..091e660feb 100644 --- a/app/Http/Requests/DeleteAccountFormRequest.php +++ b/app/Http/Requests/DeleteAccountFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class DeleteAccountFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class DeleteAccountFormRequest. */ class DeleteAccountFormRequest extends Request { diff --git a/app/Http/Requests/EmailFormRequest.php b/app/Http/Requests/EmailFormRequest.php index 34f1b4e6bc..0574e39ac2 100644 --- a/app/Http/Requests/EmailFormRequest.php +++ b/app/Http/Requests/EmailFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class EmailFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class EmailFormRequest. */ class EmailFormRequest extends Request { diff --git a/app/Http/Requests/ExportFormRequest.php b/app/Http/Requests/ExportFormRequest.php index 895f661acb..2b1dc46df0 100644 --- a/app/Http/Requests/ExportFormRequest.php +++ b/app/Http/Requests/ExportFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use Carbon\Carbon; /** - * Class ExportFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class ExportFormRequest. */ class ExportFormRequest extends Request { diff --git a/app/Http/Requests/ImportUploadRequest.php b/app/Http/Requests/ImportUploadRequest.php index 813ad6bbd7..1a4ac97c9e 100644 --- a/app/Http/Requests/ImportUploadRequest.php +++ b/app/Http/Requests/ImportUploadRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class ImportUploadRequest - * - * - * @package FireflyIII\Http\Requests + * Class ImportUploadRequest. */ class ImportUploadRequest extends Request { diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.php index 7e3912a707..fc05104976 100644 --- a/app/Http/Requests/JournalFormRequest.php +++ b/app/Http/Requests/JournalFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -27,10 +26,7 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionType; /** - * Class JournalFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class JournalFormRequest. */ class JournalFormRequest extends Request { @@ -81,7 +77,6 @@ class JournalFormRequest extends Request 'native_amount' => $this->float('native_amount'), 'source_amount' => $this->float('source_amount'), 'destination_amount' => $this->float('destination_amount'), - ]; return $data; @@ -130,12 +125,13 @@ class JournalFormRequest extends Request } /** - * Inspired by https://www.youtube.com/watch?v=WwnI0RS6J5A + * Inspired by https://www.youtube.com/watch?v=WwnI0RS6J5A. * * @param string $what * @param array $rules * * @return array + * * @throws FireflyException */ private function enhanceRules(string $what, array $rules): array diff --git a/app/Http/Requests/JournalLinkRequest.php b/app/Http/Requests/JournalLinkRequest.php index 06bcdf4b95..85d8728e5c 100644 --- a/app/Http/Requests/JournalLinkRequest.php +++ b/app/Http/Requests/JournalLinkRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use FireflyIII\Models\LinkType; /** - * Class JournalLink - * - * - * @package FireflyIII\Http\Requests + * Class JournalLink. */ class JournalLinkRequest extends Request { @@ -54,7 +50,7 @@ class JournalLinkRequest extends Request $return['transaction_journal_id'] = $this->integer('link_journal_id'); $return['comments'] = strlen($this->string('comments')) > 0 ? $this->string('comments') : null; $return['direction'] = $parts[1]; - if ($return['transaction_journal_id'] === 0 && ctype_digit($this->string('link_other'))) { + if (0 === $return['transaction_journal_id'] && ctype_digit($this->string('link_other'))) { $return['transaction_journal_id'] = $this->integer('link_other'); } diff --git a/app/Http/Requests/LinkTypeFormRequest.php b/app/Http/Requests/LinkTypeFormRequest.php index 8895dd2199..b113f24a53 100644 --- a/app/Http/Requests/LinkTypeFormRequest.php +++ b/app/Http/Requests/LinkTypeFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; /** - * Class BillFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class BillFormRequest. */ class LinkTypeFormRequest extends Request { @@ -53,7 +49,7 @@ class LinkTypeFormRequest extends Request $repository = app(LinkTypeRepositoryInterface::class); $nameRule = 'required|min:1|unique:link_types,name'; $idRule = ''; - if (!is_null($repository->find($this->integer('id'))->id)) { + if (null !== $repository->find($this->integer('id'))->id) { $idRule = 'exists:link_types,id'; $nameRule = 'required|min:1'; } diff --git a/app/Http/Requests/MassDeleteJournalRequest.php b/app/Http/Requests/MassDeleteJournalRequest.php index 7d5a65d394..dc386dca03 100644 --- a/app/Http/Requests/MassDeleteJournalRequest.php +++ b/app/Http/Requests/MassDeleteJournalRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class MassDeleteJournalRequest - * - * - * @package FireflyIII\Http\Requests + * Class MassDeleteJournalRequest. */ class MassDeleteJournalRequest extends Request { diff --git a/app/Http/Requests/MassEditJournalRequest.php b/app/Http/Requests/MassEditJournalRequest.php index eb82783c5b..0bf81bcfea 100644 --- a/app/Http/Requests/MassEditJournalRequest.php +++ b/app/Http/Requests/MassEditJournalRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class MassEditJournalRequest - * - * - * @package FireflyIII\Http\Requests + * Class MassEditJournalRequest. */ class MassEditJournalRequest extends Request { diff --git a/app/Http/Requests/NewUserFormRequest.php b/app/Http/Requests/NewUserFormRequest.php index bded8431d1..7cbcf455f2 100644 --- a/app/Http/Requests/NewUserFormRequest.php +++ b/app/Http/Requests/NewUserFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class NewUserFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class NewUserFormRequest. */ class NewUserFormRequest extends Request { diff --git a/app/Http/Requests/PiggyBankFormRequest.php b/app/Http/Requests/PiggyBankFormRequest.php index d4525faf88..268a0287c8 100644 --- a/app/Http/Requests/PiggyBankFormRequest.php +++ b/app/Http/Requests/PiggyBankFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use Carbon\Carbon; /** - * Class PiggyBankFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class PiggyBankFormRequest. */ class PiggyBankFormRequest extends Request { @@ -67,7 +63,6 @@ class PiggyBankFormRequest extends Request $nameRule = 'required|between:1,255|uniquePiggyBankForUser:' . intval($this->get('id')); } - $rules = [ 'name' => $nameRule, 'account_id' => 'required|belongsToUser:accounts', @@ -76,7 +71,6 @@ class PiggyBankFormRequest extends Request 'startdate' => 'date', 'targetdate' => 'date|nullable', 'order' => 'integer|min:1', - ]; return $rules; diff --git a/app/Http/Requests/ProfileFormRequest.php b/app/Http/Requests/ProfileFormRequest.php index e53eb5efe5..c12219d758 100644 --- a/app/Http/Requests/ProfileFormRequest.php +++ b/app/Http/Requests/ProfileFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class ProfileFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class ProfileFormRequest. */ class ProfileFormRequest extends Request { diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index fa05499a90..40eee6037b 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -33,10 +32,7 @@ use FireflyIII\Repositories\Tag\TagRepositoryInterface; use Illuminate\Support\Collection; /** - * Class CategoryFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class CategoryFormRequest. */ class ReportFormRequest extends Request { @@ -62,7 +58,7 @@ class ReportFormRequest extends Request if (is_array($set)) { foreach ($set as $accountId) { $account = $repository->find(intval($accountId)); - if (!is_null($account->id)) { + if (null !== $account->id) { $collection->push($account); } } @@ -83,7 +79,7 @@ class ReportFormRequest extends Request if (is_array($set)) { foreach ($set as $budgetId) { $budget = $repository->find(intval($budgetId)); - if (!is_null($budget->id)) { + if (null !== $budget->id) { $collection->push($budget); } } @@ -104,7 +100,7 @@ class ReportFormRequest extends Request if (is_array($set)) { foreach ($set as $categoryId) { $category = $repository->find(intval($categoryId)); - if (!is_null($category->id)) { + if (null !== $category->id) { $collection->push($category); } } @@ -115,6 +111,7 @@ class ReportFormRequest extends Request /** * @return Carbon + * * @throws FireflyException */ public function getEndDate(): Carbon @@ -122,7 +119,7 @@ class ReportFormRequest extends Request $date = new Carbon; $range = $this->get('daterange'); $parts = explode(' - ', strval($range)); - if (count($parts) === 2) { + if (2 === count($parts)) { try { $date = new Carbon($parts[1]); } catch (Exception $e) { @@ -135,6 +132,7 @@ class ReportFormRequest extends Request /** * @return Carbon + * * @throws FireflyException */ public function getStartDate(): Carbon @@ -142,7 +140,7 @@ class ReportFormRequest extends Request $date = new Carbon; $range = $this->get('daterange'); $parts = explode(' - ', strval($range)); - if (count($parts) === 2) { + if (2 === count($parts)) { try { $date = new Carbon($parts[0]); } catch (Exception $e) { @@ -165,7 +163,7 @@ class ReportFormRequest extends Request if (is_array($set)) { foreach ($set as $tagTag) { $tag = $repository->findByTag($tagTag); - if (!is_null($tag->id)) { + if (null !== $tag->id) { $collection->push($tag); } } diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php index 71c845b08a..f26c4113d6 100644 --- a/app/Http/Requests/Request.php +++ b/app/Http/Requests/Request.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -27,9 +26,7 @@ use Carbon\Carbon; use Illuminate\Foundation\Http\FormRequest; /** - * Class Request - * - * @package FireflyIII\Http\Requests + * Class Request. */ class Request extends FormRequest { @@ -40,7 +37,7 @@ class Request extends FormRequest */ public function boolean(string $field): bool { - return intval($this->input($field)) === 1; + return 1 === intval($this->input($field)); } /** diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php index 89f484a09a..eb4453070b 100644 --- a/app/Http/Requests/RuleFormRequest.php +++ b/app/Http/Requests/RuleFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use FireflyIII\Repositories\Rule\RuleRepositoryInterface; /** - * Class RuleFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class RuleFormRequest. */ class RuleFormRequest extends Request { @@ -77,7 +73,7 @@ class RuleFormRequest extends Request $contextActions = join(',', config('firefly.rule-actions-text')); $titleRule = 'required|between:1,100|uniqueObjectForUser:rules,title'; - if (!is_null($repository->find(intval($this->get('id')))->id)) { + if (null !== $repository->find(intval($this->get('id')))->id) { $titleRule = 'required|between:1,100|uniqueObjectForUser:rules,title,' . intval($this->get('id')); } $rules = [ @@ -91,7 +87,7 @@ class RuleFormRequest extends Request 'rule-action.*' => 'required|in:' . join(',', $validActions), ]; // since Laravel does not support this stuff yet, here's a trick. - for ($i = 0; $i < 10; $i++) { + for ($i = 0; $i < 10; ++$i) { $rules['rule-action-value.' . $i] = 'required_if:rule-action.' . $i . ',' . $contextActions . '|ruleActionValue'; } diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php index fa9163a177..539f647446 100644 --- a/app/Http/Requests/RuleGroupFormRequest.php +++ b/app/Http/Requests/RuleGroupFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; /** - * Class RuleGroupFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class RuleGroupFormRequest. */ class RuleGroupFormRequest extends Request { @@ -62,7 +58,7 @@ class RuleGroupFormRequest extends Request /** @var RuleGroupRepositoryInterface $repository */ $repository = app(RuleGroupRepositoryInterface::class); $titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title'; - if (!is_null($repository->find(intval($this->get('id')))->id)) { + if (null !== $repository->find(intval($this->get('id')))->id) { $titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title,' . intval($this->get('id')); } diff --git a/app/Http/Requests/SelectTransactionsRequest.php b/app/Http/Requests/SelectTransactionsRequest.php index 2ff802a032..1c96d0eb83 100644 --- a/app/Http/Requests/SelectTransactionsRequest.php +++ b/app/Http/Requests/SelectTransactionsRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use Carbon\Carbon; /** - * Class ExportFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class ExportFormRequest. */ class SelectTransactionsRequest extends Request { diff --git a/app/Http/Requests/SplitJournalFormRequest.php b/app/Http/Requests/SplitJournalFormRequest.php index 0c7b41ca43..0865751fb4 100644 --- a/app/Http/Requests/SplitJournalFormRequest.php +++ b/app/Http/Requests/SplitJournalFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,9 +25,7 @@ namespace FireflyIII\Http\Requests; use Steam; /** - * Class SplitJournalFormRequest - * - * @package FireflyIII\Http\Requests + * Class SplitJournalFormRequest. */ class SplitJournalFormRequest extends Request { diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index 00ae83beed..dd835fd9a6 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; @@ -26,10 +25,7 @@ namespace FireflyIII\Http\Requests; use FireflyIII\Repositories\Tag\TagRepositoryInterface; /** - * Class TagFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class TagFormRequest. */ class TagFormRequest extends Request { @@ -51,7 +47,7 @@ class TagFormRequest extends Request $longitude = null; $zoomLevel = null; - if ($this->get('tag_position_has_tag') === 'true') { + if ('true' === $this->get('tag_position_has_tag')) { $latitude = $this->string('tag_position_latitude'); $longitude = $this->string('tag_position_longitude'); $zoomLevel = $this->integer('tag_position_zoomlevel'); @@ -78,7 +74,7 @@ class TagFormRequest extends Request $repository = app(TagRepositoryInterface::class); $idRule = ''; $tagRule = 'required|min:1|uniqueObjectForUser:tags,tag'; - if (!is_null($repository->find(intval($this->get('id')))->id)) { + if (null !== $repository->find(intval($this->get('id')))->id) { $idRule = 'belongsToUser:tags'; $tagRule = 'required|min:1|uniqueObjectForUser:tags,tag,' . $this->get('id'); } diff --git a/app/Http/Requests/TestRuleFormRequest.php b/app/Http/Requests/TestRuleFormRequest.php index 93454f522e..098315e0f9 100644 --- a/app/Http/Requests/TestRuleFormRequest.php +++ b/app/Http/Requests/TestRuleFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class RuleFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class RuleFormRequest. */ class TestRuleFormRequest extends Request { diff --git a/app/Http/Requests/TokenFormRequest.php b/app/Http/Requests/TokenFormRequest.php index 4b9b17cbac..e3b2f3819f 100644 --- a/app/Http/Requests/TokenFormRequest.php +++ b/app/Http/Requests/TokenFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class TokenFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class TokenFormRequest. */ class TokenFormRequest extends Request { diff --git a/app/Http/Requests/UserFormRequest.php b/app/Http/Requests/UserFormRequest.php index 5d21912927..ffb06350ea 100644 --- a/app/Http/Requests/UserFormRequest.php +++ b/app/Http/Requests/UserFormRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class UserFormRequest - * - * - * @package FireflyIII\Http\Requests + * Class UserFormRequest. */ class UserFormRequest extends Request { @@ -47,7 +43,7 @@ class UserFormRequest extends Request { return [ 'email' => $this->string('email'), - 'blocked' => $this->integer('blocked') === 1, + 'blocked' => 1 === $this->integer('blocked'), 'blocked_code' => $this->string('blocked_code'), 'password' => $this->string('password'), ]; diff --git a/app/Http/Requests/UserRegistrationRequest.php b/app/Http/Requests/UserRegistrationRequest.php index c14439f810..dffe9a3223 100644 --- a/app/Http/Requests/UserRegistrationRequest.php +++ b/app/Http/Requests/UserRegistrationRequest.php @@ -18,16 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Http\Requests; /** - * Class UserRegistrationRequest - * - * - * @package FireflyIII\Http\Requests + * Class UserRegistrationRequest. */ class UserRegistrationRequest extends Request { @@ -49,7 +45,6 @@ class UserRegistrationRequest extends Request return [ 'email' => 'email|required', 'password' => 'confirmed|secure_password', - ]; } } diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index ff2b8e7227..a988150c12 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); use Carbon\Carbon; @@ -43,9 +42,7 @@ use FireflyIII\Models\TransactionType; use FireflyIII\User; use Illuminate\Support\Collection; -/** - * HOME - */ +// HOME Breadcrumbs::register( 'home', function (BreadCrumbGenerator $breadcrumbs) { @@ -60,9 +57,7 @@ Breadcrumbs::register( } ); -/** - * ACCOUNTS - */ +// ACCOUNTS Breadcrumbs::register( 'accounts.index', function (BreadCrumbGenerator $breadcrumbs, string $what) { @@ -88,15 +83,15 @@ Breadcrumbs::register( $breadcrumbs->push($account->name, route('accounts.show', [$account->id])); // push when is all: - if ($moment === 'all') { + if ('all' === $moment) { $breadcrumbs->push(trans('firefly.everything'), route('accounts.show', [$account->id, 'all'])); } // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { + if ('all' !== $moment && '(nothing)' !== $moment) { $title = trans( 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + 'end' => $end->formatLocalized(strval(trans('config.month_and_day'))),] ); $breadcrumbs->push($title, route('accounts.show', [$account->id, $moment, $start, $end])); } @@ -111,7 +106,6 @@ Breadcrumbs::register( } ); - Breadcrumbs::register( 'accounts.edit', function (BreadCrumbGenerator $breadcrumbs, Account $account) { @@ -122,9 +116,7 @@ Breadcrumbs::register( } ); -/** - * ADMIN - */ +// ADMIN Breadcrumbs::register( 'admin.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -179,7 +171,6 @@ Breadcrumbs::register( } ); - Breadcrumbs::register( 'admin.links.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -228,9 +219,7 @@ Breadcrumbs::register( } ); -/** - * ATTACHMENTS - */ +// ATTACHMENTS Breadcrumbs::register( 'attachments.edit', function (BreadCrumbGenerator $breadcrumbs, Attachment $attachment) { @@ -256,9 +245,7 @@ Breadcrumbs::register( } ); -/** - * BILLS - */ +// BILLS Breadcrumbs::register( 'bills.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -297,10 +284,7 @@ Breadcrumbs::register( } ); - -/** - * BUDGETS - */ +// BUDGETS Breadcrumbs::register( 'budgets.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -338,15 +322,15 @@ Breadcrumbs::register( $breadcrumbs->push(trans('firefly.journals_without_budget'), route('budgets.no-budget')); // push when is all: - if ($moment === 'all') { + if ('all' === $moment) { $breadcrumbs->push(trans('firefly.everything'), route('budgets.no-budget', ['all'])); } // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { + if ('all' !== $moment && '(nothing)' !== $moment) { $title = trans( 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + 'end' => $end->formatLocalized(strval(trans('config.month_and_day'))),] ); $breadcrumbs->push($title, route('budgets.no-budget', [$moment])); } @@ -381,9 +365,7 @@ Breadcrumbs::register( } ); -/** - * CATEGORIES - */ +// CATEGORIES Breadcrumbs::register( 'categories.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -421,22 +403,21 @@ Breadcrumbs::register( $breadcrumbs->push($category->name, route('categories.show', [$category->id])); // push when is all: - if ($moment === 'all') { + if ('all' === $moment) { $breadcrumbs->push(trans('firefly.everything'), route('categories.show', [$category->id, 'all'])); } // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { + if ('all' !== $moment && '(nothing)' !== $moment) { $title = trans( 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + 'end' => $end->formatLocalized(strval(trans('config.month_and_day'))),] ); $breadcrumbs->push($title, route('categories.show', [$category->id, $moment])); } } ); - Breadcrumbs::register( 'categories.no-category', function (BreadCrumbGenerator $breadcrumbs, string $moment, Carbon $start, Carbon $end) { @@ -444,25 +425,22 @@ Breadcrumbs::register( $breadcrumbs->push(trans('firefly.journals_without_category'), route('categories.no-category')); // push when is all: - if ($moment === 'all') { + if ('all' === $moment) { $breadcrumbs->push(trans('firefly.everything'), route('categories.no-category', ['all'])); } // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { + if ('all' !== $moment && '(nothing)' !== $moment) { $title = trans( 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + 'end' => $end->formatLocalized(strval(trans('config.month_and_day'))),] ); $breadcrumbs->push($title, route('categories.no-category', [$moment])); } } ); - -/** - * CURRENCIES - */ +// CURRENCIES Breadcrumbs::register( 'currencies.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -494,9 +472,7 @@ Breadcrumbs::register( } ); -/** - * EXPORT - */ +// EXPORT Breadcrumbs::register( 'export.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -505,9 +481,7 @@ Breadcrumbs::register( } ); -/** - * PIGGY BANKS - */ +// PIGGY BANKS Breadcrumbs::register( 'piggy-banks.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -565,9 +539,7 @@ Breadcrumbs::register( } ); -/** - * IMPORT - */ +// IMPORT Breadcrumbs::register( 'import.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -576,9 +548,7 @@ Breadcrumbs::register( } ); -/** - * FILE IMPORT - */ +// FILE IMPORT Breadcrumbs::register( 'import.file.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -602,9 +572,7 @@ Breadcrumbs::register( } ); -/** - * PREFERENCES - */ +// PREFERENCES Breadcrumbs::register( 'preferences.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -621,9 +589,7 @@ Breadcrumbs::register( } ); -/** - * PROFILE - */ +// PROFILE Breadcrumbs::register( 'profile.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -646,9 +612,7 @@ Breadcrumbs::register( } ); -/** - * REPORTS - */ +// REPORTS Breadcrumbs::register( 'reports.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -726,9 +690,7 @@ Breadcrumbs::register( } ); -/** - * New user Controller - */ +// New user Controller Breadcrumbs::register( 'new-user.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -737,9 +699,7 @@ Breadcrumbs::register( } ); -/** - * Rules - */ +// Rules Breadcrumbs::register( 'rules.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -812,10 +772,7 @@ Breadcrumbs::register( } ); - -/** - * SEARCH - */ +// SEARCH Breadcrumbs::register( 'search.index', function (BreadCrumbGenerator $breadcrumbs, $query) { @@ -824,10 +781,7 @@ Breadcrumbs::register( } ); - -/** - * TAGS - */ +// TAGS Breadcrumbs::register( 'tags.index', function (BreadCrumbGenerator $breadcrumbs) { @@ -860,45 +814,42 @@ Breadcrumbs::register( } ); - Breadcrumbs::register( 'tags.show', function (BreadCrumbGenerator $breadcrumbs, Tag $tag, string $moment, Carbon $start, Carbon $end) { $breadcrumbs->parent('tags.index'); $breadcrumbs->push(e($tag->tag), route('tags.show', [$tag->id, $moment])); - if ($moment === 'all') { + if ('all' === $moment) { $breadcrumbs->push(trans('firefly.everything'), route('tags.show', [$tag->id, $moment])); } // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { + if ('all' !== $moment && '(nothing)' !== $moment) { $title = trans( 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + 'end' => $end->formatLocalized(strval(trans('config.month_and_day'))),] ); $breadcrumbs->push($title, route('tags.show', [$tag->id, $moment])); } } ); -/** - * TRANSACTIONS - */ +// TRANSACTIONS Breadcrumbs::register( 'transactions.index', function (BreadCrumbGenerator $breadcrumbs, string $what, string $moment = '', Carbon $start, Carbon $end) { $breadcrumbs->parent('home'); $breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what])); - if ($moment === 'all') { + if ('all' === $moment) { $breadcrumbs->push(trans('firefly.everything'), route('transactions.index', [$what, 'all'])); } // when is specific period or when empty: - if ($moment !== 'all' && $moment !== '(nothing)') { + if ('all' !== $moment && '(nothing)' !== $moment) { $title = trans( 'firefly.between_dates_breadcrumb', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))), - 'end' => $end->formatLocalized(strval(trans('config.month_and_day')))] + 'end' => $end->formatLocalized(strval(trans('config.month_and_day'))),] ); $breadcrumbs->push($title, route('transactions.index', [$what, $moment])); } @@ -948,9 +899,7 @@ Breadcrumbs::register( } ); -/** - * MASS TRANSACTION EDIT / DELETE - */ +// MASS TRANSACTION EDIT / DELETE Breadcrumbs::register( 'transactions.mass.edit', function (BreadCrumbGenerator $breadcrumbs, Collection $journals): void { @@ -979,10 +928,7 @@ Breadcrumbs::register( } ); - -/** - * SPLIT - */ +// SPLIT Breadcrumbs::register( 'transactions.split.edit', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) { diff --git a/app/Import/Configurator/ConfiguratorInterface.php b/app/Import/Configurator/ConfiguratorInterface.php index 64230bc552..a6781310c7 100644 --- a/app/Import/Configurator/ConfiguratorInterface.php +++ b/app/Import/Configurator/ConfiguratorInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Configurator; @@ -26,9 +25,7 @@ namespace FireflyIII\Import\Configurator; use FireflyIII\Models\ImportJob; /** - * Interface ConfiguratorInterface - * - * @package FireflyIII\Import\Configurator + * Interface ConfiguratorInterface. */ interface ConfiguratorInterface { @@ -76,8 +73,6 @@ interface ConfiguratorInterface /** * @param ImportJob $job - * - * @return void */ public function setJob(ImportJob $job); } diff --git a/app/Import/Configurator/CsvConfigurator.php b/app/Import/Configurator/CsvConfigurator.php index 217b72b332..79593ca556 100644 --- a/app/Import/Configurator/CsvConfigurator.php +++ b/app/Import/Configurator/CsvConfigurator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Configurator; @@ -32,13 +31,11 @@ use FireflyIII\Support\Import\Configuration\Csv\Roles; use Log; /** - * Class CsvConfigurator - * - * @package FireflyIII\Import\Configurator + * Class CsvConfigurator. */ class CsvConfigurator implements ConfiguratorInterface { - /** @var ImportJob */ + /** @var ImportJob */ private $job; /** @var string */ @@ -57,6 +54,7 @@ class CsvConfigurator implements ConfiguratorInterface * @param array $data * * @return bool + * * @throws FireflyException */ public function configureJob(array $data): bool @@ -76,6 +74,7 @@ class CsvConfigurator implements ConfiguratorInterface * Return the data required for the next step in the job configuration. * * @return array + * * @throws FireflyException */ public function getNextData(): array @@ -91,6 +90,7 @@ class CsvConfigurator implements ConfiguratorInterface /** * @return string + * * @throws FireflyException */ public function getNextView(): string @@ -146,7 +146,7 @@ class CsvConfigurator implements ConfiguratorInterface public function setJob(ImportJob $job) { $this->job = $job; - if (is_null($this->job->configuration) || count($this->job->configuration) === 0) { + if (null === $this->job->configuration || 0 === count($this->job->configuration)) { Log::debug(sprintf('Gave import job %s initial configuration.', $this->job->key)); $this->job->configuration = config('csv.default_config'); $this->job->save(); @@ -155,26 +155,27 @@ class CsvConfigurator implements ConfiguratorInterface /** * @return string + * * @throws FireflyException */ private function getConfigurationClass(): string { $class = false; switch (true) { - case (!$this->job->configuration['initial-config-complete']): + case !$this->job->configuration['initial-config-complete']: $class = Initial::class; break; - case (!$this->job->configuration['column-roles-complete']): + case !$this->job->configuration['column-roles-complete']: $class = Roles::class; break; - case (!$this->job->configuration['column-mapping-complete']): + case !$this->job->configuration['column-mapping-complete']: $class = Map::class; break; default: break; } - if ($class === false || strlen($class) === 0) { + if (false === $class || 0 === strlen($class)) { throw new FireflyException('Cannot handle current job state in getConfigurationClass().'); } if (!class_exists($class)) { diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php index d9e98f73d8..e3180d9368 100644 --- a/app/Import/Converter/Amount.php +++ b/app/Import/Converter/Amount.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Converter; @@ -26,16 +25,13 @@ namespace FireflyIII\Import\Converter; use Log; /** - * Class RabobankDebetCredit - * - * @package FireflyIII\Import\Converter + * Class RabobankDebetCredit. */ class Amount implements ConverterInterface { - /** * Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. - * - Jamie Zawinski + * - Jamie Zawinski. * * * @param $value @@ -46,7 +42,7 @@ class Amount implements ConverterInterface */ public function convert($value): string { - if (is_null($value)) { + if (null === $value) { return '0'; } $value = strval($value); @@ -56,35 +52,35 @@ class Amount implements ConverterInterface $altPosition = $len - 2; $decimal = null; - if (($len > 2 && $value{$decimalPosition} === '.') || ($len > 2 && strpos($value, '.') > $decimalPosition)) { + if (($len > 2 && '.' === $value[$decimalPosition]) || ($len > 2 && strpos($value, '.') > $decimalPosition)) { $decimal = '.'; Log::debug(sprintf('Decimal character in "%s" seems to be a dot.', $value)); } - if ($len > 2 && $value{$decimalPosition} === ',') { + if ($len > 2 && ',' === $value[$decimalPosition]) { $decimal = ','; Log::debug(sprintf('Decimal character in "%s" seems to be a comma.', $value)); } // decimal character is null? find out if "0.1" or ".1" or "0,1" or ",1" - if ($len > 1 && ($value{$altPosition} === '.' || $value{$altPosition} === ',')) { - $decimal = $value{$altPosition}; + if ($len > 1 && ('.' === $value[$altPosition] || ',' === $value[$altPosition])) { + $decimal = $value[$altPosition]; Log::debug(sprintf('Alternate search resulted in "%s" for decimal sign.', $decimal)); } // if decimal is dot, replace all comma's and spaces with nothing. then parse as float (round to 4 pos) - if ($decimal === '.') { + if ('.' === $decimal) { $search = [',', ' ']; $oldValue = $value; $value = str_replace($search, '', $value); Log::debug(sprintf('Converted amount from "%s" to "%s".', $oldValue, $value)); } - if ($decimal === ',') { + if (',' === $decimal) { $search = ['.', ' ']; $oldValue = $value; $value = str_replace($search, '', $value); $value = str_replace(',', '.', $value); Log::debug(sprintf('Converted amount from "%s" to "%s".', $oldValue, $value)); } - if (is_null($decimal)) { + if (null === $decimal) { // replace all: $search = ['.', ' ', ',']; $oldValue = $value; diff --git a/app/Import/Converter/ConverterInterface.php b/app/Import/Converter/ConverterInterface.php index 4047c23924..20a4ba6411 100644 --- a/app/Import/Converter/ConverterInterface.php +++ b/app/Import/Converter/ConverterInterface.php @@ -18,21 +18,17 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Converter; /** - * Interface ConverterInterface - * - * @package FireflyIII\Import\Converter + * Interface ConverterInterface. */ interface ConverterInterface { /** * @param $value - * */ public function convert($value); } diff --git a/app/Import/Converter/INGDebetCredit.php b/app/Import/Converter/INGDebetCredit.php index 04eb26cfa3..2772100bd7 100644 --- a/app/Import/Converter/INGDebetCredit.php +++ b/app/Import/Converter/INGDebetCredit.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Converter; @@ -26,13 +25,10 @@ namespace FireflyIII\Import\Converter; use Log; /** - * Class INGDebetCredit - * - * @package FireflyIII\Import\Converter + * Class INGDebetCredit. */ class INGDebetCredit implements ConverterInterface { - /** * @param $value * @@ -42,7 +38,7 @@ class INGDebetCredit implements ConverterInterface { Log::debug('Going to convert ing debet credit', ['value' => $value]); - if ($value === 'Af') { + if ('Af' === $value) { Log::debug('Return -1'); return -1; diff --git a/app/Import/Converter/RabobankDebetCredit.php b/app/Import/Converter/RabobankDebetCredit.php index 064a740f60..81dbd57f96 100644 --- a/app/Import/Converter/RabobankDebetCredit.php +++ b/app/Import/Converter/RabobankDebetCredit.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Converter; @@ -26,13 +25,10 @@ namespace FireflyIII\Import\Converter; use Log; /** - * Class RabobankDebetCredit - * - * @package FireflyIII\Import\Converter + * Class RabobankDebetCredit. */ class RabobankDebetCredit implements ConverterInterface { - /** * @param $value * @@ -42,7 +38,7 @@ class RabobankDebetCredit implements ConverterInterface { Log::debug('Going to convert ', ['value' => $value]); - if ($value === 'D') { + if ('D' === $value) { Log::debug('Return -1'); return -1; diff --git a/app/Import/FileProcessor/CsvProcessor.php b/app/Import/FileProcessor/CsvProcessor.php index 7dd6e83da2..0b547eb026 100644 --- a/app/Import/FileProcessor/CsvProcessor.php +++ b/app/Import/FileProcessor/CsvProcessor.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\FileProcessor; @@ -37,12 +36,10 @@ use Log; * Class CsvProcessor, as the name suggests, goes over CSV file line by line and creates * "ImportJournal" objects, which are used in another step to create new journals and transactions * and what-not. - * - * @package FireflyIII\Import\FileProcessor */ class CsvProcessor implements FileProcessorInterface { - /** @var ImportJob */ + /** @var ImportJob */ private $job; /** @var Collection */ private $objects; @@ -136,6 +133,7 @@ class CsvProcessor implements FileProcessorInterface * @param string $value * * @return array + * * @throws FireflyException */ private function annotateValue(int $index, string $value) @@ -167,7 +165,7 @@ class CsvProcessor implements FileProcessorInterface $config = $this->job->configuration; $reader = Reader::createFromString($content); $delimiter = $config['delimiter']; - if ($delimiter === 'tab') { + if ('tab' === $delimiter) { $delimiter = "\t"; } $reader->setDelimiter($delimiter); @@ -213,6 +211,7 @@ class CsvProcessor implements FileProcessorInterface * @param array $array * * @return string + * * @throws FireflyException */ private function getRowHash(array $array): string @@ -220,7 +219,7 @@ class CsvProcessor implements FileProcessorInterface $json = json_encode($array); $jsonError = json_last_error(); - if ($json === false) { + if (false === $json) { throw new FireflyException(sprintf('Error while encoding JSON for CSV row: %s', $this->getJsonError($jsonError))); } $hash = hash('sha256', $json); @@ -235,6 +234,7 @@ class CsvProcessor implements FileProcessorInterface * @param array $row * * @return ImportJournal + * * @throws FireflyException */ private function importRow(int $index, array $row): ImportJournal @@ -248,7 +248,7 @@ class CsvProcessor implements FileProcessorInterface $journal->setHash($hash); /** - * @var int $rowIndex + * @var int * @var string $value */ foreach ($row as $rowIndex => $value) { @@ -280,7 +280,7 @@ class CsvProcessor implements FileProcessorInterface ->where('data', $json) ->where('name', 'importHash') ->first(); - if (!is_null($entry)) { + if (null !== $entry) { return true; } @@ -293,6 +293,7 @@ class CsvProcessor implements FileProcessorInterface * @param array $row * * @return array + * * @throws FireflyException */ private function specifics(array $row): array diff --git a/app/Import/FileProcessor/FileProcessorInterface.php b/app/Import/FileProcessor/FileProcessorInterface.php index 3664e74f3d..94fd9bd0a5 100644 --- a/app/Import/FileProcessor/FileProcessorInterface.php +++ b/app/Import/FileProcessor/FileProcessorInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\FileProcessor; @@ -27,14 +26,10 @@ use FireflyIII\Models\ImportJob; use Illuminate\Support\Collection; /** - * Interface FileProcessorInterface - * - * @package FireflyIII\Import\FileProcessor + * Interface FileProcessorInterface. */ interface FileProcessorInterface { - - /** * @return Collection */ @@ -50,5 +45,5 @@ interface FileProcessorInterface * * @return FileProcessorInterface */ - public function setJob(ImportJob $job): FileProcessorInterface; + public function setJob(ImportJob $job): self; } diff --git a/app/Import/Logging/CommandHandler.php b/app/Import/Logging/CommandHandler.php index a21095a6fa..b55c1f9dc7 100644 --- a/app/Import/Logging/CommandHandler.php +++ b/app/Import/Logging/CommandHandler.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Logging; @@ -27,14 +26,11 @@ use Illuminate\Console\Command; use Monolog\Handler\AbstractProcessingHandler; /** - * Class CommandHandler - * - * @package FireflyIII\Import\Logging + * Class CommandHandler. */ class CommandHandler extends AbstractProcessingHandler { - - /** @var Command */ + /** @var Command */ private $command; /** @@ -51,11 +47,9 @@ class CommandHandler extends AbstractProcessingHandler } /** - * Writes the record down to the log of the implementing handler + * Writes the record down to the log of the implementing handler. * - * @param array $record - * - * @return void + * @param array $record */ protected function write(array $record) { diff --git a/app/Import/Mapper/AssetAccountIbans.php b/app/Import/Mapper/AssetAccountIbans.php index b5d5699529..6a53db8941 100644 --- a/app/Import/Mapper/AssetAccountIbans.php +++ b/app/Import/Mapper/AssetAccountIbans.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -28,13 +27,10 @@ use FireflyIII\Models\AccountType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; /** - * Class AssetAccounts - * - * @package FireflyIII\Import\Mapper + * Class AssetAccounts. */ class AssetAccountIbans implements MapperInterface { - /** * @return array */ @@ -52,7 +48,7 @@ class AssetAccountIbans implements MapperInterface if (strlen($iban) > 0) { $topList[$account->id] = $account->iban . ' (' . $account->name . ')'; } - if (strlen($iban) === 0) { + if (0 === strlen($iban)) { $list[$account->id] = $account->name; } } diff --git a/app/Import/Mapper/AssetAccounts.php b/app/Import/Mapper/AssetAccounts.php index e12b33340d..43188a6833 100644 --- a/app/Import/Mapper/AssetAccounts.php +++ b/app/Import/Mapper/AssetAccounts.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -28,13 +27,10 @@ use FireflyIII\Models\AccountType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; /** - * Class AssetAccounts - * - * @package FireflyIII\Import\Mapper + * Class AssetAccounts. */ class AssetAccounts implements MapperInterface { - /** * @return array */ diff --git a/app/Import/Mapper/Bills.php b/app/Import/Mapper/Bills.php index 8770f8c988..b758b52dd1 100644 --- a/app/Import/Mapper/Bills.php +++ b/app/Import/Mapper/Bills.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -27,13 +26,10 @@ use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; /** - * Class Bills - * - * @package FireflyIII\Import\Mapper + * Class Bills. */ class Bills implements MapperInterface { - /** * @return array */ diff --git a/app/Import/Mapper/Budgets.php b/app/Import/Mapper/Budgets.php index ab1b8bc151..eb1b73c9d8 100644 --- a/app/Import/Mapper/Budgets.php +++ b/app/Import/Mapper/Budgets.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -27,13 +26,10 @@ use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; /** - * Class Budgets - * - * @package FireflyIII\Import\Mapper + * Class Budgets. */ class Budgets implements MapperInterface { - /** * @return array */ diff --git a/app/Import/Mapper/Categories.php b/app/Import/Mapper/Categories.php index 76b3b60f55..d6e0bd3d0f 100644 --- a/app/Import/Mapper/Categories.php +++ b/app/Import/Mapper/Categories.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -27,13 +26,10 @@ use FireflyIII\Models\Category; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; /** - * Class Categories - * - * @package FireflyIII\Import\Mapper + * Class Categories. */ class Categories implements MapperInterface { - /** * @return array */ diff --git a/app/Import/Mapper/MapperInterface.php b/app/Import/Mapper/MapperInterface.php index 528e6e8d3c..b0ca4803b5 100644 --- a/app/Import/Mapper/MapperInterface.php +++ b/app/Import/Mapper/MapperInterface.php @@ -18,19 +18,15 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; /** - * Interface MapperInterface - * - * @package FireflyIII\Import\Mapper + * Interface MapperInterface. */ interface MapperInterface { - /** * @return array */ diff --git a/app/Import/Mapper/OpposingAccountIbans.php b/app/Import/Mapper/OpposingAccountIbans.php index 476fd073ab..894ff7f509 100644 --- a/app/Import/Mapper/OpposingAccountIbans.php +++ b/app/Import/Mapper/OpposingAccountIbans.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -28,13 +27,10 @@ use FireflyIII\Models\AccountType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; /** - * Class OpposingAccounts - * - * @package FireflyIII\Import\Mapper + * Class OpposingAccounts. */ class OpposingAccountIbans implements MapperInterface { - /** * @return array */ @@ -58,7 +54,7 @@ class OpposingAccountIbans implements MapperInterface if (strlen($iban) > 0) { $topList[$account->id] = $account->iban . ' (' . $account->name . ')'; } - if (strlen($iban) === 0) { + if (0 === strlen($iban)) { $list[$account->id] = $account->name; } } @@ -68,7 +64,6 @@ class OpposingAccountIbans implements MapperInterface $list = $topList + $list; $list = [0 => trans('csv.map_do_not_map')] + $list; - return $list; } } diff --git a/app/Import/Mapper/OpposingAccounts.php b/app/Import/Mapper/OpposingAccounts.php index f880ff10d9..c80c1753ab 100644 --- a/app/Import/Mapper/OpposingAccounts.php +++ b/app/Import/Mapper/OpposingAccounts.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -28,13 +27,10 @@ use FireflyIII\Models\AccountType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; /** - * Class OpposingAccounts - * - * @package FireflyIII\Import\Mapper + * Class OpposingAccounts. */ class OpposingAccounts implements MapperInterface { - /** * @return array */ diff --git a/app/Import/Mapper/Tags.php b/app/Import/Mapper/Tags.php index a09a64c260..8a696ae082 100644 --- a/app/Import/Mapper/Tags.php +++ b/app/Import/Mapper/Tags.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -27,13 +26,10 @@ use FireflyIII\Models\Tag; use FireflyIII\Repositories\Tag\TagRepositoryInterface; /** - * Class Tags - * - * @package FireflyIII\Import\Mapper + * Class Tags. */ class Tags implements MapperInterface { - /** * @return array */ diff --git a/app/Import/Mapper/TransactionCurrencies.php b/app/Import/Mapper/TransactionCurrencies.php index 2ba0703bd1..0a52533aee 100644 --- a/app/Import/Mapper/TransactionCurrencies.php +++ b/app/Import/Mapper/TransactionCurrencies.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Mapper; @@ -26,13 +25,10 @@ namespace FireflyIII\Import\Mapper; use FireflyIII\Models\TransactionCurrency; /** - * Class TransactionCurrencies - * - * @package FireflyIII\Import\Mapper + * Class TransactionCurrencies. */ class TransactionCurrencies implements MapperInterface { - /** * @return array */ diff --git a/app/Import/MapperPreProcess/PreProcessorInterface.php b/app/Import/MapperPreProcess/PreProcessorInterface.php index 5c302557df..c8232d0239 100644 --- a/app/Import/MapperPreProcess/PreProcessorInterface.php +++ b/app/Import/MapperPreProcess/PreProcessorInterface.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\MapperPreProcess; /** - * Interface PreProcessorInterface - * - * @package FireflyIII\Import\MapperPreProcess + * Interface PreProcessorInterface. */ interface PreProcessorInterface { diff --git a/app/Import/MapperPreProcess/TagsComma.php b/app/Import/MapperPreProcess/TagsComma.php index 02032cadcd..a7534f0aeb 100644 --- a/app/Import/MapperPreProcess/TagsComma.php +++ b/app/Import/MapperPreProcess/TagsComma.php @@ -18,19 +18,15 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\MapperPreProcess; /** - * Class TagsComma - * - * @package FireflyIII\Import\MapperPreProcess + * Class TagsComma. */ class TagsComma implements PreProcessorInterface { - /** * @param string $value * diff --git a/app/Import/MapperPreProcess/TagsSpace.php b/app/Import/MapperPreProcess/TagsSpace.php index 2db886e10b..02f9bcebe9 100644 --- a/app/Import/MapperPreProcess/TagsSpace.php +++ b/app/Import/MapperPreProcess/TagsSpace.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\MapperPreProcess; /** - * Class TagsSpace - * - * @package FireflyIII\Import\MapperPreProcess + * Class TagsSpace. */ class TagsSpace implements PreProcessorInterface { diff --git a/app/Import/Object/ImportAccount.php b/app/Import/Object/ImportAccount.php index 7a26cf9f29..31786c2be5 100644 --- a/app/Import/Object/ImportAccount.php +++ b/app/Import/Object/ImportAccount.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Object; @@ -31,19 +30,15 @@ use Illuminate\Support\Collection; use Log; /** - * - * Class ImportAccount - * - * @package FireflyIII\Import\Object + * Class ImportAccount. */ class ImportAccount { - - /** @var Account */ + /** @var Account */ private $account; /** @var array */ private $accountIban = []; - /** @var array */ + /** @var array */ private $accountId = []; /** @var array */ private $accountName = []; @@ -61,9 +56,9 @@ class ImportAccount * @var int */ private $forbiddenAccountId = 0; - /** @var AccountRepositoryInterface */ + /** @var AccountRepositoryInterface */ private $repository; - /** @var User */ + /** @var User */ private $user; /** @@ -82,7 +77,7 @@ class ImportAccount */ public function getAccount(): Account { - if (is_null($this->account->id)) { + if (null === $this->account->id) { $this->store(); } @@ -174,14 +169,14 @@ class ImportAccount $accountType = AccountType::whereType($this->expectedType)->first(); // 1: find by ID, iban or name (and type) - if (count($this->accountId) === 3) { + if (3 === count($this->accountId)) { Log::debug(sprintf('Finding account of type %d and ID %d', $accountType->id, $this->accountId['value'])); /** @var Account $account */ $account = $this->user->accounts()->where('id', '!=', $this->forbiddenAccountId)->where('account_type_id', $accountType->id)->where( 'id', $this->accountId['value'] )->first(); - if (!is_null($account)) { + if (null !== $account) { Log::debug(sprintf('Found unmapped %s account by ID (#%d): %s', $this->expectedType, $account->id, $account->name)); return $account; @@ -191,7 +186,7 @@ class ImportAccount /** @var Collection $accounts */ $accounts = $this->repository->getAccountsByType([$accountType->type]); // Two: find by IBAN (and type): - if (count($this->accountIban) === 3) { + if (3 === count($this->accountIban)) { $iban = $this->accountIban['value']; Log::debug(sprintf('Finding account of type %d and IBAN %s', $accountType->id, $iban)); $filtered = $accounts->filter( @@ -207,14 +202,14 @@ class ImportAccount return null; } ); - if ($filtered->count() === 1) { + if (1 === $filtered->count()) { return $filtered->first(); } Log::debug('Found nothing.'); } // Three: find by name (and type): - if (count($this->accountName) === 3) { + if (3 === count($this->accountName)) { $name = $this->accountName['value']; Log::debug(sprintf('Finding account of type %d and name %s', $accountType->id, $name)); $filtered = $accounts->filter( @@ -229,7 +224,7 @@ class ImportAccount } ); - if ($filtered->count() === 1) { + if (1 === $filtered->count()) { return $filtered->first(); } Log::debug('Found nothing.'); @@ -253,7 +248,7 @@ class ImportAccount Log::debug(sprintf('Find mapped account based on field "%s" with value', $field), $array); // check if a pre-mapped object exists. $mapped = $this->getMappedObject($array); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { Log::debug(sprintf('Found account #%d!', $mapped->id)); return $mapped; @@ -272,13 +267,13 @@ class ImportAccount private function getMappedObject(array $array): Account { Log::debug('In getMappedObject() for Account'); - if (count($array) === 0) { + if (0 === count($array)) { Log::debug('Array is empty, nothing will come of this.'); return new Account; } - if (array_key_exists('mapped', $array) && is_null($array['mapped'])) { + if (array_key_exists('mapped', $array) && null === $array['mapped']) { Log::debug(sprintf('No map present for value "%s". Return NULL.', $array['value'])); return new Account; @@ -289,7 +284,7 @@ class ImportAccount $search = intval($array['mapped']); $account = $this->repository->find($search); - if (is_null($account->id)) { + if (null === $account->id) { Log::error(sprintf('There is no account with id #%d. Invalid mapping will be ignored!', $search)); return new Account; @@ -297,7 +292,7 @@ class ImportAccount // must be of the same type // except when mapped is an asset, then it's fair game. // which only shows that user must map very carefully. - if ($account->accountType->type !== $this->expectedType && $account->accountType->type !== AccountType::ASSET) { + if ($account->accountType->type !== $this->expectedType && AccountType::ASSET !== $account->accountType->type) { Log::error( sprintf( 'Mapped account #%d is of type "%s" but we expect a "%s"-account. Mapping will be ignored.', @@ -322,14 +317,14 @@ class ImportAccount { // 1: find mapped object: $mapped = $this->findMappedObject(); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { $this->account = $mapped; return true; } // 2: find existing by given values: $found = $this->findExistingObject(); - if (!is_null($found->id)) { + if (null !== $found->id) { $this->account = $found; return true; @@ -340,7 +335,7 @@ class ImportAccount $oldExpectedType = $this->expectedType; $this->expectedType = AccountType::ASSET; $found = $this->findExistingObject(); - if (!is_null($found->id)) { + if (null !== $found->id) { Log::debug('Found asset account!'); $this->account = $found; @@ -349,7 +344,7 @@ class ImportAccount $this->expectedType = $oldExpectedType; // 4: if search for an asset account, fall back to given "default account" (mandatory) - if ($this->expectedType === AccountType::ASSET) { + if (AccountType::ASSET === $this->expectedType) { $this->account = $this->repository->find($this->defaultAccountId); Log::debug(sprintf('Fall back to default account #%d "%s"', $this->account->id, $this->account->name)); diff --git a/app/Import/Object/ImportBill.php b/app/Import/Object/ImportBill.php index 5a17423b6c..94cacfd7cf 100644 --- a/app/Import/Object/ImportBill.php +++ b/app/Import/Object/ImportBill.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Object; @@ -31,13 +30,10 @@ use Log; use Steam; /** - * Class ImportBill - * - * @package FireflyIII\Import\Object + * Class ImportBill. */ class ImportBill { - /** @var string */ private $amount = '1'; /** @var Bill */ @@ -48,7 +44,7 @@ class ImportBill private $name = []; /** @var BillRepositoryInterface */ private $repository; - /** @var User */ + /** @var User */ private $user; /** @@ -66,7 +62,7 @@ class ImportBill */ public function getBill(): Bill { - if (is_null($this->bill->id)) { + if (null === $this->bill->id) { $this->store(); } @@ -114,11 +110,11 @@ class ImportBill Log::debug('In findExistingObject() for Bill'); // 1: find by ID, or name - if (count($this->id) === 3) { + if (3 === count($this->id)) { Log::debug(sprintf('Finding bill with ID #%d', $this->id['value'])); /** @var Bill $bill */ $bill = $this->repository->find(intval($this->id['value'])); - if (!is_null($bill->id)) { + if (null !== $bill->id) { Log::debug(sprintf('Found unmapped bill by ID (#%d): %s', $bill->id, $bill->name)); return $bill; @@ -126,7 +122,7 @@ class ImportBill Log::debug('Found nothing.'); } // 2: find by name - if (count($this->name) === 3) { + if (3 === count($this->name)) { /** @var Collection $bills */ $bills = $this->repository->getBills(); $name = $this->name['value']; @@ -143,7 +139,7 @@ class ImportBill } ); - if ($filtered->count() === 1) { + if (1 === $filtered->count()) { return $filtered->first(); } Log::debug('Found nothing.'); @@ -167,7 +163,7 @@ class ImportBill Log::debug(sprintf('Find mapped bill based on field "%s" with value', $field), $array); // check if a pre-mapped object exists. $mapped = $this->getMappedObject($array); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { Log::debug(sprintf('Found bill #%d!', $mapped->id)); return $mapped; @@ -186,13 +182,13 @@ class ImportBill private function getMappedObject(array $array): Bill { Log::debug('In getMappedObject() for Bill'); - if (count($array) === 0) { + if (0 === count($array)) { Log::debug('Array is empty, nothing will come of this.'); return new Bill; } - if (array_key_exists('mapped', $array) && is_null($array['mapped'])) { + if (array_key_exists('mapped', $array) && null === $array['mapped']) { Log::debug(sprintf('No map present for value "%s". Return NULL.', $array['value'])); return new Bill; @@ -203,13 +199,12 @@ class ImportBill $search = intval($array['mapped']); $bill = $this->repository->find($search); - if (is_null($bill->id)) { + if (null === $bill->id) { Log::error(sprintf('There is no bill with id #%d. Invalid mapping will be ignored!', $search)); return new Bill; } - Log::debug(sprintf('Found bill! #%d ("%s"). Return it', $bill->id, $bill->name)); return $bill; @@ -222,21 +217,21 @@ class ImportBill { // 1: find mapped object: $mapped = $this->findMappedObject(); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { $this->bill = $mapped; return true; } // 2: find existing by given values: $found = $this->findExistingObject(); - if (!is_null($found->id)) { + if (null !== $found->id) { $this->bill = $found; return true; } $name = $this->name['value'] ?? ''; - if (strlen($name) === 0) { + if (0 === strlen($name)) { return true; } @@ -255,7 +250,6 @@ class ImportBill Log::debug('Found no bill so must create one ourselves. Assume default values.', $data); - $this->bill = $this->repository->store($data); Log::debug(sprintf('Successfully stored new bill #%d: %s', $this->bill->id, $this->bill->name)); diff --git a/app/Import/Object/ImportBudget.php b/app/Import/Object/ImportBudget.php index 456eb466ce..e8d2a5acf9 100644 --- a/app/Import/Object/ImportBudget.php +++ b/app/Import/Object/ImportBudget.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Object; @@ -30,13 +29,10 @@ use Illuminate\Support\Collection; use Log; /** - * Class ImportBudget - * - * @package FireflyIII\Import\Object + * Class ImportBudget. */ class ImportBudget { - /** @var Budget */ private $budget; /** @var array */ @@ -45,7 +41,7 @@ class ImportBudget private $name = []; /** @var BudgetRepositoryInterface */ private $repository; - /** @var User */ + /** @var User */ private $user; /** @@ -63,7 +59,7 @@ class ImportBudget */ public function getBudget(): Budget { - if (is_null($this->budget->id)) { + if (null === $this->budget->id) { $this->store(); } @@ -103,11 +99,11 @@ class ImportBudget Log::debug('In findExistingObject() for Budget'); // 1: find by ID, or name - if (count($this->id) === 3) { + if (3 === count($this->id)) { Log::debug(sprintf('Finding budget with ID #%d', $this->id['value'])); /** @var Budget $budget */ $budget = $this->repository->find(intval($this->id['value'])); - if (!is_null($budget->id)) { + if (null !== $budget->id) { Log::debug(sprintf('Found unmapped budget by ID (#%d): %s', $budget->id, $budget->name)); return $budget; @@ -115,7 +111,7 @@ class ImportBudget Log::debug('Found nothing.'); } // 2: find by name - if (count($this->name) === 3) { + if (3 === count($this->name)) { /** @var Collection $budgets */ $budgets = $this->repository->getBudgets(); $name = $this->name['value']; @@ -132,7 +128,7 @@ class ImportBudget } ); - if ($filtered->count() === 1) { + if (1 === $filtered->count()) { return $filtered->first(); } Log::debug('Found nothing.'); @@ -156,7 +152,7 @@ class ImportBudget Log::debug(sprintf('Find mapped budget based on field "%s" with value', $field), $array); // check if a pre-mapped object exists. $mapped = $this->getMappedObject($array); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { Log::debug(sprintf('Found budget #%d!', $mapped->id)); return $mapped; @@ -175,13 +171,13 @@ class ImportBudget private function getMappedObject(array $array): Budget { Log::debug('In getMappedObject() for Budget'); - if (count($array) === 0) { + if (0 === count($array)) { Log::debug('Array is empty, nothing will come of this.'); return new Budget; } - if (array_key_exists('mapped', $array) && is_null($array['mapped'])) { + if (array_key_exists('mapped', $array) && null === $array['mapped']) { Log::debug(sprintf('No map present for value "%s". Return NULL.', $array['value'])); return new Budget; @@ -192,7 +188,7 @@ class ImportBudget $search = intval($array['mapped']); $budget = $this->repository->find($search); - if (is_null($budget->id)) { + if (null === $budget->id) { Log::error(sprintf('There is no budget with id #%d. Invalid mapping will be ignored!', $search)); return new Budget; @@ -210,21 +206,21 @@ class ImportBudget { // 1: find mapped object: $mapped = $this->findMappedObject(); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { $this->budget = $mapped; return true; } // 2: find existing by given values: $found = $this->findExistingObject(); - if (!is_null($found->id)) { + if (null !== $found->id) { $this->budget = $found; return true; } $name = $this->name['value'] ?? ''; - if (strlen($name) === 0) { + if (0 === strlen($name)) { return true; } diff --git a/app/Import/Object/ImportCategory.php b/app/Import/Object/ImportCategory.php index e49c38acc4..fca23422ab 100644 --- a/app/Import/Object/ImportCategory.php +++ b/app/Import/Object/ImportCategory.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Object; @@ -39,7 +38,7 @@ class ImportCategory private $name = []; /** @var CategoryRepositoryInterface */ private $repository; - /** @var User */ + /** @var User */ private $user; /** @@ -57,7 +56,7 @@ class ImportCategory */ public function getCategory(): Category { - if (is_null($this->category->id)) { + if (null === $this->category->id) { $this->store(); } @@ -97,11 +96,11 @@ class ImportCategory Log::debug('In findExistingObject() for Category'); // 1: find by ID, or name - if (count($this->id) === 3) { + if (3 === count($this->id)) { Log::debug(sprintf('Finding category with ID #%d', $this->id['value'])); /** @var Category $category */ $category = $this->repository->find(intval($this->id['value'])); - if (!is_null($category->id)) { + if (null !== $category->id) { Log::debug(sprintf('Found unmapped category by ID (#%d): %s', $category->id, $category->name)); return $category; @@ -109,7 +108,7 @@ class ImportCategory Log::debug('Found nothing.'); } // 2: find by name - if (count($this->name) === 3) { + if (3 === count($this->name)) { /** @var Collection $categories */ $categories = $this->repository->getCategories(); $name = $this->name['value']; @@ -126,7 +125,7 @@ class ImportCategory } ); - if ($filtered->count() === 1) { + if (1 === $filtered->count()) { return $filtered->first(); } Log::debug('Found nothing.'); @@ -150,7 +149,7 @@ class ImportCategory Log::debug(sprintf('Find mapped category based on field "%s" with value', $field), $array); // check if a pre-mapped object exists. $mapped = $this->getMappedObject($array); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { Log::debug(sprintf('Found category #%d!', $mapped->id)); return $mapped; @@ -169,13 +168,13 @@ class ImportCategory private function getMappedObject(array $array): Category { Log::debug('In getMappedObject() for Category'); - if (count($array) === 0) { + if (0 === count($array)) { Log::debug('Array is empty, nothing will come of this.'); return new Category; } - if (array_key_exists('mapped', $array) && is_null($array['mapped'])) { + if (array_key_exists('mapped', $array) && null === $array['mapped']) { Log::debug(sprintf('No map present for value "%s". Return NULL.', $array['value'])); return new Category; @@ -186,7 +185,7 @@ class ImportCategory $search = intval($array['mapped']); $category = $this->repository->find($search); - if (is_null($category->id)) { + if (null === $category->id) { Log::error(sprintf('There is no category with id #%d. Invalid mapping will be ignored!', $search)); return new Category; @@ -204,21 +203,21 @@ class ImportCategory { // 1: find mapped object: $mapped = $this->findMappedObject(); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { $this->category = $mapped; return true; } // 2: find existing by given values: $found = $this->findExistingObject(); - if (!is_null($found->id)) { + if (null !== $found->id) { $this->category = $found; return true; } $name = $this->name['value'] ?? ''; - if (strlen($name) === 0) { + if (0 === strlen($name)) { return true; } diff --git a/app/Import/Object/ImportCurrency.php b/app/Import/Object/ImportCurrency.php index e826d65b8d..d995d7a2bb 100644 --- a/app/Import/Object/ImportCurrency.php +++ b/app/Import/Object/ImportCurrency.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Object; @@ -32,17 +31,17 @@ class ImportCurrency { /** @var array */ private $code = []; - /** @var TransactionCurrency */ + /** @var TransactionCurrency */ private $currency; /** @var array */ private $id = []; /** @var array */ private $name = []; - /** @var CurrencyRepositoryInterface */ + /** @var CurrencyRepositoryInterface */ private $repository; /** @var array */ private $symbol = []; - /** @var User */ + /** @var User */ private $user; /** @@ -59,14 +58,14 @@ class ImportCurrency */ public function getTransactionCurrency(): TransactionCurrency { - if (!is_null($this->currency->id)) { + if (null !== $this->currency->id) { return $this->currency; } Log::debug('In createCurrency()'); // check if any of them is mapped: $mapped = $this->findMappedObject(); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { Log::debug('Mapped existing currency.', ['new' => $mapped->toArray()]); $this->currency = $mapped; @@ -74,7 +73,7 @@ class ImportCurrency } $searched = $this->findExistingObject(); - if (!is_null($searched->id)) { + if (null !== $searched->id) { Log::debug('Found existing currency.', ['found' => $searched->toArray()]); $this->currency = $searched; @@ -86,7 +85,7 @@ class ImportCurrency 'name' => $this->name['value'] ?? null, 'decimal_places' => 2, ]; - if (is_null($data['code'])) { + if (null === $data['code']) { Log::debug('Need at least a code to create currency, return nothing.'); return new TransactionCurrency(); @@ -97,7 +96,6 @@ class ImportCurrency $this->currency = $currency; Log::info('Made new currency.', ['input' => $data, 'new' => $currency->toArray()]); - return $currency; } @@ -156,11 +154,11 @@ class ImportCurrency ]; foreach ($search as $field => $function) { $value = $this->$field['value'] ?? null; - if (!is_null($value)) { + if (null !== $value) { Log::debug(sprintf('Searching for %s using function %s and value %s', $field, $function, $value)); $currency = $this->repository->$function($value); - if (!is_null($currency->id)) { + if (null !== $currency->id) { return $currency; } } @@ -181,7 +179,7 @@ class ImportCurrency Log::debug(sprintf('Find mapped currency based on field "%s" with value', $field), $array); // check if a pre-mapped object exists. $mapped = $this->getMappedObject($array); - if (!is_null($mapped->id)) { + if (null !== $mapped->id) { Log::debug(sprintf('Found currency #%d!', $mapped->id)); return $mapped; @@ -200,13 +198,13 @@ class ImportCurrency private function getMappedObject(array $array): TransactionCurrency { Log::debug('In getMappedObject()'); - if (count($array) === 0) { + if (0 === count($array)) { Log::debug('Array is empty, nothing will come of this.'); return new TransactionCurrency; } - if (array_key_exists('mapped', $array) && is_null($array['mapped'])) { + if (array_key_exists('mapped', $array) && null === $array['mapped']) { Log::debug(sprintf('No map present for value "%s". Return NULL.', $array['value'])); return new TransactionCurrency; @@ -217,8 +215,7 @@ class ImportCurrency $search = intval($array['mapped']); $currency = $this->repository->find($search); - - if (is_null($currency->id)) { + if (null === $currency->id) { Log::error(sprintf('There is no currency with id #%d. Invalid mapping will be ignored!', $search)); return new TransactionCurrency; diff --git a/app/Import/Object/ImportJournal.php b/app/Import/Object/ImportJournal.php index 2d51098c4f..b78fe908e8 100644 --- a/app/Import/Object/ImportJournal.php +++ b/app/Import/Object/ImportJournal.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Object; @@ -34,25 +33,23 @@ use Log; use Steam; /** - * Class ImportJournal - * - * @package FireflyIII\Import\Object + * Class ImportJournal. */ class ImportJournal { /** @var ImportAccount */ public $asset; - /** @var ImportBill */ + /** @var ImportBill */ public $bill; /** @var ImportBudget */ public $budget; /** @var ImportCategory */ public $category; - /** @var ImportCurrency */ + /** @var ImportCurrency */ public $currency; - /** @var string */ + /** @var string */ public $description = ''; - /** @var string */ + /** @var string */ public $hash; /** @var array */ public $metaDates = []; @@ -64,7 +61,7 @@ class ImportJournal public $tags = []; /** @var string */ private $amount; - /** @var string */ + /** @var string */ private $convertedAmount = null; /** @var string */ private $date = ''; @@ -72,7 +69,7 @@ class ImportJournal private $externalId = ''; /** @var array */ private $modifiers = []; - /** @var User */ + /** @var User */ private $user; /** @@ -98,12 +95,13 @@ class ImportJournal /** * @return string + * * @throws FireflyException */ public function getAmount(): string { Log::debug('Now in getAmount()'); - if (is_null($this->convertedAmount)) { + if (null === $this->convertedAmount) { Log::debug('convertedAmount is NULL'); /** @var ConverterInterface $amountConverter */ $amountConverter = app(Amount::class); @@ -124,7 +122,7 @@ class ImportJournal Log::debug(sprintf('After modifiers the result is: "%s"', $this->convertedAmount)); } Log::debug(sprintf('convertedAmount is: "%s"', $this->convertedAmount)); - if (bccomp($this->convertedAmount, '0') === 0) { + if (0 === bccomp($this->convertedAmount, '0')) { throw new FireflyException('Amount is zero.'); } @@ -154,7 +152,7 @@ class ImportJournal */ public function getDescription(): string { - if ($this->description === '') { + if ('' === $this->description) { return '(no description)'; } diff --git a/app/Import/Routine/ImportRoutine.php b/app/Import/Routine/ImportRoutine.php index 9fe520e137..74dc52150c 100644 --- a/app/Import/Routine/ImportRoutine.php +++ b/app/Import/Routine/ImportRoutine.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Routine; @@ -35,19 +34,17 @@ use Log; class ImportRoutine { - - /** @var Collection */ + /** @var Collection */ public $errors; - /** @var Collection */ + /** @var Collection */ public $journals; /** @var int */ public $lines = 0; - /** @var ImportJob */ + /** @var ImportJob */ private $job; /** * ImportRoutine constructor. - * */ public function __construct() { @@ -60,7 +57,7 @@ class ImportRoutine */ public function run(): bool { - if ($this->job->status !== 'configured') { + if ('configured' !== $this->job->status) { Log::error(sprintf('Job %s is in state "%s" so it cannot be started.', $this->job->key, $this->job->status)); return false; @@ -93,7 +90,6 @@ class ImportRoutine Log::info(sprintf('Done with import job %s', $this->job->key)); - return true; } @@ -117,8 +113,7 @@ class ImportRoutine $processor = app($class); $processor->setJob($this->job); - if ($this->job->status === 'configured') { - + if ('configured' === $this->job->status) { // set job as "running"... $this->job->status = 'running'; $this->job->save(); diff --git a/app/Import/Specifics/AbnAmroDescription.php b/app/Import/Specifics/AbnAmroDescription.php index 6a754c50cc..cd884c7c29 100644 --- a/app/Import/Specifics/AbnAmroDescription.php +++ b/app/Import/Specifics/AbnAmroDescription.php @@ -18,24 +18,21 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Specifics; /** - * Class AbnAmroDescription + * Class AbnAmroDescription. * * Parses the description from txt files for ABN AMRO bank accounts. * * Based on the logic as described in the following Gist: * https://gist.github.com/vDorst/68d555a6a90f62fec004 - * - * @package FireflyIII\Import\Specifics */ class AbnAmroDescription implements SpecificInterface { - /** @var array */ + /** @var array */ public $row; /** @@ -70,7 +67,6 @@ class AbnAmroDescription implements SpecificInterface // Try to parse the description in known formats. $parsed = $this->parseSepaDescription() || $this->parseTRTPDescription() || $this->parseGEABEADescription() || $this->parseABNAMRODescription(); - // If the description could not be parsed, specify an unknown opposing // account, as an opposing account is required if (!$parsed) { @@ -81,7 +77,7 @@ class AbnAmroDescription implements SpecificInterface } /** - * Parses the current description with costs from ABN AMRO itself + * Parses the current description with costs from ABN AMRO itself. * * @return bool true if the description is GEA/BEA-format, false otherwise */ @@ -99,7 +95,7 @@ class AbnAmroDescription implements SpecificInterface } /** - * Parses the current description in GEA/BEA format + * Parses the current description in GEA/BEA format. * * @return bool true if the description is GEA/BEAformat, false otherwise */ @@ -107,12 +103,11 @@ class AbnAmroDescription implements SpecificInterface { // See if the current description is formatted in GEA/BEA format if (preg_match('/([BG]EA) +(NR:[a-zA-Z:0-9]+) +([0-9.\/]+) +([^,]*)/', $this->row[7], $matches)) { - // description and opposing account will be the same. $this->row[8] = $matches[4]; // 'opposing-account-name' $this->row[7] = $matches[4]; // 'description' - if ($matches[1] === 'GEA') { + if ('GEA' === $matches[1]) { $this->row[7] = 'GEA ' . $matches[4]; // 'description' } @@ -123,7 +118,8 @@ class AbnAmroDescription implements SpecificInterface } /** - * Parses the current description in SEPA format + * Parses the current description in SEPA format. + * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * * @return bool true if the description is SEPA format, false otherwise @@ -167,7 +163,7 @@ class AbnAmroDescription implements SpecificInterface // Set a new description for the current transaction. If none was given // set the description to type, name and reference $this->row[7] = $newDescription; - if (strlen($newDescription) === 0) { + if (0 === strlen($newDescription)) { $this->row[7] = sprintf('%s - %s (%s)', $type, $name, $reference); } @@ -178,7 +174,7 @@ class AbnAmroDescription implements SpecificInterface } /** - * Parses the current description in TRTP format + * Parses the current description in TRTP format. * * @return bool true if the description is TRTP format, false otherwise */ @@ -222,7 +218,7 @@ class AbnAmroDescription implements SpecificInterface // Set a new description for the current transaction. If none was given // set the description to type, name and reference $this->row[7] = $newDescription; - if (strlen($newDescription) === 0) { + if (0 === strlen($newDescription)) { $this->row[7] = sprintf('%s - %s (%s)', $type, $name, $reference); } } diff --git a/app/Import/Specifics/IngDescription.php b/app/Import/Specifics/IngDescription.php index 781f7e3395..010b93801d 100644 --- a/app/Import/Specifics/IngDescription.php +++ b/app/Import/Specifics/IngDescription.php @@ -1,7 +1,7 @@ . */ - declare(strict_types=1); namespace FireflyIII\Import\Specifics; /** - * Class IngDescription + * Class IngDescription. * * Parses the description from CSV files for Ing bank accounts. * @@ -32,12 +31,10 @@ namespace FireflyIII\Import\Specifics; * 'Incasso' the Name of Opposing account the Opposing IBAN number are in the * Description. This class will remove them, and add Name in description by * 'Betaalautomaat' so those are easily recognizable - * - * @package FireflyIII\Import\Specifics */ class IngDescription implements SpecificInterface { - /** @var array */ + /** @var array */ public $row; /** @@ -84,7 +81,7 @@ class IngDescription implements SpecificInterface /** * Add the Opposing name from cell 1 in the description for Betaalautomaten - * Otherwise the description is only: 'Pasvolgnr: Transactie: Term:' + * Otherwise the description is only: 'Pasvolgnr: Transactie: Term:'. * * @return bool true */ @@ -97,7 +94,7 @@ class IngDescription implements SpecificInterface /** * Remove IBAN number out of the description - * Default description of Description is: Naam: Omschrijving: IBAN: + * Default description of Description is: Naam: Omschrijving: IBAN: . * * @return bool true */ @@ -110,7 +107,7 @@ class IngDescription implements SpecificInterface } /** - * Remove name from the description (Remove everything before the description incl the word 'Omschrijving' ) + * Remove name from the description (Remove everything before the description incl the word 'Omschrijving' ). * * @return bool true */ diff --git a/app/Import/Specifics/PresidentsChoice.php b/app/Import/Specifics/PresidentsChoice.php index 7a0331a475..1c0d5ca1ba 100644 --- a/app/Import/Specifics/PresidentsChoice.php +++ b/app/Import/Specifics/PresidentsChoice.php @@ -18,19 +18,15 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Specifics; /** - * Class PresidentsChoice - * - * @package FireflyIII\Import\Specifics + * Class PresidentsChoice. */ class PresidentsChoice implements SpecificInterface { - /** * @return string */ @@ -56,7 +52,7 @@ class PresidentsChoice implements SpecificInterface { // first, if column 2 is empty and 3 is not, do nothing. // if column 3 is empty and column 2 is not, move amount to column 3, *-1 - if (isset($row[3]) && strlen($row[3]) === 0) { + if (isset($row[3]) && 0 === strlen($row[3])) { $row[3] = bcmul($row[2], '-1'); } if (isset($row[1])) { diff --git a/app/Import/Specifics/RabobankDescription.php b/app/Import/Specifics/RabobankDescription.php index cebaa8aaec..94a9e1f559 100644 --- a/app/Import/Specifics/RabobankDescription.php +++ b/app/Import/Specifics/RabobankDescription.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Specifics; @@ -26,9 +25,7 @@ namespace FireflyIII\Import\Specifics; use Log; /** - * Class RabobankDescription - * - * @package FireflyIII\Import\Specifics + * Class RabobankDescription. */ class RabobankDescription implements SpecificInterface { diff --git a/app/Import/Specifics/SnsDescription.php b/app/Import/Specifics/SnsDescription.php index d36aefa82e..3f52171846 100644 --- a/app/Import/Specifics/SnsDescription.php +++ b/app/Import/Specifics/SnsDescription.php @@ -21,22 +21,19 @@ /** * snsDescription.php - * Author 2017 hugovanduijn@gmail.com + * Author 2017 hugovanduijn@gmail.com. * * This software may be modified and distributed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International License. * * See the LICENSE file for details. */ - declare(strict_types=1); namespace FireflyIII\Import\Specifics; /** - * Class SnsDescription - * - * @package FireflyIII\Import\Specifics + * Class SnsDescription. */ class SnsDescription implements SpecificInterface { diff --git a/app/Import/Specifics/SpecificInterface.php b/app/Import/Specifics/SpecificInterface.php index c6c1f0a444..837966be3e 100644 --- a/app/Import/Specifics/SpecificInterface.php +++ b/app/Import/Specifics/SpecificInterface.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Specifics; /** - * Interface SpecificInterface - * - * @package FireflyIII\Import\Specifics + * Interface SpecificInterface. */ interface SpecificInterface { diff --git a/app/Import/Storage/ImportStorage.php b/app/Import/Storage/ImportStorage.php index 02e3ab90cc..47ba783826 100644 --- a/app/Import/Storage/ImportStorage.php +++ b/app/Import/Storage/ImportStorage.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Storage; @@ -35,21 +34,19 @@ use Log; /** * Is capable of storing individual ImportJournal objects. - * Class ImportStorage - * - * @package FireflyIII\Import\Storage + * Class ImportStorage. */ class ImportStorage { use ImportSupport; - /** @var Collection */ + /** @var Collection */ public $errors; /** @var Collection */ public $journals; - /** @var int */ + /** @var int */ protected $defaultCurrencyId = 1; // yes, hard coded - /** @var ImportJob */ + /** @var ImportJob */ protected $job; /** @var Collection */ protected $rules; @@ -57,7 +54,7 @@ class ImportStorage private $dateFormat = 'Ymd'; /** @var Collection */ private $objects; - /** @var array */ + /** @var array */ private $transfers = []; /** @@ -125,6 +122,7 @@ class ImportStorage * @param ImportJournal $importJournal * * @return bool + * * @throws FireflyException */ protected function storeImportJournal(int $index, ImportJournal $importJournal): bool @@ -139,7 +137,7 @@ class ImportStorage $transactionType = $this->getTransactionType($amount, $opposingAccount); $description = $importJournal->getDescription(); - /*** First step done! */ + // First step done! $this->job->addStepsDone(1); /** @@ -173,12 +171,11 @@ class ImportStorage 'date' => $date, 'hash' => $importJournal->hash, 'amount' => $amount, - ]; $journal = $this->storeJournal($parameters); unset($parameters); - /*** Another step done! */ + // Another step done! $this->job->addStepsDone(1); // store meta object things: @@ -202,12 +199,12 @@ class ImportStorage $journal->completed = true; $journal->save(); - /*** Another step done! */ + // Another step done! $this->job->addStepsDone(1); // run rules: $this->applyRules($journal); - /*** Another step done! */ + // Another step done! $this->job->addStepsDone(1); $this->journals->push($journal); @@ -224,7 +221,7 @@ class ImportStorage private function isDoubleTransfer(array $parameters): bool { Log::debug('Check if is a double transfer.'); - if ($parameters['type'] !== TransactionType::TRANSFER) { + if (TransactionType::TRANSFER !== $parameters['type']) { Log::debug(sprintf('Is a %s, not a transfer so no.', $parameters['type'])); return false; @@ -239,23 +236,23 @@ class ImportStorage foreach ($this->transfers as $transfer) { $hits = 0; if ($parameters['description'] === $transfer['description']) { - $hits++; + ++$hits; Log::debug(sprintf('Description "%s" equals "%s", hits = %d', $parameters['description'], $transfer['description'], $hits)); } if ($names === $transfer['names']) { - $hits++; + ++$hits; Log::debug(sprintf('Involved accounts, "%s" equals "%s", hits = %d', join(',', $names), join(',', $transfer['names']), $hits)); } - if (bccomp($amount, $transfer['amount']) === 0) { - $hits++; + if (0 === bccomp($amount, $transfer['amount'])) { + ++$hits; Log::debug(sprintf('Amount %s equals %s, hits = %d', $amount, $transfer['amount'], $hits)); } if ($parameters['date'] === $transfer['date']) { - $hits++; + ++$hits; Log::debug(sprintf('Date %s equals %s, hits = %d', $parameters['date'], $transfer['date'], $hits)); } // number of hits is 4? Then it's a match - if ($hits === 4) { + if (4 === $hits) { Log::error( 'There already is a transfer imported with these properties. Compare existing with new. ', ['existing' => $transfer, 'new' => $parameters] @@ -265,7 +262,6 @@ class ImportStorage } } - return false; } } diff --git a/app/Import/Storage/ImportSupport.php b/app/Import/Storage/ImportSupport.php index b594d27ee8..248fd2074f 100644 --- a/app/Import/Storage/ImportSupport.php +++ b/app/Import/Storage/ImportSupport.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Import\Storage; @@ -46,17 +45,15 @@ use Illuminate\Support\Collection; use Log; /** - * Trait ImportSupport - * - * @package FireflyIII\Import\Storage + * Trait ImportSupport. */ trait ImportSupport { /** @var int */ protected $defaultCurrencyId = 1; - /** @var ImportJob */ + /** @var ImportJob */ protected $job; - /** @var Collection */ + /** @var Collection */ protected $rules; /** @@ -88,6 +85,7 @@ trait ImportSupport * @param array $parameters * * @return bool + * * @throws FireflyException */ private function createTransaction(array $parameters): bool @@ -100,7 +98,7 @@ trait ImportSupport $transaction->foreign_currency_id = $parameters['foreign_currency']; $transaction->foreign_amount = $parameters['foreign_amount']; $transaction->save(); - if (is_null($transaction->id)) { + if (null === $transaction->id) { $errorText = join(', ', $transaction->getErrors()->all()); throw new FireflyException($errorText); } @@ -129,7 +127,7 @@ trait ImportSupport // use given currency $currency = $importJournal->currency->getTransactionCurrency(); - if (!is_null($currency->id)) { + if (null !== $currency->id) { return $currency->id; } @@ -154,7 +152,7 @@ trait ImportSupport { // use given currency by import journal. $currency = $importJournal->currency->getTransactionCurrency(); - if (!is_null($currency->id) && $currency->id !== $currencyId) { + if (null !== $currency->id && $currency->id !== $currencyId) { return $currency->id; } @@ -226,7 +224,9 @@ trait ImportSupport * @param Account $account * * @return string + * * @throws FireflyException + * * @see ImportSupport::getOpposingAccount() */ private function getTransactionType(string $amount, Account $account): string @@ -237,18 +237,18 @@ trait ImportSupport $transactionType = TransactionType::WITHDRAWAL; } - if (bccomp($amount, '0') === 1) { + if (1 === bccomp($amount, '0')) { $transactionType = TransactionType::DEPOSIT; } // if opposing is an asset account, it's a transfer: - if ($account->accountType->type === AccountType::ASSET) { + if (AccountType::ASSET === $account->accountType->type) { Log::debug(sprintf('Opposing account #%d %s is an asset account, make transfer.', $account->id, $account->name)); $transactionType = TransactionType::TRANSFER; } // verify that opposing account is of the correct type: - if ($account->accountType->type === AccountType::EXPENSE && $transactionType !== TransactionType::WITHDRAWAL) { + if (AccountType::EXPENSE === $account->accountType->type && TransactionType::WITHDRAWAL !== $transactionType) { $message = 'This row is imported as a withdrawal but opposing is an expense account. This cannot be!'; Log::error($message); throw new FireflyException($message); @@ -289,8 +289,8 @@ trait ImportSupport ->where('transaction_types.type', TransactionType::TRANSFER) ->get( ['transaction_journals.id', 'transaction_journals.encrypted', 'transaction_journals.description', - 'source_accounts.name as source_name', 'destination_accounts.name as destination_name', 'destination.amount' - , 'transaction_journals.date'] + 'source_accounts.name as source_name', 'destination_accounts.name as destination_name', 'destination.amount', + 'transaction_journals.date',] ); $array = []; /** @var TransactionJournal $entry */ @@ -323,7 +323,7 @@ trait ImportSupport ->where('data', $json) ->where('name', 'importHash') ->first(); - if (!is_null($entry)) { + if (null !== $entry) { Log::error(sprintf('A journal with hash %s has already been imported (spoiler: it\'s journal #%d)', $hash, $entry->transaction_journal_id)); return true; @@ -338,7 +338,7 @@ trait ImportSupport */ private function storeBill(TransactionJournal $journal, Bill $bill) { - if (!is_null($bill->id)) { + if (null !== $bill->id) { Log::debug(sprintf('Linked bill #%d to journal #%d', $bill->id, $journal->id)); $journal->bill()->associate($bill); $journal->save(); @@ -351,7 +351,7 @@ trait ImportSupport */ private function storeBudget(TransactionJournal $journal, Budget $budget) { - if (!is_null($budget->id)) { + if (null !== $budget->id) { Log::debug(sprintf('Linked budget #%d to journal #%d', $budget->id, $journal->id)); $journal->budgets()->save($budget); } @@ -363,7 +363,7 @@ trait ImportSupport */ private function storeCategory(TransactionJournal $journal, Category $category) { - if (!is_null($category->id)) { + if (null !== $category->id) { Log::debug(sprintf('Linked category #%d to journal #%d', $category->id, $journal->id)); $journal->categories()->save($category); } @@ -403,7 +403,7 @@ trait ImportSupport 'currency' => $parameters['currency'], 'amount' => $parameters['amount'], 'foreign_currency' => $parameters['foreign_currency'], - 'foreign_amount' => is_null($parameters['foreign_currency']) ? null : $parameters['amount'], + 'foreign_amount' => null === $parameters['foreign_currency'] ? null : $parameters['amount'], ]; $opposite = app('steam')->opposite($parameters['amount']); $two = [ @@ -412,7 +412,7 @@ trait ImportSupport 'currency' => $parameters['currency'], 'amount' => $opposite, 'foreign_currency' => $parameters['foreign_currency'], - 'foreign_amount' => is_null($parameters['foreign_currency']) ? null : $opposite, + 'foreign_amount' => null === $parameters['foreign_currency'] ? null : $opposite, ]; $this->createTransaction($one); $this->createTransaction($two); @@ -449,10 +449,10 @@ trait ImportSupport foreach ($tags as $tag) { $dbTag = $repository->findByTag($tag); - if (is_null($dbTag->id)) { + if (null === $dbTag->id) { $dbTag = $repository->store( ['tag' => $tag, 'date' => null, 'description' => null, 'latitude' => null, 'longitude' => null, - 'zoomLevel' => null, 'tagMode' => 'nothing'] + 'zoomLevel' => null, 'tagMode' => 'nothing',] ); } $journal->tags()->save($dbTag); diff --git a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php index 629a03992c..77aa4174f4 100644 --- a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php +++ b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Jobs; @@ -34,9 +33,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Collection; /** - * Class ExecuteRuleGroupOnExistingTransactions - * - * @package FireflyIII\Jobs + * Class ExecuteRuleGroupOnExistingTransactions. */ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue { @@ -44,13 +41,13 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** @var Collection */ private $accounts; - /** @var Carbon */ + /** @var Carbon */ private $endDate; /** @var RuleGroup */ private $ruleGroup; - /** @var Carbon */ + /** @var Carbon */ private $startDate; - /** @var User */ + /** @var User */ private $user; /** @@ -72,7 +69,6 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue } /** - * * @param Collection $accounts */ public function setAccounts(Collection $accounts) @@ -89,7 +85,6 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue } /** - * * @param Carbon $date */ public function setEndDate(Carbon $date) @@ -106,7 +101,6 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue } /** - * * @param Carbon $date */ public function setStartDate(Carbon $date) @@ -123,7 +117,6 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue } /** - * * @param User $user */ public function setUser(User $user) @@ -133,8 +126,6 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * Execute the job. - * - * @return void */ public function handle() { @@ -159,7 +150,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue } /** - * Collect all journals that should be processed + * Collect all journals that should be processed. * * @return Collection */ @@ -174,7 +165,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue } /** - * Collects a list of rule processors, one for each rule within the rule group + * Collects a list of rule processors, one for each rule within the rule group. * * @return array */ diff --git a/app/Jobs/ExecuteRuleOnExistingTransactions.php b/app/Jobs/ExecuteRuleOnExistingTransactions.php index b331e3a300..0c7fbd7fd1 100644 --- a/app/Jobs/ExecuteRuleOnExistingTransactions.php +++ b/app/Jobs/ExecuteRuleOnExistingTransactions.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Jobs; @@ -35,9 +34,7 @@ use Illuminate\Support\Collection; use Log; /** - * Class ExecuteRuleOnExistingTransactions - * - * @package FireflyIII\Jobs + * Class ExecuteRuleOnExistingTransactions. */ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue { @@ -45,13 +42,13 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue /** @var Collection */ private $accounts; - /** @var Carbon */ + /** @var Carbon */ private $endDate; /** @var Rule */ private $rule; - /** @var Carbon */ + /** @var Carbon */ private $startDate; - /** @var User */ + /** @var User */ private $user; /** @@ -73,7 +70,6 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue } /** - * * @param Collection $accounts */ public function setAccounts(Collection $accounts) @@ -90,7 +86,6 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue } /** - * * @param Carbon $date */ public function setEndDate(Carbon $date) @@ -107,7 +102,6 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue } /** - * * @param Carbon $date */ public function setStartDate(Carbon $date) @@ -124,7 +118,6 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue } /** - * * @param User $user */ public function setUser(User $user) @@ -134,8 +127,6 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue /** * Execute the job. - * - * @return void */ public function handle() { @@ -147,13 +138,13 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue $total = 0; // Execute the rules for each transaction foreach ($transactions as $transaction) { - $total++; + ++$total; $result = $processor->handleTransaction($transaction); if ($result) { - $hits++; + ++$hits; } if (!$result) { - $misses++; + ++$misses; } Log::info(sprintf('Current progress: %d Transactions. Hits: %d, misses: %d', $total, $hits, $misses)); // Stop processing this group if the rule specifies 'stop_processing' @@ -165,7 +156,7 @@ class ExecuteRuleOnExistingTransactions extends Job implements ShouldQueue } /** - * Collect all journals that should be processed + * Collect all journals that should be processed. * * @return Collection */ diff --git a/app/Jobs/Job.php b/app/Jobs/Job.php index 51dc805c71..738c8a0ff6 100644 --- a/app/Jobs/Job.php +++ b/app/Jobs/Job.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Jobs; @@ -26,9 +25,7 @@ namespace FireflyIII\Jobs; use Illuminate\Bus\Queueable; /** - * Class Job - * - * @package FireflyIII\Jobs + * Class Job. */ abstract class Job { diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index a7d6d47e41..58835eb59f 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Jobs; @@ -33,21 +32,19 @@ use Mail; use Swift_TransportException; /** - * Class MailError - * - * @package FireflyIII\Jobs + * Class MailError. */ class MailError extends Job implements ShouldQueue { use InteractsWithQueue, SerializesModels; - /** @var string */ + /** @var string */ protected $destination; - /** @var array */ + /** @var array */ protected $exception; - /** @var string */ + /** @var string */ protected $ipAddress; - /** @var array */ + /** @var array */ protected $userData; /** @@ -57,7 +54,6 @@ class MailError extends Job implements ShouldQueue * @param string $destination * @param string $ipAddress * @param array $exceptionData - * */ public function __construct(array $userData, string $destination, string $ipAddress, array $exceptionData) { @@ -72,8 +68,6 @@ class MailError extends Job implements ShouldQueue /** * Execute the job. - * - * @return void */ public function handle() { @@ -90,7 +84,7 @@ class MailError extends Job implements ShouldQueue ['emails.error-html', 'emails.error-text'], $args, function (Message $message) use ($email) { - if ($email !== 'mail@example.com') { + if ('mail@example.com' !== $email) { $message->to($email, $email)->subject('Caught an error in Firely III'); } } diff --git a/app/Mail/AdminTestMail.php b/app/Mail/AdminTestMail.php index 20ffc93d85..a0402718d3 100644 --- a/app/Mail/AdminTestMail.php +++ b/app/Mail/AdminTestMail.php @@ -1,4 +1,5 @@ . */ - declare(strict_types=1); - /** * RegisteredUser.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -41,9 +39,9 @@ use Illuminate\Queue\SerializesModels; class RegisteredUser extends Mailable { use Queueable, SerializesModels; - /** @var string */ + /** @var string */ public $address; - /** @var string */ + /** @var string */ public $ipAddress; /** diff --git a/app/Mail/RequestedNewPassword.php b/app/Mail/RequestedNewPassword.php index 3f28c654da..1d236adb5d 100644 --- a/app/Mail/RequestedNewPassword.php +++ b/app/Mail/RequestedNewPassword.php @@ -19,10 +19,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * RequestedNewPassword.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -41,9 +39,9 @@ use Illuminate\Queue\SerializesModels; class RequestedNewPassword extends Mailable { use Queueable, SerializesModels; - /** @var string */ + /** @var string */ public $ipAddress; - /** @var string */ + /** @var string */ public $url; /** diff --git a/app/Mail/UndoEmailChangeMail.php b/app/Mail/UndoEmailChangeMail.php index 13d61426aa..bc20ed3717 100644 --- a/app/Mail/UndoEmailChangeMail.php +++ b/app/Mail/UndoEmailChangeMail.php @@ -1,4 +1,5 @@ . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -37,9 +36,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Watson\Validating\ValidatingTrait; /** - * Class Account - * - * @package FireflyIII\Models + * Class Account. */ class Account extends Model { @@ -70,13 +67,14 @@ class Account extends Model 'active' => 'required|boolean', 'iban' => 'between:1,50|iban', ]; - /** @var bool */ + /** @var bool */ private $joinedAccountTypes; /** * @param array $fields * * @return Account + * * @throws FireflyException */ public static function firstOrCreateEncrypted(array $fields) @@ -99,7 +97,6 @@ class Account extends Model $fields['name'] = $fields['iban']; } - /** @var Account $account */ foreach ($set as $account) { if ($account->name === $fields['name']) { @@ -118,7 +115,7 @@ class Account extends Model * * @return Account */ - public static function routeBinder(Account $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { @@ -151,7 +148,7 @@ class Account extends Model { $name = $this->name; - if ($this->accountType->type === AccountType::CASH) { + if (AccountType::CASH === $this->accountType->type) { return ''; } @@ -159,16 +156,17 @@ class Account extends Model } /** - * FIxxME can return null + * FIxxME can return null. * * @param $value * * @return string + * * @throws FireflyException */ public function getIbanAttribute($value): string { - if (is_null($value) || strlen(strval($value)) === 0) { + if (null === $value || 0 === strlen(strval($value))) { return ''; } try { @@ -176,7 +174,7 @@ class Account extends Model } catch (DecryptException $e) { throw new FireflyException('Cannot decrypt value "' . $value . '" for account #' . $this->id); } - if (is_null($result)) { + if (null === $result) { return ''; } @@ -184,7 +182,6 @@ class Account extends Model } /** - * * @param string $fieldName * * @return string @@ -201,7 +198,6 @@ class Account extends Model } /** - * * @param $value * * @return string @@ -216,9 +212,10 @@ class Account extends Model } /** - * Returns the opening balance + * Returns the opening balance. * * @return TransactionJournal + * * @throws FireflyException */ public function getOpeningBalance(): TransactionJournal @@ -228,7 +225,7 @@ class Account extends Model ->where('transactions.account_id', $this->id) ->transactionTypes([TransactionType::OPENING_BALANCE]) ->first(['transaction_journals.*']); - if (is_null($journal)) { + if (null === $journal) { return new TransactionJournal; } @@ -239,6 +236,7 @@ class Account extends Model * Returns the amount of the opening balance for this account. * * @return string + * * @throws FireflyException */ public function getOpeningBalanceAmount(): string @@ -248,16 +246,16 @@ class Account extends Model ->where('transactions.account_id', $this->id) ->transactionTypes([TransactionType::OPENING_BALANCE]) ->first(['transaction_journals.*']); - if (is_null($journal)) { + if (null === $journal) { return '0'; } $count = $journal->transactions()->count(); - if ($count !== 2) { + if (2 !== $count) { throw new FireflyException(sprintf('Cannot use getFirstTransaction on journal #%d', $journal->id)); } $transaction = $journal->transactions()->where('account_id', $this->id)->first(); - if (is_null($transaction)) { + if (null === $transaction) { return '0'; } @@ -265,9 +263,10 @@ class Account extends Model } /** - * Returns the date of the opening balance for this account. If no date, will return 01-01-1900 + * Returns the date of the opening balance for this account. If no date, will return 01-01-1900. * * @return Carbon + * * @throws FireflyException */ public function getOpeningBalanceDate(): Carbon @@ -278,7 +277,7 @@ class Account extends Model ->where('transactions.account_id', $this->id) ->transactionTypes([TransactionType::OPENING_BALANCE]) ->first(['transaction_journals.*']); - if (is_null($journal)) { + if (null === $journal) { return $date; } @@ -294,13 +293,12 @@ class Account extends Model } /** - * * @param EloquentBuilder $query * @param array $types */ public function scopeAccountTypeIn(EloquentBuilder $query, array $types) { - if (is_null($this->joinedAccountTypes)) { + if (null === $this->joinedAccountTypes) { $query->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id'); $this->joinedAccountTypes = true; } @@ -308,7 +306,6 @@ class Account extends Model } /** - * * @param EloquentBuilder $query * @param string $name * @param string $value @@ -326,7 +323,6 @@ class Account extends Model } /** - * * @param $value */ public function setIbanAttribute($value) @@ -335,7 +331,6 @@ class Account extends Model } /** - * * @param $value */ public function setNameAttribute($value) @@ -347,7 +342,6 @@ class Account extends Model /** * @param $value - * */ public function setVirtualBalanceAttribute($value) { diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index 9eb33eae71..b4e6c3053f 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -27,13 +26,10 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** - * Class AccountMeta - * - * @package FireflyIII\Models + * Class AccountMeta. */ class AccountMeta extends Model { - /** * The attributes that should be casted to native types. * @@ -49,7 +45,6 @@ class AccountMeta extends Model protected $table = 'account_meta'; /** - * * @return BelongsTo */ public function account(): BelongsTo @@ -57,7 +52,6 @@ class AccountMeta extends Model return $this->belongsTo('FireflyIII\Models\Account'); } - /** * @param $value * diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 6e2a93de3c..0b00a1bce4 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -27,9 +26,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; /** - * Class AccountType - * - * @package FireflyIII\Models + * Class AccountType. */ class AccountType extends Model { @@ -42,7 +39,6 @@ class AccountType extends Model const BENEFICIARY = 'Beneficiary account'; const IMPORT = 'Import account'; - /** * The attributes that should be casted to native types. * diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index 268d16fb18..47075945dc 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -31,9 +30,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class Attachment - * - * @package FireflyIII\Models + * Class Attachment. */ class Attachment extends Model { @@ -59,7 +56,7 @@ class Attachment extends Model * * @return Attachment */ - public static function routeBinder(Attachment $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { @@ -96,7 +93,7 @@ class Attachment extends Model */ public function getDescriptionAttribute($value) { - if (is_null($value) || strlen($value) === 0) { + if (null === $value || 0 === strlen($value)) { return null; } @@ -110,7 +107,7 @@ class Attachment extends Model */ public function getFilenameAttribute($value) { - if (is_null($value) || strlen($value) === 0) { + if (null === $value || 0 === strlen($value)) { return null; } @@ -124,7 +121,7 @@ class Attachment extends Model */ public function getMimeAttribute($value) { - if (is_null($value) || strlen($value) === 0) { + if (null === $value || 0 === strlen($value)) { return null; } @@ -132,14 +129,13 @@ class Attachment extends Model } /** - * * @param $value * * @return null|string */ public function getNotesAttribute($value) { - if (is_null($value) || strlen($value) === 0) { + if (null === $value || 0 === strlen($value)) { return null; } @@ -147,14 +143,13 @@ class Attachment extends Model } /** - * * @param $value * * @return null|string */ public function getTitleAttribute($value) { - if (is_null($value) || strlen($value) === 0) { + if (null === $value || 0 === strlen($value)) { return null; } diff --git a/app/Models/AvailableBudget.php b/app/Models/AvailableBudget.php index bbb342f40e..9e90b2572f 100644 --- a/app/Models/AvailableBudget.php +++ b/app/Models/AvailableBudget.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,9 +27,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; /** - * Class AvailableBudget - * - * @package FireflyIII\Models + * Class AvailableBudget. */ class AvailableBudget extends Model { diff --git a/app/Models/Bill.php b/app/Models/Bill.php index a4e4655133..2154088715 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -32,9 +31,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Watson\Validating\ValidatingTrait; /** - * Class Bill - * - * @package FireflyIII\Models + * Class Bill. */ class Bill extends Model { @@ -60,14 +57,14 @@ class Bill extends Model = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',]; protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted']; - protected $rules = ['name' => 'required|between:1,200',]; + protected $rules = ['name' => 'required|between:1,200']; /** * @param Bill $value * * @return Bill */ - public static function routeBinder(Bill $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { @@ -84,7 +81,7 @@ class Bill extends Model */ public function getMatchAttribute($value) { - if (intval($this->match_encrypted) === 1) { + if (1 === intval($this->match_encrypted)) { return Crypt::decrypt($value); } @@ -98,7 +95,7 @@ class Bill extends Model */ public function getNameAttribute($value) { - if (intval($this->name_encrypted) === 1) { + if (1 === intval($this->name_encrypted)) { return Crypt::decrypt($value); } diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 5ce779ad83..ccc9774480 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -31,9 +30,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Watson\Validating\ValidatingTrait; /** - * Class Budget - * - * @package FireflyIII\Models + * Class Budget. */ class Budget extends Model { @@ -57,7 +54,7 @@ class Budget extends Model /** @var array */ protected $hidden = ['encrypted']; /** @var array */ - protected $rules = ['name' => 'required|between:1,200',]; + protected $rules = ['name' => 'required|between:1,200']; /** * @param array $fields @@ -91,7 +88,7 @@ class Budget extends Model * * @return Budget */ - public static function routeBinder(Budget $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { @@ -102,7 +99,6 @@ class Budget extends Model } /** - * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function budgetlimits() diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index f120cd5a5b..00c7271711 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -27,13 +26,10 @@ use Illuminate\Database\Eloquent\Model; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class BudgetLimit - * - * @package FireflyIII\Models + * Class BudgetLimit. */ class BudgetLimit extends Model { - /** * The attributes that should be casted to native types. * @@ -85,7 +81,6 @@ class BudgetLimit extends Model return $this->hasMany('FireflyIII\Models\LimitRepetition'); } - /** * @param $value */ diff --git a/app/Models/Category.php b/app/Models/Category.php index a6760c5d8f..1edc7f8432 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -31,9 +30,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Watson\Validating\ValidatingTrait; /** - * Class Category - * - * @package FireflyIII\Models + * Class Category. */ class Category extends Model { @@ -56,7 +53,7 @@ class Category extends Model /** @var array */ protected $hidden = ['encrypted']; /** @var array */ - protected $rules = ['name' => 'required|between:1,200',]; + protected $rules = ['name' => 'required|between:1,200']; /** * @param array $fields @@ -90,7 +87,7 @@ class Category extends Model * * @return Category */ - public static function routeBinder(Category $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { @@ -101,7 +98,6 @@ class Category extends Model } /** - * * @param $value * * @return string @@ -116,7 +112,6 @@ class Category extends Model } /** - * * @param $value */ public function setNameAttribute($value) diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index d399ffee55..028f5faf57 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -27,9 +26,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; /** - * Class Configuration - * - * @package FireflyIII\Models + * Class Configuration. */ class Configuration extends Model { diff --git a/app/Models/CurrencyExchangeRate.php b/app/Models/CurrencyExchangeRate.php index 27c44b51ba..acea35d9f2 100644 --- a/app/Models/CurrencyExchangeRate.php +++ b/app/Models/CurrencyExchangeRate.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,13 +27,10 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** - * Class CurrencyExchange - * - * @package FireflyIII\Models + * Class CurrencyExchange. */ class CurrencyExchangeRate extends Model { - /** @var array */ protected $dates = ['date']; diff --git a/app/Models/ExportJob.php b/app/Models/ExportJob.php index 2d223402f0..599b6bdba9 100644 --- a/app/Models/ExportJob.php +++ b/app/Models/ExportJob.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,11 +27,9 @@ use Illuminate\Database\Eloquent\Model; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class ExportJob + * Class ExportJob. * * @property User $user - * - * @package FireflyIII\Models */ class ExportJob extends Model { @@ -47,13 +44,14 @@ class ExportJob extends Model * @param $value * * @return mixed + * * @throws NotFoundHttpException */ public static function routeBinder($value) { if (auth()->check()) { $model = self::where('key', $value)->where('user_id', auth()->user()->id)->first(); - if (!is_null($model)) { + if (null !== $model) { return $model; } } diff --git a/app/Models/ImportJob.php b/app/Models/ImportJob.php index 781ea2f27c..74c7e591f9 100644 --- a/app/Models/ImportJob.php +++ b/app/Models/ImportJob.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -30,13 +29,10 @@ use Storage; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class ImportJob - * - * @package FireflyIII\Models + * Class ImportJob. */ class ImportJob extends Model { - /** * The attributes that should be casted to native types. * @@ -61,13 +57,14 @@ class ImportJob extends Model * @param $value * * @return mixed + * * @throws NotFoundHttpException */ public static function routeBinder($value) { if (auth()->check()) { $model = self::where('key', $value)->where('user_id', auth()->user()->id)->first(); - if (!is_null($model)) { + if (null !== $model) { return $model; } } @@ -127,10 +124,10 @@ class ImportJob extends Model */ public function getConfigurationAttribute($value) { - if (is_null($value)) { + if (null === $value) { return []; } - if (strlen($value) === 0) { + if (0 === strlen($value)) { return []; } @@ -144,7 +141,7 @@ class ImportJob extends Model */ public function getExtendedStatusAttribute($value) { - if (strlen($value) === 0) { + if (0 === strlen($value)) { return []; } diff --git a/app/Models/LimitRepetition.php b/app/Models/LimitRepetition.php index 5b049fdb33..2493c9ac1f 100644 --- a/app/Models/LimitRepetition.php +++ b/app/Models/LimitRepetition.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,14 +27,12 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; /** - * Class LimitRepetition + * Class LimitRepetition. * * @deprecated - * @package FireflyIII\Models */ class LimitRepetition extends Model { - /** * The attributes that should be casted to native types. * @@ -62,10 +59,8 @@ class LimitRepetition extends Model } /** - * * @param Builder $query * @param Carbon $date - * */ public function scopeAfter(Builder $query, Carbon $date) { @@ -73,10 +68,8 @@ class LimitRepetition extends Model } /** - * * @param Builder $query * @param Carbon $date - * */ public function scopeBefore(Builder $query, Carbon $date) { diff --git a/app/Models/LinkType.php b/app/Models/LinkType.php index 25c64ee0af..0c0e0cfac7 100644 --- a/app/Models/LinkType.php +++ b/app/Models/LinkType.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -29,8 +28,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * @property int $journalCount * Class LinkType - * - * @package FireflyIII\Models */ class LinkType extends Model { @@ -54,13 +51,14 @@ class LinkType extends Model * @param $value * * @return mixed + * * @throws NotFoundHttpException */ public static function routeBinder($value) { if (auth()->check()) { $model = self::where('id', $value)->first(); - if (!is_null($model)) { + if (null !== $model) { return $model; } } diff --git a/app/Models/Note.php b/app/Models/Note.php index 9f8a1b410b..4d5d2bfafb 100644 --- a/app/Models/Note.php +++ b/app/Models/Note.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -27,9 +26,7 @@ use Illuminate\Database\Eloquent\Model; use League\CommonMark\CommonMarkConverter; /** - * Class Note - * - * @package FireflyIII\Models + * Class Note. */ class Note extends Model { @@ -59,7 +56,7 @@ class Note extends Model /** * Get all of the owning noteable models. Currently piggy bank and - * transaction journal + * transaction journal. */ public function noteable() { diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index 1bb4dd2952..ebb5f74887 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -32,9 +31,7 @@ use Steam; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class PiggyBank - * - * @package FireflyIII\Models + * Class PiggyBank. */ class PiggyBank extends Model { @@ -68,7 +65,7 @@ class PiggyBank extends Model * * @return PiggyBank */ - public static function routeBinder(PiggyBank $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->account->user_id) === auth()->user()->id) { @@ -87,19 +84,19 @@ class PiggyBank extends Model } /** - * Grabs the PiggyBankRepetition that's currently relevant / active + * Grabs the PiggyBankRepetition that's currently relevant / active. * * @returns PiggyBankRepetition */ public function currentRelevantRep(): PiggyBankRepetition { - if (!is_null($this->currentRep)) { + if (null !== $this->currentRep) { return $this->currentRep; } // repeating piggy banks are no longer supported. /** @var PiggyBankRepetition $rep */ $rep = $this->piggyBankRepetitions()->first(['piggy_bank_repetitions.*']); - if (is_null($rep)) { + if (null === $rep) { return new PiggyBankRepetition(); } $this->currentRep = $rep; @@ -108,7 +105,6 @@ class PiggyBank extends Model } /** - * * @param $value * * @return string @@ -134,12 +130,12 @@ class PiggyBank extends Model $remainingAmount = bcsub($this->targetamount, $this->currentRelevantRep()->currentamount); // more than 1 month to go and still need money to save: - if ($diffInMonths > 0 && bccomp($remainingAmount, '0') === 1) { + if ($diffInMonths > 0 && 1 === bccomp($remainingAmount, '0')) { $savePerMonth = bcdiv($remainingAmount, strval($diffInMonths)); } // less than 1 month to go but still need money to save: - if ($diffInMonths === 0 && bccomp($remainingAmount, '0') === 1) { + if (0 === $diffInMonths && 1 === bccomp($remainingAmount, '0')) { $savePerMonth = $remainingAmount; } } @@ -148,7 +144,6 @@ class PiggyBank extends Model } /** - * * @param Carbon $date * * @return string @@ -156,7 +151,7 @@ class PiggyBank extends Model public function leftOnAccount(Carbon $date): string { $balance = Steam::balanceIgnoreVirtual($this->account, $date); - /** @var PiggyBank $p */ + // @var PiggyBank $p foreach ($this->account->piggyBanks as $piggyBank) { $currentAmount = $piggyBank->currentRelevantRep()->currentamount ?? '0'; @@ -191,7 +186,6 @@ class PiggyBank extends Model } /** - * * @param $value */ public function setNameAttribute($value) diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 389c8607a7..4ec1836c9b 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -26,13 +25,10 @@ namespace FireflyIII\Models; use Illuminate\Database\Eloquent\Model; /** - * Class PiggyBankEvent - * - * @package FireflyIII\Models + * Class PiggyBankEvent. */ class PiggyBankEvent extends Model { - /** * The attributes that should be casted to native types. * diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index 801eb44ad0..edb2f51841 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,13 +27,10 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Eloquent\Model; /** - * Class PiggyBankRepetition - * - * @package FireflyIII\Models + * Class PiggyBankRepetition. */ class PiggyBankRepetition extends Model { - /** * The attributes that should be casted to native types. * diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 5aee3161ab..a5296a2036 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -31,13 +30,10 @@ use Illuminate\Database\Eloquent\Model; use Log; /** - * Class Preference - * - * @package FireflyIII\Models + * Class Preference. */ class Preference extends Model { - /** * The attributes that should be casted to native types. * @@ -56,6 +52,7 @@ class Preference extends Model * @param $value * * @return mixed + * * @throws FireflyException */ public function getDataAttribute($value) @@ -74,7 +71,7 @@ class Preference extends Model } catch (Exception $e) { // don't care, assume is false. } - if (!($unserialized === false)) { + if (!(false === $unserialized)) { return $unserialized; } diff --git a/app/Models/Role.php b/app/Models/Role.php index 6b3eb96012..27a01851d5 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -27,9 +26,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; /** - * Class Role - * - * @package FireflyIII\Models + * Class Role. */ class Role extends Model { @@ -44,7 +41,6 @@ class Role extends Model 'updated_at' => 'datetime', ]; - /** * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ diff --git a/app/Models/Rule.php b/app/Models/Rule.php index d327b3c6b9..6e2101b1d4 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,9 +27,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class Rule - * - * @package FireflyIII\Models + * Class Rule. */ class Rule extends Model { @@ -56,7 +53,7 @@ class Rule extends Model * * @return Rule */ - public static function routeBinder(Rule $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { diff --git a/app/Models/RuleAction.php b/app/Models/RuleAction.php index c26359ab62..3bfdacc406 100644 --- a/app/Models/RuleAction.php +++ b/app/Models/RuleAction.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -26,9 +25,7 @@ namespace FireflyIII\Models; use Illuminate\Database\Eloquent\Model; /** - * Class RuleAction - * - * @package FireflyIII\Models + * Class RuleAction. */ class RuleAction extends Model { diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index e2d13773ec..e022f486d1 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,9 +27,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class RuleGroup - * - * @package FireflyIII\Models + * Class RuleGroup. */ class RuleGroup extends Model { @@ -56,7 +53,7 @@ class RuleGroup extends Model * * @return RuleGroup */ - public static function routeBinder(RuleGroup $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php index 629b283ee1..bf867571a6 100644 --- a/app/Models/RuleTrigger.php +++ b/app/Models/RuleTrigger.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -26,9 +25,7 @@ namespace FireflyIII\Models; use Illuminate\Database\Eloquent\Model; /** - * Class RuleTrigger - * - * @package FireflyIII\Models + * Class RuleTrigger. */ class RuleTrigger extends Model { diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 060003a0d7..ff4b2dba32 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -30,9 +29,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Watson\Validating\ValidatingTrait; /** - * Class Tag - * - * @package FireflyIII\Models + * Class Tag. */ class Tag extends Model { @@ -50,15 +47,13 @@ class Tag extends Model 'deleted_at' => 'datetime', 'date' => 'date', 'zoomLevel' => 'int', - ]; /** @var array */ protected $dates = ['date']; /** @var array */ protected $fillable = ['user_id', 'tag', 'date', 'description', 'longitude', 'latitude', 'zoomLevel', 'tagMode']; /** @var array */ - protected $rules = ['tag' => 'required|between:1,200',]; - + protected $rules = ['tag' => 'required|between:1,200']; /** * @param array $fields @@ -96,7 +91,7 @@ class Tag extends Model * * @return Tag */ - public static function routeBinder(Tag $value) + public static function routeBinder(self $value) { if (auth()->check()) { if (intval($value->user_id) === auth()->user()->id) { @@ -111,7 +106,7 @@ class Tag extends Model * * @return string */ - public static function tagSum(Tag $tag): string + public static function tagSum(self $tag): string { $sum = '0'; /** @var TransactionJournal $journal */ @@ -123,14 +118,13 @@ class Tag extends Model } /** - * * @param $value * * @return string */ public function getDescriptionAttribute($value) { - if (is_null($value)) { + if (null === $value) { return $value; } @@ -138,14 +132,13 @@ class Tag extends Model } /** - * * @param $value * * @return string */ public function getTagAttribute($value) { - if (is_null($value)) { + if (null === $value) { return null; } @@ -155,7 +148,7 @@ class Tag extends Model /** * Save the model to the database. * - * @param array $options + * @param array $options * * @return bool */ @@ -171,7 +164,6 @@ class Tag extends Model } /** - * * @param $value */ public function setDescriptionAttribute($value) @@ -180,7 +172,6 @@ class Tag extends Model } /** - * * @param $value */ public function setTagAttribute($value) diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 504782567b..ca77193672 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -30,53 +29,43 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Watson\Validating\ValidatingTrait; /** - * Class Transaction + * Class Transaction. * - * @property-read int $journal_id - * @property Carbon $date - * @property-read string $transaction_description - * @property string $transaction_amount - * @property string $transaction_foreign_amount - * @property string $transaction_type_type - * @property string $foreign_currency_symbol - * @property int $foreign_currency_dp - * - * @property int $account_id - * @property string $account_name - * @property string $account_iban - * @property string $account_number - * @property string $account_bic - * @property string $account_currency_code - * - * @property int $opposing_account_id - * @property string $opposing_account_name - * @property string $opposing_account_iban - * @property string $opposing_account_number - * @property string $opposing_account_bic - * @property string $opposing_currency_code - * - * - * @property int $transaction_budget_id - * @property string $transaction_budget_name - * @property int $transaction_journal_budget_id - * @property string $transaction_journal_budget_name - * - * @property-read int $transaction_category_id - * @property-read string $transaction_category_name - * @property-read int $transaction_journal_category_id - * @property-read string $transaction_journal_category_name - * - * @property-read int $bill_id - * @property string $bill_name - * - * @property string $notes - * @property string $tags - * - * @property string $transaction_currency_symbol - * @property int $transaction_currency_dp - * @property string $transaction_currency_code - * - * @package FireflyIII\Models + * @property int $journal_id + * @property Carbon $date + * @property string $transaction_description + * @property string $transaction_amount + * @property string $transaction_foreign_amount + * @property string $transaction_type_type + * @property string $foreign_currency_symbol + * @property int $foreign_currency_dp + * @property int $account_id + * @property string $account_name + * @property string $account_iban + * @property string $account_number + * @property string $account_bic + * @property string $account_currency_code + * @property int $opposing_account_id + * @property string $opposing_account_name + * @property string $opposing_account_iban + * @property string $opposing_account_number + * @property string $opposing_account_bic + * @property string $opposing_currency_code + * @property int $transaction_budget_id + * @property string $transaction_budget_name + * @property int $transaction_journal_budget_id + * @property string $transaction_journal_budget_name + * @property int $transaction_category_id + * @property string $transaction_category_name + * @property int $transaction_journal_category_id + * @property string $transaction_journal_category_name + * @property int $bill_id + * @property string $bill_name + * @property string $notes + * @property string $tags + * @property string $transaction_currency_symbol + * @property int $transaction_currency_dp + * @property string $transaction_currency_code */ class Transaction extends Model { @@ -97,7 +86,7 @@ class Transaction extends Model ]; protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount', 'identifier', 'transaction_currency_id', 'foreign_currency_id', - 'foreign_amount']; + 'foreign_amount',]; protected $hidden = ['encrypted']; protected $rules = [ @@ -117,7 +106,7 @@ class Transaction extends Model public static function isJoined(Builder $query, string $table): bool { $joins = $query->getQuery()->joins; - if (is_null($joins)) { + if (null === $joins) { return false; } foreach ($joins as $join) { @@ -174,7 +163,6 @@ class Transaction extends Model } /** - * * @param Builder $query * @param Carbon $date */ @@ -187,10 +175,8 @@ class Transaction extends Model } /** - * * @param Builder $query * @param Carbon $date - * */ public function scopeBefore(Builder $query, Carbon $date) { @@ -201,7 +187,6 @@ class Transaction extends Model } /** - * * @param Builder $query * @param array $types */ diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index 7737175352..5e8b4dfe7f 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,9 +27,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class TransactionCurrency - * - * @package FireflyIII\Models + * Class TransactionCurrency. */ class TransactionCurrency extends Model { @@ -58,7 +55,7 @@ class TransactionCurrency extends Model * * @return TransactionCurrency */ - public static function routeBinder(TransactionCurrency $currency) + public static function routeBinder(self $currency) { if (auth()->check()) { return $currency; diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 545890814b..c1001ee2d2 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -38,9 +37,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Watson\Validating\ValidatingTrait; /** - * Class TransactionJournal - * - * @package FireflyIII\Models + * Class TransactionJournal. */ class TransactionJournal extends Model { @@ -71,7 +68,7 @@ class TransactionJournal extends Model protected $fillable = ['user_id', 'transaction_type_id', 'bill_id', 'interest_date', 'book_date', 'process_date', 'transaction_currency_id', 'description', 'completed', - 'date', 'rent_date', 'encrypted', 'tag_count']; + 'date', 'rent_date', 'encrypted', 'tag_count',]; /** @var array */ protected $hidden = ['encrypted']; /** @var array */ @@ -89,6 +86,7 @@ class TransactionJournal extends Model * @param $value * * @return mixed + * * @throws NotFoundHttpException */ public static function routeBinder($value) @@ -98,7 +96,7 @@ class TransactionJournal extends Model ->with('transactionType') ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') ->where('user_id', auth()->user()->id)->first(['transaction_journals.*']); - if (!is_null($object)) { + if (null !== $object) { return $object; } } @@ -159,7 +157,6 @@ class TransactionJournal extends Model } /** - * * @param $value * * @return string @@ -174,7 +171,6 @@ class TransactionJournal extends Model } /** - * * @param string $name * * @return string @@ -193,14 +189,14 @@ class TransactionJournal extends Model Log::debug(sprintf('Looking for journal #%d meta field "%s".', $this->id, $name)); $entry = $this->transactionJournalMeta()->where('name', $name)->first(); - if (!is_null($entry)) { + if (null !== $entry) { $value = $entry->data; // cache: $cache->store($value); } // convert to Carbon if name is _date - if (!is_null($value) && substr($name, -5) === '_date') { + if (null !== $value && '_date' === substr($name, -5)) { $value = new Carbon($value); // cache: $cache->store($value); @@ -216,7 +212,7 @@ class TransactionJournal extends Model */ public function hasMeta(string $name): bool { - return !is_null($this->getMeta($name)); + return null !== $this->getMeta($name); } /** @@ -224,47 +220,44 @@ class TransactionJournal extends Model */ public function isDeposit(): bool { - if (!is_null($this->transaction_type_type)) { - return $this->transaction_type_type === TransactionType::DEPOSIT; + if (null !== $this->transaction_type_type) { + return TransactionType::DEPOSIT === $this->transaction_type_type; } return $this->transactionType->isDeposit(); } /** - * * @return bool */ public function isOpeningBalance(): bool { - if (!is_null($this->transaction_type_type)) { - return $this->transaction_type_type === TransactionType::OPENING_BALANCE; + if (null !== $this->transaction_type_type) { + return TransactionType::OPENING_BALANCE === $this->transaction_type_type; } return $this->transactionType->isOpeningBalance(); } /** - * * @return bool */ public function isTransfer(): bool { - if (!is_null($this->transaction_type_type)) { - return $this->transaction_type_type === TransactionType::TRANSFER; + if (null !== $this->transaction_type_type) { + return TransactionType::TRANSFER === $this->transaction_type_type; } return $this->transactionType->isTransfer(); } /** - * * @return bool */ public function isWithdrawal(): bool { - if (!is_null($this->transaction_type_type)) { - return $this->transaction_type_type === TransactionType::WITHDRAWAL; + if (null !== $this->transaction_type_type) { + return TransactionType::WITHDRAWAL === $this->transaction_type_type; } return $this->transactionType->isWithdrawal(); @@ -289,7 +282,7 @@ class TransactionJournal extends Model /** * Save the model to the database. * - * @param array $options + * @param array $options * * @return bool */ @@ -302,7 +295,6 @@ class TransactionJournal extends Model } /** - * * @param EloquentBuilder $query * @param Carbon $date * @@ -314,7 +306,6 @@ class TransactionJournal extends Model } /** - * * @param EloquentBuilder $query * @param Carbon $date * @@ -336,7 +327,6 @@ class TransactionJournal extends Model } /** - * * @param EloquentBuilder $query * @param array $types */ @@ -351,7 +341,6 @@ class TransactionJournal extends Model } /** - * * @param $value */ public function setDescriptionAttribute($value) @@ -369,12 +358,12 @@ class TransactionJournal extends Model */ public function setMeta(string $name, $value): TransactionJournalMeta { - if (is_null($value)) { + if (null === $value) { $this->deleteMeta($name); return new TransactionJournalMeta(); } - if (is_string($value) && strlen($value) === 0) { + if (is_string($value) && 0 === strlen($value)) { return new TransactionJournalMeta(); } @@ -384,7 +373,7 @@ class TransactionJournal extends Model Log::debug(sprintf('Going to set "%s" with value "%s"', $name, json_encode($value))); $entry = $this->transactionJournalMeta()->where('name', $name)->first(); - if (is_null($entry)) { + if (null === $entry) { $entry = new TransactionJournalMeta(); $entry->transactionJournal()->associate($this); $entry->name = $name; diff --git a/app/Models/TransactionJournalLink.php b/app/Models/TransactionJournalLink.php index 45036b5d29..c3a001f556 100644 --- a/app/Models/TransactionJournalLink.php +++ b/app/Models/TransactionJournalLink.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -29,9 +28,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class TransactionJournalLink - * - * @package FireflyIII\Models + * Class TransactionJournalLink. */ class TransactionJournalLink extends Model { @@ -41,6 +38,7 @@ class TransactionJournalLink extends Model * @param $value * * @return mixed + * * @throws NotFoundHttpException */ public static function routeBinder($value) @@ -52,7 +50,7 @@ class TransactionJournalLink extends Model ->where('t_a.user_id', auth()->user()->id) ->where('t_b.user_id', auth()->user()->id) ->first(['journal_links.*']); - if (!is_null($model)) { + if (null !== $model) { return $model; } } @@ -74,7 +72,7 @@ class TransactionJournalLink extends Model */ public function getCommentAttribute($value): ?string { - if (!is_null($value)) { + if (null !== $value) { return Crypt::decrypt($value); } @@ -90,12 +88,11 @@ class TransactionJournalLink extends Model } /** - * * @param $value */ public function setCommentAttribute($value): void { - if (!is_null($value) && strlen($value) > 0) { + if (null !== $value && strlen($value) > 0) { $this->attributes['comment'] = Crypt::encrypt($value); return; diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index f673fbb8cc..8a93df7870 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,9 +27,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; /** - * Class TransactionJournalMeta - * - * @package FireflyIII\Models + * Class TransactionJournalMeta. */ class TransactionJournalMeta extends Model { @@ -72,7 +69,6 @@ class TransactionJournalMeta extends Model } /** - * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function transactionJournal(): BelongsTo diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index ea09c65b9f..a915e849a0 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Models; @@ -28,9 +27,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class TransactionType - * - * @package FireflyIII\Models + * Class TransactionType. */ class TransactionType extends Model { @@ -64,19 +61,18 @@ class TransactionType extends Model throw new NotFoundHttpException; } $transactionType = self::where('type', ucfirst($type))->first(); - if (!is_null($transactionType)) { + if (null !== $transactionType) { return $transactionType; } throw new NotFoundHttpException; } - /** * @return bool */ public function isDeposit() { - return $this->type === self::DEPOSIT; + return self::DEPOSIT === $this->type; } /** @@ -84,7 +80,7 @@ class TransactionType extends Model */ public function isOpeningBalance() { - return $this->type === self::OPENING_BALANCE; + return self::OPENING_BALANCE === $this->type; } /** @@ -92,7 +88,7 @@ class TransactionType extends Model */ public function isTransfer() { - return $this->type === self::TRANSFER; + return self::TRANSFER === $this->type; } /** @@ -100,11 +96,10 @@ class TransactionType extends Model */ public function isWithdrawal() { - return $this->type === self::WITHDRAWAL; + return self::WITHDRAWAL === $this->type; } /** - * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function transactionJournals() diff --git a/app/Providers/AccountServiceProvider.php b/app/Providers/AccountServiceProvider.php index 946dc65fd3..b2d35d3a4c 100644 --- a/app/Providers/AccountServiceProvider.php +++ b/app/Providers/AccountServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\Account\AccountRepository; @@ -32,26 +30,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class AccountServiceProvider - * - * @package FireflyIII\Providers + * Class AccountServiceProvider. */ class AccountServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/AdminServiceProvider.php b/app/Providers/AdminServiceProvider.php index f75b40bc25..e2afa5d433 100644 --- a/app/Providers/AdminServiceProvider.php +++ b/app/Providers/AdminServiceProvider.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Providers; @@ -32,8 +31,6 @@ class AdminServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { @@ -41,8 +38,6 @@ class AdminServiceProvider extends ServiceProvider /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7d8752abe6..a0af9c7ee7 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Providers; @@ -27,16 +26,12 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; /** - * Class AppServiceProvider - * - * @package FireflyIII\Providers + * Class AppServiceProvider. */ class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. - * - * @return void */ public function boot() { @@ -45,8 +40,6 @@ class AppServiceProvider extends ServiceProvider /** * Register any application services. - * - * @return void */ public function register() { diff --git a/app/Providers/AttachmentServiceProvider.php b/app/Providers/AttachmentServiceProvider.php index a00ae75d42..4725f7cb0d 100644 --- a/app/Providers/AttachmentServiceProvider.php +++ b/app/Providers/AttachmentServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\Attachment\AttachmentRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class AttachmentServiceProvider - * - * @package FireflyIII\Providers + * Class AttachmentServiceProvider. */ class AttachmentServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index d03e8bc6de..3522b9cc71 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * AuthServiceProvider.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -49,13 +47,9 @@ class AuthServiceProvider extends ServiceProvider /** * Register any authentication / authorization services. - * - * @return void */ public function boot() { $this->registerPolicies(); - - // } } diff --git a/app/Providers/BillServiceProvider.php b/app/Providers/BillServiceProvider.php index dea438c324..f0377d8ca8 100644 --- a/app/Providers/BillServiceProvider.php +++ b/app/Providers/BillServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\Bill\BillRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class BillServiceProvider - * - * @package FireflyIII\Providers + * Class BillServiceProvider. */ class BillServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 64725f48ae..8a1be3536b 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * BroadcastServiceProvider.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -40,8 +38,6 @@ class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. - * - * @return void */ public function boot() { diff --git a/app/Providers/BudgetServiceProvider.php b/app/Providers/BudgetServiceProvider.php index 2818cc89e7..49fd527457 100644 --- a/app/Providers/BudgetServiceProvider.php +++ b/app/Providers/BudgetServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\Budget\BudgetRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class BudgetServiceProvider - * - * @package FireflyIII\Providers + * Class BudgetServiceProvider. */ class BudgetServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/CategoryServiceProvider.php b/app/Providers/CategoryServiceProvider.php index f39ef1c44c..2be853ccf0 100644 --- a/app/Providers/CategoryServiceProvider.php +++ b/app/Providers/CategoryServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\Category\CategoryRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class CategoryServiceProvider - * - * @package FireflyIII\Providers + * Class CategoryServiceProvider. */ class CategoryServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/CurrencyServiceProvider.php b/app/Providers/CurrencyServiceProvider.php index e00c5013b6..76a41f6f98 100644 --- a/app/Providers/CurrencyServiceProvider.php +++ b/app/Providers/CurrencyServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\Currency\CurrencyRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class CurrencyServiceProvider - * - * @package FireflyIII\Providers + * Class CurrencyServiceProvider. */ class CurrencyServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index fccd71f715..3f415111e2 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Providers; @@ -33,9 +32,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvi use Log; /** - * Class EventServiceProvider - * - * @package FireflyIII\Providers + * Class EventServiceProvider. */ class EventServiceProvider extends ServiceProvider { @@ -47,11 +44,10 @@ class EventServiceProvider extends ServiceProvider protected $listen = [ // is a User related event. - 'FireflyIII\Events\RegisteredUser' => - [ - 'FireflyIII\Handlers\Events\UserEventHandler@sendRegistrationMail', - 'FireflyIII\Handlers\Events\UserEventHandler@attachUserRole', - ], + 'FireflyIII\Events\RegisteredUser' => [ + 'FireflyIII\Handlers\Events\UserEventHandler@sendRegistrationMail', + 'FireflyIII\Handlers\Events\UserEventHandler@attachUserRole', + ], // is a User related event. 'FireflyIII\Events\RequestedNewPassword' => [ 'FireflyIII\Handlers\Events\UserEventHandler@sendNewPassword', @@ -66,25 +62,20 @@ class EventServiceProvider extends ServiceProvider 'FireflyIII\Handlers\Events\AdminEventHandler@sendTestMessage', ], // is a Transaction Journal related event. - 'FireflyIII\Events\StoredTransactionJournal' => - [ - 'FireflyIII\Handlers\Events\StoredJournalEventHandler@scanBills', - 'FireflyIII\Handlers\Events\StoredJournalEventHandler@connectToPiggyBank', - 'FireflyIII\Handlers\Events\StoredJournalEventHandler@processRules', - ], + 'FireflyIII\Events\StoredTransactionJournal' => [ + 'FireflyIII\Handlers\Events\StoredJournalEventHandler@scanBills', + 'FireflyIII\Handlers\Events\StoredJournalEventHandler@connectToPiggyBank', + 'FireflyIII\Handlers\Events\StoredJournalEventHandler@processRules', + ], // is a Transaction Journal related event. - 'FireflyIII\Events\UpdatedTransactionJournal' => - [ - 'FireflyIII\Handlers\Events\UpdatedJournalEventHandler@scanBills', - 'FireflyIII\Handlers\Events\UpdatedJournalEventHandler@processRules', - ], - + 'FireflyIII\Events\UpdatedTransactionJournal' => [ + 'FireflyIII\Handlers\Events\UpdatedJournalEventHandler@scanBills', + 'FireflyIII\Handlers\Events\UpdatedJournalEventHandler@processRules', + ], ]; /** * Register any events for your application. - * - * @return void */ public function boot() { @@ -98,15 +89,14 @@ class EventServiceProvider extends ServiceProvider */ protected function registerCreateEvents() { - // move this routine to a filter // in case of repeated piggy banks and/or other problems. PiggyBank::created( function (PiggyBank $piggyBank) { $repetition = new PiggyBankRepetition; $repetition->piggyBank()->associate($piggyBank); - $repetition->startdate = is_null($piggyBank->startdate) ? null : $piggyBank->startdate; - $repetition->targetdate = is_null($piggyBank->targetdate) ? null : $piggyBank->targetdate; + $repetition->startdate = null === $piggyBank->startdate ? null : $piggyBank->startdate; + $repetition->targetdate = null === $piggyBank->targetdate ? null : $piggyBank->targetdate; $repetition->currentamount = 0; $repetition->save(); } @@ -125,7 +115,7 @@ class EventServiceProvider extends ServiceProvider foreach ($account->transactions()->get() as $transaction) { Log::debug('Now at transaction #' . $transaction->id); $journal = $transaction->transactionJournal()->first(); - if (!is_null($journal)) { + if (null !== $journal) { Log::debug('Call for deletion of journal #' . $journal->id); $journal->delete(); } diff --git a/app/Providers/ExportJobServiceProvider.php b/app/Providers/ExportJobServiceProvider.php index 5072d617a4..143d8daf07 100644 --- a/app/Providers/ExportJobServiceProvider.php +++ b/app/Providers/ExportJobServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\ExportJob\ExportJobRepository; @@ -32,16 +30,12 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class ExportJobServiceProvider - * - * @package FireflyIII\Providers + * Class ExportJobServiceProvider. */ class ExportJobServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { @@ -49,8 +43,6 @@ class ExportJobServiceProvider extends ServiceProvider /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 771f3a1ae7..398c45bd4a 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Providers; @@ -70,9 +69,7 @@ use TwigBridge\Extension\Loader\Functions; use Validator; /** - * Class FireflyServiceProvider - * - * @package FireflyIII\Providers + * Class FireflyServiceProvider. */ class FireflyServiceProvider extends ServiceProvider { diff --git a/app/Providers/FireflySessionProvider.php b/app/Providers/FireflySessionProvider.php index 114c569deb..7e70201de8 100644 --- a/app/Providers/FireflySessionProvider.php +++ b/app/Providers/FireflySessionProvider.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Providers; @@ -31,8 +30,6 @@ class FireflySessionProvider extends ServiceProvider { /** * Register the service provider. - * - * @return void */ public function register() { @@ -45,8 +42,6 @@ class FireflySessionProvider extends ServiceProvider /** * Register the session driver instance. - * - * @return void */ protected function registerSessionDriver() { @@ -63,8 +58,6 @@ class FireflySessionProvider extends ServiceProvider /** * Register the session manager instance. - * - * @return void */ protected function registerSessionManager() { diff --git a/app/Providers/JournalServiceProvider.php b/app/Providers/JournalServiceProvider.php index 03c22f3160..5ed46fffa0 100644 --- a/app/Providers/JournalServiceProvider.php +++ b/app/Providers/JournalServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Helpers\Collector\JournalCollector; @@ -34,26 +32,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class JournalServiceProvider - * - * @package FireflyIII\Providers + * Class JournalServiceProvider. */ class JournalServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { @@ -76,7 +67,6 @@ class JournalServiceProvider extends ServiceProvider $collector->setUser(auth()->user()); } - return $collector; } ); diff --git a/app/Providers/LogServiceProvider.php b/app/Providers/LogServiceProvider.php index 168a0a2e0b..bdfb6cc6bb 100644 --- a/app/Providers/LogServiceProvider.php +++ b/app/Providers/LogServiceProvider.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Providers; @@ -27,18 +26,14 @@ use Illuminate\Log\LogServiceProvider as LaravelLogServiceProvider; use Illuminate\Log\Writer; /** - * Class LogServiceProvider - * - * @package FireflyIII\Providers + * Class LogServiceProvider. */ class LogServiceProvider extends LaravelLogServiceProvider { /** * Configure the Monolog handlers for the application. * - * @param \Illuminate\Log\Writer $log - * - * @return void + * @param \Illuminate\Log\Writer $log */ protected function configureDailyHandler(Writer $log) { @@ -52,9 +47,7 @@ class LogServiceProvider extends LaravelLogServiceProvider /** * Configure the Monolog handlers for the application. * - * @param \Illuminate\Log\Writer $log - * - * @return void + * @param \Illuminate\Log\Writer $log */ protected function configureSingleHandler(Writer $log) { diff --git a/app/Providers/PiggyBankServiceProvider.php b/app/Providers/PiggyBankServiceProvider.php index b9f0569643..2655f5b522 100644 --- a/app/Providers/PiggyBankServiceProvider.php +++ b/app/Providers/PiggyBankServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\PiggyBank\PiggyBankRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class PiggyBankServiceProvider - * - * @package FireflyIII\Providers + * Class PiggyBankServiceProvider. */ class PiggyBankServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index a12f9ef45e..1be7d7c064 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - /** * RouteServiceProvider.php * Copyright (c) 2017 thegrumpydictator@gmail.com @@ -49,36 +47,26 @@ class RouteServiceProvider extends ServiceProvider /** * Define your route model bindings, pattern filters, etc. - * - * @return void */ public function boot() { - // - parent::boot(); } /** * Define the routes for the application. - * - * @return void */ public function map() { $this->mapApiRoutes(); $this->mapWebRoutes(); - - // } /** * Define the "api" routes for the application. * * These routes are typically stateless. - * - * @return void */ protected function mapApiRoutes() { @@ -92,8 +80,6 @@ class RouteServiceProvider extends ServiceProvider * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. - * - * @return void */ protected function mapWebRoutes() { diff --git a/app/Providers/RuleGroupServiceProvider.php b/app/Providers/RuleGroupServiceProvider.php index 54173feb0b..07c9ee2e0a 100644 --- a/app/Providers/RuleGroupServiceProvider.php +++ b/app/Providers/RuleGroupServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\RuleGroup\RuleGroupRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class RuleGroupServiceProvider - * - * @package FireflyIII\Providers + * Class RuleGroupServiceProvider. */ class RuleGroupServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/RuleServiceProvider.php b/app/Providers/RuleServiceProvider.php index 1af440b191..bf49190da9 100644 --- a/app/Providers/RuleServiceProvider.php +++ b/app/Providers/RuleServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\Rule\RuleRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class RuleServiceProvider - * - * @package FireflyIII\Providers + * Class RuleServiceProvider. */ class RuleServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/SearchServiceProvider.php b/app/Providers/SearchServiceProvider.php index d7fa9c6ec6..97c5072950 100644 --- a/app/Providers/SearchServiceProvider.php +++ b/app/Providers/SearchServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Support\Search\Search; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class SearchServiceProvider - * - * @package FireflyIII\Providers + * Class SearchServiceProvider. */ class SearchServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Providers/SessionServiceProvider.php b/app/Providers/SessionServiceProvider.php index 7cf1fbed69..7143eafff9 100644 --- a/app/Providers/SessionServiceProvider.php +++ b/app/Providers/SessionServiceProvider.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Providers; @@ -27,16 +26,12 @@ use FireflyIII\Http\Middleware\StartFireflySession; use Illuminate\Session\SessionServiceProvider as BaseSessionServiceProvider; /** - * Class SessionServiceProvider - * - * @package FireflyIII\Providers + * Class SessionServiceProvider. */ class SessionServiceProvider extends BaseSessionServiceProvider { /** * Register the service provider. - * - * @return void */ public function register() { diff --git a/app/Providers/TagServiceProvider.php b/app/Providers/TagServiceProvider.php index aac1d9c1f8..acbf9e18cd 100644 --- a/app/Providers/TagServiceProvider.php +++ b/app/Providers/TagServiceProvider.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Providers; use FireflyIII\Repositories\Tag\TagRepository; @@ -30,26 +28,19 @@ use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** - * Class TagServiceProvider - * - * @package FireflyIII\Providers + * Class TagServiceProvider. */ class TagServiceProvider extends ServiceProvider { /** * Bootstrap the application services. - * - * @return void */ public function boot() { - // } /** * Register the application services. - * - * @return void */ public function register() { diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index fac886b38a..a3641779a8 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII\Repositories\Account; use Carbon\Carbon; @@ -38,10 +36,7 @@ use Log; use Validator; /** - * - * Class AccountRepository - * - * @package FireflyIII\Repositories\Account + * Class AccountRepository. */ class AccountRepository implements AccountRepositoryInterface { @@ -53,7 +48,7 @@ class AccountRepository implements AccountRepositoryInterface private $validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType', 'accountNumber', 'currency_id', 'BIC']; /** - * Moved here from account CRUD + * Moved here from account CRUD. * * @param array $types * @@ -76,10 +71,10 @@ class AccountRepository implements AccountRepositoryInterface */ public function destroy(Account $account, Account $moveTo): bool { - if (!is_null($moveTo->id)) { + if (null !== $moveTo->id) { DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]); } - if (!is_null($account)) { + if (null !== $account) { $account->delete(); } @@ -102,7 +97,7 @@ class AccountRepository implements AccountRepositoryInterface ->orderBy('transaction_journals.order', 'ASC') ->orderBy('transaction_journals.id', 'DESC') ->first(['transaction_journals.date']); - if (!is_null($date)) { + if (null !== $date) { $last = new Carbon($date->date); } @@ -125,7 +120,7 @@ class AccountRepository implements AccountRepositoryInterface ->where('transaction_journals.user_id', $this->user->id) ->orderBy('transaction_journals.id', 'ASC') ->first(['transaction_journals.id']); - if (!is_null($first)) { + if (null !== $first) { return TransactionJournal::find(intval($first->id)); } @@ -142,7 +137,7 @@ class AccountRepository implements AccountRepositoryInterface public function oldestJournalDate(Account $account): Carbon { $journal = $this->oldestJournal($account); - if (is_null($journal->id)) { + if (null === $journal->id) { return new Carbon; } @@ -206,7 +201,7 @@ class AccountRepository implements AccountRepositoryInterface protected function deleteInitialBalance(Account $account) { $journal = $this->openingBalanceTransaction($account); - if (!is_null($journal->id)) { + if (null !== $journal->id) { $journal->delete(); } } @@ -222,7 +217,7 @@ class AccountRepository implements AccountRepositoryInterface ->where('transactions.account_id', $account->id) ->transactionTypes([TransactionType::OPENING_BALANCE]) ->first(['transaction_journals.*']); - if (is_null($journal)) { + if (null === $journal) { Log::debug('Could not find a opening balance journal, return empty one.'); return new TransactionJournal; @@ -236,6 +231,7 @@ class AccountRepository implements AccountRepositoryInterface * @param array $data * * @return Account + * * @throws FireflyException */ protected function storeAccount(array $data): Account @@ -245,13 +241,13 @@ class AccountRepository implements AccountRepositoryInterface $accountType = AccountType::whereType($type)->first(); $data['iban'] = $this->filterIban($data['iban']); // verify account type - if (is_null($accountType)) { + if (null === $accountType) { throw new FireflyException(sprintf('Account type "%s" is invalid. Cannot create account.', $data['accountType'])); } // account may exist already: $existingAccount = $this->findByName($data['name'], [$type]); - if (!is_null($existingAccount->id)) { + if (null !== $existingAccount->id) { Log::warning(sprintf('There already is an account named "%s" of type "%s".', $data['name'], $type)); return $existingAccount; @@ -264,14 +260,14 @@ class AccountRepository implements AccountRepositoryInterface 'account_type_id' => $accountType->id, 'name' => $data['name'], 'virtual_balance' => $data['virtualBalance'], - 'active' => $data['active'] === true ? true : false, + 'active' => true === $data['active'] ? true : false, 'iban' => $data['iban'], ]; $newAccount = new Account($databaseData); Log::debug('Final account creation dataset', $databaseData); $newAccount->save(); // verify its creation: - if (is_null($newAccount->id)) { + if (null === $newAccount->id) { Log::error( sprintf('Could not create account "%s" (%d error(s))', $data['name'], $newAccount->getErrors()->count()), $newAccount->getErrors()->toArray() @@ -296,7 +292,7 @@ class AccountRepository implements AccountRepositoryInterface $amount = strval($data['openingBalance']); Log::debug(sprintf('Submitted amount is %s', $amount)); - if (bccomp($amount, '0') === 0) { + if (0 === bccomp($amount, '0')) { return new TransactionJournal; } @@ -340,7 +336,7 @@ class AccountRepository implements AccountRepositoryInterface 'transaction_currency_id' => $currencyId, ] ); - $one->save();// first transaction: from + $one->save(); // first transaction: from $two = new Transaction( [ @@ -376,7 +372,6 @@ class AccountRepository implements AccountRepositoryInterface } /** - * * @param Account $account * @param array $data * @@ -388,14 +383,14 @@ class AccountRepository implements AccountRepositoryInterface $openingBalance = $this->openingBalanceTransaction($account); // no opening balance journal? create it: - if (is_null($openingBalance->id)) { + if (null === $openingBalance->id) { Log::debug('No opening balance journal yet, create journal.'); $this->storeInitialBalance($account, $data); return true; } // opening balance data? update it! - if (!is_null($openingBalance->id)) { + if (null !== $openingBalance->id) { Log::debug('Opening balance journal found, update journal.'); $this->updateOpeningBalanceJournal($account, $openingBalance, $data); @@ -408,7 +403,6 @@ class AccountRepository implements AccountRepositoryInterface /** * @param Account $account * @param array $data - * */ protected function updateMetadata(Account $account, array $data) { @@ -417,7 +411,7 @@ class AccountRepository implements AccountRepositoryInterface $entry = $account->accountMeta()->where('name', $field)->first(); // if $data has field and $entry is null, create new one: - if (isset($data[$field]) && is_null($entry)) { + if (isset($data[$field]) && null === $entry) { Log::debug( sprintf( 'Created meta-field "%s":"%s" for account #%d ("%s") ', @@ -437,7 +431,7 @@ class AccountRepository implements AccountRepositoryInterface } // if $data has field and $entry is not null, update $entry: - if (isset($data[$field]) && !is_null($entry)) { + if (isset($data[$field]) && null !== $entry) { $entry->data = $data[$field]; $entry->save(); Log::debug( @@ -468,7 +462,7 @@ class AccountRepository implements AccountRepositoryInterface Log::debug(sprintf('Submitted amount for opening balance to update is %s', $amount)); - if (bccomp($amount, '0') === 0) { + if (0 === bccomp($amount, '0')) { $journal->delete(); return true; @@ -500,7 +494,6 @@ class AccountRepository implements AccountRepositoryInterface return true; } - /** * @param array $data * @@ -509,7 +502,7 @@ class AccountRepository implements AccountRepositoryInterface protected function validOpeningBalanceData(array $data): bool { $data['openingBalance'] = strval($data['openingBalance'] ?? ''); - if (isset($data['openingBalance']) && !is_null($data['openingBalance']) && strlen($data['openingBalance']) > 0 + if (isset($data['openingBalance']) && null !== $data['openingBalance'] && strlen($data['openingBalance']) > 0 && isset($data['openingBalanceDate'])) { Log::debug('Array has valid opening balance data.'); @@ -527,7 +520,7 @@ class AccountRepository implements AccountRepositoryInterface */ private function filterIban(?string $iban) { - if (is_null($iban)) { + if (null === $iban) { return null; } $data = ['iban' => $iban]; diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 7457bbcc39..05b4ae3aa0 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Account; @@ -30,13 +29,10 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface AccountRepositoryInterface - * - * @package FireflyIII\Repositories\Account + * Interface AccountRepositoryInterface. */ interface AccountRepositoryInterface { - /** * Moved here from account CRUD. * diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index 292ed3f030..04b5c18f84 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Account; @@ -33,9 +32,7 @@ use Log; use Steam; /** - * Class AccountTasker - * - * @package FireflyIII\Repositories\Account + * Class AccountTasker. */ class AccountTasker implements AccountTaskerInterface { @@ -83,7 +80,7 @@ class AccountTasker implements AccountTaskerInterface $entry['end_balance'] = $endSet[$account->id] ?? '0'; // first journal exists, and is on start, then this is the actual opening balance: - if (!is_null($first->id) && $first->date->isSameDay($start)) { + if (null !== $first->id && $first->date->isSameDay($start)) { Log::debug(sprintf('Date of first journal for %s is %s', $account->name, $first->date->format('Y-m-d'))); $entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount; Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $start->format('Y-m-d'), $entry['start_balance'])); @@ -162,7 +159,7 @@ class AccountTasker implements AccountTaskerInterface $transactions = $transactions->filter( function (Transaction $transaction) { // return positive amounts only. - if (bccomp($transaction->transaction_amount, '0') === 1) { + if (1 === bccomp($transaction->transaction_amount, '0')) { return $transaction; } @@ -213,7 +210,7 @@ class AccountTasker implements AccountTaskerInterface ]; } $expenses[$opposingId]['sum'] = bcadd($expenses[$opposingId]['sum'], $transaction->transaction_amount); - $expenses[$opposingId]['count']++; + ++$expenses[$opposingId]['count']; } // do averages: $keys = array_keys($expenses); @@ -223,7 +220,6 @@ class AccountTasker implements AccountTaskerInterface } } - return $expenses; } } diff --git a/app/Repositories/Account/AccountTaskerInterface.php b/app/Repositories/Account/AccountTaskerInterface.php index f3b4e6fca3..3e3f022a68 100644 --- a/app/Repositories/Account/AccountTaskerInterface.php +++ b/app/Repositories/Account/AccountTaskerInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Account; @@ -28,9 +27,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface AccountTaskerInterface - * - * @package FireflyIII\Repositories\Account + * Interface AccountTaskerInterface. */ interface AccountTaskerInterface { diff --git a/app/Repositories/Account/FindAccountsTrait.php b/app/Repositories/Account/FindAccountsTrait.php index e040ee8408..7a06298410 100644 --- a/app/Repositories/Account/FindAccountsTrait.php +++ b/app/Repositories/Account/FindAccountsTrait.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Account; @@ -34,8 +33,6 @@ use Log; * @property User $user * * Trait FindAccountsTrait - * - * @package FireflyIII\Repositories\Account */ trait FindAccountsTrait { @@ -47,7 +44,7 @@ trait FindAccountsTrait public function find(int $accountId): Account { $account = $this->user->accounts()->find($accountId); - if (is_null($account)) { + if (null === $account) { return new Account; } diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index d3b2e73008..a0e62e508e 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Attachment; @@ -33,9 +32,7 @@ use Log; use Storage; /** - * Class AttachmentRepository - * - * @package FireflyIII\Repositories\Attachment + * Class AttachmentRepository. */ class AttachmentRepository implements AttachmentRepositoryInterface { @@ -80,7 +77,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface public function find(int $id): Attachment { $attachment = $this->user->attachments()->find($id); - if (is_null($attachment)) { + if (null === $attachment) { return new Attachment; } @@ -95,7 +92,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface public function findWithoutUser(int $id): Attachment { $attachment = Attachment::find($id); - if (is_null($attachment)) { + if (null === $attachment) { return new Attachment; } diff --git a/app/Repositories/Attachment/AttachmentRepositoryInterface.php b/app/Repositories/Attachment/AttachmentRepositoryInterface.php index 7decdab90d..bf15bbea35 100644 --- a/app/Repositories/Attachment/AttachmentRepositoryInterface.php +++ b/app/Repositories/Attachment/AttachmentRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Attachment; @@ -29,13 +28,10 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface AttachmentRepositoryInterface - * - * @package FireflyIII\Repositories\Attachment + * Interface AttachmentRepositoryInterface. */ interface AttachmentRepositoryInterface { - /** * @param Attachment $attachment * diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index ee77dbc9fa..f51f3b5fd4 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Bill; @@ -37,13 +36,10 @@ use Log; use Navigation; /** - * Class BillRepository - * - * @package FireflyIII\Repositories\Bill + * Class BillRepository. */ class BillRepository implements BillRepositoryInterface { - /** @var User */ private $user; @@ -69,7 +65,7 @@ class BillRepository implements BillRepositoryInterface public function find(int $billId): Bill { $bill = $this->user->bills()->find($billId); - if (is_null($bill)) { + if (null === $bill) { $bill = new Bill; } @@ -156,7 +152,7 @@ class BillRepository implements BillRepositoryInterface 'bills.automatch', 'bills.active', 'bills.name_encrypted', - 'bills.match_encrypted']; + 'bills.match_encrypted',]; $ids = $accounts->pluck('id')->toArray(); $set = $this->user->bills() ->leftJoin( @@ -178,7 +174,7 @@ class BillRepository implements BillRepositoryInterface $set = $set->sortBy( function (Bill $bill) { - $int = $bill->active === 1 ? 0 : 1; + $int = 1 === $bill->active ? 0 : 1; return $int . strtolower($bill->name); } @@ -300,9 +296,7 @@ class BillRepository implements BillRepositoryInterface $set = new Collection; Log::debug(sprintf('Now at bill "%s" (%s)', $bill->name, $bill->repeat_freq)); - /* - * Start at 2016-10-01, see when we expect the bill to hit: - */ + // Start at 2016-10-01, see when we expect the bill to hit: $currentStart = clone $start; Log::debug(sprintf('First currentstart is %s', $currentStart->format('Y-m-d'))); @@ -310,9 +304,7 @@ class BillRepository implements BillRepositoryInterface Log::debug(sprintf('Currentstart is now %s.', $currentStart->format('Y-m-d'))); $nextExpectedMatch = $this->nextDateMatch($bill, $currentStart); Log::debug(sprintf('Next Date match after %s is %s', $currentStart->format('Y-m-d'), $nextExpectedMatch->format('Y-m-d'))); - /* - * If nextExpectedMatch is after end, we continue: - */ + // If nextExpectedMatch is after end, we continue: if ($nextExpectedMatch > $end) { Log::debug( sprintf('nextExpectedMatch %s is after %s, so we skip this bill now.', $nextExpectedMatch->format('Y-m-d'), $end->format('Y-m-d')) @@ -337,7 +329,6 @@ class BillRepository implements BillRepositoryInterface ); Log::debug(sprintf('Found dates between %s and %s:', $start->format('Y-m-d'), $end->format('Y-m-d')), $simple->toArray()); - return $set; } @@ -482,9 +473,7 @@ class BillRepository implements BillRepositoryInterface */ public function scan(Bill $bill, TransactionJournal $journal): bool { - /* - * Can only support withdrawals. - */ + // Can only support withdrawals. if (false === $journal->isWithdrawal()) { return false; } @@ -498,10 +487,7 @@ class BillRepository implements BillRepositoryInterface $wordMatch = $this->doWordMatch($matches, $description); $amountMatch = $this->doAmountMatch($journal->amountPositive(), $bill->amount_min, $bill->amount_max); - - /* - * If both, update! - */ + // If both, update! if ($wordMatch && $amountMatch) { $journal->bill()->associate($bill); $journal->save(); @@ -547,7 +533,6 @@ class BillRepository implements BillRepositoryInterface 'skip' => $data['skip'], 'automatch' => $data['automatch'], 'active' => $data['active'], - ] ); @@ -603,8 +588,8 @@ class BillRepository implements BillRepositoryInterface $wordMatch = false; $count = 0; foreach ($matches as $word) { - if (!(strpos($description, strtolower($word)) === false)) { - $count++; + if (!(false === strpos($description, strtolower($word)))) { + ++$count; } } if ($count >= count($matches)) { diff --git a/app/Repositories/Bill/BillRepositoryInterface.php b/app/Repositories/Bill/BillRepositoryInterface.php index 0705dba846..acc5b9b977 100644 --- a/app/Repositories/Bill/BillRepositoryInterface.php +++ b/app/Repositories/Bill/BillRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Bill; @@ -30,9 +29,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface BillRepositoryInterface - * - * @package FireflyIII\Repositories\Bill + * Interface BillRepositoryInterface. */ interface BillRepositoryInterface { diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 9a8ed2f65a..e4be053696 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Budget; @@ -42,9 +41,7 @@ use Navigation; use stdClass; /** - * Class BudgetRepository - * - * @package FireflyIII\Repositories\Budget + * Class BudgetRepository. */ class BudgetRepository implements BudgetRepositoryInterface { @@ -133,7 +130,7 @@ class BudgetRepository implements BudgetRepositoryInterface } /** - * Filters entries from the result set generated by getBudgetPeriodReport + * Filters entries from the result set generated by getBudgetPeriodReport. * * @param Collection $set * @param int $budgetId @@ -155,7 +152,7 @@ class BudgetRepository implements BudgetRepositoryInterface } ); $amount = '0'; - if (!is_null($result->first())) { + if (null !== $result->first()) { $amount = $result->first()->sum_of_period; } @@ -175,7 +172,7 @@ class BudgetRepository implements BudgetRepositoryInterface public function find(int $budgetId): Budget { $budget = $this->user->budgets()->find($budgetId); - if (is_null($budget)) { + if (null === $budget) { $budget = new Budget; } @@ -214,7 +211,7 @@ class BudgetRepository implements BudgetRepositoryInterface { $oldest = Carbon::create()->startOfYear(); $journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first(); - if (!is_null($journal)) { + if (null !== $journal) { $oldest = $journal->date < $oldest ? $journal->date : $oldest; } @@ -222,7 +219,7 @@ class BudgetRepository implements BudgetRepositoryInterface ->transactions() ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.id') ->orderBy('transaction_journals.date', 'ASC')->first(['transactions.*', 'transaction_journals.date']); - if (!is_null($transaction)) { + if (null !== $transaction) { $carbon = new Carbon($transaction->date); $oldest = $carbon < $oldest ? $carbon : $oldest; } @@ -303,7 +300,7 @@ class BudgetRepository implements BudgetRepositoryInterface ->where('transaction_currency_id', $currency->id) ->where('start_date', $start->format('Y-m-d')) ->where('end_date', $end->format('Y-m-d'))->first(); - if (!is_null($availableBudget)) { + if (null !== $availableBudget) { $amount = strval($availableBudget->amount); } @@ -478,7 +475,7 @@ class BudgetRepository implements BudgetRepositoryInterface ->where('transaction_currency_id', $currency->id) ->where('start_date', $start->format('Y-m-d')) ->where('end_date', $end->format('Y-m-d'))->first(); - if (is_null($availableBudget)) { + if (null === $availableBudget) { $availableBudget = new AvailableBudget; $availableBudget->user()->associate($this->user); $availableBudget->transactionCurrency()->associate($currency); @@ -517,7 +514,7 @@ class BudgetRepository implements BudgetRepositoryInterface if ($accounts->count() > 0) { $collector->setAccounts($accounts); } - if ($accounts->count() === 0) { + if (0 === $accounts->count()) { $collector->setAllAssetAccounts(); } @@ -544,7 +541,7 @@ class BudgetRepository implements BudgetRepositoryInterface if ($accounts->count() > 0) { $collector->setAccounts($accounts); } - if ($accounts->count() === 0) { + if (0 === $accounts->count()) { $collector->setAllAssetAccounts(); } @@ -621,7 +618,7 @@ class BudgetRepository implements BudgetRepositoryInterface ->first(['budget_limits.*']); // if more than 1 limit found, delete the others: - if ($limits > 1 && !is_null($limit)) { + if ($limits > 1 && null !== $limit) { $budget->budgetlimits() ->where('budget_limits.start_date', $start->format('Y-m-d')) ->where('budget_limits.end_date', $end->format('Y-m-d')) @@ -629,13 +626,13 @@ class BudgetRepository implements BudgetRepositoryInterface } // delete if amount is zero. - if (!is_null($limit) && $amount <= 0.0) { + if (null !== $limit && $amount <= 0.0) { $limit->delete(); return new BudgetLimit; } // update if exists: - if (!is_null($limit)) { + if (null !== $limit) { $limit->amount = $amount; $limit->save(); diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index e419a0b0f0..ee4a15d9d2 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Budget; @@ -31,9 +30,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface BudgetRepositoryInterface - * - * @package FireflyIII\Repositories\Budget + * Interface BudgetRepositoryInterface. */ interface BudgetRepositoryInterface { @@ -62,7 +59,7 @@ interface BudgetRepositoryInterface public function destroy(Budget $budget): bool; /** - * Filters entries from the result set generated by getBudgetPeriodReport + * Filters entries from the result set generated by getBudgetPeriodReport. * * @param Collection $set * @param int $budgetId @@ -132,7 +129,6 @@ interface BudgetRepositoryInterface public function getBudgetLimits(Budget $budget, Carbon $start, Carbon $end): Collection; /** - * * @param Collection $budgets * @param Collection $accounts * @param Carbon $start diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 7c6f1e6f88..659e5dde38 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Category; @@ -34,9 +33,7 @@ use Log; use Navigation; /** - * Class CategoryRepository - * - * @package FireflyIII\Repositories\Category + * Class CategoryRepository. */ class CategoryRepository implements CategoryRepositoryInterface { @@ -76,7 +73,7 @@ class CategoryRepository implements CategoryRepositoryInterface } /** - * Find a category + * Find a category. * * @param int $categoryId * @@ -85,7 +82,7 @@ class CategoryRepository implements CategoryRepositoryInterface public function find(int $categoryId): Category { $category = $this->user->categories()->find($categoryId); - if (is_null($category)) { + if (null === $category) { $category = new Category; } @@ -93,7 +90,7 @@ class CategoryRepository implements CategoryRepositoryInterface } /** - * Find a category + * Find a category. * * @param string $name * @@ -121,13 +118,13 @@ class CategoryRepository implements CategoryRepositoryInterface $firstJournalDate = $this->getFirstJournalDate($category); $firstTransactionDate = $this->getFirstTransactionDate($category); - if (is_null($firstTransactionDate) && is_null($firstJournalDate)) { + if (null === $firstTransactionDate && null === $firstJournalDate) { return null; } - if (is_null($firstTransactionDate)) { + if (null === $firstTransactionDate) { return $firstJournalDate; } - if (is_null($firstJournalDate)) { + if (null === $firstJournalDate) { return $firstTransactionDate; } @@ -167,13 +164,13 @@ class CategoryRepository implements CategoryRepositoryInterface $lastJournalDate = $this->getLastJournalDate($category, $accounts); $lastTransactionDate = $this->getLastTransactionDate($category, $accounts); - if (is_null($lastTransactionDate) && is_null($lastJournalDate)) { + if (null === $lastTransactionDate && null === $lastJournalDate) { return null; } - if (is_null($lastTransactionDate)) { + if (null === $lastTransactionDate) { return $lastJournalDate; } - if (is_null($lastJournalDate)) { + if (null === $lastJournalDate) { return $lastTransactionDate; } @@ -218,7 +215,7 @@ class CategoryRepository implements CategoryRepositoryInterface /** @var Transaction $transaction */ foreach ($transactions as $transaction) { // if positive, skip: - if (bccomp($transaction->transaction_amount, '0') === 1) { + if (1 === bccomp($transaction->transaction_amount, '0')) { continue; } $categoryId = max(intval($transaction->transaction_journal_category_id), intval($transaction->transaction_category_id)); @@ -253,7 +250,7 @@ class CategoryRepository implements CategoryRepositoryInterface foreach ($transactions as $transaction) { // if positive, skip: - if (bccomp($transaction->transaction_amount, '0') === 1) { + if (1 === bccomp($transaction->transaction_amount, '0')) { continue; } $date = $transaction->date->format($carbonFormat); @@ -336,7 +333,6 @@ class CategoryRepository implements CategoryRepositoryInterface ]; Log::debug('Looping transactions..'); foreach ($transactions as $transaction) { - // if negative, skip: if (bccomp($transaction->transaction_amount, '0') === -1) { continue; @@ -377,15 +373,13 @@ class CategoryRepository implements CategoryRepositoryInterface $collector->setUser($this->user); $collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setCategories($categories); - if ($accounts->count() > 0) { $collector->setAccounts($accounts); } - if ($accounts->count() === 0) { + if (0 === $accounts->count()) { $collector->setAllAssetAccounts(); } - $set = $collector->getJournals(); $sum = strval($set->sum('transaction_amount')); @@ -409,7 +403,7 @@ class CategoryRepository implements CategoryRepositoryInterface if ($accounts->count() > 0) { $collector->setAccounts($accounts); } - if ($accounts->count() === 0) { + if (0 === $accounts->count()) { $collector->setAllAssetAccounts(); } @@ -472,7 +466,7 @@ class CategoryRepository implements CategoryRepositoryInterface $query = $category->transactionJournals()->orderBy('date', 'ASC'); $result = $query->first(['transaction_journals.*']); - if (!is_null($result)) { + if (null !== $result) { return $result->date; } @@ -492,7 +486,7 @@ class CategoryRepository implements CategoryRepositoryInterface ->orderBy('transaction_journals.date', 'DESC'); $lastTransaction = $query->first(['transaction_journals.*']); - if (!is_null($lastTransaction)) { + if (null !== $lastTransaction) { return new Carbon($lastTransaction->date); } @@ -516,7 +510,7 @@ class CategoryRepository implements CategoryRepositoryInterface $result = $query->first(['transaction_journals.*']); - if (!is_null($result)) { + if (null !== $result) { return $result->date; } @@ -541,7 +535,7 @@ class CategoryRepository implements CategoryRepositoryInterface } $lastTransaction = $query->first(['transaction_journals.*']); - if (!is_null($lastTransaction)) { + if (null !== $lastTransaction) { return new Carbon($lastTransaction->date); } diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index 7dc423800b..2444678ca5 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Category; @@ -29,9 +28,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface CategoryRepositoryInterface - * - * @package FireflyIII\Repositories\Category + * Interface CategoryRepositoryInterface. */ interface CategoryRepositoryInterface { @@ -53,7 +50,7 @@ interface CategoryRepositoryInterface public function earnedInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string; /** - * Find a category + * Find a category. * * @param int $categoryId * @@ -62,7 +59,7 @@ interface CategoryRepositoryInterface public function find(int $categoryId): Category; /** - * Find a category + * Find a category. * * @param string $name * diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index eda842ccdd..0edb00f25a 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Currency; @@ -33,9 +32,7 @@ use Log; use Preferences; /** - * Class CurrencyRepository - * - * @package FireflyIII\Repositories\Currency + * Class CurrencyRepository. */ class CurrencyRepository implements CurrencyRepositoryInterface { @@ -54,7 +51,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } // is the only currency left - if ($this->get()->count() === 1) { + if (1 === $this->get()->count()) { return false; } @@ -99,7 +96,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } /** - * Find by ID + * Find by ID. * * @param int $currencyId * @@ -108,7 +105,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface public function find(int $currencyId): TransactionCurrency { $currency = TransactionCurrency::find($currencyId); - if (is_null($currency)) { + if (null === $currency) { $currency = new TransactionCurrency; } @@ -116,7 +113,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } /** - * Find by currency code + * Find by currency code. * * @param string $currencyCode * @@ -125,7 +122,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface public function findByCode(string $currencyCode): TransactionCurrency { $currency = TransactionCurrency::where('code', $currencyCode)->first(); - if (is_null($currency)) { + if (null === $currency) { $currency = new TransactionCurrency; } @@ -133,7 +130,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } /** - * Find by currency name + * Find by currency name. * * @param string $currencyName * @@ -142,7 +139,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface public function findByName(string $currencyName): TransactionCurrency { $preferred = TransactionCurrency::whereName($currencyName)->first(); - if (is_null($preferred)) { + if (null === $preferred) { $preferred = new TransactionCurrency; } @@ -150,7 +147,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } /** - * Find by currency symbol + * Find by currency symbol. * * @param string $currencySymbol * @@ -159,7 +156,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface public function findBySymbol(string $currencySymbol): TransactionCurrency { $currency = TransactionCurrency::whereSymbol($currencySymbol)->first(); - if (is_null($currency)) { + if (null === $currency) { $currency = new TransactionCurrency; } @@ -192,7 +189,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface public function getCurrencyByPreference(Preference $preference): TransactionCurrency { $preferred = TransactionCurrency::where('code', $preference->data)->first(); - if (is_null($preferred)) { + if (null === $preferred) { $preferred = TransactionCurrency::first(); } @@ -220,7 +217,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface ->where('from_currency_id', $fromCurrency->id) ->where('to_currency_id', $toCurrency->id) ->where('date', $date->format('Y-m-d'))->first(); - if (!is_null($rate)) { + if (null !== $rate) { Log::debug(sprintf('Found cached exchange rate in database for %s to %s on %s', $fromCurrency->code, $toCurrency->code, $date->format('Y-m-d'))); return $rate; diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php index 1e6982e63a..233e59044a 100644 --- a/app/Repositories/Currency/CurrencyRepositoryInterface.php +++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Currency; @@ -31,9 +30,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface CurrencyRepositoryInterface - * - * @package FireflyIII\Repositories\Currency + * Interface CurrencyRepositoryInterface. */ interface CurrencyRepositoryInterface { @@ -59,7 +56,7 @@ interface CurrencyRepositoryInterface public function destroy(TransactionCurrency $currency): bool; /** - * Find by ID + * Find by ID. * * @param int $currencyId * @@ -68,7 +65,7 @@ interface CurrencyRepositoryInterface public function find(int $currencyId): TransactionCurrency; /** - * Find by currency code + * Find by currency code. * * @param string $currencyCode * @@ -77,7 +74,7 @@ interface CurrencyRepositoryInterface public function findByCode(string $currencyCode): TransactionCurrency; /** - * Find by currency name + * Find by currency name. * * @param string $currencyName * @@ -86,7 +83,7 @@ interface CurrencyRepositoryInterface public function findByName(string $currencyName): TransactionCurrency; /** - * Find by currency symbol + * Find by currency symbol. * * @param string $currencySymbol * diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index 73a5306109..85fc0cb189 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\ExportJob; @@ -31,9 +30,7 @@ use Log; use Storage; /** - * Class ExportJobRepository - * - * @package FireflyIII\Repositories\ExportJob + * Class ExportJobRepository. */ class ExportJobRepository implements ExportJobRepositoryInterface { @@ -91,7 +88,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface while ($count < 30) { $key = Str::random(12); $existing = $this->findByKey($key); - if (is_null($existing->id)) { + if (null === $existing->id) { $exportJob = new ExportJob; $exportJob->user()->associate($this->user); $exportJob->key = Str::random(12); @@ -102,7 +99,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface return $exportJob; } - $count++; + ++$count; } return new ExportJob; @@ -129,7 +126,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface public function findByKey(string $key): ExportJob { $result = $this->user->exportJobs()->where('key', $key)->first(['export_jobs.*']); - if (is_null($result)) { + if (null === $result) { return new ExportJob; } diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php index 6e513e57a2..34c1eb3b29 100644 --- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php +++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\ExportJob; @@ -27,9 +26,7 @@ use FireflyIII\Models\ExportJob; use FireflyIII\User; /** - * Interface ExportJobRepositoryInterface - * - * @package FireflyIII\Repositories\ExportJob + * Interface ExportJobRepositoryInterface. */ interface ExportJobRepositoryInterface { diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php index 38f900d938..c3bef54aee 100644 --- a/app/Repositories/ImportJob/ImportJobRepository.php +++ b/app/Repositories/ImportJob/ImportJobRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\ImportJob; @@ -35,9 +34,7 @@ use Storage; use Symfony\Component\HttpFoundation\File\UploadedFile; /** - * Class ImportJobRepository - * - * @package FireflyIII\Repositories\ImportJob + * Class ImportJobRepository. */ class ImportJobRepository implements ImportJobRepositoryInterface { @@ -48,6 +45,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface * @param string $fileType * * @return ImportJob + * * @throws FireflyException */ public function create(string $fileType): ImportJob @@ -62,7 +60,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface while ($count < 30) { $key = Str::random(12); $existing = $this->findByKey($key); - if (is_null($existing->id)) { + if (null === $existing->id) { $importJob = new ImportJob; $importJob->user()->associate($this->user); $importJob->file_type = $fileType; @@ -80,7 +78,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface // breaks the loop: return $importJob; } - $count++; + ++$count; } return new ImportJob; @@ -94,7 +92,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface public function findByKey(string $key): ImportJob { $result = $this->user->importJobs()->where('key', $key)->first(['import_jobs.*']); - if (is_null($result)) { + if (null === $result) { return new ImportJob; } @@ -122,7 +120,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface $configRaw = $configFileObject->fread($configFileObject->getSize()); $configuration = json_decode($configRaw, true); - if (!is_null($configuration) && is_array($configuration)) { + if (null !== $configuration && is_array($configuration)) { Log::debug('Found configuration', $configuration); $this->setConfiguration($job, $configuration); } @@ -147,7 +145,6 @@ class ImportJobRepository implements ImportJobRepositoryInterface $contentEncrypted = Crypt::encrypt($content); $disk = Storage::disk('upload'); - // user is demo user, replace upload with prepared file. if ($repository->hasRole($this->user, 'demo')) { $stubsDisk = Storage::disk('stubs'); diff --git a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php index 91d2d5449a..ad74c4e021 100644 --- a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php +++ b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\ImportJob; @@ -28,9 +27,7 @@ use FireflyIII\User; use Symfony\Component\HttpFoundation\File\UploadedFile; /** - * Interface ImportJobRepositoryInterface - * - * @package FireflyIII\Repositories\ImportJob + * Interface ImportJobRepositoryInterface. */ interface ImportJobRepositoryInterface { diff --git a/app/Repositories/Journal/CreateJournalsTrait.php b/app/Repositories/Journal/CreateJournalsTrait.php index cac82799ef..e9b9e1be87 100644 --- a/app/Repositories/Journal/CreateJournalsTrait.php +++ b/app/Repositories/Journal/CreateJournalsTrait.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Journal; @@ -39,8 +38,6 @@ use Log; * @property User $user * * Trait CreateJournalsTrait - * - * @package FireflyIII\Repositories\Journal */ trait CreateJournalsTrait { @@ -54,7 +51,6 @@ trait CreateJournalsTrait abstract public function storeAccounts(User $user, TransactionType $type, array $data): array; /** - * * * Remember: a balancingAct takes at most one expense and one transfer. * an advancePayment takes at most one expense, infinite deposits and NO transfers. * @@ -71,7 +67,7 @@ trait CreateJournalsTrait foreach ($array as $name) { if (strlen(trim($name)) > 0) { $tag = Tag::firstOrCreateEncrypted(['tag' => $name, 'user_id' => $journal->user_id]); - if (!is_null($tag)) { + if (null !== $tag) { Log::debug(sprintf('Will try to connect tag #%d to journal #%d.', $tag->id, $journal->id)); $tagRepository->connect($journal, $tag); } @@ -87,7 +83,7 @@ trait CreateJournalsTrait */ protected function storeBudgetWithTransaction(Transaction $transaction, int $budgetId) { - if (intval($budgetId) > 0 && $transaction->transactionJournal->transactionType->type !== TransactionType::TRANSFER) { + if (intval($budgetId) > 0 && TransactionType::TRANSFER !== $transaction->transactionJournal->transactionType->type) { /** @var \FireflyIII\Models\Budget $budget */ $budget = Budget::find($budgetId); $transaction->budgets()->save($budget); @@ -123,7 +119,7 @@ trait CreateJournalsTrait // store transaction one way: $amount = bcmul(strval($transaction['amount']), '-1'); - $foreignAmount = is_null($transaction['foreign_amount']) ? null : bcmul(strval($transaction['foreign_amount']), '-1'); + $foreignAmount = null === $transaction['foreign_amount'] ? null : bcmul(strval($transaction['foreign_amount']), '-1'); $one = $this->storeTransaction( [ 'journal' => $journal, @@ -143,7 +139,7 @@ trait CreateJournalsTrait // and the other way: $amount = strval($transaction['amount']); - $foreignAmount = is_null($transaction['foreign_amount']) ? null : strval($transaction['foreign_amount']); + $foreignAmount = null === $transaction['foreign_amount'] ? null : strval($transaction['foreign_amount']); $two = $this->storeTransaction( [ 'journal' => $journal, @@ -182,11 +178,10 @@ trait CreateJournalsTrait 'identifier' => $data['identifier'], ]; - - if (is_null($data['foreign_currency_id'])) { + if (null === $data['foreign_currency_id']) { unset($fields['foreign_currency_id']); } - if (is_null($data['foreign_amount'])) { + if (null === $data['foreign_amount']) { unset($fields['foreign_amount']); } @@ -195,18 +190,17 @@ trait CreateJournalsTrait Log::debug(sprintf('Transaction stored with ID: %s', $transaction->id)); - if (!is_null($data['category'])) { + if (null !== $data['category']) { $transaction->categories()->save($data['category']); } - if (!is_null($data['budget'])) { + if (null !== $data['budget']) { $transaction->categories()->save($data['budget']); } return $transaction; } - /** * @param TransactionJournal $journal * @param string $note @@ -215,16 +209,16 @@ trait CreateJournalsTrait */ protected function updateNote(TransactionJournal $journal, string $note): bool { - if (strlen($note) === 0) { + if (0 === strlen($note)) { $dbNote = $journal->notes()->first(); - if (!is_null($dbNote)) { + if (null !== $dbNote) { $dbNote->delete(); } return true; } $dbNote = $journal->notes()->first(); - if (is_null($dbNote)) { + if (null === $dbNote) { $dbNote = new Note(); $dbNote->noteable()->associate($journal); } diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index 8c99fa16b9..2e03e96231 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Journal; @@ -34,9 +33,7 @@ use Log; use Preferences; /** - * Class JournalRepository - * - * @package FireflyIII\Repositories\Journal + * Class JournalRepository. */ class JournalRepository implements JournalRepositoryInterface { @@ -64,7 +61,7 @@ class JournalRepository implements JournalRepositoryInterface $messages->add('destination_account_expense', trans('firefly.invalid_convert_selection')); $messages->add('source_account_asset', trans('firefly.invalid_convert_selection')); - if ($source->id === $destination->id || is_null($source->id) || is_null($destination->id)) { + if ($source->id === $destination->id || null === $source->id || null === $destination->id) { return $messages; } @@ -78,7 +75,7 @@ class JournalRepository implements JournalRepositoryInterface $journal->save(); // if journal is a transfer now, remove budget: - if ($type->type === TransactionType::TRANSFER) { + if (TransactionType::TRANSFER === $type->type) { $journal->budgets()->detach(); } @@ -117,7 +114,7 @@ class JournalRepository implements JournalRepositoryInterface public function find(int $journalId): TransactionJournal { $journal = $this->user->transactionJournals()->where('id', $journalId)->first(); - if (is_null($journal)) { + if (null === $journal) { return new TransactionJournal; } @@ -157,7 +154,7 @@ class JournalRepository implements JournalRepositoryInterface } /** - * Get users first transaction journal + * Get users first transaction journal. * * @return TransactionJournal */ @@ -165,7 +162,7 @@ class JournalRepository implements JournalRepositoryInterface { $entry = $this->user->transactionJournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']); - if (is_null($entry)) { + if (null === $entry) { return new TransactionJournal; } @@ -187,7 +184,7 @@ class JournalRepository implements JournalRepositoryInterface */ public function isTransfer(TransactionJournal $journal): bool { - return $journal->transactionType->type === TransactionType::TRANSFER; + return TransactionType::TRANSFER === $journal->transactionType->type; } /** @@ -200,7 +197,7 @@ class JournalRepository implements JournalRepositoryInterface Log::debug(sprintf('Going to reconcile transaction #%d', $transaction->id)); $opposing = $this->findOpposingTransaction($transaction); - if (is_null($opposing)) { + if (null === $opposing) { Log::debug('Opposing transaction is NULL. Cannot reconcile.'); return false; @@ -272,7 +269,7 @@ class JournalRepository implements JournalRepositoryInterface 'account' => $accounts['source'], 'amount' => bcmul($amount, '-1'), 'transaction_currency_id' => $data['currency_id'], - 'foreign_amount' => is_null($data['foreign_amount']) ? null : bcmul(strval($data['foreign_amount']), '-1'), + 'foreign_amount' => null === $data['foreign_amount'] ? null : bcmul(strval($data['foreign_amount']), '-1'), 'foreign_currency_id' => $data['foreign_currency_id'], 'description' => null, 'category' => null, @@ -296,7 +293,6 @@ class JournalRepository implements JournalRepositoryInterface $this->storeTransaction($two); - // store tags if (isset($data['tags']) && is_array($data['tags'])) { $this->saveTags($journal, $data['tags']); @@ -329,14 +325,13 @@ class JournalRepository implements JournalRepositoryInterface */ public function update(TransactionJournal $journal, array $data): TransactionJournal { - // update actual journal: $journal->description = $data['description']; $journal->date = $data['date']; $accounts = $this->storeAccounts($this->user, $journal->transactionType, $data); $data = $this->verifyNativeAmount($data, $accounts); $data['amount'] = strval($data['amount']); - $data['foreign_amount'] = is_null($data['foreign_amount']) ? null : strval($data['foreign_amount']); + $data['foreign_amount'] = null === $data['foreign_amount'] ? null : strval($data['foreign_amount']); // unlink all categories, recreate them: $journal->categories()->detach(); @@ -359,7 +354,7 @@ class JournalRepository implements JournalRepositoryInterface } // update note: - if (isset($data['notes']) && !is_null($data['notes'])) { + if (isset($data['notes']) && null !== $data['notes']) { $this->updateNote($journal, strval($data['notes'])); } @@ -401,11 +396,10 @@ class JournalRepository implements JournalRepositoryInterface $journal->budgets()->detach(); // update note: - if (isset($data['notes']) && !is_null($data['notes'])) { + if (isset($data['notes']) && null !== $data['notes']) { $this->updateNote($journal, strval($data['notes'])); } - // update meta fields: $result = $journal->save(); if ($result) { @@ -434,7 +428,7 @@ class JournalRepository implements JournalRepositoryInterface Log::debug(sprintf('Split journal update split transaction %d', $identifier)); $transaction = $this->appendTransactionData($transaction, $data); $this->storeSplitTransaction($journal, $transaction, $identifier); - $identifier++; + ++$identifier; } $journal->save(); diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index d2c4edb1ea..34efa0a649 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Journal; @@ -32,13 +31,10 @@ use Illuminate\Support\Collection; use Illuminate\Support\MessageBag; /** - * Interface JournalRepositoryInterface - * - * @package FireflyIII\Repositories\Journal + * Interface JournalRepositoryInterface. */ interface JournalRepositoryInterface { - /** * @param TransactionJournal $journal * @param TransactionType $type @@ -66,7 +62,7 @@ interface JournalRepositoryInterface public function delete(TransactionJournal $journal): bool; /** - * Find a specific journal + * Find a specific journal. * * @param int $journalId * @@ -89,7 +85,7 @@ interface JournalRepositoryInterface public function findTransaction(int $transactionid): ?Transaction; /** - * Get users very first transaction journal + * Get users very first transaction journal. * * @return TransactionJournal */ diff --git a/app/Repositories/Journal/JournalTasker.php b/app/Repositories/Journal/JournalTasker.php index a0a3928d2a..ae7f22e7be 100644 --- a/app/Repositories/Journal/JournalTasker.php +++ b/app/Repositories/Journal/JournalTasker.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Journal; @@ -36,17 +35,13 @@ use Illuminate\Support\Collection; use Steam; /** - * Class JournalTasker - * - * @package FireflyIII\Repositories\Journal + * Class JournalTasker. */ class JournalTasker implements JournalTaskerInterface { - /** @var User */ private $user; - /** * @param TransactionJournal $journal * @@ -128,7 +123,6 @@ class JournalTasker implements JournalTaskerInterface 'foreign_currencies.decimal_places as foreign_currency_dp', 'foreign_currencies.code as foreign_currency_code', 'foreign_currencies.symbol as foreign_currency_symbol', - ] ); @@ -156,14 +150,14 @@ class JournalTasker implements JournalTaskerInterface 'source_account_after' => bcadd($sourceBalance, $entry->amount), 'destination_id' => $entry->destination_id, 'destination_amount' => bcmul($entry->amount, '-1'), - 'foreign_destination_amount' => is_null($entry->foreign_amount) ? null : bcmul($entry->foreign_amount, '-1'), + 'foreign_destination_amount' => null === $entry->foreign_amount ? null : bcmul($entry->foreign_amount, '-1'), 'destination_account_id' => $entry->destination_account_id, 'destination_account_type' => $entry->destination_account_type, 'destination_account_name' => Steam::decrypt(intval($entry->destination_account_encrypted), $entry->destination_account_name), 'destination_account_before' => $destinationBalance, 'destination_account_after' => bcadd($destinationBalance, bcmul($entry->amount, '-1')), - 'budget_id' => is_null($budget) ? 0 : $budget->id, - 'category' => is_null($category) ? '' : $category->name, + 'budget_id' => null === $budget ? 0 : $budget->id, + 'category' => null === $category ? '' : $category->name, 'transaction_currency_id' => $entry->transaction_currency_id, 'transaction_currency_code' => $entry->transaction_currency_code, 'transaction_currency_symbol' => $entry->transaction_currency_symbol, @@ -173,15 +167,14 @@ class JournalTasker implements JournalTaskerInterface 'foreign_currency_symbol' => $entry->foreign_currency_symbol, 'foreign_currency_dp' => $entry->foreign_currency_dp, ]; - if ($entry->destination_account_type === AccountType::CASH) { + if (AccountType::CASH === $entry->destination_account_type) { $transaction['destination_account_name'] = ''; } - if ($entry->account_type === AccountType::CASH) { + if (AccountType::CASH === $entry->account_type) { $transaction['source_account_name'] = ''; } - $transactions[] = $transaction; } $cache->store($transactions); @@ -200,7 +193,7 @@ class JournalTasker implements JournalTaskerInterface /** * Collect the balance of an account before the given transaction has hit. This is tricky, because * the balance does not depend on the transaction itself but the journal it's part of. And of course - * the order of transactions within the journal. So the query is pretty complex: + * the order of transactions within the journal. So the query is pretty complex:. * * @param int $transactionId * diff --git a/app/Repositories/Journal/JournalTaskerInterface.php b/app/Repositories/Journal/JournalTaskerInterface.php index 98985477d8..37899de92f 100644 --- a/app/Repositories/Journal/JournalTaskerInterface.php +++ b/app/Repositories/Journal/JournalTaskerInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Journal; @@ -28,9 +27,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface JournalTaskerInterface - * - * @package FireflyIII\Repositories\Journal + * Interface JournalTaskerInterface. */ interface JournalTaskerInterface { diff --git a/app/Repositories/Journal/SupportJournalsTrait.php b/app/Repositories/Journal/SupportJournalsTrait.php index d825158223..a357a316bc 100644 --- a/app/Repositories/Journal/SupportJournalsTrait.php +++ b/app/Repositories/Journal/SupportJournalsTrait.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Journal; @@ -34,9 +33,7 @@ use FireflyIII\User; use Log; /** - * Trait SupportJournalsTrait - * - * @package FireflyIII\Repositories\Journal + * Trait SupportJournalsTrait. */ trait SupportJournalsTrait { @@ -46,6 +43,7 @@ trait SupportJournalsTrait * @param array $data * * @return array + * * @throws FireflyException */ protected function storeAccounts(User $user, TransactionType $type, array $data): array @@ -73,17 +71,16 @@ trait SupportJournalsTrait throw new FireflyException(sprintf('Did not recognise transaction type "%s".', $type->type)); } - if (is_null($accounts['source'])) { + if (null === $accounts['source']) { Log::error('"source"-account is null, so we cannot continue!', ['data' => $data]); throw new FireflyException('"source"-account is null, so we cannot continue!'); } - if (is_null($accounts['destination'])) { + if (null === $accounts['destination']) { Log::error('"destination"-account is null, so we cannot continue!', ['data' => $data]); throw new FireflyException('"destination"-account is null, so we cannot continue!'); } - return $accounts; } @@ -93,7 +90,7 @@ trait SupportJournalsTrait */ protected function storeBudgetWithJournal(TransactionJournal $journal, int $budgetId) { - if (intval($budgetId) > 0 && $journal->transactionType->type === TransactionType::WITHDRAWAL) { + if (intval($budgetId) > 0 && TransactionType::WITHDRAWAL === $journal->transactionType->type) { /** @var \FireflyIII\Models\Budget $budget */ $budget = Budget::find($budgetId); $journal->budgets()->save($budget); @@ -215,6 +212,7 @@ trait SupportJournalsTrait * @param array $accounts * * @return array + * * @throws FireflyException */ protected function verifyNativeAmount(array $data, array $accounts): array @@ -227,7 +225,7 @@ trait SupportJournalsTrait // which account to check for what the native currency is? $check = 'source'; - if ($transactionType->type === TransactionType::DEPOSIT) { + if (TransactionType::DEPOSIT === $transactionType->type) { $check = 'destination'; } switch ($transactionType->type) { diff --git a/app/Repositories/Journal/UpdateJournalsTrait.php b/app/Repositories/Journal/UpdateJournalsTrait.php index 75aba8e0a0..0095d8bf83 100644 --- a/app/Repositories/Journal/UpdateJournalsTrait.php +++ b/app/Repositories/Journal/UpdateJournalsTrait.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Journal; @@ -34,15 +33,12 @@ use FireflyIII\Repositories\Tag\TagRepositoryInterface; use Log; /** - * Trait UpdateJournalsTrait - * - * @package FireflyIII\Repositories\Journal + * Trait UpdateJournalsTrait. */ trait UpdateJournalsTrait { - /** - * When the user edits a split journal, each line is missing crucial data: + * When the user edits a split journal, each line is missing crucial data:. * * - Withdrawal lines are missing the source account ID * - Deposit lines are missing the destination account ID @@ -84,14 +80,14 @@ trait UpdateJournalsTrait protected function updateDestinationTransaction(TransactionJournal $journal, Account $account, array $data) { $set = $journal->transactions()->where('amount', '>', 0)->get(); - if ($set->count() !== 1) { + if (1 !== $set->count()) { throw new FireflyException(sprintf('Journal #%d has %d transactions with an amount more than zero.', $journal->id, $set->count())); } /** @var Transaction $transaction */ $transaction = $set->first(); $transaction->amount = app('steam')->positive($data['amount']); $transaction->transaction_currency_id = $data['currency_id']; - $transaction->foreign_amount = is_null($data['foreign_amount']) ? null : app('steam')->positive($data['foreign_amount']); + $transaction->foreign_amount = null === $data['foreign_amount'] ? null : app('steam')->positive($data['foreign_amount']); $transaction->foreign_currency_id = $data['foreign_currency_id']; $transaction->account_id = $account->id; $transaction->save(); @@ -108,14 +104,14 @@ trait UpdateJournalsTrait { // should be one: $set = $journal->transactions()->where('amount', '<', 0)->get(); - if ($set->count() !== 1) { + if (1 !== $set->count()) { throw new FireflyException(sprintf('Journal #%d has %d transactions with an amount more than zero.', $journal->id, $set->count())); } /** @var Transaction $transaction */ $transaction = $set->first(); $transaction->amount = bcmul(app('steam')->positive($data['amount']), '-1'); $transaction->transaction_currency_id = $data['currency_id']; - $transaction->foreign_amount = is_null($data['foreign_amount']) ? null : bcmul(app('steam')->positive($data['foreign_amount']), '-1'); + $transaction->foreign_amount = null === $data['foreign_amount'] ? null : bcmul(app('steam')->positive($data['foreign_amount']), '-1'); $transaction->foreign_currency_id = $data['foreign_currency_id']; $transaction->account_id = $account->id; $transaction->save(); @@ -133,7 +129,6 @@ trait UpdateJournalsTrait /** @var TagRepositoryInterface $tagRepository */ $tagRepository = app(TagRepositoryInterface::class); - // find or create all tags: $tags = []; $ids = []; @@ -150,7 +145,7 @@ trait UpdateJournalsTrait DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal->id)->whereNotIn('tag_id', $ids)->delete(); } // if count is zero, delete them all: - if (count($ids) === 0) { + if (0 === count($ids)) { DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal->id)->delete(); } diff --git a/app/Repositories/LinkType/LinkTypeRepository.php b/app/Repositories/LinkType/LinkTypeRepository.php index 2f71487d7d..c600cc0f54 100644 --- a/app/Repositories/LinkType/LinkTypeRepository.php +++ b/app/Repositories/LinkType/LinkTypeRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\LinkType; @@ -30,9 +29,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Class LinkTypeRepository - * - * @package FireflyIII\Repositories\LinkType + * Class LinkTypeRepository. */ class LinkTypeRepository implements LinkTypeRepositoryInterface { @@ -57,7 +54,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface */ public function destroy(LinkType $linkType, LinkType $moveTo): bool { - if (!is_null($moveTo->id)) { + if (null !== $moveTo->id) { TransactionJournalLink::where('link_type_id', $linkType->id)->update(['link_type_id' => $moveTo->id]); } $linkType->delete(); @@ -85,7 +82,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface public function find(int $id): LinkType { $linkType = LinkType::find($id); - if (is_null($linkType)) { + if (null === $linkType) { return new LinkType; } @@ -105,7 +102,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface $count = TransactionJournalLink::whereDestinationId($one->id)->whereSourceId($two->id)->count(); $opposingCount = TransactionJournalLink::whereDestinationId($two->id)->whereSourceId($one->id)->count(); - return ($count + $opposingCount > 0); + return $count + $opposingCount > 0; } /** diff --git a/app/Repositories/LinkType/LinkTypeRepositoryInterface.php b/app/Repositories/LinkType/LinkTypeRepositoryInterface.php index 5e4fe38e7e..b917cec351 100644 --- a/app/Repositories/LinkType/LinkTypeRepositoryInterface.php +++ b/app/Repositories/LinkType/LinkTypeRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\LinkType; @@ -29,9 +28,7 @@ use FireflyIII\Models\TransactionJournalLink; use Illuminate\Support\Collection; /** - * Interface LinkTypeRepositoryInterface - * - * @package FireflyIII\Repositories\LinkType + * Interface LinkTypeRepositoryInterface. */ interface LinkTypeRepositoryInterface { diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index a9e557f081..49f2852217 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\PiggyBank; @@ -34,13 +33,10 @@ use Illuminate\Support\Collection; use Log; /** - * Class PiggyBankRepository - * - * @package FireflyIII\Repositories\PiggyBank + * Class PiggyBankRepository. */ class PiggyBankRepository implements PiggyBankRepositoryInterface { - /** @var User */ private $user; @@ -142,6 +138,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * @param PiggyBank $piggyBank * * @return bool + * * @throws \Exception */ public function destroy(PiggyBank $piggyBank): bool @@ -159,7 +156,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface public function find(int $piggyBankid): PiggyBank { $piggyBank = $this->user->piggyBanks()->where('piggy_banks.id', $piggyBankid)->first(['piggy_banks.*']); - if (!is_null($piggyBank)) { + if (null !== $piggyBank) { return $piggyBank; } @@ -200,9 +197,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface Log::debug(sprintf('Account #%d is the source, so will remove amount from piggy bank.', $piggyBank->account_id)); } - // if the amount is positive, make sure it fits in piggy bank: - if (bccomp($amount, '0') === 1 && bccomp($room, $amount) === -1) { + if (1 === bccomp($amount, '0') && bccomp($room, $amount) === -1) { // amount is positive and $room is smaller than $amount Log::debug(sprintf('Room in piggy bank for extra money is %f', $room)); Log::debug(sprintf('There is NO room to add %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name)); @@ -212,7 +208,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface } // amount is negative and $currentamount is smaller than $amount - if (bccomp($amount, '0') === -1 && bccomp($compare, $amount) === 1) { + if (bccomp($amount, '0') === -1 && 1 === bccomp($compare, $amount)) { Log::debug(sprintf('Max amount to remove is %f', $repetition->currentamount)); Log::debug(sprintf('Cannot remove %f from piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name)); Log::debug(sprintf('New amount is %f', $compare)); @@ -269,7 +265,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface public function getRepetition(PiggyBank $piggyBank, Carbon $date): PiggyBankRepetition { $repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($date)->first(); - if (is_null($repetition)) { + if (null === $repetition) { return new PiggyBankRepetition; } @@ -313,7 +309,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface } /** - * * set id of piggy bank. * * @param int $piggyBankId @@ -397,16 +392,16 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface */ private function updateNote(PiggyBank $piggyBank, string $note): bool { - if (strlen($note) === 0) { + if (0 === strlen($note)) { $dbNote = $piggyBank->notes()->first(); - if (!is_null($dbNote)) { + if (null !== $dbNote) { $dbNote->delete(); } return true; } $dbNote = $piggyBank->notes()->first(); - if (is_null($dbNote)) { + if (null === $dbNote) { $dbNote = new Note(); $dbNote->noteable()->associate($piggyBank); } diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php index 2c6b335908..1219552227 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\PiggyBank; @@ -32,9 +31,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface PiggyBankRepositoryInterface - * - * @package FireflyIII\Repositories\PiggyBank + * Interface PiggyBankRepositoryInterface. */ interface PiggyBankRepositoryInterface { diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index cf15854ea3..8f58c366ce 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Rule; @@ -31,9 +30,7 @@ use FireflyIII\Models\RuleTrigger; use FireflyIII\User; /** - * Class RuleRepository - * - * @package FireflyIII\Repositories\Rule + * Class RuleRepository. */ class RuleRepository implements RuleRepositoryInterface { @@ -74,7 +71,7 @@ class RuleRepository implements RuleRepositoryInterface public function find(int $ruleId): Rule { $rule = $this->user->rules()->find($ruleId); - if (is_null($rule)) { + if (null === $rule) { return new Rule; } @@ -82,7 +79,7 @@ class RuleRepository implements RuleRepositoryInterface } /** - * FIxXME can return null + * FIxXME can return null. * * @return RuleGroup */ @@ -105,12 +102,13 @@ class RuleRepository implements RuleRepositoryInterface * @param Rule $rule * * @return string + * * @throws FireflyException */ public function getPrimaryTrigger(Rule $rule): string { $count = $rule->ruleTriggers()->count(); - if ($count === 0) { + if (0 === $count) { throw new FireflyException('Rules should have more than zero triggers, rule #' . $rule->id . ' has none!'); } @@ -133,7 +131,6 @@ class RuleRepository implements RuleRepositoryInterface $other->save(); } - $rule->order = ($rule->order + 1); $rule->save(); $this->resetRulesInGroupOrder($rule->ruleGroup); @@ -176,10 +173,10 @@ class RuleRepository implements RuleRepositoryInterface foreach ($ids as $actionId) { /** @var RuleTrigger $trigger */ $action = $rule->ruleActions()->find($actionId); - if (!is_null($action)) { + if (null !== $action) { $action->order = $order; $action->save(); - $order++; + ++$order; } } @@ -198,10 +195,10 @@ class RuleRepository implements RuleRepositoryInterface foreach ($ids as $triggerId) { /** @var RuleTrigger $trigger */ $trigger = $rule->ruleTriggers()->find($triggerId); - if (!is_null($trigger)) { + if (null !== $trigger) { $trigger->order = $order; $trigger->save(); - $order++; + ++$order; } } @@ -226,7 +223,7 @@ class RuleRepository implements RuleRepositoryInterface foreach ($set as $entry) { $entry->order = $count; $entry->save(); - $count++; + ++$count; } return true; @@ -260,7 +257,7 @@ class RuleRepository implements RuleRepositoryInterface $rule->rule_group_id = $data['rule_group_id']; $rule->order = ($order + 1); $rule->active = 1; - $rule->stop_processing = intval($data['stop_processing']) === 1; + $rule->stop_processing = 1 === intval($data['stop_processing']); $rule->title = $data['title']; $rule->description = strlen($data['description']) > 0 ? $data['description'] : null; @@ -289,10 +286,9 @@ class RuleRepository implements RuleRepositoryInterface $ruleAction->active = 1; $ruleAction->stop_processing = $values['stopProcessing']; $ruleAction->action_type = $values['action']; - $ruleAction->action_value = is_null($values['value']) ? '' : $values['value']; + $ruleAction->action_value = null === $values['value'] ? '' : $values['value']; $ruleAction->save(); - return $ruleAction; } @@ -310,7 +306,7 @@ class RuleRepository implements RuleRepositoryInterface $ruleTrigger->active = 1; $ruleTrigger->stop_processing = $values['stopProcessing']; $ruleTrigger->trigger_type = $values['action']; - $ruleTrigger->trigger_value = is_null($values['value']) ? '' : $values['value']; + $ruleTrigger->trigger_value = null === $values['value'] ? '' : $values['value']; $ruleTrigger->save(); return $ruleTrigger; @@ -344,7 +340,6 @@ class RuleRepository implements RuleRepositoryInterface // recreate actions: $this->storeActions($rule, $data); - return $rule; } @@ -405,7 +400,7 @@ class RuleRepository implements RuleRepositoryInterface ]; $this->storeTrigger($rule, $triggerValues); - $order++; + ++$order; } return true; diff --git a/app/Repositories/Rule/RuleRepositoryInterface.php b/app/Repositories/Rule/RuleRepositoryInterface.php index a7fd8bacd7..57612767d5 100644 --- a/app/Repositories/Rule/RuleRepositoryInterface.php +++ b/app/Repositories/Rule/RuleRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Rule; @@ -30,9 +29,7 @@ use FireflyIII\Models\RuleTrigger; use FireflyIII\User; /** - * Interface RuleRepositoryInterface - * - * @package FireflyIII\Repositories\Rule + * Interface RuleRepositoryInterface. */ interface RuleRepositoryInterface { @@ -55,7 +52,6 @@ interface RuleRepositoryInterface */ public function find(int $ruleId): Rule; - /** * @return RuleGroup */ diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 09b74d84ae..4c45395466 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\RuleGroup; @@ -30,9 +29,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; /** - * Class RuleGroupRepository - * - * @package FireflyIII\Repositories\RuleGroup + * Class RuleGroupRepository. */ class RuleGroupRepository implements RuleGroupRepositoryInterface { @@ -57,7 +54,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface { /** @var Rule $rule */ foreach ($ruleGroup->rules as $rule) { - if (is_null($moveTo)) { + if (null === $moveTo) { $rule->delete(); continue; } @@ -69,7 +66,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface $ruleGroup->delete(); $this->resetRuleGroupOrder(); - if (!is_null($moveTo)) { + if (null !== $moveTo) { $this->resetRulesInGroupOrder($moveTo); } @@ -84,7 +81,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface public function find(int $ruleGroupId): RuleGroup { $group = $this->user->ruleGroups()->find($ruleGroupId); - if (is_null($group)) { + if (null === $group) { return new RuleGroup; } @@ -234,10 +231,9 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface foreach ($set as $entry) { $entry->order = $count; $entry->save(); - $count++; + ++$count; } - return true; } @@ -259,7 +255,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface foreach ($set as $entry) { $entry->order = $count; $entry->save(); - $count++; + ++$count; } return true; @@ -289,8 +285,6 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface 'description' => $data['description'], 'order' => ($order + 1), 'active' => 1, - - ] ); $newRuleGroup->save(); diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php index a2ee5e45a5..ca9a142bc1 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php +++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\RuleGroup; @@ -28,16 +27,11 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface RuleGroupRepositoryInterface - * - * @package FireflyIII\Repositories\RuleGroup + * Interface RuleGroupRepositoryInterface. */ interface RuleGroupRepositoryInterface { - /** - * - * * @return int */ public function count(): int; diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 25e99d7773..e75bc5710f 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Tag; @@ -35,18 +34,14 @@ use Illuminate\Support\Collection; use Log; /** - * Class TagRepository - * - * @package FireflyIII\Repositories\Tag + * Class TagRepository. */ class TagRepository implements TagRepositoryInterface { - /** @var User */ private $user; /** - * * @param TransactionJournal $journal * @param Tag $tag * @@ -54,9 +49,7 @@ class TagRepository implements TagRepositoryInterface */ public function connect(TransactionJournal $journal, Tag $tag): bool { - /* - * Already connected: - */ + // Already connected: if ($journal->tags()->find($tag->id)) { Log::info(sprintf('Tag #%d is already connected to journal #%d.', $tag->id, $journal->id)); @@ -116,7 +109,7 @@ class TagRepository implements TagRepositoryInterface public function find(int $tagId): Tag { $tag = $this->user->tags()->find($tagId); - if (is_null($tag)) { + if (null === $tag) { $tag = new Tag; } @@ -131,7 +124,7 @@ class TagRepository implements TagRepositoryInterface public function findByTag(string $tag): Tag { $tags = $this->user->tags()->get(); - /** @var Tag $tag */ + // @var Tag $tag foreach ($tags as $databaseTag) { if ($databaseTag->tag === $tag) { return $databaseTag; @@ -149,7 +142,7 @@ class TagRepository implements TagRepositoryInterface public function firstUseDate(Tag $tag): Carbon { $journal = $tag->transactionJournals()->orderBy('date', 'ASC')->first(); - if (!is_null($journal)) { + if (null !== $journal) { return $journal->date; } @@ -190,7 +183,7 @@ class TagRepository implements TagRepositoryInterface public function lastUseDate(Tag $tag): Carbon { $journal = $tag->transactionJournals()->orderBy('date', 'DESC')->first(); - if (!is_null($journal)) { + if (null !== $journal) { return $journal->date; } @@ -265,7 +258,7 @@ class TagRepository implements TagRepositoryInterface /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); - if (!is_null($start) && !is_null($end)) { + if (null !== $start && null !== $end) { $collector->setRange($start, $end); } @@ -291,7 +284,7 @@ class TagRepository implements TagRepositoryInterface /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); - if (!is_null($start) && !is_null($end)) { + if (null !== $start && null !== $end) { $collector->setRange($start, $end); } @@ -308,7 +301,7 @@ class TagRepository implements TagRepositoryInterface foreach ($journals as $journal) { $amount = app('steam')->positive(strval($journal->transaction_amount)); $type = $journal->transaction_type_type; - if ($type === TransactionType::WITHDRAWAL) { + if (TransactionType::WITHDRAWAL === $type) { $amount = bcmul($amount, '-1'); } $sums[$type] = bcadd($sums[$type], $amount); @@ -326,15 +319,11 @@ class TagRepository implements TagRepositoryInterface */ public function tagCloud(?int $year): array { - /* - * Some vars - */ + // Some vars $min = null; $max = '0'; $return = []; - /* - * get tags with a certain amount (in this range): - */ + // get tags with a certain amount (in this range): $query = $this->user->tags() ->leftJoin('tag_transaction_journal', 'tag_transaction_journal.tag_id', '=', 'tags.id') ->leftJoin('transaction_journals', 'tag_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') @@ -343,10 +332,10 @@ class TagRepository implements TagRepositoryInterface ->groupBy('tags.id'); // add date range (or not): - if (is_null($year)) { + if (null === $year) { $query->whereNull('tags.date'); } - if (!is_null($year)) { + if (null !== $year) { $start = $year . '-01-01'; $end = $year . '-12-31'; $query->where('tags.date', '>=', $start)->where('tags.date', '<=', $end); @@ -358,16 +347,14 @@ class TagRepository implements TagRepositoryInterface $tagsWithAmounts[$tag->id] = strval($tag->amount_sum); } - /* - * get all tags in period: - */ + // get all tags in period: $query = $this->user->tags(); - if (!is_null($year)) { + if (null !== $year) { $start = $year . '-01-01'; $end = $year . '-12-31'; $query->where('date', '>=', $start)->where('date', '<=', $end); } - if (is_null($year)) { + if (null === $year) { $query->whereNull('date'); } $tags = $query->orderBy('id', 'desc')->get(); @@ -375,10 +362,10 @@ class TagRepository implements TagRepositoryInterface /** @var Tag $tag */ foreach ($tags as $tag) { $amount = $tagsWithAmounts[$tag->id] ?? '0'; - if (is_null($min)) { + if (null === $min) { $min = $amount; } - $max = bccomp($amount, $max) === 1 ? $amount : $max; + $max = 1 === bccomp($amount, $max) ? $amount : $max; $min = bccomp($amount, $min) === -1 ? $amount : $min; $temporary[] = [ @@ -431,21 +418,20 @@ class TagRepository implements TagRepositoryInterface $amountDiff = $max - $min; // no difference? Every tag same range: - if ($amountDiff === 0.0) { + if (0.0 === $amountDiff) { return $range[0]; } $diff = $range[1] - $range[0]; $step = 1; - if ($diff != 0) { + if (0 != $diff) { $step = $amountDiff / $diff; } - if ($step == 0) { + if (0 == $step) { $step = 1; } $extra = round($amount / $step); - return intval($range[0] + $extra); } } diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index 6e04a0a2df..814fb87036 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\Tag; @@ -30,13 +29,10 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface TagRepositoryInterface - * - * @package FireflyIII\Repositories\Tag + * Interface TagRepositoryInterface. */ interface TagRepositoryInterface { - /** * This method will connect a journal with a tag. * diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index 88bb889c86..45c567ca2d 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\User; @@ -31,13 +30,10 @@ use Log; use Preferences; /** - * Class UserRepository - * - * @package FireflyIII\Repositories\User + * Class UserRepository. */ class UserRepository implements UserRepositoryInterface { - /** * @return Collection */ @@ -153,7 +149,7 @@ class UserRepository implements UserRepositoryInterface public function find(int $userId): User { $user = User::find($userId); - if (!is_null($user)) { + if (null !== $user) { return $user; } @@ -183,14 +179,14 @@ class UserRepository implements UserRepositoryInterface // two factor: $is2faEnabled = Preferences::getForUser($user, 'twoFactorAuthEnabled', false)->data; - $has2faSecret = !is_null(Preferences::getForUser($user, 'twoFactorAuthSecret')); + $has2faSecret = null !== Preferences::getForUser($user, 'twoFactorAuthSecret'); $return['has_2fa'] = false; if ($is2faEnabled && $has2faSecret) { $return['has_2fa'] = true; } $return['is_admin'] = $user->hasRole('owner'); - $return['blocked'] = intval($user->blocked) === 1; + $return['blocked'] = 1 === intval($user->blocked); $return['blocked_code'] = $user->blocked_code; $return['accounts'] = $user->accounts()->count(); $return['journals'] = $user->transactionJournals()->count(); diff --git a/app/Repositories/User/UserRepositoryInterface.php b/app/Repositories/User/UserRepositoryInterface.php index 9bca371f10..8436eee569 100644 --- a/app/Repositories/User/UserRepositoryInterface.php +++ b/app/Repositories/User/UserRepositoryInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Repositories\User; @@ -27,13 +26,10 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface UserRepositoryInterface - * - * @package FireflyIII\Repositories\User + * Interface UserRepositoryInterface. */ interface UserRepositoryInterface { - /** * Returns a collection of all users. * diff --git a/app/Services/Bunq/Id/BunqId.php b/app/Services/Bunq/Id/BunqId.php index 21609f5fa3..3ba845c54e 100644 --- a/app/Services/Bunq/Id/BunqId.php +++ b/app/Services/Bunq/Id/BunqId.php @@ -19,15 +19,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Id; /** - * Class BunqId - * - * @package FireflyIII\Services\Bunq\Id + * Class BunqId. */ class BunqId { diff --git a/app/Services/Bunq/Id/DeviceServerId.php b/app/Services/Bunq/Id/DeviceServerId.php index 88b91358b5..a074753b55 100644 --- a/app/Services/Bunq/Id/DeviceServerId.php +++ b/app/Services/Bunq/Id/DeviceServerId.php @@ -19,15 +19,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Id; /** - * Class DeviceServerId - * - * @package Bunq\Id + * Class DeviceServerId. */ class DeviceServerId extends BunqId { diff --git a/app/Services/Bunq/Id/DeviceSessionId.php b/app/Services/Bunq/Id/DeviceSessionId.php index c8443c4f2f..71ce07ebcc 100644 --- a/app/Services/Bunq/Id/DeviceSessionId.php +++ b/app/Services/Bunq/Id/DeviceSessionId.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Id; /** - * Class DeviceSessionId - * - * @package Bunq\Id + * Class DeviceSessionId. */ class DeviceSessionId extends BunqId { diff --git a/app/Services/Bunq/Id/InstallationId.php b/app/Services/Bunq/Id/InstallationId.php index 84abcb61f9..48a9d73170 100644 --- a/app/Services/Bunq/Id/InstallationId.php +++ b/app/Services/Bunq/Id/InstallationId.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Id; /** - * Class InstallationId - * - * @package Bunq\Id + * Class InstallationId. */ class InstallationId extends BunqId { diff --git a/app/Services/Bunq/Object/Alias.php b/app/Services/Bunq/Object/Alias.php index a625543de8..7819c6bd48 100644 --- a/app/Services/Bunq/Object/Alias.php +++ b/app/Services/Bunq/Object/Alias.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; /** - * Class Alias - * - * @package FireflyIII\Services\Bunq\Object + * Class Alias. */ class Alias extends BunqObject { diff --git a/app/Services/Bunq/Object/Amount.php b/app/Services/Bunq/Object/Amount.php index 854a5ca6ba..2504bffb26 100644 --- a/app/Services/Bunq/Object/Amount.php +++ b/app/Services/Bunq/Object/Amount.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; /** - * Class Amount - * - * @package FireflyIII\Services\Bunq\Object + * Class Amount. */ class Amount extends BunqObject { diff --git a/app/Services/Bunq/Object/Avatar.php b/app/Services/Bunq/Object/Avatar.php index 034e9c817c..0ac804bacd 100644 --- a/app/Services/Bunq/Object/Avatar.php +++ b/app/Services/Bunq/Object/Avatar.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; /** - * Class Avatar - * - * @package FireflyIII\Services\Bunq\Object + * Class Avatar. */ class Avatar extends BunqObject { diff --git a/app/Services/Bunq/Object/BunqObject.php b/app/Services/Bunq/Object/BunqObject.php index 050ae58046..a14df09963 100644 --- a/app/Services/Bunq/Object/BunqObject.php +++ b/app/Services/Bunq/Object/BunqObject.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; /** - * Class BunqObject - * - * @package FireflyIII\Services\Bunq\Object + * Class BunqObject. */ class BunqObject { diff --git a/app/Services/Bunq/Object/DeviceServer.php b/app/Services/Bunq/Object/DeviceServer.php index d1498dcb93..f884631c0a 100644 --- a/app/Services/Bunq/Object/DeviceServer.php +++ b/app/Services/Bunq/Object/DeviceServer.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; @@ -28,17 +27,17 @@ use FireflyIII\Services\Bunq\Id\DeviceServerId; class DeviceServer extends BunqObject { - /** @var Carbon */ + /** @var Carbon */ private $created; - /** @var string */ + /** @var string */ private $description; - /** @var DeviceServerId */ + /** @var DeviceServerId */ private $id; - /** @var string */ + /** @var string */ private $ip; - /** @var string */ + /** @var string */ private $status; - /** @var Carbon */ + /** @var Carbon */ private $updated; public function __construct(array $data) diff --git a/app/Services/Bunq/Object/MonetaryAccountBank.php b/app/Services/Bunq/Object/MonetaryAccountBank.php index 1fe87a304b..d5b60d6652 100644 --- a/app/Services/Bunq/Object/MonetaryAccountBank.php +++ b/app/Services/Bunq/Object/MonetaryAccountBank.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; @@ -26,35 +25,33 @@ namespace FireflyIII\Services\Bunq\Object; use Carbon\Carbon; /** - * Class MonetaryAccountBank - * - * @package FireflyIII\Services\Bunq\Object + * Class MonetaryAccountBank. */ class MonetaryAccountBank extends BunqObject { /** @var array */ private $aliases = []; - /** @var Avatar */ + /** @var Avatar */ private $avatar; - /** @var Amount */ + /** @var Amount */ private $balance; /** @var Carbon */ private $created; /** @var string */ private $currency = ''; - /** @var Amount */ + /** @var Amount */ private $dailyLimit; - /** @var Amount */ + /** @var Amount */ private $dailySpent; /** @var string */ private $description = ''; /** @var int */ private $id = 0; - /** @var MonetaryAccountProfile */ + /** @var MonetaryAccountProfile */ private $monetaryAccountProfile; /** @var array */ private $notificationFilters = []; - /** @var Amount */ + /** @var Amount */ private $overdraftLimit; /** @var string */ private $publicUuid = ''; @@ -62,7 +59,7 @@ class MonetaryAccountBank extends BunqObject private $reason = ''; /** @var string */ private $reasonDescription = ''; - /** @var MonetaryAccountSetting */ + /** @var MonetaryAccountSetting */ private $setting; /** @var string */ private $status = ''; diff --git a/app/Services/Bunq/Object/MonetaryAccountProfile.php b/app/Services/Bunq/Object/MonetaryAccountProfile.php index 8bcc47ec03..8a4f436f43 100644 --- a/app/Services/Bunq/Object/MonetaryAccountProfile.php +++ b/app/Services/Bunq/Object/MonetaryAccountProfile.php @@ -18,21 +18,18 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; /** - * Class MonetaryAccountProfile - * - * @package FireflyIII\Services\Bunq\Object + * Class MonetaryAccountProfile. */ class MonetaryAccountProfile extends BunqObject { /** @var string */ private $profileActionRequired = ''; - /** @var Amount */ + /** @var Amount */ private $profileAmountRequired; private $profileDrain; private $profileFill; diff --git a/app/Services/Bunq/Object/MonetaryAccountSetting.php b/app/Services/Bunq/Object/MonetaryAccountSetting.php index d592e914da..58f44f80b0 100644 --- a/app/Services/Bunq/Object/MonetaryAccountSetting.php +++ b/app/Services/Bunq/Object/MonetaryAccountSetting.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; /** - * Class MonetaryAccountSetting - * - * @package FireflyIII\Services\Bunq\Object + * Class MonetaryAccountSetting. */ class MonetaryAccountSetting extends BunqObject { diff --git a/app/Services/Bunq/Object/NotificationFilter.php b/app/Services/Bunq/Object/NotificationFilter.php index baf65ed86c..aedc952109 100644 --- a/app/Services/Bunq/Object/NotificationFilter.php +++ b/app/Services/Bunq/Object/NotificationFilter.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; /** - * Class NotificationFilter - * - * @package FireflyIII\Services\Bunq\Object + * Class NotificationFilter. */ class NotificationFilter extends BunqObject { diff --git a/app/Services/Bunq/Object/ServerPublicKey.php b/app/Services/Bunq/Object/ServerPublicKey.php index bdea9e69a7..b70a6ac01e 100644 --- a/app/Services/Bunq/Object/ServerPublicKey.php +++ b/app/Services/Bunq/Object/ServerPublicKey.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; /** - * Class ServerPublicKey - * - * @package Bunq\Object + * Class ServerPublicKey. */ class ServerPublicKey extends BunqObject { diff --git a/app/Services/Bunq/Object/UserCompany.php b/app/Services/Bunq/Object/UserCompany.php index 54cfcdfc56..36f37ce4a4 100644 --- a/app/Services/Bunq/Object/UserCompany.php +++ b/app/Services/Bunq/Object/UserCompany.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; @@ -26,9 +25,7 @@ namespace FireflyIII\Services\Bunq\Object; use Carbon\Carbon; /** - * Class UserCompany - * - * @package FireflyIII\Services\Bunq\Object + * Class UserCompany. */ class UserCompany extends BunqObject { @@ -69,7 +66,7 @@ class UserCompany extends BunqObject private $status = ''; /** @var string */ private $subStatus = ''; - /** @var string */ + /** @var string */ private $typeOfBusinessEntity = ''; /** @var array */ private $ubos = []; diff --git a/app/Services/Bunq/Object/UserLight.php b/app/Services/Bunq/Object/UserLight.php index b7c7ee4c34..060a257282 100644 --- a/app/Services/Bunq/Object/UserLight.php +++ b/app/Services/Bunq/Object/UserLight.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; @@ -26,9 +25,7 @@ namespace FireflyIII\Services\Bunq\Object; use Carbon\Carbon; /** - * Class UserLight - * - * @package FireflyIII\Services\Bunq\Object + * Class UserLight. */ class UserLight extends BunqObject { @@ -62,7 +59,7 @@ class UserLight extends BunqObject */ public function __construct(array $data) { - if (count($data) === 0) { + if (0 === count($data)) { return; } $this->id = intval($data['id']); diff --git a/app/Services/Bunq/Object/UserPerson.php b/app/Services/Bunq/Object/UserPerson.php index d66b2e97d6..223dfef779 100644 --- a/app/Services/Bunq/Object/UserPerson.php +++ b/app/Services/Bunq/Object/UserPerson.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Object; @@ -26,9 +25,7 @@ namespace FireflyIII\Services\Bunq\Object; use Carbon\Carbon; /** - * Class UserPerson - * - * @package Bunq\Object + * Class UserPerson. */ class UserPerson extends BunqObject { @@ -101,7 +98,7 @@ class UserPerson extends BunqObject */ public function __construct(array $data) { - if (count($data) === 0) { + if (0 === count($data)) { return; } $this->id = intval($data['id']); diff --git a/app/Services/Bunq/Request/BunqRequest.php b/app/Services/Bunq/Request/BunqRequest.php index 9ff87c3567..dcc4a23729 100644 --- a/app/Services/Bunq/Request/BunqRequest.php +++ b/app/Services/Bunq/Request/BunqRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; @@ -31,15 +30,13 @@ use Requests; use Requests_Exception; /** - * Class BunqRequest - * - * @package Bunq\Request + * Class BunqRequest. */ abstract class BunqRequest { /** @var string */ protected $secret = ''; - /** @var ServerPublicKey */ + /** @var ServerPublicKey */ protected $serverPublicKey; /** @var string */ private $privateKey = ''; @@ -111,14 +108,15 @@ abstract class BunqRequest * @param string $data * * @return string + * * @throws FireflyException */ protected function generateSignature(string $method, string $uri, array $headers, string $data): string { - if (strlen($this->privateKey) === 0) { + if (0 === strlen($this->privateKey)) { throw new FireflyException('No private key present.'); } - if (strtolower($method) === 'get' || strtolower($method) === 'delete') { + if ('get' === strtolower($method) || 'delete' === strtolower($method)) { $data = ''; } @@ -127,7 +125,7 @@ abstract class BunqRequest $headersToSign = ['Cache-Control', 'User-Agent']; ksort($headers); foreach ($headers as $name => $value) { - if (in_array($name, $headersToSign) || substr($name, 0, 7) === 'X-Bunq-') { + if (in_array($name, $headersToSign) || 'X-Bunq-' === substr($name, 0, 7)) { $toSign .= sprintf("%s: %s\n", $name, $value); } } @@ -202,11 +200,12 @@ abstract class BunqRequest * @param array $headers * * @return array + * * @throws Exception */ protected function sendSignedBunqDelete(string $uri, array $headers): array { - if (strlen($this->server) === 0) { + if (0 === strlen($this->server)) { throw new FireflyException('No bunq server defined'); } @@ -216,7 +215,7 @@ abstract class BunqRequest try { $response = Requests::delete($fullUri, $headers); } catch (Requests_Exception $e) { - return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()],]]; + return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; @@ -235,7 +234,6 @@ abstract class BunqRequest throw new FireflyException(sprintf('Could not verify signature for request to "%s"', $uri)); } - return $array; } @@ -245,11 +243,12 @@ abstract class BunqRequest * @param array $headers * * @return array + * * @throws Exception */ protected function sendSignedBunqGet(string $uri, array $data, array $headers): array { - if (strlen($this->server) === 0) { + if (0 === strlen($this->server)) { throw new FireflyException('No bunq server defined'); } @@ -260,7 +259,7 @@ abstract class BunqRequest try { $response = Requests::get($fullUri, $headers); } catch (Requests_Exception $e) { - return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()],]]; + return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; @@ -287,6 +286,7 @@ abstract class BunqRequest * @param array $headers * * @return array + * * @throws Exception */ protected function sendSignedBunqPost(string $uri, array $data, array $headers): array @@ -298,7 +298,7 @@ abstract class BunqRequest try { $response = Requests::post($fullUri, $headers, $body); } catch (Requests_Exception $e) { - return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()],]]; + return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; @@ -316,7 +316,6 @@ abstract class BunqRequest throw new FireflyException(sprintf('Could not verify signature for request to "%s"', $uri)); } - return $array; } @@ -332,7 +331,7 @@ abstract class BunqRequest try { $response = Requests::delete($fullUri, $headers); } catch (Requests_Exception $e) { - return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()],]]; + return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; $array = json_decode($body, true); @@ -362,7 +361,7 @@ abstract class BunqRequest try { $response = Requests::post($fullUri, $headers, $body); } catch (Requests_Exception $e) { - return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()],]]; + return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; $array = json_decode($body, true); @@ -375,7 +374,6 @@ abstract class BunqRequest $this->throwResponseError($array); } - return $array; } @@ -387,7 +385,7 @@ abstract class BunqRequest private function isErrorResponse(array $response): bool { $key = key($response); - if ($key === 'Error') { + if ('Error' === $key) { return true; } @@ -431,6 +429,7 @@ abstract class BunqRequest * @param int $statusCode * * @return bool + * * @throws Exception */ private function verifyServerSignature(string $body, array $headers, int $statusCode): bool @@ -440,15 +439,14 @@ abstract class BunqRequest $verifyHeaders = []; // false when no public key is present - if (is_null($this->serverPublicKey)) { + if (null === $this->serverPublicKey) { Log::error('No public key present in class, so return FALSE.'); return false; } foreach ($headers as $header => $value) { - // skip non-bunq headers or signature - if (substr($header, 0, 7) !== 'x-bunq-' || $header === 'x-bunq-server-signature') { + if ('x-bunq-' !== substr($header, 0, 7) || 'x-bunq-server-signature' === $header) { continue; } // need to have upper case variant of header: diff --git a/app/Services/Bunq/Request/DeleteDeviceSessionRequest.php b/app/Services/Bunq/Request/DeleteDeviceSessionRequest.php index fb23e334c5..750baef294 100644 --- a/app/Services/Bunq/Request/DeleteDeviceSessionRequest.php +++ b/app/Services/Bunq/Request/DeleteDeviceSessionRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; @@ -27,13 +26,11 @@ use FireflyIII\Services\Bunq\Token\SessionToken; use Log; /** - * Class DeleteDeviceSessionRequest - * - * @package FireflyIII\Services\Bunq\Request + * Class DeleteDeviceSessionRequest. */ class DeleteDeviceSessionRequest extends BunqRequest { - /** @var SessionToken */ + /** @var SessionToken */ private $sessionToken; /** diff --git a/app/Services/Bunq/Request/DeviceServerRequest.php b/app/Services/Bunq/Request/DeviceServerRequest.php index a2aa6f9d7d..a6d817bf7b 100644 --- a/app/Services/Bunq/Request/DeviceServerRequest.php +++ b/app/Services/Bunq/Request/DeviceServerRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; @@ -27,17 +26,15 @@ use FireflyIII\Services\Bunq\Id\DeviceServerId; use FireflyIII\Services\Bunq\Token\InstallationToken; /** - * Class DeviceServerRequest - * - * @package Bunq\Request + * Class DeviceServerRequest. */ class DeviceServerRequest extends BunqRequest { /** @var string */ private $description = ''; - /** @var DeviceServerId */ + /** @var DeviceServerId */ private $deviceServerId; - /** @var InstallationToken */ + /** @var InstallationToken */ private $installationToken; /** @var array */ private $permittedIps = []; diff --git a/app/Services/Bunq/Request/DeviceSessionRequest.php b/app/Services/Bunq/Request/DeviceSessionRequest.php index 36319e79be..603b795ac6 100644 --- a/app/Services/Bunq/Request/DeviceSessionRequest.php +++ b/app/Services/Bunq/Request/DeviceSessionRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; @@ -31,21 +30,19 @@ use FireflyIII\Services\Bunq\Token\SessionToken; use Log; /** - * Class DeviceSessionRequest - * - * @package FireflyIII\Services\Bunq\Request + * Class DeviceSessionRequest. */ class DeviceSessionRequest extends BunqRequest { - /** @var DeviceSessionId */ + /** @var DeviceSessionId */ private $deviceSessionId; - /** @var InstallationToken */ + /** @var InstallationToken */ private $installationToken; - /** @var SessionToken */ + /** @var SessionToken */ private $sessionToken; - /** @var UserCompany */ + /** @var UserCompany */ private $userCompany; - /** @var UserPerson */ + /** @var UserPerson */ private $userPerson; /** @@ -59,7 +56,6 @@ class DeviceSessionRequest extends BunqRequest $headers['X-Bunq-Client-Authentication'] = $this->installationToken->getToken(); $response = $this->sendSignedBunqPost($uri, $data, $headers); - $this->deviceSessionId = $this->extractDeviceSessionId($response); $this->sessionToken = $this->extractSessionToken($response); $this->userPerson = $this->extractUserPerson($response); @@ -137,7 +133,6 @@ class DeviceSessionRequest extends BunqRequest $data = $this->getKeyFromResponse('UserCompany', $response); $userCompany = new UserCompany($data); - return $userCompany; } @@ -151,7 +146,6 @@ class DeviceSessionRequest extends BunqRequest $data = $this->getKeyFromResponse('UserPerson', $response); $userPerson = new UserPerson($data); - return $userPerson; } } diff --git a/app/Services/Bunq/Request/InstallationTokenRequest.php b/app/Services/Bunq/Request/InstallationTokenRequest.php index 45e6cb81d0..8678ebb0c3 100644 --- a/app/Services/Bunq/Request/InstallationTokenRequest.php +++ b/app/Services/Bunq/Request/InstallationTokenRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; @@ -29,15 +28,13 @@ use FireflyIII\Services\Bunq\Token\InstallationToken; use Log; /** - * Class InstallationTokenRequest - * - * @package FireflyIII\Services\Bunq\Request + * Class InstallationTokenRequest. */ class InstallationTokenRequest extends BunqRequest { /** @var InstallationId */ private $installationId; - /** @var InstallationToken */ + /** @var InstallationToken */ private $installationToken; /** @var string */ private $publicKey = ''; @@ -48,7 +45,7 @@ class InstallationTokenRequest extends BunqRequest public function call(): void { $uri = '/v1/installation'; - $data = ['client_public_key' => $this->publicKey,]; + $data = ['client_public_key' => $this->publicKey]; $headers = $this->getDefaultHeaders(); $response = $this->sendUnsignedBunqPost($uri, $data, $headers); Log::debug('Installation request response', $response); diff --git a/app/Services/Bunq/Request/ListDeviceServerRequest.php b/app/Services/Bunq/Request/ListDeviceServerRequest.php index 40957ea306..4c82e91c8e 100644 --- a/app/Services/Bunq/Request/ListDeviceServerRequest.php +++ b/app/Services/Bunq/Request/ListDeviceServerRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; @@ -28,15 +27,13 @@ use FireflyIII\Services\Bunq\Token\InstallationToken; use Illuminate\Support\Collection; /** - * Class ListDeviceServerRequest - * - * @package FireflyIII\Services\Bunq\Request + * Class ListDeviceServerRequest. */ class ListDeviceServerRequest extends BunqRequest { /** @var Collection */ private $devices; - /** @var InstallationToken */ + /** @var InstallationToken */ private $installationToken; public function __construct() diff --git a/app/Services/Bunq/Request/ListMonetaryAccountRequest.php b/app/Services/Bunq/Request/ListMonetaryAccountRequest.php index 231ad1d8db..bfdf871f32 100644 --- a/app/Services/Bunq/Request/ListMonetaryAccountRequest.php +++ b/app/Services/Bunq/Request/ListMonetaryAccountRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; @@ -28,15 +27,13 @@ use FireflyIII\Services\Bunq\Token\SessionToken; use Illuminate\Support\Collection; /** - * Class ListMonetaryAccountRequest - * - * @package FireflyIII\Services\Bunq\Request + * Class ListMonetaryAccountRequest. */ class ListMonetaryAccountRequest extends BunqRequest { - /** @var Collection */ + /** @var Collection */ private $monetaryAccounts; - /** @var SessionToken */ + /** @var SessionToken */ private $sessionToken; /** @var int */ private $userId = 0; diff --git a/app/Services/Bunq/Request/ListUserRequest.php b/app/Services/Bunq/Request/ListUserRequest.php index 066f6ee785..8aa9bf2407 100644 --- a/app/Services/Bunq/Request/ListUserRequest.php +++ b/app/Services/Bunq/Request/ListUserRequest.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Request; @@ -29,19 +28,17 @@ use FireflyIII\Services\Bunq\Object\UserPerson; use FireflyIII\Services\Bunq\Token\SessionToken; /** - * Class ListUserRequest - * - * @package FireflyIII\Services\Bunq\Request + * Class ListUserRequest. */ class ListUserRequest extends BunqRequest { - /** @var SessionToken */ + /** @var SessionToken */ private $sessionToken; - /** @var UserCompany */ + /** @var UserCompany */ private $userCompany; - /** @var UserLight */ + /** @var UserLight */ private $userLight; - /** @var UserPerson */ + /** @var UserPerson */ private $userPerson; /** @@ -90,7 +87,6 @@ class ListUserRequest extends BunqRequest return $this->userPerson; } - /** * @param SessionToken $sessionToken */ diff --git a/app/Services/Bunq/Token/BunqToken.php b/app/Services/Bunq/Token/BunqToken.php index 7ea1b16ab7..e83537fc7a 100644 --- a/app/Services/Bunq/Token/BunqToken.php +++ b/app/Services/Bunq/Token/BunqToken.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Token; @@ -26,19 +25,17 @@ namespace FireflyIII\Services\Bunq\Token; use Carbon\Carbon; /** - * Class BunqToken - * - * @package Bunq\Token + * Class BunqToken. */ class BunqToken { - /** @var Carbon */ + /** @var Carbon */ private $created; /** @var int */ private $id = 0; /** @var string */ private $token = ''; - /** @var Carbon */ + /** @var Carbon */ private $updated; /** diff --git a/app/Services/Bunq/Token/InstallationToken.php b/app/Services/Bunq/Token/InstallationToken.php index 1659da3598..4bf38c4d3c 100644 --- a/app/Services/Bunq/Token/InstallationToken.php +++ b/app/Services/Bunq/Token/InstallationToken.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Bunq\Token; /** - * Class InstallationToken - * - * @package FireflyIII\Services\Bunq\Token + * Class InstallationToken. */ class InstallationToken extends BunqToken { diff --git a/app/Services/Bunq/Token/SessionToken.php b/app/Services/Bunq/Token/SessionToken.php index 1e9df7e787..129216906c 100644 --- a/app/Services/Bunq/Token/SessionToken.php +++ b/app/Services/Bunq/Token/SessionToken.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace Bunq\Token; @@ -26,9 +25,7 @@ namespace Bunq\Token; namespace FireflyIII\Services\Bunq\Token; /** - * Class SessionToken - * - * @package FireflyIII\Services\Bunq\Token + * Class SessionToken. */ class SessionToken extends BunqToken { diff --git a/app/Services/Currency/ExchangeRateInterface.php b/app/Services/Currency/ExchangeRateInterface.php index e783de5f72..5e9bdfd080 100644 --- a/app/Services/Currency/ExchangeRateInterface.php +++ b/app/Services/Currency/ExchangeRateInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Currency; diff --git a/app/Services/Currency/FixerIO.php b/app/Services/Currency/FixerIO.php index b7748953ee..f51541cf6a 100644 --- a/app/Services/Currency/FixerIO.php +++ b/app/Services/Currency/FixerIO.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Currency; @@ -32,13 +31,11 @@ use Requests; use Requests_Exception; /** - * Class FixerIO - * - * @package FireflyIII\Services\Currency + * Class FixerIO. */ class FixerIO implements ExchangeRateInterface { - /** @var User */ + /** @var User */ protected $user; public function getRate(TransactionCurrency $fromCurrency, TransactionCurrency $toCurrency, Carbon $date): CurrencyExchangeRate @@ -57,14 +54,14 @@ class FixerIO implements ExchangeRateInterface // Requests_Exception $rate = 1.0; $content = null; - if ($statusCode !== 200) { + if (200 !== $statusCode) { Log::error(sprintf('Something went wrong. Received error code %d and body "%s" from FixerIO.', $statusCode, $body)); } // get rate from body: - if ($statusCode === 200) { + if (200 === $statusCode) { $content = json_decode($body, true); } - if (!is_null($content)) { + if (null !== $content) { $code = $toCurrency->code; $rate = isset($content['rates'][$code]) ? $content['rates'][$code] : '1'; } diff --git a/app/Services/Password/PwndVerifier.php b/app/Services/Password/PwndVerifier.php index bf4734b0e3..61cf6947b9 100644 --- a/app/Services/Password/PwndVerifier.php +++ b/app/Services/Password/PwndVerifier.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Password; @@ -28,13 +27,10 @@ use Requests; use Requests_Exception; /** - * Class PwndVerifier - * - * @package FireflyIII\Services\Password + * Class PwndVerifier. */ class PwndVerifier implements Verifier { - /** * Verify the given password against (some) service. * @@ -54,7 +50,7 @@ class PwndVerifier implements Verifier return true; } Log::debug(sprintf('Status code returned is %d', $result->status_code)); - if ($result->status_code === 404) { + if (404 === $result->status_code) { return true; } diff --git a/app/Services/Password/Verifier.php b/app/Services/Password/Verifier.php index db600e12ee..54b5f63eb7 100644 --- a/app/Services/Password/Verifier.php +++ b/app/Services/Password/Verifier.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Services\Password; /** - * Interface Verifier - * - * @package FireflyIII\Services\Password + * Interface Verifier. */ interface Verifier { diff --git a/app/Support/Amount.php b/app/Support/Amount.php index 844f0cd5e1..16b251fdec 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; @@ -30,18 +29,15 @@ use Illuminate\Support\Collection; use Preferences as Prefs; /** - * Class Amount - * - * @package FireflyIII\Support + * Class Amount. */ class Amount { - /** * bool $sepBySpace is $localeconv['n_sep_by_space'] * int $signPosn = $localeconv['n_sign_posn'] * string $sign = $localeconv['negative_sign'] - * bool $csPrecedes = $localeconv['n_cs_precedes'] + * bool $csPrecedes = $localeconv['n_cs_precedes']. * * @param bool $sepBySpace * @param int $signPosn @@ -74,7 +70,6 @@ class Amount // AD%v_B%sCE (amount before currency) // the _ is the optional space - // switch on how to display amount: switch ($signPosn) { default: @@ -140,7 +135,7 @@ class Amount $result = $formatted . $space . $format->symbol; } - if ($coloured === true) { + if (true === $coloured) { if ($amount > 0) { return sprintf('%s', $result); } @@ -206,6 +201,7 @@ class Amount /** * @return \FireflyIII\Models\TransactionCurrency + * * @throws FireflyException */ public function getDefaultCurrency(): TransactionCurrency @@ -219,6 +215,7 @@ class Amount * @param User $user * * @return \FireflyIII\Models\TransactionCurrency + * * @throws FireflyException */ public function getDefaultCurrencyByUser(User $user): TransactionCurrency @@ -231,7 +228,7 @@ class Amount } $currencyPreference = Prefs::getForUser($user, 'currencyPreference', config('firefly.default_currency', 'EUR')); $currency = TransactionCurrency::where('code', $currencyPreference->data)->first(); - if (is_null($currency)) { + if (null === $currency) { throw new FireflyException(sprintf('No currency found with code "%s"', $currencyPreference->data)); } $cache->store($currency); @@ -249,8 +246,8 @@ class Amount */ public function getJsConfig(array $config): array { - $negative = self::getAmountJsConfig($config['n_sep_by_space'] === 1, $config['n_sign_posn'], $config['negative_sign'], $config['n_cs_precedes'] === 1); - $positive = self::getAmountJsConfig($config['p_sep_by_space'] === 1, $config['p_sign_posn'], $config['positive_sign'], $config['p_cs_precedes'] === 1); + $negative = self::getAmountJsConfig(1 === $config['n_sep_by_space'], $config['n_sign_posn'], $config['negative_sign'], 1 === $config['n_cs_precedes']); + $positive = self::getAmountJsConfig(1 === $config['p_sep_by_space'], $config['p_sign_posn'], $config['positive_sign'], 1 === $config['p_cs_precedes']); return [ 'pos' => $positive, diff --git a/app/Support/Binder/AccountList.php b/app/Support/Binder/AccountList.php index 415ed494ed..d048a0f666 100644 --- a/app/Support/Binder/AccountList.php +++ b/app/Support/Binder/AccountList.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; @@ -28,13 +27,10 @@ use Illuminate\Support\Collection; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class AccountList - * - * @package FireflyIII\Support\Binder + * Class AccountList. */ class AccountList implements BinderInterface { - /** * @param $value * @param $route diff --git a/app/Support/Binder/BinderInterface.php b/app/Support/Binder/BinderInterface.php index 1754966a77..e5887a69da 100644 --- a/app/Support/Binder/BinderInterface.php +++ b/app/Support/Binder/BinderInterface.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; /** - * Interface BinderInterface - * - * @package FireflyIII\Support\Binder + * Interface BinderInterface. */ interface BinderInterface { diff --git a/app/Support/Binder/BudgetList.php b/app/Support/Binder/BudgetList.php index 1d91fd3a80..279c0982d7 100644 --- a/app/Support/Binder/BudgetList.php +++ b/app/Support/Binder/BudgetList.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; @@ -28,13 +27,10 @@ use Illuminate\Support\Collection; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class BudgetList - * - * @package FireflyIII\Support\Binder + * Class BudgetList. */ class BudgetList implements BinderInterface { - /** * @param $value * @param $route diff --git a/app/Support/Binder/CategoryList.php b/app/Support/Binder/CategoryList.php index 3688972bd8..2469a5c524 100644 --- a/app/Support/Binder/CategoryList.php +++ b/app/Support/Binder/CategoryList.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; @@ -28,13 +27,10 @@ use Illuminate\Support\Collection; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class CategoryList - * - * @package FireflyIII\Support\Binder + * Class CategoryList. */ class CategoryList implements BinderInterface { - /** * @param $value * @param $route diff --git a/app/Support/Binder/CurrencyCode.php b/app/Support/Binder/CurrencyCode.php index 641ec4fd72..e2f810d432 100644 --- a/app/Support/Binder/CurrencyCode.php +++ b/app/Support/Binder/CurrencyCode.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionCurrency; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class CurrencyCode - * - * @package FireflyIII\Support\Binder + * Class CurrencyCode. */ class CurrencyCode implements BinderInterface { - /** * @param $value * @param $route @@ -43,7 +39,7 @@ class CurrencyCode implements BinderInterface public static function routeBinder($value, $route) { $currency = TransactionCurrency::where('code', $value)->first(); - if (!is_null($currency)) { + if (null !== $currency) { return $currency; } throw new NotFoundHttpException; diff --git a/app/Support/Binder/Date.php b/app/Support/Binder/Date.php index 0499b1c5e1..d517fd1957 100644 --- a/app/Support/Binder/Date.php +++ b/app/Support/Binder/Date.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; @@ -30,14 +29,10 @@ use Log; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class Date - * - * @package FireflyIII\Support\Binder + * Class Date. */ class Date implements BinderInterface { - - /** * @param $value * @param $route @@ -70,7 +65,6 @@ class Date implements BinderInterface return $fiscalHelper->startOfFiscalYear(Carbon::now()); case 'currentFiscalYearEnd': return $fiscalHelper->endOfFiscalYear(Carbon::now()); - } } } diff --git a/app/Support/Binder/JournalList.php b/app/Support/Binder/JournalList.php index a5a605423f..cb8171b9cb 100644 --- a/app/Support/Binder/JournalList.php +++ b/app/Support/Binder/JournalList.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; @@ -28,13 +27,10 @@ use Illuminate\Support\Collection; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class JournalList - * - * @package FireflyIII\Support\Binder + * Class JournalList. */ class JournalList implements BinderInterface { - /** * @param $value * @param $route @@ -48,7 +44,7 @@ class JournalList implements BinderInterface /** @var \Illuminate\Support\Collection $object */ $object = TransactionJournal::whereIn('transaction_journals.id', $ids) ->where('transaction_journals.user_id', auth()->user()->id) - ->get(['transaction_journals.*',]); + ->get(['transaction_journals.*']); if ($object->count() > 0) { return $object; diff --git a/app/Support/Binder/TagList.php b/app/Support/Binder/TagList.php index 1bd98fe722..de088a0ddf 100644 --- a/app/Support/Binder/TagList.php +++ b/app/Support/Binder/TagList.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; @@ -29,13 +28,10 @@ use Illuminate\Support\Collection; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class TagList - * - * @package FireflyIII\Support\Binder + * Class TagList. */ class TagList implements BinderInterface { - /** * @param $value * @param $route diff --git a/app/Support/Binder/UnfinishedJournal.php b/app/Support/Binder/UnfinishedJournal.php index 1cf152879e..56b9c42cf5 100644 --- a/app/Support/Binder/UnfinishedJournal.php +++ b/app/Support/Binder/UnfinishedJournal.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Binder; @@ -27,14 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * Class Date - * - * @package FireflyIII\Support\Binder + * Class Date. */ class UnfinishedJournal implements BinderInterface { - - /** * @param $value * @param $route diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 5dc23ccfb5..2cfd0e720c 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; @@ -28,14 +27,11 @@ use Illuminate\Support\Collection; use Preferences as Prefs; /** - * Class CacheProperties - * - * @package FireflyIII\Support + * Class CacheProperties. */ class CacheProperties { - - /** @var string */ + /** @var string */ protected $hash = ''; /** @var Collection */ protected $properties; @@ -81,7 +77,7 @@ class CacheProperties */ public function has(): bool { - if (getenv('APP_ENV') === 'testing') { + if ('testing' === getenv('APP_ENV')) { return false; } $this->hash(); @@ -98,7 +94,6 @@ class CacheProperties } /** - * @return void */ private function hash() { diff --git a/app/Support/ChartColour.php b/app/Support/ChartColour.php index f53e5c412b..3f2eb21488 100644 --- a/app/Support/ChartColour.php +++ b/app/Support/ChartColour.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; /** - * Class ChartColour - * - * @package FireflyIII\Support + * Class ChartColour. */ class ChartColour { diff --git a/app/Support/Domain.php b/app/Support/Domain.php index 03e093b638..c94e1e80b5 100644 --- a/app/Support/Domain.php +++ b/app/Support/Domain.php @@ -18,15 +18,12 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; /** - * Class Domain - * - * @package FireflyIII\Support + * Class Domain. */ class Domain { diff --git a/app/Support/Events/BillScanner.php b/app/Support/Events/BillScanner.php index d58a048e72..21315f668a 100644 --- a/app/Support/Events/BillScanner.php +++ b/app/Support/Events/BillScanner.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Events; @@ -27,9 +26,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Bill\BillRepositoryInterface; /** - * Class BillScanner - * - * @package FireflyIII\Support\Events + * Class BillScanner. */ class BillScanner { diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 764b8f1beb..0c3b5b5e1f 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; @@ -28,19 +27,14 @@ use Carbon\Carbon; use Eloquent; use Illuminate\Support\Collection; use Illuminate\Support\MessageBag; -use Input; use RuntimeException; use Session; /** - * Class ExpandedForm - * - * @package FireflyIII\Support - * + * Class ExpandedForm. */ class ExpandedForm { - /** * @param $name * @param null $value @@ -87,7 +81,7 @@ class ExpandedForm */ public function checkbox(string $name, $value = 1, $checked = null, $options = []): string { - $options['checked'] = $checked === true ? true : null; + $options['checked'] = true === $checked ? true : null; $label = $this->label($name, $options); $options = $this->expandOptionArray($name, $label, $options); $classes = $this->getHolderClasses($name); @@ -173,7 +167,6 @@ class ExpandedForm } /** - * * Takes any collection and tries to make a sensible select list compatible array of it. * * @param \Illuminate\Support\Collection $set @@ -190,7 +183,7 @@ class ExpandedForm $title = null; foreach ($fields as $field) { - if (isset($entry->$field) && is_null($title)) { + if (isset($entry->$field) && null === $title) { $title = $entry->$field; } } @@ -216,7 +209,7 @@ class ExpandedForm $title = null; foreach ($fields as $field) { - if (isset($entry->$field) && is_null($title)) { + if (isset($entry->$field) && null === $title) { $title = $entry->$field; } } @@ -287,11 +280,10 @@ class ExpandedForm unset($options['placeholder']); // make sure value is formatted nicely: - if (!is_null($value) && $value !== '') { + if (null !== $value && '' !== $value) { $value = round($value, $selectedCurrency->decimal_places); } - $html = view('form.non-selectable-amount', compact('selectedCurrency', 'classes', 'name', 'label', 'value', 'options'))->render(); return $html; @@ -316,12 +308,11 @@ class ExpandedForm unset($options['placeholder']); // make sure value is formatted nicely: - if (!is_null($value) && $value !== '') { + if (null !== $value && '' !== $value) { $decimals = $selectedCurrency->decimal_places ?? 2; $value = round($value, $decimals); } - $html = view('form.non-selectable-amount', compact('selectedCurrency', 'classes', 'name', 'label', 'value', 'options'))->render(); return $html; @@ -364,7 +355,7 @@ class ExpandedForm // don't care } - $previousValue = is_null($previousValue) ? 'store' : $previousValue; + $previousValue = null === $previousValue ? 'store' : $previousValue; $html = view('form.options', compact('type', 'name', 'previousValue'))->render(); return $html; @@ -508,10 +499,10 @@ class ExpandedForm { if (Session::has('preFilled')) { $preFilled = session('preFilled'); - $value = isset($preFilled[$name]) && is_null($value) ? $preFilled[$name] : $value; + $value = isset($preFilled[$name]) && null === $value ? $preFilled[$name] : $value; } try { - if (!is_null(request()->old($name))) { + if (null !== request()->old($name)) { $value = request()->old($name); } } catch (RuntimeException $e) { @@ -521,7 +512,6 @@ class ExpandedForm $value = $value->format('Y-m-d'); } - return $value; } @@ -532,14 +522,12 @@ class ExpandedForm */ protected function getHolderClasses(string $name): string { - /* - * Get errors from session: - */ + // Get errors from session: /** @var MessageBag $errors */ $errors = session('errors'); $classes = 'form-group'; - if (!is_null($errors) && $errors->has($name)) { + if (null !== $errors && $errors->has($name)) { $classes = 'form-group has-error has-feedback'; } @@ -596,11 +584,10 @@ class ExpandedForm } // make sure value is formatted nicely: - if (!is_null($value) && $value !== '') { + if (null !== $value && '' !== $value) { $value = round($value, $defaultCurrency->decimal_places); } - $html = view('form.' . $view, compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render(); return $html; diff --git a/app/Support/Facades/Amount.php b/app/Support/Facades/Amount.php index ab7dcd3d4c..d60471705d 100644 --- a/app/Support/Facades/Amount.php +++ b/app/Support/Facades/Amount.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Facades; @@ -26,9 +25,7 @@ namespace FireflyIII\Support\Facades; use Illuminate\Support\Facades\Facade; /** - * Class Amount - * - * @package FireflyIII\Support\Facades + * Class Amount. */ class Amount extends Facade { diff --git a/app/Support/Facades/ExpandedForm.php b/app/Support/Facades/ExpandedForm.php index 9f71f90399..9334a4212c 100644 --- a/app/Support/Facades/ExpandedForm.php +++ b/app/Support/Facades/ExpandedForm.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Facades; @@ -26,9 +25,7 @@ namespace FireflyIII\Support\Facades; use Illuminate\Support\Facades\Facade; /** - * Class Amount - * - * @package FireflyIII\Support\Facades + * Class Amount. */ class ExpandedForm extends Facade { diff --git a/app/Support/Facades/FireflyConfig.php b/app/Support/Facades/FireflyConfig.php index 048e3e4b25..d8da789f1f 100644 --- a/app/Support/Facades/FireflyConfig.php +++ b/app/Support/Facades/FireflyConfig.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Facades; @@ -26,9 +25,7 @@ namespace FireflyIII\Support\Facades; use Illuminate\Support\Facades\Facade; /** - * Class FireflyConfig - * - * @package FireflyIII\Support\Facades + * Class FireflyConfig. */ class FireflyConfig extends Facade { diff --git a/app/Support/Facades/Navigation.php b/app/Support/Facades/Navigation.php index 95665752fb..cd5ef864f3 100644 --- a/app/Support/Facades/Navigation.php +++ b/app/Support/Facades/Navigation.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Facades; @@ -26,9 +25,7 @@ namespace FireflyIII\Support\Facades; use Illuminate\Support\Facades\Facade; /** - * Class Navigation - * - * @package FireflyIII\Support\Facades + * Class Navigation. */ class Navigation extends Facade { diff --git a/app/Support/Facades/Preferences.php b/app/Support/Facades/Preferences.php index d6a6373fb1..1cb13a12d6 100644 --- a/app/Support/Facades/Preferences.php +++ b/app/Support/Facades/Preferences.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Facades; @@ -26,9 +25,7 @@ namespace FireflyIII\Support\Facades; use Illuminate\Support\Facades\Facade; /** - * Class Preferences - * - * @package FireflyIII\Support\Facades + * Class Preferences. */ class Preferences extends Facade { diff --git a/app/Support/Facades/Steam.php b/app/Support/Facades/Steam.php index 015e910873..cc523bff9d 100644 --- a/app/Support/Facades/Steam.php +++ b/app/Support/Facades/Steam.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Facades; @@ -26,9 +25,7 @@ namespace FireflyIII\Support\Facades; use Illuminate\Support\Facades\Facade; /** - * Class Steam - * - * @package FireflyIII\Support\Facades + * Class Steam. */ class Steam extends Facade { diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.php index 367d4c7c06..6842300967 100644 --- a/app/Support/FireflyConfig.php +++ b/app/Support/FireflyConfig.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; @@ -28,9 +27,7 @@ use FireflyIII\Models\Configuration; use Log; /** - * Class FireflyConfig - * - * @package FireflyIII\Support + * Class FireflyConfig. */ class FireflyConfig { @@ -38,6 +35,7 @@ class FireflyConfig * @param $name * * @return bool + * * @throws \Exception */ public function delete($name): bool @@ -72,7 +70,7 @@ class FireflyConfig return $config; } // no preference found and default is null: - if (is_null($default)) { + if (null === $default) { return null; } @@ -100,7 +98,7 @@ class FireflyConfig { Log::debug('Set new value for ', ['name' => $name]); $config = Configuration::whereName($name)->first(); - if (is_null($config)) { + if (null === $config) { Log::debug('Does not exist yet ', ['name' => $name]); $item = new Configuration; $item->name = $name; diff --git a/app/Support/Import/Configuration/ConfigurationInterface.php b/app/Support/Import/Configuration/ConfigurationInterface.php index a5723a55ad..14a2ecb4ae 100644 --- a/app/Support/Import/Configuration/ConfigurationInterface.php +++ b/app/Support/Import/Configuration/ConfigurationInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Import\Configuration; @@ -26,9 +25,7 @@ namespace FireflyIII\Support\Import\Configuration; use FireflyIII\Models\ImportJob; /** - * Class ConfigurationInterface - * - * @package FireflyIII\Support\Import\Configuration + * Class ConfigurationInterface. */ interface ConfigurationInterface { diff --git a/app/Support/Import/Configuration/Csv/Initial.php b/app/Support/Import/Configuration/Csv/Initial.php index c6f770e777..dff977be5c 100644 --- a/app/Support/Import/Configuration/Csv/Initial.php +++ b/app/Support/Import/Configuration/Csv/Initial.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Import\Configuration\Csv; @@ -31,9 +30,7 @@ use FireflyIII\Support\Import\Configuration\ConfigurationInterface; use Log; /** - * Class CsvInitial - * - * @package FireflyIII\Support\Import\Configuration + * Class CsvInitial. */ class Initial implements ConfigurationInterface { @@ -109,23 +106,22 @@ class Initial implements ConfigurationInterface $importId = $data['csv_import_account'] ?? 0; $account = $repository->find(intval($importId)); - $hasHeaders = isset($data['has_headers']) && intval($data['has_headers']) === 1 ? true : false; + $hasHeaders = isset($data['has_headers']) && 1 === intval($data['has_headers']) ? true : false; $config = $this->job->configuration; $config['initial-config-complete'] = true; $config['has-headers'] = $hasHeaders; $config['date-format'] = $data['date_format']; $config['delimiter'] = $data['csv_delimiter']; - $config['delimiter'] = $config['delimiter'] === 'tab' ? "\t" : $config['delimiter']; + $config['delimiter'] = 'tab' === $config['delimiter'] ? "\t" : $config['delimiter']; Log::debug('Entered import account.', ['id' => $importId]); - - if (!is_null($account->id)) { + if (null !== $account->id) { Log::debug('Found account.', ['id' => $account->id, 'name' => $account->name]); $config['import-account'] = $account->id; } - if (is_null($account->id)) { + if (null === $account->id) { Log::error('Could not find anything for csv_import_account.', ['id' => $importId]); } diff --git a/app/Support/Import/Configuration/Csv/Map.php b/app/Support/Import/Configuration/Csv/Map.php index 612d782b4f..7aa35f62b0 100644 --- a/app/Support/Import/Configuration/Csv/Map.php +++ b/app/Support/Import/Configuration/Csv/Map.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Import\Configuration\Csv; @@ -33,9 +32,7 @@ use League\Csv\Reader; use Log; /** - * Class Mapping - * - * @package FireflyIII\Support\Import\Configuration\Csv + * Class Mapping. */ class Map implements ConfigurationInterface { @@ -43,13 +40,14 @@ class Map implements ConfigurationInterface private $configuration = []; /** @var array that holds each column to be mapped by the user */ private $data = []; - /** @var ImportJob */ + /** @var ImportJob */ private $job; /** @var array */ private $validSpecifics = []; /** * @return array + * * @throws FireflyException */ public function getData(): array @@ -79,10 +77,9 @@ class Map implements ConfigurationInterface } $value = $row[$index]; if (strlen($value) > 0) { - // we can do some preprocessing here, // which is exclusively to fix the tags: - if (!is_null($this->data[$index]['preProcessMap']) && strlen($this->data[$index]['preProcessMap']) > 0) { + if (null !== $this->data[$index]['preProcessMap'] && strlen($this->data[$index]['preProcessMap']) > 0) { /** @var PreProcessorInterface $preProcessor */ $preProcessor = app($this->data[$index]['preProcessMap']); $result = $preProcessor->run($value); @@ -92,7 +89,6 @@ class Map implements ConfigurationInterface Log::debug($rowIndex . ':' . $index . 'Value after preprocessor', ['value-new' => $result]); Log::debug($rowIndex . ':' . $index . 'Value after joining', ['value-complete' => $this->data[$index]['values']]); - continue; } @@ -154,7 +150,7 @@ class Map implements ConfigurationInterface $config['column-mapping-config'][$index] = []; foreach ($data as $value => $mapId) { $mapId = intval($mapId); - if ($mapId !== 0) { + if (0 !== $mapId) { $config['column-mapping-config'][$index][$value] = intval($mapId); } } @@ -192,15 +188,13 @@ class Map implements ConfigurationInterface $config = $this->job->configuration; /** - * @var int $index + * @var int * @var bool $mustBeMapped */ foreach ($config['column-do-mapping'] as $index => $mustBeMapped) { $column = $this->validateColumnName($config['column-roles'][$index] ?? '_ignore'); $shouldMap = $this->shouldMapColumn($column, $mustBeMapped); if ($shouldMap) { - - // create configuration entry for this specific column and add column to $this->data array for later processing. $this->data[$index] = [ 'name' => $column, @@ -226,7 +220,7 @@ class Map implements ConfigurationInterface $hasPreProcess = config('csv.import_roles.' . $column . '.pre-process-map'); $preProcessClass = config('csv.import_roles.' . $column . '.pre-process-mapper'); - if (!is_null($hasPreProcess) && $hasPreProcess === true && !is_null($preProcessClass)) { + if (null !== $hasPreProcess && true === $hasPreProcess && null !== $preProcessClass) { $name = sprintf('\\FireflyIII\\Import\\MapperPreProcess\\%s', $preProcessClass); } @@ -237,6 +231,7 @@ class Map implements ConfigurationInterface * @param array $row * * @return array + * * @throws FireflyException */ private function runSpecifics(array $row): array @@ -269,13 +264,14 @@ class Map implements ConfigurationInterface { $canBeMapped = config('csv.import_roles.' . $column . '.mappable'); - return ($canBeMapped && $mustBeMapped); + return $canBeMapped && $mustBeMapped; } /** * @param string $column * * @return string + * * @throws FireflyException */ private function validateColumnName(string $column): string diff --git a/app/Support/Import/Configuration/Csv/Roles.php b/app/Support/Import/Configuration/Csv/Roles.php index 265b98aeab..2f03e3f1a5 100644 --- a/app/Support/Import/Configuration/Csv/Roles.php +++ b/app/Support/Import/Configuration/Csv/Roles.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Import\Configuration\Csv; @@ -30,14 +29,12 @@ use League\Csv\Reader; use Log; /** - * Class Roles - * - * @package FireflyIII\Support\Import\Configuration\Csv + * Class Roles. */ class Roles implements ConfigurationInterface { private $data = []; - /** @var ImportJob */ + /** @var ImportJob */ private $job; /** @var string */ @@ -75,7 +72,7 @@ class Roles implements ConfigurationInterface $count = count($row); $this->data['total'] = $count > $this->data['total'] ? $count : $this->data['total']; $this->processRow($row); - $start++; + ++$start; } $this->updateColumCount(); @@ -118,7 +115,7 @@ class Roles implements ConfigurationInterface Log::debug('Now in storeConfiguration of Roles.'); $config = $this->job->configuration; $count = $config['column-count']; - for ($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; ++$i) { $role = $data['role'][$i] ?? '_ignore'; $mapping = isset($data['map'][$i]) && $data['map'][$i] === '1' ? true : false; $config['column-roles'][$i] = $role; @@ -126,7 +123,6 @@ class Roles implements ConfigurationInterface Log::debug(sprintf('Column %d has been given role %s', $i, $role)); } - $this->job->configuration = $config; $this->job->save(); @@ -134,7 +130,6 @@ class Roles implements ConfigurationInterface $this->setRolesComplete(); $this->isMappingNecessary(); - return true; } @@ -158,11 +153,11 @@ class Roles implements ConfigurationInterface { $config = $this->job->configuration; $count = $config['column-count']; - for ($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; ++$i) { $role = $config['column-roles'][$i] ?? '_ignore'; $mapping = $config['column-do-mapping'][$i] ?? false; - if ($role === '_ignore' && $mapping === true) { + if ('_ignore' === $role && true === $mapping) { $mapping = false; Log::debug(sprintf('Column %d has type %s so it cannot be mapped.', $i, $role)); } @@ -183,14 +178,14 @@ class Roles implements ConfigurationInterface $config = $this->job->configuration; $count = $config['column-count']; $toBeMapped = 0; - for ($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; ++$i) { $mapping = $config['column-do-mapping'][$i] ?? false; - if ($mapping === true) { - $toBeMapped++; + if (true === $mapping) { + ++$toBeMapped; } } Log::debug(sprintf('Found %d columns that need mapping.', $toBeMapped)); - if ($toBeMapped === 0) { + if (0 === $toBeMapped) { // skip setting of map, because none need to be mapped: $config['column-mapping-complete'] = true; $this->job->configuration = $config; @@ -201,7 +196,7 @@ class Roles implements ConfigurationInterface } /** - * make unique example data + * make unique example data. */ private function makeExamplesUnique(): bool { @@ -258,12 +253,12 @@ class Roles implements ConfigurationInterface $count = $config['column-count']; $assigned = 0; $hasAmount = false; - for ($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; ++$i) { $role = $config['column-roles'][$i] ?? '_ignore'; - if ($role !== '_ignore') { - $assigned++; + if ('_ignore' !== $role) { + ++$assigned; } - if ($role === 'amount') { + if ('amount' === $role) { $hasAmount = true; } } @@ -273,7 +268,7 @@ class Roles implements ConfigurationInterface $this->job->save(); $this->warning = ''; } - if ($assigned === 0 || !$hasAmount) { + if (0 === $assigned || !$hasAmount) { $this->warning = strval(trans('csv.roles_warning')); } diff --git a/app/Support/Import/Information/BunqInformation.php b/app/Support/Import/Information/BunqInformation.php index 9570506a0d..3c76d63558 100644 --- a/app/Support/Import/Information/BunqInformation.php +++ b/app/Support/Import/Information/BunqInformation.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Import\Information; @@ -38,14 +37,11 @@ use Log; use Preferences; /** - * Class BunqInformation - * - * @package FireflyIII\Support\Import\Information + * Class BunqInformation. */ class BunqInformation implements InformationInterface { - - /** @var User */ + /** @var User */ private $user; /** @@ -92,7 +88,7 @@ class BunqInformation implements InformationInterface ]; /** @var Alias $alias */ foreach ($account->getAliases() as $alias) { - if ($alias->getType() === 'IBAN') { + if ('IBAN' === $alias->getType()) { $current['number'] = $alias->getValue(); } } @@ -161,6 +157,7 @@ class BunqInformation implements InformationInterface * @param SessionToken $sessionToken * * @return int + * * @throws FireflyException */ private function getUserInformation(SessionToken $sessionToken): int diff --git a/app/Support/Import/Information/InformationInterface.php b/app/Support/Import/Information/InformationInterface.php index 068889f2fe..7de8e527d4 100644 --- a/app/Support/Import/Information/InformationInterface.php +++ b/app/Support/Import/Information/InformationInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Import\Information; @@ -26,13 +25,10 @@ namespace FireflyIII\Support\Import\Information; use FireflyIII\User; /** - * Interface InformationInterface - * - * @package FireflyIII\Support\Import\Information + * Interface InformationInterface. */ interface InformationInterface { - /** * Returns a collection of accounts. Preferrably, these follow a uniform Firefly III format so they can be managed over banks. * diff --git a/app/Support/Import/Prerequisites/BunqPrerequisites.php b/app/Support/Import/Prerequisites/BunqPrerequisites.php index c9eae0595b..75614b3762 100644 --- a/app/Support/Import/Prerequisites/BunqPrerequisites.php +++ b/app/Support/Import/Prerequisites/BunqPrerequisites.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Import\Prerequisites; @@ -41,12 +40,10 @@ use Requests_Exception; /** * This class contains all the routines necessary to connect to Bunq. - * - * @package FireflyIII\Support\Import\Prerequisites */ class BunqPrerequisites implements PrerequisitesInterface { - /** @var User */ + /** @var User */ private $user; /** @@ -80,7 +77,7 @@ class BunqPrerequisites implements PrerequisitesInterface { $apiKey = Preferences::getForUser($this->user, 'bunq_api_key', false); - return ($apiKey->data === false || is_null($apiKey->data)); + return false === $apiKey->data || null === $apiKey->data; } /** @@ -156,6 +153,7 @@ class BunqPrerequisites implements PrerequisitesInterface * to try and detect the server ID for this firefly instance. * * @return DeviceServerId + * * @throws FireflyException */ private function getExistingDevice(): DeviceServerId @@ -187,7 +185,7 @@ class BunqPrerequisites implements PrerequisitesInterface { Log::debug('Get installation token.'); $token = Preferences::getForUser($this->user, 'bunq_installation_token', null); - if (!is_null($token)) { + if (null !== $token) { return $token->data; } Log::debug('Have no token, request one.'); @@ -219,7 +217,7 @@ class BunqPrerequisites implements PrerequisitesInterface { Log::debug('get private key'); $preference = Preferences::getForUser($this->user, 'bunq_private_key', null); - if (is_null($preference)) { + if (null === $preference) { Log::debug('private key is null'); // create key pair $this->createKeyPair(); @@ -239,7 +237,7 @@ class BunqPrerequisites implements PrerequisitesInterface { Log::debug('get public key'); $preference = Preferences::getForUser($this->user, 'bunq_public_key', null); - if (is_null($preference)) { + if (null === $preference) { Log::debug('public key is null'); // create key pair $this->createKeyPair(); @@ -254,18 +252,19 @@ class BunqPrerequisites implements PrerequisitesInterface * Request users server remote IP. Let's assume this value will not change any time soon. * * @return string + * * @throws FireflyException */ private function getRemoteIp(): string { $preference = Preferences::getForUser($this->user, 'external_ip', null); - if (is_null($preference)) { + if (null === $preference) { try { $response = Requests::get('https://api.ipify.org'); } catch (Requests_Exception $e) { throw new FireflyException(sprintf('Could not retrieve external IP: %s', $e->getMessage())); } - if ($response->status_code !== 200) { + if (200 !== $response->status_code) { throw new FireflyException(sprintf('Could not retrieve external IP: %d %s', $response->status_code, $response->body)); } $serverIp = $response->body; @@ -299,7 +298,7 @@ class BunqPrerequisites implements PrerequisitesInterface Log::debug('Now in registerDevice'); $deviceServerId = Preferences::getForUser($this->user, 'bunq_device_server_id', null); $serverIp = $this->getRemoteIp(); - if (!is_null($deviceServerId)) { + if (null !== $deviceServerId) { Log::debug('Have device server ID.'); return $deviceServerId->data; @@ -323,7 +322,7 @@ class BunqPrerequisites implements PrerequisitesInterface } catch (FireflyException $e) { Log::error($e->getMessage()); } - if (is_null($deviceServerId)) { + if (null === $deviceServerId) { // try get the current from a list: $deviceServerId = $this->getExistingDevice(); } diff --git a/app/Support/Import/Prerequisites/PrerequisitesInterface.php b/app/Support/Import/Prerequisites/PrerequisitesInterface.php index f6042869d4..e52fad7d61 100644 --- a/app/Support/Import/Prerequisites/PrerequisitesInterface.php +++ b/app/Support/Import/Prerequisites/PrerequisitesInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Import\Prerequisites; diff --git a/app/Support/Models/TransactionJournalTrait.php b/app/Support/Models/TransactionJournalTrait.php index ff039bea5a..928fa95e79 100644 --- a/app/Support/Models/TransactionJournalTrait.php +++ b/app/Support/Models/TransactionJournalTrait.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Models; @@ -35,19 +34,18 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; /** - * Class TransactionJournalTrait + * Class TransactionJournalTrait. * * @property int $id * @property Carbon $date * @property string $transaction_type_type * @property TransactionType $transactionType - * - * @package FireflyIII\Support\Models */ trait TransactionJournalTrait { /** * @return string + * * @throws FireflyException */ public function amount(): string @@ -100,7 +98,7 @@ trait TransactionJournalTrait public function budgetId(): int { $budget = $this->budgets()->first(); - if (!is_null($budget)) { + if (null !== $budget) { return $budget->id; } @@ -123,7 +121,7 @@ trait TransactionJournalTrait public function categoryAsString(): string { $category = $this->categories()->first(); - if (!is_null($category)) { + if (null !== $category) { return $category->name; } @@ -137,10 +135,10 @@ trait TransactionJournalTrait */ public function dateAsString(string $dateField = ''): string { - if ($dateField === '') { + if ('' === $dateField) { return $this->date->format('Y-m-d'); } - if (!is_null($this->$dateField) && $this->$dateField instanceof Carbon) { + if (null !== $this->$dateField && $this->$dateField instanceof Carbon) { // make field NULL $carbon = clone $this->$dateField; $this->$dateField = null; @@ -153,7 +151,7 @@ trait TransactionJournalTrait return $carbon->format('Y-m-d'); } $metaField = $this->getMeta($dateField); - if (!is_null($metaField)) { + if (null !== $metaField) { $carbon = new Carbon($metaField); return $carbon->format('Y-m-d'); @@ -205,7 +203,6 @@ trait TransactionJournalTrait } /** - * * @param string $name * * @return string @@ -226,7 +223,7 @@ trait TransactionJournalTrait public function isJoined(Builder $query, string $table): bool { $joins = $query->getQuery()->joins; - if (is_null($joins)) { + if (null === $joins) { return false; } foreach ($joins as $join) { @@ -239,19 +236,16 @@ trait TransactionJournalTrait } /** - * * @return bool */ abstract public function isOpeningBalance(): bool; /** - * * @return bool */ abstract public function isTransfer(): bool; /** - * * @return bool */ abstract public function isWithdrawal(): bool; @@ -284,7 +278,7 @@ trait TransactionJournalTrait /** * Save the model to the database. * - * @param array $options + * @param array $options * * @return bool */ diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index ae3ec494b0..402a48a666 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; @@ -27,19 +26,17 @@ use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; /** - * Class Navigation - * - * @package FireflyIII\Support + * Class Navigation. */ class Navigation { - /** * @param \Carbon\Carbon $theDate * @param $repeatFreq * @param $skip * * @return \Carbon\Carbon + * * @throws FireflyException */ public function addPeriod(Carbon $theDate, string $repeatFreq, int $skip): Carbon @@ -75,7 +72,7 @@ class Navigation // if period is 1M and diff in month is 2 and new DOM = 1, sub a day: $months = ['1M', 'month', 'monthly']; $difference = $date->month - $theDate->month; - if (in_array($repeatFreq, $months) && $difference === 2 && $date->day === 1) { + if (in_array($repeatFreq, $months) && 2 === $difference && 1 === $date->day) { $date->subDay(); } @@ -87,6 +84,7 @@ class Navigation * @param $repeatFreq * * @return \Carbon\Carbon + * * @throws FireflyException */ public function endOfPeriod(\Carbon\Carbon $end, string $repeatFreq): Carbon @@ -113,7 +111,7 @@ class Navigation // if the range is custom, the end of the period // is another X days (x is the difference between start) // and end added to $theCurrentEnd - if ($repeatFreq === 'custom') { + if ('custom' === $repeatFreq) { /** @var Carbon $tStart */ $tStart = session('start', Carbon::now()->startOfMonth()); /** @var Carbon $tEnd */ @@ -178,7 +176,7 @@ class Navigation $currentEnd->$function(); } - if (!is_null($maxDate) && $currentEnd > $maxDate) { + if (null !== $maxDate && $currentEnd > $maxDate) { return clone $maxDate; } @@ -227,6 +225,7 @@ class Navigation * @param $repeatFrequency * * @return string + * * @throws FireflyException */ public function periodShow(Carbon $theDate, string $repeatFrequency): string @@ -248,13 +247,12 @@ class Navigation 'year' => trans('config.year'), 'yearly' => trans('config.year'), '6M' => trans('config.half_year'), - ]; if (isset($formatMap[$repeatFrequency])) { return $date->formatLocalized(strval($formatMap[$repeatFrequency])); } - if ($repeatFrequency === '3M' || $repeatFrequency === 'quarter') { + if ('3M' === $repeatFrequency || 'quarter' === $repeatFrequency) { $quarter = ceil($theDate->month / 3); return sprintf('Q%d %d', $quarter, $theDate->year); @@ -384,6 +382,7 @@ class Navigation * @param $repeatFreq * * @return \Carbon\Carbon + * * @throws FireflyException */ public function startOfPeriod(Carbon $theDate, string $repeatFreq): Carbon @@ -412,7 +411,7 @@ class Navigation return $date; } - if ($repeatFreq === 'half-year' || $repeatFreq === '6M') { + if ('half-year' === $repeatFreq || '6M' === $repeatFreq) { $month = $date->month; $date->startOfYear(); if ($month >= 7) { @@ -421,11 +420,10 @@ class Navigation return $date; } - if ($repeatFreq === 'custom') { + if ('custom' === $repeatFreq) { return $date; // the date is already at the start. } - throw new FireflyException(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $repeatFreq)); } @@ -435,6 +433,7 @@ class Navigation * @param int $subtract * * @return \Carbon\Carbon + * * @throws FireflyException */ public function subtractPeriod(Carbon $theDate, string $repeatFreq, int $subtract = 1): Carbon @@ -476,7 +475,7 @@ class Navigation // a custom range requires the session start // and session end to calculate the difference in days. // this is then subtracted from $theDate (* $subtract). - if ($repeatFreq === 'custom') { + if ('custom' === $repeatFreq) { /** @var Carbon $tStart */ $tStart = session('start', Carbon::now()->startOfMonth()); /** @var Carbon $tEnd */ @@ -495,6 +494,7 @@ class Navigation * @param \Carbon\Carbon $start * * @return \Carbon\Carbon + * * @throws FireflyException */ public function updateEndDate(string $range, Carbon $start): Carbon @@ -515,7 +515,7 @@ class Navigation return $end; } - if ($range === '6M') { + if ('6M' === $range) { if ($start->month >= 7) { $end->endOfYear(); @@ -533,6 +533,7 @@ class Navigation * @param \Carbon\Carbon $start * * @return \Carbon\Carbon + * * @throws FireflyException */ public function updateStartDate(string $range, Carbon $start): Carbon @@ -551,7 +552,7 @@ class Navigation return $start; } - if ($range === '6M') { + if ('6M' === $range) { if ($start->month >= 7) { $start->startOfYear()->addMonths(6); diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index 33a7becce5..0750c44394 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; @@ -30,9 +29,7 @@ use Illuminate\Support\Collection; use Session; /** - * Class Preferences - * - * @package FireflyIII\Support + * Class Preferences. */ class Preferences { @@ -53,6 +50,7 @@ class Preferences * @param $name * * @return bool + * * @throws \Exception */ public function delete(string $name): bool @@ -87,7 +85,7 @@ class Preferences public function get($name, $default = null) { $user = auth()->user(); - if (is_null($user)) { + if (null === $user) { return $default; } @@ -119,7 +117,7 @@ class Preferences /** * @param \FireflyIII\User $user - * @param string $name + * @param string $name * @param null|string $default * * @return \FireflyIII\Models\Preference|null @@ -139,7 +137,7 @@ class Preferences return $preference; } // no preference found and default is null: - if (is_null($default)) { + if (null === $default) { // return NULL return null; } @@ -154,7 +152,7 @@ class Preferences { $lastActivity = microtime(); $preference = $this->get('lastActivity', microtime()); - if (!is_null($preference)) { + if (null !== $preference) { $lastActivity = $preference->data; } @@ -173,15 +171,15 @@ class Preferences } /** - * @param $name - * @param $value + * @param $name + * @param $value * * @return Preference */ public function set($name, $value): Preference { $user = auth()->user(); - if (is_null($user)) { + if (null === $user) { // make new preference, return it: $pref = new Preference; $pref->name = $name; @@ -206,7 +204,7 @@ class Preferences Cache::forget($fullName); $pref = Preference::where('user_id', $user->id)->where('name', $name)->first(['id', 'name', 'data']); - if (!is_null($pref)) { + if (null !== $pref) { $pref->data = $value; $pref->save(); diff --git a/app/Support/Search/Modifier.php b/app/Support/Search/Modifier.php index cf23cc9383..4d2271a729 100644 --- a/app/Support/Search/Modifier.php +++ b/app/Support/Search/Modifier.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Search; @@ -56,6 +55,7 @@ class Modifier * @SuppressWarnings(PHPMD.CyclomaticComplexity) * * @return bool + * * @throws FireflyException */ public static function apply(array $modifier, Transaction $transaction): bool @@ -149,7 +149,7 @@ class Modifier */ public static function stringCompare(string $haystack, string $needle): bool { - $res = !(strpos(strtolower($haystack), strtolower($needle)) === false); + $res = !(false === strpos(strtolower($haystack), strtolower($needle))); Log::debug(sprintf('"%s" is in "%s"? %s', $needle, $haystack, var_export($res, true))); return $res; @@ -164,11 +164,11 @@ class Modifier private static function budget(Transaction $transaction, string $search): bool { $journalBudget = ''; - if (!is_null($transaction->transaction_journal_budget_name)) { + if (null !== $transaction->transaction_journal_budget_name) { $journalBudget = Steam::decrypt(intval($transaction->transaction_journal_budget_encrypted), $transaction->transaction_journal_budget_name); } $transactionBudget = ''; - if (!is_null($transaction->transaction_budget_name)) { + if (null !== $transaction->transaction_budget_name) { $journalBudget = Steam::decrypt(intval($transaction->transaction_budget_encrypted), $transaction->transaction_budget_name); } @@ -184,11 +184,11 @@ class Modifier private static function category(Transaction $transaction, string $search): bool { $journalCategory = ''; - if (!is_null($transaction->transaction_journal_category_name)) { + if (null !== $transaction->transaction_journal_category_name) { $journalCategory = Steam::decrypt(intval($transaction->transaction_journal_category_encrypted), $transaction->transaction_journal_category_name); } $transactionCategory = ''; - if (!is_null($transaction->transaction_category_name)) { + if (null !== $transaction->transaction_category_name) { $journalCategory = Steam::decrypt(intval($transaction->transaction_category_encrypted), $transaction->transaction_category_name); } diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.php index 7b59960233..e5aa93b4cb 100644 --- a/app/Support/Search/Search.php +++ b/app/Support/Search/Search.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Search; @@ -33,9 +32,7 @@ use Illuminate\Support\Collection; use Log; /** - * Class Search - * - * @package FireflyIII\Search + * Class Search. */ class Search implements SearchInterface { @@ -43,13 +40,13 @@ class Search implements SearchInterface private $limit = 100; /** @var Collection */ private $modifiers; - /** @var string */ + /** @var string */ private $originalQuery = ''; /** @var User */ private $user; /** @var array */ private $validModifiers = []; - /** @var array */ + /** @var array */ private $words = []; /** @@ -67,7 +64,7 @@ class Search implements SearchInterface public function getWordsAsString(): string { $string = join(' ', $this->words); - if (strlen($string) === 0) { + if (0 === strlen($string)) { return is_string($this->originalQuery) ? $this->originalQuery : ''; } @@ -150,7 +147,7 @@ class Search implements SearchInterface Log::debug(sprintf('Total count is now %d', $result->count())); // Update counters - $page++; + ++$page; $processed += count($set); Log::debug(sprintf('Page is now %d, processed is %d', $page, $processed)); @@ -235,7 +232,6 @@ class Search implements SearchInterface } } - return $collector; } @@ -245,12 +241,12 @@ class Search implements SearchInterface private function extractModifier(string $string) { $parts = explode(':', $string); - if (count($parts) === 2 && strlen(trim(strval($parts[0]))) > 0 && strlen(trim(strval($parts[1])))) { + if (2 === count($parts) && strlen(trim(strval($parts[0]))) > 0 && strlen(trim(strval($parts[1])))) { $type = trim(strval($parts[0])); $value = trim(strval($parts[1])); if (in_array($type, $this->validModifiers)) { // filter for valid type - $this->modifiers->push(['type' => $type, 'value' => $value,]); + $this->modifiers->push(['type' => $type, 'value' => $value]); } } } @@ -259,6 +255,7 @@ class Search implements SearchInterface * @param Transaction $transaction * * @return bool + * * @throws FireflyException */ private function matchModifiers(Transaction $transaction): bool @@ -278,7 +275,7 @@ class Search implements SearchInterface // then a for-each and a switch for every possible other thingie. foreach ($this->modifiers as $modifier) { $res = Modifier::apply($modifier, $transaction); - if ($res === false) { + if (false === $res) { return $res; } } @@ -294,11 +291,11 @@ class Search implements SearchInterface */ private function strposArray(string $haystack, array $needle) { - if (strlen($haystack) === 0) { + if (0 === strlen($haystack)) { return false; } foreach ($needle as $what) { - if (stripos($haystack, $what) !== false) { + if (false !== stripos($haystack, $what)) { return true; } } diff --git a/app/Support/Search/SearchInterface.php b/app/Support/Search/SearchInterface.php index d87d07dbe7..f24c26cfc3 100644 --- a/app/Support/Search/SearchInterface.php +++ b/app/Support/Search/SearchInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Search; @@ -27,9 +26,7 @@ use FireflyIII\User; use Illuminate\Support\Collection; /** - * Interface SearchInterface - * - * @package FireflyIII\Support\Search + * Interface SearchInterface. */ interface SearchInterface { @@ -48,7 +45,6 @@ interface SearchInterface */ public function parseQuery(string $query); - /** * @return Collection */ diff --git a/app/Support/SingleCacheProperties.php b/app/Support/SingleCacheProperties.php index 9e2b3324ad..f0b88d108d 100644 --- a/app/Support/SingleCacheProperties.php +++ b/app/Support/SingleCacheProperties.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; @@ -26,9 +25,7 @@ namespace FireflyIII\Support; use Illuminate\Support\Collection; /** - * Class CacheProperties - * - * @package FireflyIII\Support + * Class CacheProperties. */ class SingleCacheProperties extends CacheProperties { diff --git a/app/Support/Steam.php b/app/Support/Steam.php index a7b56c774d..70a95bdb01 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support; @@ -32,15 +31,11 @@ use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Support\Collection; /** - * Class Steam - * - * @package FireflyIII\Support + * Class Steam. */ class Steam { - /** - * * @param \FireflyIII\Models\Account $account * @param \Carbon\Carbon $date * @@ -48,7 +43,6 @@ class Steam */ public function balance(Account $account, Carbon $date): string { - // abuse chart properties: $cache = new CacheProperties; $cache->addProperty($account->id); @@ -59,7 +53,7 @@ class Steam } $currencyId = intval($account->getMeta('currency_id')); // use system default currency: - if ($currencyId === 0) { + if (0 === $currencyId) { $currency = app('amount')->getDefaultCurrency(); $currencyId = $currency->id; } @@ -81,7 +75,7 @@ class Steam ->sum('transactions.foreign_amount') ); $balance = bcadd($nativeBalance, $foreignBalance); - $virtual = is_null($account->virtual_balance) ? '0' : strval($account->virtual_balance); + $virtual = null === $account->virtual_balance ? '0' : strval($account->virtual_balance); $balance = bcadd($balance, $virtual); $cache->store($balance); @@ -89,7 +83,6 @@ class Steam } /** - * * @param \FireflyIII\Models\Account $account * @param \Carbon\Carbon $date * @@ -97,7 +90,6 @@ class Steam */ public function balanceIgnoreVirtual(Account $account, Carbon $date): string { - // abuse chart properties: $cache = new CacheProperties; $cache->addProperty($account->id); @@ -132,7 +124,7 @@ class Steam } /** - * Gets the balance for the given account during the whole range, using this format: + * Gets the balance for the given account during the whole range, using this format:. * * [yyyy-mm-dd] => 123,2 * @@ -187,10 +179,10 @@ class Steam /** @var Transaction $entry */ foreach ($set as $entry) { // normal amount and foreign amount - $modified = is_null($entry->modified) ? '0' : strval($entry->modified); - $foreignModified = is_null($entry->modified_foreign) ? '0' : strval($entry->modified_foreign); + $modified = null === $entry->modified ? '0' : strval($entry->modified); + $foreignModified = null === $entry->modified_foreign ? '0' : strval($entry->modified_foreign); $amount = '0'; - if ($currencyId === $entry->transaction_currency_id || $currencyId === 0) { + if ($currencyId === $entry->transaction_currency_id || 0 === $currencyId) { // use normal amount: $amount = $modified; } @@ -250,7 +242,7 @@ class Steam */ public function decrypt(int $isEncrypted, string $value) { - if ($isEncrypted === 1) { + if (1 === $isEncrypted) { return Crypt::decrypt($value); } @@ -285,7 +277,7 @@ class Steam */ public function negative(string $amount): string { - if (bccomp($amount, '0') === 1) { + if (1 === bccomp($amount, '0')) { $amount = bcmul($amount, '-1'); } @@ -313,21 +305,21 @@ class Steam { $string = strtolower($string); - if (!(stripos($string, 'k') === false)) { + if (!(false === stripos($string, 'k'))) { // has a K in it, remove the K and multiply by 1024. $bytes = bcmul(rtrim($string, 'kK'), '1024'); return intval($bytes); } - if (!(stripos($string, 'm') === false)) { + if (!(false === stripos($string, 'm'))) { // has a M in it, remove the M and multiply by 1048576. $bytes = bcmul(rtrim($string, 'mM'), '1048576'); return intval($bytes); } - if (!(stripos($string, 'g') === false)) { + if (!(false === stripos($string, 'g'))) { // has a G in it, remove the G and multiply by (1024)^3. $bytes = bcmul(rtrim($string, 'gG'), '1073741824'); diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.php index cd2c528e3c..98ff3509b7 100644 --- a/app/Support/Twig/AmountFormat.php +++ b/app/Support/Twig/AmountFormat.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig; @@ -31,13 +30,11 @@ use Twig_SimpleFunction; /** * Contains all amount formatting routines. - * - * @package FireflyIII\Support\Twig */ class AmountFormat extends Twig_Extension { /** - * {@inheritDoc} + * {@inheritdoc} */ public function getFilters(): array { @@ -48,7 +45,7 @@ class AmountFormat extends Twig_Extension } /** - * {@inheritDoc} + * {@inheritdoc} */ public function getFunctions(): array { @@ -74,7 +71,6 @@ class AmountFormat extends Twig_Extension } /** - * * @return Twig_SimpleFilter */ protected function formatAmount(): Twig_SimpleFilter @@ -102,7 +98,7 @@ class AmountFormat extends Twig_Extension function (AccountModel $account, string $amount, bool $coloured = true): string { $currencyId = intval($account->getMeta('currency_id')); - if ($currencyId !== 0) { + if (0 !== $currencyId) { $currency = TransactionCurrency::find($currencyId); return app('amount')->formatAnything($currency, $amount, $coloured); @@ -175,7 +171,6 @@ class AmountFormat extends Twig_Extension return new Twig_SimpleFunction( 'formatDestinationAfter', function (array $transaction): string { - // build fake currency for main amount. $format = new TransactionCurrency; $format->decimal_places = $transaction['transaction_currency_dp']; @@ -183,7 +178,7 @@ class AmountFormat extends Twig_Extension $string = app('amount')->formatAnything($format, $transaction['destination_account_after'], true); // also append foreign amount for clarity: - if (!is_null($transaction['foreign_destination_amount'])) { + if (null !== $transaction['foreign_destination_amount']) { // build fake currency for foreign amount $format = new TransactionCurrency; $format->decimal_places = $transaction['foreign_currency_dp']; @@ -191,7 +186,6 @@ class AmountFormat extends Twig_Extension $string .= ' (' . app('amount')->formatAnything($format, $transaction['foreign_destination_amount'], true) . ')'; } - return $string; }, ['is_safe' => ['html']] @@ -206,7 +200,6 @@ class AmountFormat extends Twig_Extension return new Twig_SimpleFunction( 'formatDestinationBefore', function (array $transaction): string { - // build fake currency for main amount. $format = new TransactionCurrency; $format->decimal_places = $transaction['transaction_currency_dp']; @@ -226,7 +219,6 @@ class AmountFormat extends Twig_Extension return new Twig_SimpleFunction( 'formatSourceAfter', function (array $transaction): string { - // build fake currency for main amount. $format = new TransactionCurrency; $format->decimal_places = $transaction['transaction_currency_dp']; @@ -234,7 +226,7 @@ class AmountFormat extends Twig_Extension $string = app('amount')->formatAnything($format, $transaction['source_account_after'], true); // also append foreign amount for clarity: - if (!is_null($transaction['foreign_source_amount'])) { + if (null !== $transaction['foreign_source_amount']) { // build fake currency for foreign amount $format = new TransactionCurrency; $format->decimal_places = $transaction['foreign_currency_dp']; @@ -242,7 +234,6 @@ class AmountFormat extends Twig_Extension $string .= ' (' . app('amount')->formatAnything($format, $transaction['foreign_source_amount'], true) . ')'; } - return $string; }, ['is_safe' => ['html']] @@ -257,7 +248,6 @@ class AmountFormat extends Twig_Extension return new Twig_SimpleFunction( 'formatSourceBefore', function (array $transaction): string { - // build fake currency for main amount. $format = new TransactionCurrency; $format->decimal_places = $transaction['transaction_currency_dp']; diff --git a/app/Support/Twig/Extension/Transaction.php b/app/Support/Twig/Extension/Transaction.php index b9d9816859..bb2e9d6365 100644 --- a/app/Support/Twig/Extension/Transaction.php +++ b/app/Support/Twig/Extension/Transaction.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig\Extension; @@ -33,13 +32,10 @@ use Lang; use Twig_Extension; /** - * Class Transaction - * - * @package FireflyIII\Support\Twig\Extension + * Class Transaction. */ class Transaction extends Twig_Extension { - /** * Can show the amount of a transaction, if that transaction has been collected by the journal collector. * @@ -61,16 +57,16 @@ class Transaction extends Twig_Extension $format = '%s'; $coloured = true; - if ($transaction->transaction_type_type === TransactionType::DEPOSIT) { + if (TransactionType::DEPOSIT === $transaction->transaction_type_type) { $amount = bcmul($amount, '-1'); } - if ($transaction->transaction_type_type === TransactionType::TRANSFER) { + if (TransactionType::TRANSFER === $transaction->transaction_type_type) { $amount = app('steam')->positive($amount); $coloured = false; $format = '%s'; } - if ($transaction->transaction_type_type === TransactionType::OPENING_BALANCE) { + if (TransactionType::OPENING_BALANCE === $transaction->transaction_type_type) { $amount = strval($transaction->transaction_amount); } @@ -79,15 +75,13 @@ class Transaction extends Twig_Extension $currency->decimal_places = $transaction->transaction_currency_dp; $str = sprintf($format, app('amount')->formatAnything($currency, $amount, $coloured)); - - if (!is_null($transaction->transaction_foreign_amount)) { + if (null !== $transaction->transaction_foreign_amount) { $amount = bcmul(app('steam')->positive(strval($transaction->transaction_foreign_amount)), '-1'); - if ($transaction->transaction_type_type === TransactionType::DEPOSIT) { + if (TransactionType::DEPOSIT === $transaction->transaction_type_type) { $amount = bcmul($amount, '-1'); } - - if ($transaction->transaction_type_type === TransactionType::TRANSFER) { + if (TransactionType::TRANSFER === $transaction->transaction_type_type) { $amount = app('steam')->positive($amount); $coloured = false; $format = '%s'; @@ -120,7 +114,7 @@ class Transaction extends Twig_Extension } // first display amount: - $amount = $transaction['journal_type'] === TransactionType::WITHDRAWAL ? $transaction['source_amount'] + $amount = TransactionType::WITHDRAWAL === $transaction['journal_type'] ? $transaction['source_amount'] : $transaction['destination_amount']; $fakeCurrency = new TransactionCurrency; $fakeCurrency->decimal_places = $transaction['transaction_currency_dp']; @@ -128,8 +122,8 @@ class Transaction extends Twig_Extension $string = app('amount')->formatAnything($fakeCurrency, $amount, true); // then display (if present) the foreign amount: - if (!is_null($transaction['foreign_source_amount'])) { - $amount = $transaction['journal_type'] === TransactionType::WITHDRAWAL ? $transaction['foreign_source_amount'] + if (null !== $transaction['foreign_source_amount']) { + $amount = TransactionType::WITHDRAWAL === $transaction['journal_type'] ? $transaction['foreign_source_amount'] : $transaction['foreign_destination_amount']; $fakeCurrency = new TransactionCurrency; $fakeCurrency->decimal_places = $transaction['foreign_currency_dp']; @@ -176,7 +170,7 @@ class Transaction extends Twig_Extension // see if the transaction has a budget: $budgets = $transaction->budgets()->get(); - if ($budgets->count() === 0) { + if (0 === $budgets->count()) { $budgets = $transaction->transactionJournal()->first()->budgets()->get(); } if ($budgets->count() > 0) { @@ -231,7 +225,7 @@ class Transaction extends Twig_Extension // see if the transaction has a category: $categories = $transaction->categories()->get(); - if ($categories->count() === 0) { + if (0 === $categories->count()) { $categories = $transaction->transactionJournal()->first()->categories()->get(); } if ($categories->count() > 0) { @@ -296,14 +290,14 @@ class Transaction extends Twig_Extension $type = $transaction->account_type; // name is present in object, use that one: - if (bccomp($transaction->transaction_amount, '0') === -1 && !is_null($transaction->opposing_account_id)) { + if (bccomp($transaction->transaction_amount, '0') === -1 && null !== $transaction->opposing_account_id) { $name = $transaction->opposing_account_name; $transactionId = intval($transaction->opposing_account_id); $type = $transaction->opposing_account_type; } // Find the opposing account and use that one: - if (bccomp($transaction->transaction_amount, '0') === -1 && is_null($transaction->opposing_account_id)) { + if (bccomp($transaction->transaction_amount, '0') === -1 && null === $transaction->opposing_account_id) { // if the amount is negative, find the opposing account and use that one: $journalId = $transaction->journal_id; /** @var TransactionModel $other */ @@ -320,7 +314,7 @@ class Transaction extends Twig_Extension $type = $other->type; } - if ($type === AccountType::CASH) { + if (AccountType::CASH === $type) { $txt = '(' . trans('firefly.cash') . ')'; $cache->store($txt); @@ -418,7 +412,7 @@ class Transaction extends Twig_Extension return $cache->get(); } $icon = ''; - if (intval($transaction->reconciled) === 1) { + if (1 === intval($transaction->reconciled)) { $icon = ''; } @@ -477,13 +471,13 @@ class Transaction extends Twig_Extension $type = $transaction->account_type; // name is present in object, use that one: - if (bccomp($transaction->transaction_amount, '0') === 1 && !is_null($transaction->opposing_account_id)) { + if (1 === bccomp($transaction->transaction_amount, '0') && null !== $transaction->opposing_account_id) { $name = $transaction->opposing_account_name; $transactionId = intval($transaction->opposing_account_id); $type = $transaction->opposing_account_type; } // Find the opposing account and use that one: - if (bccomp($transaction->transaction_amount, '0') === 1 && is_null($transaction->opposing_account_id)) { + if (1 === bccomp($transaction->transaction_amount, '0') && null === $transaction->opposing_account_id) { $journalId = $transaction->journal_id; /** @var TransactionModel $other */ $other = TransactionModel::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) @@ -499,7 +493,7 @@ class Transaction extends Twig_Extension $type = $other->type; } - if ($type === AccountType::CASH) { + if (AccountType::CASH === $type) { $txt = '(' . trans('firefly.cash') . ')'; $cache->store($txt); diff --git a/app/Support/Twig/Extension/TransactionJournal.php b/app/Support/Twig/Extension/TransactionJournal.php index 5e429db205..5f96804ff9 100644 --- a/app/Support/Twig/Extension/TransactionJournal.php +++ b/app/Support/Twig/Extension/TransactionJournal.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig\Extension; @@ -31,7 +30,6 @@ use Twig_Extension; class TransactionJournal extends Twig_Extension { - /** * @param JournalModel $journal * @@ -63,7 +61,7 @@ class TransactionJournal extends Twig_Extension } $totals[$currencyId]['amount'] = bcadd($transaction->amount, $totals[$currencyId]['amount']); - if (!is_null($transaction->foreign_currency_id)) { + if (null !== $transaction->foreign_currency_id) { $foreignId = $transaction->foreign_currency_id; $foreign = $transaction->foreignCurrency; if (!isset($totals[$foreignId])) { @@ -77,7 +75,7 @@ class TransactionJournal extends Twig_Extension } $array = []; foreach ($totals as $total) { - if ($type === TransactionType::WITHDRAWAL) { + if (TransactionType::WITHDRAWAL === $type) { $total['amount'] = bcmul($total['amount'], '-1'); } $array[] = app('amount')->formatAnything($total['currency'], $total['amount']); diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 9b8d524a0b..98c37aa162 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig; @@ -33,15 +32,10 @@ use Twig_SimpleFilter; use Twig_SimpleFunction; /** - * - * Class TwigSupport - * - * @package FireflyIII\Support + * Class TwigSupport. */ class General extends Twig_Extension { - - /** * @return array */ @@ -51,12 +45,11 @@ class General extends Twig_Extension $this->balance(), $this->formatFilesize(), $this->mimeIcon(), - ]; } /** - * {@inheritDoc} + * {@inheritdoc} */ public function getFunctions(): array { @@ -70,12 +63,11 @@ class General extends Twig_Extension $this->steamPositive(), $this->activeRoutePartial(), $this->activeRoutePartialWhat(), - ]; } /** - * {@inheritDoc} + * {@inheritdoc} */ public function getName(): string { @@ -96,7 +88,7 @@ class General extends Twig_Extension $args = func_get_args(); $route = $args[0]; // name of the route. $name = Route::getCurrentRoute()->getName() ?? ''; - if (!(strpos($name, $route) === false)) { + if (!(false === strpos($name, $route))) { return 'active'; } @@ -121,7 +113,7 @@ class General extends Twig_Extension $what = $args[2]; // name of the route. $activeWhat = $context['what'] ?? false; - if ($what === $activeWhat && !(strpos(Route::getCurrentRoute()->getName(), $route) === false)) { + if ($what === $activeWhat && !(false === strpos(Route::getCurrentRoute()->getName(), $route))) { return 'active'; } @@ -162,7 +154,7 @@ class General extends Twig_Extension return new Twig_SimpleFilter( 'balance', function (?Account $account): string { - if (is_null($account)) { + if (null === $account) { return 'NULL'; } $date = session('end', Carbon::now()->endOfMonth()); @@ -193,7 +185,6 @@ class General extends Twig_Extension return new Twig_SimpleFilter( 'filesize', function (int $size): string { - // less than one GB, more than one MB if ($size < (1024 * 1024 * 2014) && $size >= (1024 * 1024)) { return round($size / (1024 * 1024), 2) . ' MB'; @@ -209,7 +200,6 @@ class General extends Twig_Extension ); } - /** * @return Twig_SimpleFunction */ diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php index 808bf2199d..1f32719ab3 100644 --- a/app/Support/Twig/Journal.php +++ b/app/Support/Twig/Journal.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig; @@ -34,14 +33,10 @@ use Twig_SimpleFilter; use Twig_SimpleFunction; /** - * Class Journal - * - * @package FireflyIII\Support\Twig + * Class Journal. */ class Journal extends Twig_Extension { - - /** * @return Twig_SimpleFunction */ @@ -62,7 +57,7 @@ class Journal extends Twig_Extension $array = []; /** @var Account $entry */ foreach ($list as $entry) { - if ($entry->accountType->type === AccountType::CASH) { + if (AccountType::CASH === $entry->accountType->type) { $array[] = '(cash)'; continue; } @@ -134,7 +129,7 @@ class Journal extends Twig_Extension $array = []; /** @var Account $entry */ foreach ($list as $entry) { - if ($entry->accountType->type === AccountType::CASH) { + if (AccountType::CASH === $entry->accountType->type) { $array[] = '(cash)'; continue; } @@ -165,7 +160,6 @@ class Journal extends Twig_Extension return $cache->get(); // @codeCoverageIgnore } - $budgets = []; // get all budgets: foreach ($journal->budgets as $budget) { @@ -205,7 +199,7 @@ class Journal extends Twig_Extension foreach ($journal->categories as $category) { $categories[] = sprintf('%1$s', e($category->name), route('categories.show', $category->id)); } - if (count($categories) === 0) { + if (0 === count($categories)) { $set = Category::distinct()->leftJoin('category_transaction', 'categories.id', '=', 'category_transaction.category_id') ->leftJoin('transactions', 'category_transaction.transaction_id', '=', 'transactions.id') ->leftJoin('transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') diff --git a/app/Support/Twig/Loader/TransactionJournalLoader.php b/app/Support/Twig/Loader/TransactionJournalLoader.php index 6e92978c14..f0a3de2895 100644 --- a/app/Support/Twig/Loader/TransactionJournalLoader.php +++ b/app/Support/Twig/Loader/TransactionJournalLoader.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig\Loader; @@ -27,13 +26,10 @@ use FireflyIII\Support\Twig\Extension\TransactionJournal; use Twig_RuntimeLoaderInterface; /** - * Class TransactionJournalLoader - * - * @package FireflyIII\Support\Twig\Extension + * Class TransactionJournalLoader. */ class TransactionJournalLoader implements Twig_RuntimeLoaderInterface { - /** * Creates the runtime implementation of a Twig element (filter/function/test). * diff --git a/app/Support/Twig/Loader/TransactionLoader.php b/app/Support/Twig/Loader/TransactionLoader.php index 4c4b8e9892..a32ee03d43 100644 --- a/app/Support/Twig/Loader/TransactionLoader.php +++ b/app/Support/Twig/Loader/TransactionLoader.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig\Loader; @@ -27,13 +26,10 @@ use FireflyIII\Support\Twig\Extension\Transaction; use Twig_RuntimeLoaderInterface; /** - * Class TransactionLoader - * - * @package FireflyIII\Support\Twig\Extension + * Class TransactionLoader. */ class TransactionLoader implements Twig_RuntimeLoaderInterface { - /** * Creates the runtime implementation of a Twig element (filter/function/test). * diff --git a/app/Support/Twig/PiggyBank.php b/app/Support/Twig/PiggyBank.php index a56a67e2be..05d91a04be 100644 --- a/app/Support/Twig/PiggyBank.php +++ b/app/Support/Twig/PiggyBank.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig; @@ -28,14 +27,10 @@ use Twig_Extension; use Twig_SimpleFunction; /** - * - * Class PiggyBank - * - * @package FireflyIII\Support\Twig + * Class PiggyBank. */ class PiggyBank extends Twig_Extension { - /** * */ diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php index 8b89b48226..9a9350de10 100644 --- a/app/Support/Twig/Rule.php +++ b/app/Support/Twig/Rule.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig; @@ -28,13 +27,10 @@ use Twig_Extension; use Twig_SimpleFunction; /** - * Class Rule - * - * @package FireflyIII\Support\Twig + * Class Rule. */ class Rule extends Twig_Extension { - /** * @return Twig_SimpleFunction */ @@ -84,7 +80,7 @@ class Rule extends Twig_Extension $ruleTriggers = array_keys(Config::get('firefly.rule-triggers')); $possibleTriggers = []; foreach ($ruleTriggers as $key) { - if ($key !== 'user_action') { + if ('user_action' !== $key) { $possibleTriggers[$key] = trans('firefly.rule_trigger_' . $key . '_choice'); } } @@ -93,7 +89,6 @@ class Rule extends Twig_Extension return $possibleTriggers; } - ); } diff --git a/app/Support/Twig/Transaction.php b/app/Support/Twig/Transaction.php index fa1f8a76ba..c9095e78cd 100644 --- a/app/Support/Twig/Transaction.php +++ b/app/Support/Twig/Transaction.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig; @@ -28,9 +27,7 @@ use Twig_Extension; use Twig_SimpleFilter; /** - * Class Transaction - * - * @package FireflyIII\Support\Twig + * Class Transaction. */ class Transaction extends Twig_Extension { diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php index 3939dd8f3d..fd4ffe1852 100644 --- a/app/Support/Twig/Translation.php +++ b/app/Support/Twig/Translation.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Support\Twig; @@ -28,14 +27,10 @@ use Twig_SimpleFilter; use Twig_SimpleFunction; /** - * - * Class Budget - * - * @package FireflyIII\Support\Twig + * Class Budget. */ class Translation extends Twig_Extension { - /** * @return array */ @@ -54,20 +49,18 @@ class Translation extends Twig_Extension return $filters; } - /** - * {@inheritDoc} + * {@inheritdoc} */ public function getFunctions(): array { return [ $this->journalLinkTranslation(), - ]; } /** - * {@inheritDoc} + * {@inheritdoc} */ public function getName(): string { diff --git a/app/TransactionRules/Actions/ActionInterface.php b/app/TransactionRules/Actions/ActionInterface.php index 4df180fd8e..82a84f0c41 100644 --- a/app/TransactionRules/Actions/ActionInterface.php +++ b/app/TransactionRules/Actions/ActionInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -27,9 +26,7 @@ use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; /** - * Interface ActionInterface - * - * @package FireflyIII\TransactionRules\Action + * Interface ActionInterface. */ interface ActionInterface { diff --git a/app/TransactionRules/Actions/AddTag.php b/app/TransactionRules/Actions/AddTag.php index a1f667a459..6b7109adf5 100644 --- a/app/TransactionRules/Actions/AddTag.php +++ b/app/TransactionRules/Actions/AddTag.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -29,13 +28,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class AddTag - * - * @package FireflyIII\TransactionRules\Actions + * Class AddTag. */ class AddTag implements ActionInterface { - /** @var RuleAction */ private $action; @@ -56,12 +52,11 @@ class AddTag implements ActionInterface */ public function act(TransactionJournal $journal): bool { - // journal has this tag maybe? $tag = Tag::firstOrCreateEncrypted(['tag' => $this->action->action_value, 'user_id' => $journal->user->id]); $count = $journal->tags()->where('tag_id', $tag->id)->count(); - if ($count === 0) { + if (0 === $count) { $journal->tags()->save($tag); Log::debug(sprintf('RuleAction AddTag. Added tag #%d ("%s") to journal %d.', $tag->id, $tag->tag, $journal->id)); diff --git a/app/TransactionRules/Actions/AppendDescription.php b/app/TransactionRules/Actions/AppendDescription.php index 12e9d5339f..58b7298f41 100644 --- a/app/TransactionRules/Actions/AppendDescription.php +++ b/app/TransactionRules/Actions/AppendDescription.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -28,15 +27,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class AppendDescription - * - * @package FireflyIII\TransactionRules\Actions + * Class AppendDescription. */ class AppendDescription implements ActionInterface { private $action; - /** * TriggerInterface constructor. * diff --git a/app/TransactionRules/Actions/AppendNotes.php b/app/TransactionRules/Actions/AppendNotes.php index ef57c62fbf..4af78bbe30 100644 --- a/app/TransactionRules/Actions/AppendNotes.php +++ b/app/TransactionRules/Actions/AppendNotes.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -29,15 +28,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class AppendNotes - * - * @package FireflyIII\TransactionRules\Actions + * Class AppendNotes. */ class AppendNotes implements ActionInterface { private $action; - /** * TriggerInterface constructor. * @@ -56,7 +52,7 @@ class AppendNotes implements ActionInterface public function act(TransactionJournal $journal): bool { $dbNote = $journal->notes()->first(); - if (is_null($dbNote)) { + if (null === $dbNote) { $dbNote = new Note; $dbNote->noteable()->associate($journal); } diff --git a/app/TransactionRules/Actions/ClearBudget.php b/app/TransactionRules/Actions/ClearBudget.php index b666bc9cd1..bf78f5070c 100644 --- a/app/TransactionRules/Actions/ClearBudget.php +++ b/app/TransactionRules/Actions/ClearBudget.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -28,15 +27,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class ClearBudget - * - * @package FireflyIII\TransactionRules\Action + * Class ClearBudget. */ class ClearBudget implements ActionInterface { private $action; - /** * TriggerInterface constructor. * diff --git a/app/TransactionRules/Actions/ClearCategory.php b/app/TransactionRules/Actions/ClearCategory.php index fee2a49a1a..c4f5f8dc81 100644 --- a/app/TransactionRules/Actions/ClearCategory.php +++ b/app/TransactionRules/Actions/ClearCategory.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -28,15 +27,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class ClearCategory - * - * @package FireflyIII\TransactionRules\Action + * Class ClearCategory. */ class ClearCategory implements ActionInterface { private $action; - /** * TriggerInterface constructor. * diff --git a/app/TransactionRules/Actions/ClearNotes.php b/app/TransactionRules/Actions/ClearNotes.php index f02b3662bc..dd84d16519 100644 --- a/app/TransactionRules/Actions/ClearNotes.php +++ b/app/TransactionRules/Actions/ClearNotes.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -29,15 +28,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class ClearNotes - * - * @package FireflyIII\TransactionRules\Actions + * Class ClearNotes. */ class ClearNotes implements ActionInterface { private $action; - /** * TriggerInterface constructor. * diff --git a/app/TransactionRules/Actions/PrependDescription.php b/app/TransactionRules/Actions/PrependDescription.php index 0a1b1c3e49..fa60c30c3f 100644 --- a/app/TransactionRules/Actions/PrependDescription.php +++ b/app/TransactionRules/Actions/PrependDescription.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -28,15 +27,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class AppendDescription - * - * @package FireflyIII\TransactionRules\Actions + * Class AppendDescription. */ class PrependDescription implements ActionInterface { private $action; - /** * TriggerInterface constructor. * @@ -58,7 +54,6 @@ class PrependDescription implements ActionInterface $journal->description = $this->action->action_value . $journal->description; $journal->save(); - return true; } } diff --git a/app/TransactionRules/Actions/PrependNotes.php b/app/TransactionRules/Actions/PrependNotes.php index 2273b59076..21b20592c8 100644 --- a/app/TransactionRules/Actions/PrependNotes.php +++ b/app/TransactionRules/Actions/PrependNotes.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -29,15 +28,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class PrependNotes - * - * @package FireflyIII\TransactionRules\Actions + * Class PrependNotes. */ class PrependNotes implements ActionInterface { private $action; - /** * TriggerInterface constructor. * @@ -56,7 +52,7 @@ class PrependNotes implements ActionInterface public function act(TransactionJournal $journal): bool { $dbNote = $journal->notes()->first(); - if (is_null($dbNote)) { + if (null === $dbNote) { $dbNote = new Note; $dbNote->noteable()->associate($journal); } diff --git a/app/TransactionRules/Actions/RemoveAllTags.php b/app/TransactionRules/Actions/RemoveAllTags.php index caebb9e389..d6efb992e0 100644 --- a/app/TransactionRules/Actions/RemoveAllTags.php +++ b/app/TransactionRules/Actions/RemoveAllTags.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -28,15 +27,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class RemoveAllTags - * - * @package FireflyIII\TransactionRules\Actions + * Class RemoveAllTags. */ class RemoveAllTags implements ActionInterface { private $action; - /** * TriggerInterface constructor. * diff --git a/app/TransactionRules/Actions/RemoveTag.php b/app/TransactionRules/Actions/RemoveTag.php index c6b178f255..1ddd98d7a0 100644 --- a/app/TransactionRules/Actions/RemoveTag.php +++ b/app/TransactionRules/Actions/RemoveTag.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -29,15 +28,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class RemoveTag - * - * @package FireflyIII\TransactionRules\Actions + * Class RemoveTag. */ class RemoveTag implements ActionInterface { private $action; - /** * TriggerInterface constructor. * @@ -64,7 +60,7 @@ class RemoveTag implements ActionInterface } )->first(); - if (!is_null($tag)) { + if (null !== $tag) { Log::debug(sprintf('RuleAction RemoveTag removed tag #%d ("%s") from journal #%d.', $tag->id, $tag->tag, $journal->id)); $journal->tags()->detach([$tag->id]); diff --git a/app/TransactionRules/Actions/SetBudget.php b/app/TransactionRules/Actions/SetBudget.php index 932cca045c..c9efbb6422 100644 --- a/app/TransactionRules/Actions/SetBudget.php +++ b/app/TransactionRules/Actions/SetBudget.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -31,15 +30,12 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Log; /** - * Class SetBudget - * - * @package FireflyIII\TransactionRules\Action + * Class SetBudget. */ class SetBudget implements ActionInterface { private $action; - /** * TriggerInterface constructor. * @@ -67,13 +63,13 @@ class SetBudget implements ActionInterface return $current->name === $search; } )->first(); - if (is_null($budget)) { + if (null === $budget) { Log::debug(sprintf('RuleAction SetBudget could not set budget of journal #%d to "%s" because no such budget exists.', $journal->id, $search)); return true; } - if ($journal->transactionType->type !== TransactionType::WITHDRAWAL) { + if (TransactionType::WITHDRAWAL !== $journal->transactionType->type) { Log::debug( sprintf( 'RuleAction SetBudget could not set budget of journal #%d to "%s" because journal is a %s.', @@ -90,7 +86,6 @@ class SetBudget implements ActionInterface $journal->budgets()->sync([$budget->id]); - return true; } } diff --git a/app/TransactionRules/Actions/SetCategory.php b/app/TransactionRules/Actions/SetCategory.php index ca540ccdc5..daa3b611dd 100644 --- a/app/TransactionRules/Actions/SetCategory.php +++ b/app/TransactionRules/Actions/SetCategory.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -29,15 +28,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class SetCategory - * - * @package FireflyIII\TransactionRules\Action + * Class SetCategory. */ class SetCategory implements ActionInterface { private $action; - /** * TriggerInterface constructor. * diff --git a/app/TransactionRules/Actions/SetDescription.php b/app/TransactionRules/Actions/SetDescription.php index f0a29cc896..4face0a53c 100644 --- a/app/TransactionRules/Actions/SetDescription.php +++ b/app/TransactionRules/Actions/SetDescription.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -28,15 +27,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class SetDescription - * - * @package FireflyIII\TransactionRules\Actions + * Class SetDescription. */ class SetDescription implements ActionInterface { private $action; - /** * TriggerInterface constructor. * diff --git a/app/TransactionRules/Actions/SetDestinationAccount.php b/app/TransactionRules/Actions/SetDestinationAccount.php index 58b7eb7f8b..75ab0bc67c 100644 --- a/app/TransactionRules/Actions/SetDestinationAccount.php +++ b/app/TransactionRules/Actions/SetDestinationAccount.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -32,24 +31,21 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** - * Class SetDestinationAccount - * - * @package FireflyIII\TransactionRules\Action + * Class SetDestinationAccount. */ class SetDestinationAccount implements ActionInterface { private $action; - /** @var TransactionJournal */ + /** @var TransactionJournal */ private $journal; - /** @var Account */ + /** @var Account */ private $newDestinationAccount; /** @var AccountRepositoryInterface */ private $repository; - /** * TriggerInterface constructor. * @@ -81,7 +77,7 @@ class SetDestinationAccount implements ActionInterface $type = $journal->transactionType->type; // if this is a deposit or a transfer, the destination account must be an asset account or a default account, and it MUST exist: - if (($type === TransactionType::DEPOSIT || $type === TransactionType::TRANSFER) && !$this->findAssetAccount()) { + if ((TransactionType::DEPOSIT === $type || TransactionType::TRANSFER === $type) && !$this->findAssetAccount()) { Log::error( sprintf( 'Cannot change destination account of journal #%d because no asset account with name "%s" exists.', @@ -94,7 +90,7 @@ class SetDestinationAccount implements ActionInterface } // if this is a withdrawal, the new destination account must be a expense account and may be created: - if ($type === TransactionType::WITHDRAWAL) { + if (TransactionType::WITHDRAWAL === $type) { $this->findExpenseAccount(); } @@ -117,7 +113,7 @@ class SetDestinationAccount implements ActionInterface { $account = $this->repository->findByName($this->action->action_value, [AccountType::DEFAULT, AccountType::ASSET]); - if (is_null($account->id)) { + if (null === $account->id) { Log::debug(sprintf('There is NO asset account called "%s".', $this->action->action_value)); return false; @@ -134,7 +130,7 @@ class SetDestinationAccount implements ActionInterface private function findExpenseAccount() { $account = $this->repository->findByName($this->action->action_value, [AccountType::EXPENSE]); - if (is_null($account->id)) { + if (null === $account->id) { // create new revenue account with this name: $data = [ 'name' => $this->action->action_value, diff --git a/app/TransactionRules/Actions/SetNotes.php b/app/TransactionRules/Actions/SetNotes.php index 6bed507707..3b548a9f08 100644 --- a/app/TransactionRules/Actions/SetNotes.php +++ b/app/TransactionRules/Actions/SetNotes.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -29,15 +28,12 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class SetNotes - * - * @package FireflyIII\TransactionRules\Actions + * Class SetNotes. */ class SetNotes implements ActionInterface { private $action; - /** * TriggerInterface constructor. * @@ -56,7 +52,7 @@ class SetNotes implements ActionInterface public function act(TransactionJournal $journal): bool { $dbNote = $journal->notes()->first(); - if (is_null($dbNote)) { + if (null === $dbNote) { $dbNote = new Note; $dbNote->noteable()->associate($journal); } diff --git a/app/TransactionRules/Actions/SetSourceAccount.php b/app/TransactionRules/Actions/SetSourceAccount.php index f45461f698..733c4ba546 100644 --- a/app/TransactionRules/Actions/SetSourceAccount.php +++ b/app/TransactionRules/Actions/SetSourceAccount.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; @@ -32,24 +31,21 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** - * Class SetSourceAccount - * - * @package FireflyIII\TransactionRules\Action + * Class SetSourceAccount. */ class SetSourceAccount implements ActionInterface { private $action; - /** @var TransactionJournal */ + /** @var TransactionJournal */ private $journal; - /** @var Account */ + /** @var Account */ private $newSourceAccount; /** @var AccountRepositoryInterface */ private $repository; - /** * TriggerInterface constructor. * @@ -80,7 +76,7 @@ class SetSourceAccount implements ActionInterface // journal type: $type = $journal->transactionType->type; // if this is a transfer or a withdrawal, the new source account must be an asset account or a default account, and it MUST exist: - if (($type === TransactionType::WITHDRAWAL || $type === TransactionType::TRANSFER) && !$this->findAssetAccount()) { + if ((TransactionType::WITHDRAWAL === $type || TransactionType::TRANSFER === $type) && !$this->findAssetAccount()) { Log::error( sprintf( 'Cannot change source account of journal #%d because no asset account with name "%s" exists.', @@ -93,7 +89,7 @@ class SetSourceAccount implements ActionInterface } // if this is a deposit, the new source account must be a revenue account and may be created: - if ($type === TransactionType::DEPOSIT) { + if (TransactionType::DEPOSIT === $type) { $this->findRevenueAccount(); } @@ -116,7 +112,7 @@ class SetSourceAccount implements ActionInterface { $account = $this->repository->findByName($this->action->action_value, [AccountType::DEFAULT, AccountType::ASSET]); - if (is_null($account->id)) { + if (null === $account->id) { Log::debug(sprintf('There is NO asset account called "%s".', $this->action->action_value)); return false; @@ -133,7 +129,7 @@ class SetSourceAccount implements ActionInterface private function findRevenueAccount() { $account = $this->repository->findByName($this->action->action_value, [AccountType::REVENUE]); - if (is_null($account->id)) { + if (null === $account->id) { // create new revenue account with this name: $data = [ 'name' => $this->action->action_value, diff --git a/app/TransactionRules/Factory/ActionFactory.php b/app/TransactionRules/Factory/ActionFactory.php index 9d0fe14e52..f45cae70ed 100644 --- a/app/TransactionRules/Factory/ActionFactory.php +++ b/app/TransactionRules/Factory/ActionFactory.php @@ -1,7 +1,7 @@ . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Factory; @@ -32,8 +31,6 @@ use Log; /** * @codeCoverageIgnore * Class ActionFactory - * - * @package FireflyIII\TransactionRules\Factory */ class ActionFactory { @@ -65,6 +62,7 @@ class ActionFactory * @param string $actionType * * @return string + * * @throws FireflyException */ public static function getActionClass(string $actionType): string @@ -84,13 +82,13 @@ class ActionFactory } /** - * Returns a map with actiontypes, mapped to the class representing that type + * Returns a map with actiontypes, mapped to the class representing that type. * * @return array */ protected static function getActionTypes(): array { - if (count(self::$actionTypes) === 0) { + if (0 === count(self::$actionTypes)) { self::$actionTypes = Domain::getRuleActions(); } diff --git a/app/TransactionRules/Factory/TriggerFactory.php b/app/TransactionRules/Factory/TriggerFactory.php index 3f7bf3fc28..83fc417097 100644 --- a/app/TransactionRules/Factory/TriggerFactory.php +++ b/app/TransactionRules/Factory/TriggerFactory.php @@ -1,7 +1,7 @@ . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Factory; @@ -33,8 +32,6 @@ use Log; /** * @codeCoverageIgnore * Interface TriggerInterface - * - * @package FireflyIII\TransactionRules\Triggers */ class TriggerFactory { @@ -78,7 +75,9 @@ class TriggerFactory * @param bool $stopProcessing * * @see TriggerFactory::getTrigger + * * @return AbstractTrigger + * * @throws FireflyException */ public static function makeTriggerFromStrings(string $triggerType, string $triggerValue, bool $stopProcessing) @@ -98,7 +97,7 @@ class TriggerFactory */ protected static function getTriggerTypes(): array { - if (count(self::$triggerTypes) === 0) { + if (0 === count(self::$triggerTypes)) { self::$triggerTypes = Domain::getRuleTriggers(); } @@ -113,6 +112,7 @@ class TriggerFactory * @param string $triggerType * * @return TriggerInterface|string + * * @throws FireflyException */ private static function getTriggerClass(string $triggerType): string diff --git a/app/TransactionRules/Processor.php b/app/TransactionRules/Processor.php index e0156162cc..a880c88910 100644 --- a/app/TransactionRules/Processor.php +++ b/app/TransactionRules/Processor.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules; @@ -36,26 +35,23 @@ use Illuminate\Support\Collection; use Log; /** - * Class Processor - * - * @package FireflyIII\TransactionRules + * Class Processor. */ final class Processor { - /** @var Collection */ + /** @var Collection */ public $actions; - /** @var TransactionJournal */ + /** @var TransactionJournal */ public $journal; - /** @var Rule */ + /** @var Rule */ public $rule; /** @var Collection */ public $triggers; /** @var int */ - protected $foundTriggers = 0; + private $foundTriggers = 0; /** * Processor constructor. - * */ private function __construct() { @@ -68,7 +64,6 @@ final class Processor * and actions found in the given Rule. * * @param Rule $rule - * * @param bool $includeActions * * @return Processor @@ -128,7 +123,7 @@ final class Processor { $self = new self; foreach ($triggers as $entry) { - $entry['value'] = is_null($entry['value']) ? '' : $entry['value']; + $entry['value'] = null === $entry['value'] ? '' : $entry['value']; $trigger = TriggerFactory::makeTriggerFromStrings($entry['type'], $entry['value'], $entry['stopProcessing']); $self->triggers->push($trigger); } @@ -153,7 +148,6 @@ final class Processor } /** - * * @return \FireflyIII\Models\Rule */ public function getRule(): Rule @@ -185,7 +179,7 @@ final class Processor Log::debug('Has more than zero actions.'); $this->actions(); } - if ($this->actions->count() === 0) { + if (0 === $this->actions->count()) { Log::info('Rule has no actions!'); } @@ -227,7 +221,7 @@ final class Processor private function actions() { /** - * @var int $index + * @var int * @var RuleAction $action */ foreach ($this->actions as $action) { @@ -246,7 +240,7 @@ final class Processor /** * Method to check whether the current transaction would be triggered - * by the given list of triggers + * by the given list of triggers. * * @return bool */ @@ -258,12 +252,12 @@ final class Processor Log::debug(sprintf('Found triggers starts at %d', $foundTriggers)); /** @var AbstractTrigger $trigger */ foreach ($this->triggers as $trigger) { - $foundTriggers++; + ++$foundTriggers; Log::debug(sprintf('Now checking trigger %s with value %s', get_class($trigger), $trigger->getTriggerValue())); /** @var AbstractTrigger $trigger */ if ($trigger->triggered($this->journal)) { Log::debug('Is a match!'); - $hitTriggers++; + ++$hitTriggers; } if ($trigger->stopProcessing) { Log::debug('Stop processing this trigger and break.'); diff --git a/app/TransactionRules/TransactionMatcher.php b/app/TransactionRules/TransactionMatcher.php index 510d4cca84..73639adf5b 100644 --- a/app/TransactionRules/TransactionMatcher.php +++ b/app/TransactionRules/TransactionMatcher.php @@ -1,7 +1,7 @@ . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules; @@ -33,9 +32,7 @@ use Log; /** * Class TransactionMatcher is used to find a list of - * transaction matching a set of triggers - * - * @package FireflyIII\TransactionRules + * transaction matching a set of triggers. */ class TransactionMatcher { @@ -43,9 +40,9 @@ class TransactionMatcher private $limit = 10; /** @var int Maximum number of transaction to search in (for performance reasons) * */ private $range = 200; - /** @var Rule */ + /** @var Rule */ private $rule; - /** @var JournalTaskerInterface */ + /** @var JournalTaskerInterface */ private $tasker; /** @var array */ private $transactionTypes = [TransactionType::DEPOSIT, TransactionType::WITHDRAWAL, TransactionType::TRANSFER]; @@ -68,11 +65,10 @@ class TransactionMatcher * triggers onto each transaction journal until enough matches are found ($limit). * * @return Collection - * */ public function findTransactionsByRule() { - if (count($this->rule->ruleTriggers) === 0) { + if (0 === count($this->rule->ruleTriggers)) { return new Collection; } @@ -93,11 +89,10 @@ class TransactionMatcher * triggers onto each transaction journal until enough matches are found ($limit). * * @return Collection - * */ public function findTransactionsByTriggers(): Collection { - if (count($this->triggers) === 0) { + if (0 === count($this->triggers)) { return new Collection; } @@ -125,7 +120,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setLimit(int $limit): TransactionMatcher + public function setLimit(int $limit): self { $this->limit = $limit; @@ -145,7 +140,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setRange(int $range): TransactionMatcher + public function setRange(int $range): self { $this->range = $range; @@ -165,7 +160,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setTriggers(array $triggers): TransactionMatcher + public function setTriggers(array $triggers): self { $this->triggers = $triggers; @@ -221,7 +216,7 @@ class TransactionMatcher Log::debug(sprintf('Total count is now %d', $result->count())); // Update counters - $page++; + ++$page; $processed += count($set); Log::debug(sprintf('Page is now %d, processed is %d', $page, $processed)); diff --git a/app/TransactionRules/Triggers/AbstractTrigger.php b/app/TransactionRules/Triggers/AbstractTrigger.php index e1fd0dc6cb..d6e9b73b30 100644 --- a/app/TransactionRules/Triggers/AbstractTrigger.php +++ b/app/TransactionRules/Triggers/AbstractTrigger.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -30,20 +29,18 @@ use FireflyIII\Models\TransactionJournal; * This class will be magical! * * Class AbstractTrigger - * - * @package FireflyIII\TransactionRules\Triggers */ class AbstractTrigger { - /** @var bool */ + /** @var bool */ public $stopProcessing; - /** @var string */ + /** @var string */ protected $checkValue; - /** @var TransactionJournal */ + /** @var TransactionJournal */ protected $journal; /** @var RuleTrigger */ protected $trigger; - /** @var string */ + /** @var string */ protected $triggerValue; /** @@ -106,6 +103,7 @@ class AbstractTrigger /** * @codeCoverageIgnore + * * @return RuleTrigger */ public function getTrigger(): RuleTrigger @@ -115,6 +113,7 @@ class AbstractTrigger /** * @codeCoverageIgnore + * * @return string */ public function getTriggerValue(): string diff --git a/app/TransactionRules/Triggers/AmountExactly.php b/app/TransactionRules/Triggers/AmountExactly.php index c6e6262e6e..fdc6c68391 100644 --- a/app/TransactionRules/Triggers/AmountExactly.php +++ b/app/TransactionRules/Triggers/AmountExactly.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class AmountExactly - * - * @package FireflyIII\TransactionRules\Triggers + * Class AmountExactly. */ final class AmountExactly extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -52,7 +48,7 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { + if (null !== $value) { return false; } Log::error(sprintf('Cannot use %s with a null value.', self::class)); @@ -70,7 +66,7 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface $amount = $journal->destination_amount ?? $journal->amountPositive(); $compare = $this->triggerValue; $result = bccomp($amount, $compare); - if ($result === 0) { + if (0 === $result) { Log::debug(sprintf('RuleTrigger AmountExactly for journal #%d: %d matches %d exactly, so return true', $journal->id, $amount, $compare)); return true; diff --git a/app/TransactionRules/Triggers/AmountLess.php b/app/TransactionRules/Triggers/AmountLess.php index c635859f09..40a3626297 100644 --- a/app/TransactionRules/Triggers/AmountLess.php +++ b/app/TransactionRules/Triggers/AmountLess.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class AmountLess - * - * @package FireflyIII\TransactionRules\Triggers + * Class AmountLess. */ final class AmountLess extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -52,7 +48,7 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { + if (null !== $value) { return false; } Log::error(sprintf('Cannot use %s with a null value.', self::class)); diff --git a/app/TransactionRules/Triggers/AmountMore.php b/app/TransactionRules/Triggers/AmountMore.php index 619bd9e5c5..aa3c1591ea 100644 --- a/app/TransactionRules/Triggers/AmountMore.php +++ b/app/TransactionRules/Triggers/AmountMore.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class AmountMore - * - * @package FireflyIII\TransactionRules\Triggers + * Class AmountMore. */ final class AmountMore extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -52,9 +48,9 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = bccomp('0', strval($value)) === 0; - if ($res === true) { + if (null !== $value) { + $res = 0 === bccomp('0', strval($value)); + if (true === $res) { Log::error(sprintf('Cannot use %s with a value equal to 0.', self::class)); } @@ -76,7 +72,7 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface $amount = $journal->destination_amount ?? $journal->amountPositive(); $compare = $this->triggerValue; $result = bccomp($amount, $compare); - if ($result === 1) { + if (1 === $result) { Log::debug(sprintf('RuleTrigger AmountMore for journal #%d: %d is more than %d, so return true', $journal->id, $amount, $compare)); return true; diff --git a/app/TransactionRules/Triggers/BudgetIs.php b/app/TransactionRules/Triggers/BudgetIs.php index cc234e6636..b465c76e4c 100644 --- a/app/TransactionRules/Triggers/BudgetIs.php +++ b/app/TransactionRules/Triggers/BudgetIs.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class BudgetIs - * - * @package FireflyIII\TransactionRules\Triggers + * Class BudgetIs. */ final class BudgetIs extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,7 +49,7 @@ final class BudgetIs extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { + if (null !== $value) { return false; } Log::error(sprintf('Cannot use %s with a null value.', self::class)); @@ -69,7 +65,7 @@ final class BudgetIs extends AbstractTrigger implements TriggerInterface public function triggered(TransactionJournal $journal): bool { $budget = $journal->budgets()->first(); - if (!is_null($budget)) { + if (null !== $budget) { $name = strtolower($budget->name); // match on journal: if ($name === strtolower($this->triggerValue)) { @@ -79,12 +75,12 @@ final class BudgetIs extends AbstractTrigger implements TriggerInterface } } - if (is_null($budget)) { + if (null === $budget) { // perhaps transactions have this budget? /** @var Transaction $transaction */ foreach ($journal->transactions as $transaction) { $budget = $transaction->budgets()->first(); - if (!is_null($budget)) { + if (null !== $budget) { $name = strtolower($budget->name); if ($name === strtolower($this->triggerValue)) { Log::debug( diff --git a/app/TransactionRules/Triggers/CategoryIs.php b/app/TransactionRules/Triggers/CategoryIs.php index 6b406031d6..969ba4d062 100644 --- a/app/TransactionRules/Triggers/CategoryIs.php +++ b/app/TransactionRules/Triggers/CategoryIs.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class CategoryIs - * - * @package FireflyIII\TransactionRules\Triggers + * Class CategoryIs. */ final class CategoryIs extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,7 +49,7 @@ final class CategoryIs extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { + if (null !== $value) { return false; } Log::error(sprintf('Cannot use %s with a null value.', self::class)); @@ -69,7 +65,7 @@ final class CategoryIs extends AbstractTrigger implements TriggerInterface public function triggered(TransactionJournal $journal): bool { $category = $journal->categories()->first(); - if (!is_null($category)) { + if (null !== $category) { $name = strtolower($category->name); // match on journal: if ($name === strtolower($this->triggerValue)) { @@ -79,12 +75,12 @@ final class CategoryIs extends AbstractTrigger implements TriggerInterface } } - if (is_null($category)) { + if (null === $category) { // perhaps transactions have this category? /** @var Transaction $transaction */ foreach ($journal->transactions as $transaction) { $category = $transaction->categories()->first(); - if (!is_null($category)) { + if (null !== $category) { $name = strtolower($category->name); if ($name === strtolower($this->triggerValue)) { Log::debug( diff --git a/app/TransactionRules/Triggers/DescriptionContains.php b/app/TransactionRules/Triggers/DescriptionContains.php index a81f10f2a2..f583f99bde 100644 --- a/app/TransactionRules/Triggers/DescriptionContains.php +++ b/app/TransactionRules/Triggers/DescriptionContains.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class DescriptionContains - * - * @package FireflyIII\TransactionRules\Triggers + * Class DescriptionContains. */ final class DescriptionContains extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -52,9 +48,9 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -76,7 +72,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf $search = strtolower($this->triggerValue); $source = strtolower($journal->description ?? ''); $strpos = stripos($source, $search); - if (!($strpos === false)) { + if (!(false === $strpos)) { Log::debug(sprintf('RuleTrigger DescriptionContains for journal #%d: "%s" contains "%s", return true.', $journal->id, $source, $search)); return true; diff --git a/app/TransactionRules/Triggers/DescriptionEnds.php b/app/TransactionRules/Triggers/DescriptionEnds.php index 1877eb8099..f6a6c5f48c 100644 --- a/app/TransactionRules/Triggers/DescriptionEnds.php +++ b/app/TransactionRules/Triggers/DescriptionEnds.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class DescriptionEnds - * - * @package FireflyIII\TransactionRules\Triggers + * Class DescriptionEnds. */ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -52,9 +48,9 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/DescriptionIs.php b/app/TransactionRules/Triggers/DescriptionIs.php index bcfeb803d6..77e310a30e 100644 --- a/app/TransactionRules/Triggers/DescriptionIs.php +++ b/app/TransactionRules/Triggers/DescriptionIs.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class DescriptionIs - * - * @package FireflyIII\TransactionRules\Triggers + * Class DescriptionIs. */ final class DescriptionIs extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -52,7 +48,7 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { + if (null !== $value) { return false; } diff --git a/app/TransactionRules/Triggers/DescriptionStarts.php b/app/TransactionRules/Triggers/DescriptionStarts.php index 9d48ffcc2f..c3e123b88b 100644 --- a/app/TransactionRules/Triggers/DescriptionStarts.php +++ b/app/TransactionRules/Triggers/DescriptionStarts.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class DescriptionStarts - * - * @package FireflyIII\TransactionRules\Triggers + * Class DescriptionStarts. */ final class DescriptionStarts extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -52,9 +48,9 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/FromAccountContains.php b/app/TransactionRules/Triggers/FromAccountContains.php index ae26f69a31..38c1f5535c 100644 --- a/app/TransactionRules/Triggers/FromAccountContains.php +++ b/app/TransactionRules/Triggers/FromAccountContains.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class FromAccountContains - * - * @package FireflyIII\TransactionRules\Triggers + * Class FromAccountContains. */ final class FromAccountContains extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -83,7 +79,7 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf $search = strtolower($this->triggerValue); $strpos = strpos($fromAccountName, $search); - if (!($strpos === false)) { + if (!(false === $strpos)) { Log::debug(sprintf('RuleTrigger FromAccountContains for journal #%d: "%s" contains "%s", return true.', $journal->id, $fromAccountName, $search)); return true; diff --git a/app/TransactionRules/Triggers/FromAccountEnds.php b/app/TransactionRules/Triggers/FromAccountEnds.php index 1a469a310e..4a01a543a1 100644 --- a/app/TransactionRules/Triggers/FromAccountEnds.php +++ b/app/TransactionRules/Triggers/FromAccountEnds.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class FromAccountEnds - * - * @package FireflyIII\TransactionRules\Triggers + * Class FromAccountEnds. */ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -92,7 +88,6 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface return false; } - $part = substr($name, $searchLength * -1); if ($part === $search) { diff --git a/app/TransactionRules/Triggers/FromAccountIs.php b/app/TransactionRules/Triggers/FromAccountIs.php index 53787e0910..6764ad94b0 100644 --- a/app/TransactionRules/Triggers/FromAccountIs.php +++ b/app/TransactionRules/Triggers/FromAccountIs.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class FromAccountIs - * - * @package FireflyIII\TransactionRules\Triggers + * Class FromAccountIs. */ final class FromAccountIs extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/FromAccountStarts.php b/app/TransactionRules/Triggers/FromAccountStarts.php index 637c3d34d3..f75bc9717c 100644 --- a/app/TransactionRules/Triggers/FromAccountStarts.php +++ b/app/TransactionRules/Triggers/FromAccountStarts.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class FromAccountStarts - * - * @package FireflyIII\TransactionRules\Triggers + * Class FromAccountStarts. */ final class FromAccountStarts extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/HasAnyBudget.php b/app/TransactionRules/Triggers/HasAnyBudget.php index 3d1628e461..c039dc006a 100644 --- a/app/TransactionRules/Triggers/HasAnyBudget.php +++ b/app/TransactionRules/Triggers/HasAnyBudget.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class HasAnyBudget - * - * @package FireflyIII\TransactionRules\Triggers + * Class HasAnyBudget. */ final class HasAnyBudget extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples diff --git a/app/TransactionRules/Triggers/HasAnyCategory.php b/app/TransactionRules/Triggers/HasAnyCategory.php index aad3509b8a..50d72ce62e 100644 --- a/app/TransactionRules/Triggers/HasAnyCategory.php +++ b/app/TransactionRules/Triggers/HasAnyCategory.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class HasAnyCategory - * - * @package FireflyIII\TransactionRules\Triggers + * Class HasAnyCategory. */ final class HasAnyCategory extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples diff --git a/app/TransactionRules/Triggers/HasAnyTag.php b/app/TransactionRules/Triggers/HasAnyTag.php index 0d83e06adf..abac39866f 100644 --- a/app/TransactionRules/Triggers/HasAnyTag.php +++ b/app/TransactionRules/Triggers/HasAnyTag.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class HasAnyTag - * - * @package FireflyIII\TransactionRules\Triggers + * Class HasAnyTag. */ final class HasAnyTag extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples diff --git a/app/TransactionRules/Triggers/HasAttachment.php b/app/TransactionRules/Triggers/HasAttachment.php index 54528c65fb..2e7eaad91b 100644 --- a/app/TransactionRules/Triggers/HasAttachment.php +++ b/app/TransactionRules/Triggers/HasAttachment.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,7 +27,6 @@ use Log; class HasAttachment extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples diff --git a/app/TransactionRules/Triggers/HasNoBudget.php b/app/TransactionRules/Triggers/HasNoBudget.php index db3a6d66f9..6834fd24c8 100644 --- a/app/TransactionRules/Triggers/HasNoBudget.php +++ b/app/TransactionRules/Triggers/HasNoBudget.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class HasNoBudget - * - * @package FireflyIII\TransactionRules\Triggers + * Class HasNoBudget. */ final class HasNoBudget extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -70,7 +66,7 @@ final class HasNoBudget extends AbstractTrigger implements TriggerInterface foreach ($journal->transactions()->get() as $transaction) { $count += $transaction->budgets()->count(); } - if ($count === 0) { + if (0 === $count) { Log::debug(sprintf('RuleTrigger HasNoBudget for journal #%d: count is %d, return true.', $journal->id, $count)); return true; diff --git a/app/TransactionRules/Triggers/HasNoCategory.php b/app/TransactionRules/Triggers/HasNoCategory.php index 76ac645a0b..b12072d005 100644 --- a/app/TransactionRules/Triggers/HasNoCategory.php +++ b/app/TransactionRules/Triggers/HasNoCategory.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class HasNoCategory - * - * @package FireflyIII\TransactionRules\Triggers + * Class HasNoCategory. */ final class HasNoCategory extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -71,7 +67,7 @@ final class HasNoCategory extends AbstractTrigger implements TriggerInterface $count += $transaction->categories()->count(); } - if ($count === 0) { + if (0 === $count) { Log::debug(sprintf('RuleTrigger HasNoCategory for journal #%d: count is %d, return true.', $journal->id, $count)); return true; diff --git a/app/TransactionRules/Triggers/HasNoTag.php b/app/TransactionRules/Triggers/HasNoTag.php index 04dc7542f7..b547171450 100644 --- a/app/TransactionRules/Triggers/HasNoTag.php +++ b/app/TransactionRules/Triggers/HasNoTag.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class HasNoTag - * - * @package FireflyIII\TransactionRules\Triggers + * Class HasNoTag. */ final class HasNoTag extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -63,7 +59,7 @@ final class HasNoTag extends AbstractTrigger implements TriggerInterface public function triggered(TransactionJournal $journal): bool { $count = $journal->tags()->count(); - if ($count === 0) { + if (0 === $count) { Log::debug(sprintf('RuleTrigger HasNoTag for journal #%d: count is %d, return true.', $journal->id, $count)); return true; diff --git a/app/TransactionRules/Triggers/NotesAny.php b/app/TransactionRules/Triggers/NotesAny.php index e342a98962..fb63301ad7 100644 --- a/app/TransactionRules/Triggers/NotesAny.php +++ b/app/TransactionRules/Triggers/NotesAny.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class NotesAny - * - * @package FireflyIII\TransactionRules\Triggers + * Class NotesAny. */ final class NotesAny extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -66,7 +62,7 @@ final class NotesAny extends AbstractTrigger implements TriggerInterface /** @var Note $note */ $note = $journal->notes()->first(); $text = ''; - if (!is_null($note)) { + if (null !== $note) { $text = $note->text; } diff --git a/app/TransactionRules/Triggers/NotesAre.php b/app/TransactionRules/Triggers/NotesAre.php index ef7362649d..34a7fef5f6 100644 --- a/app/TransactionRules/Triggers/NotesAre.php +++ b/app/TransactionRules/Triggers/NotesAre.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class NotesAre - * - * @package FireflyIII\TransactionRules\Triggers + * Class NotesAre. */ final class NotesAre extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,7 +49,7 @@ final class NotesAre extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { + if (null !== $value) { return false; } @@ -72,7 +68,7 @@ final class NotesAre extends AbstractTrigger implements TriggerInterface /** @var Note $note */ $note = $journal->notes()->first(); $text = ''; - if (!is_null($note)) { + if (null !== $note) { $text = strtolower($note->text); } $search = strtolower($this->triggerValue); diff --git a/app/TransactionRules/Triggers/NotesContain.php b/app/TransactionRules/Triggers/NotesContain.php index 6b1d04521a..10f3c35d44 100644 --- a/app/TransactionRules/Triggers/NotesContain.php +++ b/app/TransactionRules/Triggers/NotesContain.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class NotesContain - * - * @package FireflyIII\TransactionRules\Triggers + * Class NotesContain. */ final class NotesContain extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -76,7 +72,7 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface { $search = trim(strtolower($this->triggerValue)); - if (strlen($search) === 0) { + if (0 === strlen($search)) { Log::debug(sprintf('RuleTrigger NotesContain for journal #%d: "%s" is empty, return false.', $journal->id, $search)); return false; @@ -85,13 +81,12 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface /** @var Note $note */ $note = $journal->notes()->first(); $text = ''; - if (!is_null($note)) { + if (null !== $note) { $text = strtolower($note->text); } - $strpos = strpos($text, $search); - if (!($strpos === false)) { + if (!(false === $strpos)) { Log::debug(sprintf('RuleTrigger NotesContain for journal #%d: "%s" contains "%s", return true.', $journal->id, $text, $search)); return true; diff --git a/app/TransactionRules/Triggers/NotesEmpty.php b/app/TransactionRules/Triggers/NotesEmpty.php index 5c52cca0b1..dc1bedff4f 100644 --- a/app/TransactionRules/Triggers/NotesEmpty.php +++ b/app/TransactionRules/Triggers/NotesEmpty.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class NotesEmpty - * - * @package FireflyIII\TransactionRules\Triggers + * Class NotesEmpty. */ final class NotesEmpty extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -66,11 +62,11 @@ final class NotesEmpty extends AbstractTrigger implements TriggerInterface /** @var Note $note */ $note = $journal->notes()->first(); $text = ''; - if (!is_null($note)) { + if (null !== $note) { $text = $note->text; } - if (strlen($text) === 0) { + if (0 === strlen($text)) { Log::debug(sprintf('RuleTrigger NotesEmpty for journal #%d: strlen is 0, return true.', $journal->id)); return true; diff --git a/app/TransactionRules/Triggers/NotesEnd.php b/app/TransactionRules/Triggers/NotesEnd.php index f4c1546281..8c36fcb659 100644 --- a/app/TransactionRules/Triggers/NotesEnd.php +++ b/app/TransactionRules/Triggers/NotesEnd.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class NotesEnd - * - * @package FireflyIII\TransactionRules\Triggers + * Class NotesEnd. */ final class NotesEnd extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -77,7 +73,7 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface /** @var Note $note */ $note = $journal->notes()->first(); $text = ''; - if (!is_null($note)) { + if (null !== $note) { $text = strtolower($note->text); } $notesLength = strlen($text); diff --git a/app/TransactionRules/Triggers/NotesStart.php b/app/TransactionRules/Triggers/NotesStart.php index 64385a6f7e..eedea6f71e 100644 --- a/app/TransactionRules/Triggers/NotesStart.php +++ b/app/TransactionRules/Triggers/NotesStart.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class NotesStart - * - * @package FireflyIII\TransactionRules\Triggers + * Class NotesStart. */ final class NotesStart extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class NotesStart extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -77,7 +73,7 @@ final class NotesStart extends AbstractTrigger implements TriggerInterface /** @var Note $note */ $note = $journal->notes()->first(); $text = ''; - if (!is_null($note)) { + if (null !== $note) { $text = strtolower($note->text); } $search = strtolower($this->triggerValue); diff --git a/app/TransactionRules/Triggers/TagIs.php b/app/TransactionRules/Triggers/TagIs.php index 7c7b7b02c9..3f4fcb19f1 100644 --- a/app/TransactionRules/Triggers/TagIs.php +++ b/app/TransactionRules/Triggers/TagIs.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class TagIs - * - * @package FireflyIII\TransactionRules\Triggers + * Class TagIs. */ final class TagIs extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,7 +49,7 @@ final class TagIs extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { + if (null !== $value) { return false; } Log::error(sprintf('Cannot use %s with a null value.', self::class)); diff --git a/app/TransactionRules/Triggers/ToAccountContains.php b/app/TransactionRules/Triggers/ToAccountContains.php index 729e1454b9..cd4141c826 100644 --- a/app/TransactionRules/Triggers/ToAccountContains.php +++ b/app/TransactionRules/Triggers/ToAccountContains.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class ToAccountContains - * - * @package FireflyIII\TransactionRules\Triggers + * Class ToAccountContains. */ final class ToAccountContains extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -83,7 +79,7 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac $search = strtolower($this->triggerValue); $strpos = strpos($toAccountName, $search); - if (!($strpos === false)) { + if (!(false === $strpos)) { Log::debug(sprintf('RuleTrigger ToAccountContains for journal #%d: "%s" contains "%s", return true.', $journal->id, $toAccountName, $search)); return true; diff --git a/app/TransactionRules/Triggers/ToAccountEnds.php b/app/TransactionRules/Triggers/ToAccountEnds.php index 01a8936171..ba2a4f0d30 100644 --- a/app/TransactionRules/Triggers/ToAccountEnds.php +++ b/app/TransactionRules/Triggers/ToAccountEnds.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class ToAccountEnds - * - * @package FireflyIII\TransactionRules\Triggers + * Class ToAccountEnds. */ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -92,7 +88,6 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface return false; } - $part = substr($toAccountName, $searchLength * -1); if ($part === $search) { diff --git a/app/TransactionRules/Triggers/ToAccountIs.php b/app/TransactionRules/Triggers/ToAccountIs.php index 457c421da6..50a20375c0 100644 --- a/app/TransactionRules/Triggers/ToAccountIs.php +++ b/app/TransactionRules/Triggers/ToAccountIs.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class ToAccountIs - * - * @package FireflyIII\TransactionRules\Triggers + * Class ToAccountIs. */ final class ToAccountIs extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/ToAccountStarts.php b/app/TransactionRules/Triggers/ToAccountStarts.php index 84f52c24d1..3c47e2cdae 100644 --- a/app/TransactionRules/Triggers/ToAccountStarts.php +++ b/app/TransactionRules/Triggers/ToAccountStarts.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -28,13 +27,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class ToAccountStarts - * - * @package FireflyIII\TransactionRules\Triggers + * Class ToAccountStarts. */ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -53,9 +49,9 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { - $res = strval($value) === ''; - if ($res === true) { + if (null !== $value) { + $res = '' === strval($value); + if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } @@ -90,7 +86,6 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface } Log::debug(sprintf('RuleTrigger ToAccountStarts for journal #%d: "%s" does not start with "%s", return false.', $journal->id, $toAccountName, $search)); - return false; } } diff --git a/app/TransactionRules/Triggers/TransactionType.php b/app/TransactionRules/Triggers/TransactionType.php index e2ddf1b564..3e29c00c4d 100644 --- a/app/TransactionRules/Triggers/TransactionType.php +++ b/app/TransactionRules/Triggers/TransactionType.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class TransactionType - * - * @package FireflyIII\TransactionRules\Triggers + * Class TransactionType. */ final class TransactionType extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples @@ -52,7 +48,7 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - if (!is_null($value)) { + if (null !== $value) { return false; } Log::error(sprintf('Cannot use %s with a null value.', self::class)); @@ -67,7 +63,7 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface */ public function triggered(TransactionJournal $journal): bool { - $type = !is_null($journal->transaction_type_type) ? $journal->transaction_type_type : strtolower($journal->transactionType->type); + $type = null !== $journal->transaction_type_type ? $journal->transaction_type_type : strtolower($journal->transactionType->type); $search = strtolower($this->triggerValue); if ($type === $search) { diff --git a/app/TransactionRules/Triggers/TriggerInterface.php b/app/TransactionRules/Triggers/TriggerInterface.php index 611498f7fc..7b3efa89b1 100644 --- a/app/TransactionRules/Triggers/TriggerInterface.php +++ b/app/TransactionRules/Triggers/TriggerInterface.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -26,13 +25,10 @@ namespace FireflyIII\TransactionRules\Triggers; use FireflyIII\Models\TransactionJournal; /** - * Interface TriggerInterface - * - * @package FireflyIII\TransactionRules\Triggers + * Interface TriggerInterface. */ interface TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples diff --git a/app/TransactionRules/Triggers/UserAction.php b/app/TransactionRules/Triggers/UserAction.php index 6a3bacca20..eb0a99076e 100644 --- a/app/TransactionRules/Triggers/UserAction.php +++ b/app/TransactionRules/Triggers/UserAction.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\TransactionRules\Triggers; @@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal; use Log; /** - * Class UserAction - * - * @package FireflyIII\TransactionRules\Triggers + * Class UserAction. */ final class UserAction extends AbstractTrigger implements TriggerInterface { - /** * A trigger is said to "match anything", or match any given transaction, * when the trigger value is very vague or has no restrictions. Easy examples diff --git a/app/User.php b/app/User.php index 92699f32ff..d301d96331 100644 --- a/app/User.php +++ b/app/User.php @@ -18,10 +18,8 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); - namespace FireflyIII; use FireflyIII\Events\RequestedNewPassword; @@ -34,9 +32,7 @@ use Illuminate\Notifications\Notifiable; use Request; /** - * Class User - * - * @package FireflyIII + * Class User. */ class User extends Authenticatable { @@ -227,9 +223,7 @@ class User extends Authenticatable /** * Send the password reset notification. * - * @param string $token - * - * @return void + * @param string $token */ public function sendPasswordResetNotification($token) { diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 70290446bc..95b14b987b 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -18,7 +18,6 @@ * You should have received a copy of the GNU General Public License * along with Firefly III. If not, see . */ - declare(strict_types=1); namespace FireflyIII\Validation; @@ -42,20 +41,16 @@ use Illuminate\Contracts\Translation\Translator; use Illuminate\Validation\Validator; /** - * Class FireflyValidator - * - * @package FireflyIII\Validation + * Class FireflyValidator. */ class FireflyValidator extends Validator { - /** * @param Translator $translator * @param array $data * @param array $rules * @param array $messages * @param array $customAttributes - * */ public function __construct(Translator $translator, array $data, array $rules, array $messages = [], array $customAttributes = []) { @@ -64,15 +59,15 @@ class FireflyValidator extends Validator /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * * @param $attribute * @param $value * * @return bool - * */ public function validate2faCode($attribute, $value): bool { - if (!is_string($value) || is_null($value) || strlen($value) <> 6) { + if (!is_string($value) || null === $value || 6 != strlen($value)) { return false; } @@ -83,6 +78,7 @@ class FireflyValidator extends Validator /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * * @param $attribute * @param $value * @param $parameters @@ -93,11 +89,11 @@ class FireflyValidator extends Validator { $field = $parameters[1] ?? 'id'; - if (intval($value) === 0) { + if (0 === intval($value)) { return true; } $count = DB::table($parameters[0])->where('user_id', auth()->user()->id)->where($field, $value)->count(); - if ($count === 1) { + if (1 === $count) { return true; } @@ -106,20 +102,20 @@ class FireflyValidator extends Validator /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * * @param $attribute * @param $value * * @return bool - * */ public function validateBic($attribute, $value): bool { $regex = '/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i'; $result = preg_match($regex, $value); - if ($result === false) { + if (false === $result) { return false; } - if ($result === 0) { + if (0 === $result) { return false; } @@ -128,15 +124,15 @@ class FireflyValidator extends Validator /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * * @param $attribute * @param $value * - * * @return bool */ public function validateIban($attribute, $value): bool { - if (!is_string($value) || is_null($value) || strlen($value) < 6) { + if (!is_string($value) || null === $value || strlen($value) < 6) { return false; } @@ -144,7 +140,7 @@ class FireflyValidator extends Validator $search = [' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; $replace = ['', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', - '32', '33', '34', '35']; + '32', '33', '34', '35',]; // take $first = substr($value, 0, 4); @@ -153,7 +149,7 @@ class FireflyValidator extends Validator $iban = str_replace($search, $replace, $iban); $checksum = bcmod($iban, '97'); - return (intval($checksum) === 1); + return 1 === intval($checksum); } /** @@ -173,6 +169,7 @@ class FireflyValidator extends Validator /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * * @param $attribute * @param $value * @param $parameters @@ -183,11 +180,11 @@ class FireflyValidator extends Validator { $field = $parameters[1] ?? 'id'; - if (intval($value) === 0) { + if (0 === intval($value)) { return true; } $count = DB::table($parameters[0])->where($field, $value)->count(); - if ($count === 1) { + if (1 === $count) { return true; } @@ -225,10 +222,9 @@ class FireflyValidator extends Validator } )->count(); - return ($count === 1); + return 1 === $count; case 'invalid': return false; - } } @@ -256,13 +252,13 @@ class FireflyValidator extends Validator switch ($name) { case 'amount_less': $result = is_numeric($value); - if ($result === false) { + if (false === $result) { return false; } break; case 'transaction_type': $count = TransactionType::where('type', $value)->count(); - if (!($count === 1)) { + if (!(1 === $count)) { return false; } break; @@ -293,7 +289,7 @@ class FireflyValidator extends Validator { $verify = false; if (isset($this->data['verify_password'])) { - $verify = intval($this->data['verify_password']) === 1; + $verify = 1 === intval($this->data['verify_password']); } if ($verify) { /** @var Verifier $service */ @@ -307,11 +303,11 @@ class FireflyValidator extends Validator /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * * @param $attribute * @param $value * @param $parameters * - * * @return bool */ public function validateUniqueAccountForUser($attribute, $value, $parameters): bool @@ -332,12 +328,12 @@ class FireflyValidator extends Validator return $this->validateByAccountId($value); } - return false; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * * @param $attribute * @param $value * @param $parameters @@ -380,7 +376,6 @@ class FireflyValidator extends Validator * @param $value * @param $parameters * - * * @return bool */ public function validateUniqueObjectForUser($attribute, $value, $parameters): bool @@ -408,6 +403,7 @@ class FireflyValidator extends Validator /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * * @param $attribute * @param $value * @param $parameters @@ -419,7 +415,7 @@ class FireflyValidator extends Validator $exclude = $parameters[0] ?? null; $query = DB::table('piggy_banks')->whereNull('piggy_banks.deleted_at') ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')->where('accounts.user_id', auth()->user()->id); - if (!is_null($exclude)) { + if (null !== $exclude) { $query->where('piggy_banks.id', '!=', $exclude); } $set = $query->get(['piggy_banks.*']); @@ -484,7 +480,6 @@ class FireflyValidator extends Validator $type = AccountType::find($this->data['account_type_id'])->first(); $value = $this->tryDecrypt($this->data['name']); - $set = $user->accounts()->where('account_type_id', $type->id)->get(); /** @var Account $entry */ foreach ($set as $entry) { @@ -500,7 +495,6 @@ class FireflyValidator extends Validator * @param $value * * @return bool - * */ private function validateByAccountId($value): bool { From 0c1ff98c66240d590f5a3272f0699e3481a2ffc2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 12:53:55 +0100 Subject: [PATCH 177/258] Remove reference to self. --- .../Collector/JournalCollectorInterface.php | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/app/Helpers/Collector/JournalCollectorInterface.php b/app/Helpers/Collector/JournalCollectorInterface.php index d6a7793572..5ac5e90bed 100644 --- a/app/Helpers/Collector/JournalCollectorInterface.php +++ b/app/Helpers/Collector/JournalCollectorInterface.php @@ -40,28 +40,28 @@ interface JournalCollectorInterface * * @return JournalCollectorInterface */ - public function addFilter(string $filter): self; + public function addFilter(string $filter): JournalCollectorInterface; /** * @param string $amount * * @return JournalCollectorInterface */ - public function amountIs(string $amount): self; + public function amountIs(string $amount): JournalCollectorInterface; /** * @param string $amount * * @return JournalCollectorInterface */ - public function amountLess(string $amount): self; + public function amountLess(string $amount): JournalCollectorInterface; /** * @param string $amount * * @return JournalCollectorInterface */ - public function amountMore(string $amount): self; + public function amountMore(string $amount): JournalCollectorInterface; /** * @return int @@ -83,89 +83,89 @@ interface JournalCollectorInterface * * @return JournalCollectorInterface */ - public function removeFilter(string $filter): self; + public function removeFilter(string $filter): JournalCollectorInterface; /** * @param Collection $accounts * * @return JournalCollectorInterface */ - public function setAccounts(Collection $accounts): self; + public function setAccounts(Collection $accounts): JournalCollectorInterface; /** * @param Carbon $after * * @return JournalCollectorInterface */ - public function setAfter(Carbon $after): self; + public function setAfter(Carbon $after): JournalCollectorInterface; /** * @return JournalCollectorInterface */ - public function setAllAssetAccounts(): self; + public function setAllAssetAccounts(): JournalCollectorInterface; /** * @param Carbon $before * * @return JournalCollectorInterface */ - public function setBefore(Carbon $before): self; + public function setBefore(Carbon $before): JournalCollectorInterface; /** * @param Collection $bills * * @return JournalCollectorInterface */ - public function setBills(Collection $bills): self; + public function setBills(Collection $bills): JournalCollectorInterface; /** * @param Budget $budget * * @return JournalCollectorInterface */ - public function setBudget(Budget $budget): self; + public function setBudget(Budget $budget): JournalCollectorInterface; /** * @param Collection $budgets * * @return JournalCollectorInterface */ - public function setBudgets(Collection $budgets): self; + public function setBudgets(Collection $budgets): JournalCollectorInterface; /** * @param Collection $categories * * @return JournalCollectorInterface */ - public function setCategories(Collection $categories): self; + public function setCategories(Collection $categories): JournalCollectorInterface; /** * @param Category $category * * @return JournalCollectorInterface */ - public function setCategory(Category $category): self; + public function setCategory(Category $category): JournalCollectorInterface; /** * @param int $limit * * @return JournalCollectorInterface */ - public function setLimit(int $limit): self; + public function setLimit(int $limit): JournalCollectorInterface; /** * @param int $offset * * @return JournalCollectorInterface */ - public function setOffset(int $offset): self; + public function setOffset(int $offset): JournalCollectorInterface; /** * @param int $page * * @return JournalCollectorInterface */ - public function setPage(int $page): self; + public function setPage(int $page): JournalCollectorInterface; /** * @param Carbon $start @@ -173,28 +173,28 @@ interface JournalCollectorInterface * * @return JournalCollectorInterface */ - public function setRange(Carbon $start, Carbon $end): self; + public function setRange(Carbon $start, Carbon $end): JournalCollectorInterface; /** * @param Tag $tag * * @return JournalCollectorInterface */ - public function setTag(Tag $tag): self; + public function setTag(Tag $tag): JournalCollectorInterface; /** * @param Collection $tags * * @return JournalCollectorInterface */ - public function setTags(Collection $tags): self; + public function setTags(Collection $tags): JournalCollectorInterface; /** * @param array $types * * @return JournalCollectorInterface */ - public function setTypes(array $types): self; + public function setTypes(array $types): JournalCollectorInterface; public function setUser(User $user); @@ -206,25 +206,25 @@ interface JournalCollectorInterface /** * @return JournalCollectorInterface */ - public function withBudgetInformation(): self; + public function withBudgetInformation(): JournalCollectorInterface; /** * @return JournalCollectorInterface */ - public function withCategoryInformation(): self; + public function withCategoryInformation(): JournalCollectorInterface; /** * @return JournalCollectorInterface */ - public function withOpposingAccount(): self; + public function withOpposingAccount(): JournalCollectorInterface; /** * @return JournalCollectorInterface */ - public function withoutBudget(): self; + public function withoutBudget(): JournalCollectorInterface; /** * @return JournalCollectorInterface */ - public function withoutCategory(): self; + public function withoutCategory(): JournalCollectorInterface; } From 63d93968d009d9f400cb744703304e741313e798 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 15:30:15 +0100 Subject: [PATCH 178/258] Fix tests. --- app/Export/Entry/Entry.php | 2 +- .../Report/ReportGeneratorInterface.php | 12 ++++++------ app/Helpers/Chart/MetaPieChartInterface.php | 16 ++++++++-------- .../FileProcessor/FileProcessorInterface.php | 2 +- app/TransactionRules/TransactionMatcher.php | 6 +++--- .../2016_06_16_000002_create_main_tables.php | 3 +++ .../TransactionRules/Actions/RemoveTagTest.php | 8 +++----- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/app/Export/Entry/Entry.php b/app/Export/Entry/Entry.php index 44271130f1..6b43d3408e 100644 --- a/app/Export/Entry/Entry.php +++ b/app/Export/Entry/Entry.php @@ -93,7 +93,7 @@ final class Entry * * @return Entry */ - public static function fromTransaction(Transaction $transaction): self + public static function fromTransaction(Transaction $transaction): Entry { $entry = new self; $entry->journal_id = $transaction->journal_id; diff --git a/app/Generator/Report/ReportGeneratorInterface.php b/app/Generator/Report/ReportGeneratorInterface.php index f4ff815cc1..c3752b2739 100644 --- a/app/Generator/Report/ReportGeneratorInterface.php +++ b/app/Generator/Report/ReportGeneratorInterface.php @@ -40,40 +40,40 @@ interface ReportGeneratorInterface * * @return ReportGeneratorInterface */ - public function setAccounts(Collection $accounts): self; + public function setAccounts(Collection $accounts): ReportGeneratorInterface; /** * @param Collection $budgets * * @return ReportGeneratorInterface */ - public function setBudgets(Collection $budgets): self; + public function setBudgets(Collection $budgets): ReportGeneratorInterface; /** * @param Collection $categories * * @return ReportGeneratorInterface */ - public function setCategories(Collection $categories): self; + public function setCategories(Collection $categories): ReportGeneratorInterface; /** * @param Carbon $date * * @return ReportGeneratorInterface */ - public function setEndDate(Carbon $date): self; + public function setEndDate(Carbon $date): ReportGeneratorInterface; /** * @param Carbon $date * * @return ReportGeneratorInterface */ - public function setStartDate(Carbon $date): self; + public function setStartDate(Carbon $date): ReportGeneratorInterface; /** * @param Collection $tags * * @return ReportGeneratorInterface */ - public function setTags(Collection $tags): self; + public function setTags(Collection $tags): ReportGeneratorInterface; } diff --git a/app/Helpers/Chart/MetaPieChartInterface.php b/app/Helpers/Chart/MetaPieChartInterface.php index 250b13c7bc..ee094a2e83 100644 --- a/app/Helpers/Chart/MetaPieChartInterface.php +++ b/app/Helpers/Chart/MetaPieChartInterface.php @@ -44,54 +44,54 @@ interface MetaPieChartInterface * * @return MetaPieChartInterface */ - public function setAccounts(Collection $accounts): self; + public function setAccounts(Collection $accounts): MetaPieChartInterface; /** * @param Collection $budgets * * @return MetaPieChartInterface */ - public function setBudgets(Collection $budgets): self; + public function setBudgets(Collection $budgets): MetaPieChartInterface; /** * @param Collection $categories * * @return MetaPieChartInterface */ - public function setCategories(Collection $categories): self; + public function setCategories(Collection $categories): MetaPieChartInterface; /** * @param bool $collectOtherObjects * * @return MetaPieChartInterface */ - public function setCollectOtherObjects(bool $collectOtherObjects): self; + public function setCollectOtherObjects(bool $collectOtherObjects): MetaPieChartInterface; /** * @param Carbon $end * * @return MetaPieChartInterface */ - public function setEnd(Carbon $end): self; + public function setEnd(Carbon $end): MetaPieChartInterface; /** * @param Carbon $start * * @return MetaPieChartInterface */ - public function setStart(Carbon $start): self; + public function setStart(Carbon $start): MetaPieChartInterface; /** * @param Collection $tags * * @return MetaPieChartInterface */ - public function setTags(Collection $tags): self; + public function setTags(Collection $tags): MetaPieChartInterface; /** * @param User $user * * @return MetaPieChartInterface */ - public function setUser(User $user): self; + public function setUser(User $user): MetaPieChartInterface; } diff --git a/app/Import/FileProcessor/FileProcessorInterface.php b/app/Import/FileProcessor/FileProcessorInterface.php index 94fd9bd0a5..e8a480176f 100644 --- a/app/Import/FileProcessor/FileProcessorInterface.php +++ b/app/Import/FileProcessor/FileProcessorInterface.php @@ -45,5 +45,5 @@ interface FileProcessorInterface * * @return FileProcessorInterface */ - public function setJob(ImportJob $job): self; + public function setJob(ImportJob $job): FileProcessorInterface; } diff --git a/app/TransactionRules/TransactionMatcher.php b/app/TransactionRules/TransactionMatcher.php index 73639adf5b..82753bd86a 100644 --- a/app/TransactionRules/TransactionMatcher.php +++ b/app/TransactionRules/TransactionMatcher.php @@ -120,7 +120,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setLimit(int $limit): self + public function setLimit(int $limit): TransactionMatcher { $this->limit = $limit; @@ -140,7 +140,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setRange(int $range): self + public function setRange(int $range): TransactionMatcher { $this->range = $range; @@ -160,7 +160,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setTriggers(array $triggers): self + public function setTriggers(array $triggers): TransactionMatcher { $this->triggers = $triggers; diff --git a/database/migrations/2016_06_16_000002_create_main_tables.php b/database/migrations/2016_06_16_000002_create_main_tables.php index 1eaa6f2fbe..4823ac9e39 100644 --- a/database/migrations/2016_06_16_000002_create_main_tables.php +++ b/database/migrations/2016_06_16_000002_create_main_tables.php @@ -550,6 +550,9 @@ class CreateMainTables extends Migration $table->integer('transaction_journal_id', false, true); $table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade'); $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); + + // unique combi: + $table->unique(['tag_id', 'transaction_journal_id']); } ); } diff --git a/tests/Unit/TransactionRules/Actions/RemoveTagTest.php b/tests/Unit/TransactionRules/Actions/RemoveTagTest.php index de1674378c..a4134f9aa3 100644 --- a/tests/Unit/TransactionRules/Actions/RemoveTagTest.php +++ b/tests/Unit/TransactionRules/Actions/RemoveTagTest.php @@ -72,13 +72,11 @@ class RemoveTagTest extends TestCase public function testActNoTag() { // get journal, link al tags: + /** @var TransactionJournal $journal */ $journal = TransactionJournal::find(11); $tags = $journal->user->tags()->get(); - foreach ($tags as $tag) { - $journal->tags()->save($tag); - $journal->save(); - } - $this->assertEquals($tags->count(), $journal->tags()->count()); + $journal->tags()->sync($tags->pluck('id')->toArray()); + $this->assertEquals($tags->count(), $journal->tags()->get()->count()); // fire the action: $ruleAction = new RuleAction; From bf87ffb9337c8c0030cfbd44d668d5fd38c749ed Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 15 Nov 2017 15:38:39 +0100 Subject: [PATCH 179/258] Simplify tag cloud. --- app/Repositories/Tag/TagRepository.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index e75bc5710f..4870c0761d 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -323,6 +323,8 @@ class TagRepository implements TagRepositoryInterface $min = null; $max = '0'; $return = []; + // get all tags + $allTags = $this->user->tags(); // get tags with a certain amount (in this range): $query = $this->user->tags() ->leftJoin('tag_transaction_journal', 'tag_transaction_journal.tag_id', '=', 'tags.id') @@ -334,11 +336,13 @@ class TagRepository implements TagRepositoryInterface // add date range (or not): if (null === $year) { $query->whereNull('tags.date'); + $allTags->whereNull('date'); } if (null !== $year) { $start = $year . '-01-01'; $end = $year . '-12-31'; $query->where('tags.date', '>=', $start)->where('tags.date', '<=', $end); + $allTags->where('date', '>=', $start)->where('date', '<=', $end); } $set = $query->get(['tags.id', DB::raw('SUM(transactions.amount) as amount_sum')]); $tagsWithAmounts = []; @@ -347,16 +351,6 @@ class TagRepository implements TagRepositoryInterface $tagsWithAmounts[$tag->id] = strval($tag->amount_sum); } - // get all tags in period: - $query = $this->user->tags(); - if (null !== $year) { - $start = $year . '-01-01'; - $end = $year . '-12-31'; - $query->where('date', '>=', $start)->where('date', '<=', $end); - } - if (null === $year) { - $query->whereNull('date'); - } $tags = $query->orderBy('id', 'desc')->get(); $temporary = []; /** @var Tag $tag */ From 02c2636b7d59c5feb406506dca81dda257c2c04d Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 17 Nov 2017 05:52:44 +0100 Subject: [PATCH 180/258] Fix #997 --- app/Repositories/Tag/TagRepository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 4870c0761d..e8330c11e2 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -336,13 +336,13 @@ class TagRepository implements TagRepositoryInterface // add date range (or not): if (null === $year) { $query->whereNull('tags.date'); - $allTags->whereNull('date'); + $allTags->whereNull('tags.date'); } if (null !== $year) { $start = $year . '-01-01'; $end = $year . '-12-31'; $query->where('tags.date', '>=', $start)->where('tags.date', '<=', $end); - $allTags->where('date', '>=', $start)->where('date', '<=', $end); + $allTags->where('tags.date', '>=', $start)->where('tags.date', '<=', $end); } $set = $query->get(['tags.id', DB::raw('SUM(transactions.amount) as amount_sum')]); $tagsWithAmounts = []; @@ -351,7 +351,7 @@ class TagRepository implements TagRepositoryInterface $tagsWithAmounts[$tag->id] = strval($tag->amount_sum); } - $tags = $query->orderBy('id', 'desc')->get(); + $tags = $query->orderBy('tags.id', 'desc')->get(); $temporary = []; /** @var Tag $tag */ foreach ($tags as $tag) { From 32695ba960ce2f50fddde67d371728d173a17ae3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 17 Nov 2017 08:22:26 +0100 Subject: [PATCH 181/258] Blind attempt to fix #997 --- app/Repositories/Tag/TagRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 4870c0761d..5174e0a745 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -331,7 +331,7 @@ class TagRepository implements TagRepositoryInterface ->leftJoin('transaction_journals', 'tag_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') ->leftJoin('transactions', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') ->where('transactions.amount', '>', 0) - ->groupBy('tags.id'); + ->groupBy(['tags.id','tags.tag']); // add date range (or not): if (null === $year) { @@ -351,7 +351,7 @@ class TagRepository implements TagRepositoryInterface $tagsWithAmounts[$tag->id] = strval($tag->amount_sum); } - $tags = $query->orderBy('id', 'desc')->get(); + $tags = $query->orderBy('id', 'desc')->get(['tags.id','tags.tag']); $temporary = []; /** @var Tag $tag */ foreach ($tags as $tag) { From 141225c980e4904522ef2bb54a93b4dcf80f798e Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 17 Nov 2017 19:31:48 +0100 Subject: [PATCH 182/258] Code for #914 --- app/Http/Controllers/HomeController.php | 5 +- public/js/ff/charts.js | 67 +++++++++++++++++++++++-- public/js/ff/index.js | 7 ++- resources/lang/en_US/firefly.php | 2 + resources/views/index.twig | 8 +++ 5 files changed, 82 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index d24313062a..dec3344e4b 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -86,7 +86,9 @@ class HomeController extends Controller } /** + * @param Request $request * + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function displayDebug(Request $request) { @@ -193,6 +195,7 @@ class HomeController extends Controller $end = session('end', Carbon::now()->endOfMonth()); $accounts = $repository->getAccountsById($frontPage->data); $showDeps = Preferences::get('showDepositsFrontpage', false)->data; + $today = new Carbon; // zero bills? Hide some elements from view. /** @var BillRepositoryInterface $billRepository */ @@ -208,7 +211,7 @@ class HomeController extends Controller return view( 'index', - compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount') + compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount','start','end','today') ); } diff --git a/public/js/ff/charts.js b/public/js/ff/charts.js index 9b59ab1db4..4595bb6a4a 100644 --- a/public/js/ff/charts.js +++ b/public/js/ff/charts.js @@ -20,6 +20,9 @@ /** global: Chart, defaultChartOptions, accounting, defaultPieOptions, noDataForChart */ var allCharts = {}; + + + /* Make some colours: */ @@ -58,6 +61,43 @@ Chart.defaults.global.responsive = true; Chart.defaults.global.maintainAspectRatio = false; + + +/** + * Chart line thing + */ +const verticalLinePlugin = { + getLinePosition: function (chart, pointIndex) { + const meta = chart.getDatasetMeta(0); // first dataset is used to discover X coordinate of a point + const data = meta.data; + return data[pointIndex]._model.x; + }, + renderVerticalLine: function (chartInstance, pointIndex) { + const lineLeftOffset = this.getLinePosition(chartInstance, pointIndex); + const scale = chartInstance.scales['y-axis-0']; + const context = chartInstance.chart.ctx; + + // render vertical line + context.beginPath(); + context.strokeStyle = fillColors[3]; + context.moveTo(lineLeftOffset, scale.top); + context.lineTo(lineLeftOffset, scale.bottom); + context.stroke(); + + // write label + context.fillStyle = "#444444"; + context.textAlign = 'left'; + context.fillText(todayText, lineLeftOffset, scale.top * 3); // (scale.bottom - scale.top) / 2 + scale.top + }, + + afterDatasetsDraw: function (chart, easing) { + if (chart.config.lineAtIndex) { + chart.config.lineAtIndex.forEach(pointIndex => this.renderVerticalLine(chart, pointIndex)); + } + } +}; + +Chart.plugins.register(verticalLinePlugin); /** * * @param data @@ -89,7 +129,17 @@ function lineChart(URI, container) { var options = $.extend(true, {}, defaultChartOptions); var chartType = 'line'; - drawAChart(URI, container, chartType, options, colorData); + drawAChart(URI, container, chartType, options, colorData, -1); +} + +function lineChartWithDay(URI, container, today) { + "use strict"; + console.log('in lineChartWithDay'); + var colorData = true; + var options = $.extend(true, {}, defaultChartOptions); + var chartType = 'line'; + + drawAChart(URI, container, chartType, options, colorData, today); } /** @@ -248,8 +298,9 @@ function pieChart(URI, container) { * @param chartType * @param options * @param colorData + * @param today */ -function drawAChart(URI, container, chartType, options, colorData) { +function drawAChart(URI, container, chartType, options, colorData, today) { var containerObj = $('#' + container); if (containerObj.length === 0) { return; @@ -286,11 +337,17 @@ function drawAChart(URI, container, chartType, options, colorData) { } else { // new chart! var ctx = document.getElementById(container).getContext("2d"); - allCharts[container] = new Chart(ctx, { + var chartOpts = { type: chartType, data: data, - options: options - }); + options: options, + lineAtIndex: [] + }; + if(today >= 0) { + chartOpts.lineAtIndex.push(today-1); + console.log('push opt'); + } + allCharts[container] = new Chart(ctx, chartOpts); } }).fail(function () { diff --git a/public/js/ff/index.js b/public/js/ff/index.js index 60b906cc0d..2dfb20fa92 100644 --- a/public/js/ff/index.js +++ b/public/js/ff/index.js @@ -29,7 +29,12 @@ $(function () { function drawChart() { "use strict"; - lineChart(accountFrontpageUri, 'accounts-chart'); + if(today >= 0) { + lineChartWithDay(accountFrontpageUri, 'accounts-chart', today); + } else { + lineChart(accountFrontpageUri, 'accounts-chart'); + } + if (billCount > 0) { pieChart('chart/bill/frontpage', 'bills-chart'); } diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index d387359f22..16a7b72be2 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Close', 'actions' => 'Actions', 'edit' => 'Edit', 'delete' => 'Delete', 'welcomeBack' => 'What\'s playing?', 'everything' => 'Everything', + 'today' => 'today', 'customRange' => 'Custom range', 'apply' => 'Apply', 'select_date' => 'Select date..', diff --git a/resources/views/index.twig b/resources/views/index.twig index 738230fb8a..89b03ae452 100644 --- a/resources/views/index.twig +++ b/resources/views/index.twig @@ -142,6 +142,14 @@ var accountRevenueUri = '{{ route('chart.account.revenue') }}'; var accountExpenseUri = '{{ route('chart.account.expense') }}'; var piggyInfoUri = '{{ route('json.fp.piggy-banks') }}'; + var todayText = ' {{ 'today'|_ }}'; + + + {% if start.lte(today) and end.gte(today) %} + var today = {{ today.day }}; + {% else %} + var today = -1; + {% endif %} From 51a1512a3fb8b2c3449d737d723a06e46bc601ff Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 05:23:19 +0100 Subject: [PATCH 183/258] Language update [skip ci] --- resources/lang/de_DE/firefly.php | 2 ++ resources/lang/es_ES/firefly.php | 2 ++ resources/lang/fr_FR/firefly.php | 36 +++++++++++++++++--------------- resources/lang/id_ID/firefly.php | 2 ++ resources/lang/nl_NL/firefly.php | 2 ++ resources/lang/pl_PL/firefly.php | 2 ++ resources/lang/pt_BR/firefly.php | 2 ++ resources/lang/ru_RU/firefly.php | 2 ++ resources/lang/sl_SI/firefly.php | 2 ++ 9 files changed, 35 insertions(+), 17 deletions(-) diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 93592bc900..59eb56c81f 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Schließen', 'actions' => 'Aktionen', 'edit' => 'Bearbeiten', 'delete' => 'Löschen', 'welcomeBack' => 'Was ist gerade los?', 'everything' => 'Alle', + 'today' => 'today', 'customRange' => 'Individueller Bereich', 'apply' => 'Übernehmen', 'select_date' => 'Wähle ein Datum..', diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index 2ec5979915..c772189473 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Cerrar', 'actions' => 'Acciones', 'edit' => 'Editar', 'delete' => 'Eliminar', 'welcomeBack' => '¿Qué está pasando?', 'everything' => 'Todo', + 'today' => 'today', 'customRange' => 'Rango personalizado', 'apply' => 'Aplicar', 'select_date' => 'Seleccionar fecha...', diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index f2a8b095bc..5fbf192009 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Fermer', 'actions' => 'Actions', 'edit' => 'Modifier', 'delete' => 'Supprimer', 'welcomeBack' => 'Que se passe-t-il ?', 'everything' => 'Tout', + 'today' => 'today', 'customRange' => 'Etendue personnalisée', 'apply' => 'Appliquer', 'select_date' => 'Sélectionner une date..', @@ -619,20 +621,20 @@ return [ 'revenue_accounts' => 'Comptes de recettes', 'cash_accounts' => 'Comptes de trésorerie', 'Cash account' => 'Compte de trésorerie', - 'reconcile_account' => 'Reconcile account ":account"', - 'end_of_reconcile_period' => 'End of reconcile period: :period', - 'start_of_reconcile_period' => 'Start of reconcile period: :period', - 'start_balance' => 'Start balance', - 'end_balance' => 'End balance', - 'update_balance_dates_instruction' => 'Match the amounts and dates above to your bank statement, and press "Start reconciling"', - 'select_transactions_instruction' => 'Select the transactions that appear on your bank statement.', - 'select_range_and_balance' => 'First verify the date-range and balances. Then press "Start reconciling"', - 'date_change_instruction' => 'If you change the date range now, any progress will be lost.', - 'update_selection' => 'Update selection', - 'store_reconcile' => 'Store reconciliation', - 'reconcile_options' => 'Reconciliation options', - 'reconcile_range' => 'Reconciliation range', - 'start_reconcile' => 'Start reconciling', + 'reconcile_account' => 'Rapprocher le compte ": compte"', + 'end_of_reconcile_period' => 'Fin de la période de rapptrochement : :period', + 'start_of_reconcile_period' => 'Début de la période de rapprochement : :period', + 'start_balance' => 'Solde initial', + 'end_balance' => 'Solde de clotûre', + 'update_balance_dates_instruction' => 'Faites correspondre les montants et les dates ci-dessus à votre relevé bancaire et appuyez sur "Démarrer le rapprochement"', + 'select_transactions_instruction' => 'Sélectionnez les transactions qui apparaissent sur votre relevé bancaire.', + 'select_range_and_balance' => 'Vérifiez d\'abord la plage de dates et les soldes. Puis appuyez sur "Démarrer le rapprochement"', + 'date_change_instruction' => 'Si vous modifiez la plage de dates maintenant, toute progression sera perdue.', + 'update_selection' => 'Mettre à jour la sélection', + 'store_reconcile' => 'Stocker le rapprochement', + 'reconcile_options' => 'Options de rapprochement', + 'reconcile_range' => 'Plage de rapprochement', + 'start_reconcile' => 'Commencer le rapprochement', 'cash' => 'espèce', 'account_type' => 'Type de compte', 'save_transactions_by_moving' => 'Enregistrer ces opération(s) en les déplaçant vers un autre compte :', @@ -731,7 +733,7 @@ return [ 'Revenue account' => 'Compte de recettes', 'Initial balance account' => 'Balance initiale', 'budgets' => 'Budgets', - 'tags' => 'Tags', + 'tags' => 'Mots-clés', 'reports' => 'Rapports', 'transactions' => 'Opérations', 'expenses' => 'Dépenses', @@ -861,7 +863,7 @@ return [ 'earned' => 'Gagné', 'overspent' => 'Trop dépensé', 'left' => 'Reste', - 'no_budget' => '(no budget)', + 'no_budget' => '(pas de budget)', 'max-amount' => 'Montant maximum', 'min-amount' => 'Montant minimum', 'journal-amount' => 'Entrée de facture courante', @@ -936,7 +938,7 @@ return [ 'firefly_instance_configuration' => 'Options de configuration pour Firefly III', 'setting_single_user_mode' => 'Mode utilisateur unique', 'setting_single_user_mode_explain' => 'Par défaut, Firefly III accepte uniquement un (1) enregistrement : vous. Il s\'agit d\'une mesure de sécurité qui empêche les autres d\'utiliser votre instance, à moins que vous ne les autorisiez. Les enregistrements futurs sont bloqués. Lorsque vous désactivez cette case, d\'autres personnes peuvent utiliser votre instance aussi bien, en supposant qu\'elles puissent l\'atteindre (quand il est connecté à Internet).', - 'store_configuration' => 'Configuration de la boutique', + 'store_configuration' => 'Sauvegarder la configuration', 'single_user_administration' => 'Gestion de l\'utilisateur pour :email', 'edit_user' => 'Modifier l\'utilisateur :email', 'hidden_fields_preferences' => 'Tous les champs ne sont pas visibles dès maintenant. Vous devez les activer dans vos paramètres.', diff --git a/resources/lang/id_ID/firefly.php b/resources/lang/id_ID/firefly.php index 1ccf0ac21f..468b4f91dd 100644 --- a/resources/lang/id_ID/firefly.php +++ b/resources/lang/id_ID/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Close', 'actions' => 'Actions', 'edit' => 'Edit', 'delete' => 'Delete', 'welcomeBack' => 'What\'s playing?', 'everything' => 'Everything', + 'today' => 'today', 'customRange' => 'Custom range', 'apply' => 'Apply', 'select_date' => 'Select date..', diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index 1256dfa222..86c06659f1 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Sluiten', 'actions' => 'Acties', 'edit' => 'Wijzig', 'delete' => 'Verwijder', 'welcomeBack' => 'Hoe staat het er voor?', 'everything' => 'Alles', + 'today' => 'vandaag', 'customRange' => 'Zelf bereik kiezen', 'apply' => 'Go', 'select_date' => 'Selecteer periode..', diff --git a/resources/lang/pl_PL/firefly.php b/resources/lang/pl_PL/firefly.php index 55b571d572..7472338144 100644 --- a/resources/lang/pl_PL/firefly.php +++ b/resources/lang/pl_PL/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Zamknij', 'actions' => 'Akcje', 'edit' => 'Modyfikuj', 'delete' => 'Usuń', 'welcomeBack' => 'Co jest grane?', 'everything' => 'Wszystko', + 'today' => 'today', 'customRange' => 'Niestandardowy zakres', 'apply' => 'Zastosuj', 'select_date' => 'Wybierz datę...', diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 5d1ce8ee7d..9c8cfb90b5 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Fechar', 'actions' => 'Ações', 'edit' => 'Editar', 'delete' => 'Apagar', 'welcomeBack' => 'O que está passando?', 'everything' => 'Tudo', + 'today' => 'today', 'customRange' => 'Intervalo Personalizado', 'apply' => 'Aplicar', 'select_date' => 'Selecione a data..', diff --git a/resources/lang/ru_RU/firefly.php b/resources/lang/ru_RU/firefly.php index 5ced61b508..0bf030e857 100644 --- a/resources/lang/ru_RU/firefly.php +++ b/resources/lang/ru_RU/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'Закрыть', 'actions' => 'Действия', 'edit' => 'Изменить', 'delete' => 'Удалить', 'welcomeBack' => 'Что происходит с моими финансами?', 'everything' => 'Всё', + 'today' => 'today', 'customRange' => 'Другой интервал', 'apply' => 'Применить', 'select_date' => 'Выбрать дату...', diff --git a/resources/lang/sl_SI/firefly.php b/resources/lang/sl_SI/firefly.php index 73394b16bb..adf7fb8e15 100644 --- a/resources/lang/sl_SI/firefly.php +++ b/resources/lang/sl_SI/firefly.php @@ -13,12 +13,14 @@ declare(strict_types=1); return [ // general stuff: + 'language_incomplete' => 'Incomplete translation', 'close' => 'zapri', 'actions' => 'Dejanja', 'edit' => 'uredi', 'delete' => 'izbriši', 'welcomeBack' => 'Kaj dogaja?', 'everything' => 'vse', + 'today' => 'today', 'customRange' => 'obseg po meri', 'apply' => 'uporabi', 'select_date' => 'Izberi datum..', From 573e72f7fbe3f91786b6e25a55df64df3f3e989a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 05:45:58 +0100 Subject: [PATCH 184/258] Fix views for #1000 --- app/Http/Requests/AccountFormRequest.php | 4 ++-- app/Http/Requests/BillFormRequest.php | 4 ++-- app/Http/Requests/JournalFormRequest.php | 8 ++++---- app/Http/Requests/PiggyBankFormRequest.php | 2 +- public/js/ff/transactions/list.js | 2 +- resources/views/index.twig | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index eff6e1240f..261247f432 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -48,12 +48,12 @@ class AccountFormRequest extends Request 'active' => $this->boolean('active'), 'accountType' => $this->string('what'), 'currency_id' => $this->integer('currency_id'), - 'virtualBalance' => $this->float('virtualBalance'), + 'virtualBalance' => $this->string('virtualBalance'), 'iban' => $this->string('iban'), 'BIC' => $this->string('BIC'), 'accountNumber' => $this->string('accountNumber'), 'accountRole' => $this->string('accountRole'), - 'openingBalance' => $this->float('openingBalance'), + 'openingBalance' => $this->string('openingBalance'), 'openingBalanceDate' => $this->date('openingBalanceDate'), 'ccType' => $this->string('ccType'), 'ccMonthlyPaymentDate' => $this->string('ccMonthlyPaymentDate'), diff --git a/app/Http/Requests/BillFormRequest.php b/app/Http/Requests/BillFormRequest.php index c7d416064e..b08c26279a 100644 --- a/app/Http/Requests/BillFormRequest.php +++ b/app/Http/Requests/BillFormRequest.php @@ -44,10 +44,10 @@ class BillFormRequest extends Request return [ 'name' => $this->string('name'), 'match' => $this->string('match'), - 'amount_min' => $this->float('amount_min'), + 'amount_min' => $this->string('amount_min'), 'amount_currency_id_amount_min' => $this->integer('amount_currency_id_amount_min'), 'amount_currency_id_amount_max' => $this->integer('amount_currency_id_amount_max'), - 'amount_max' => $this->float('amount_max'), + 'amount_max' => $this->string('amount_max'), 'date' => $this->date('date'), 'repeat_freq' => $this->string('repeat_freq'), 'skip' => $this->integer('skip'), diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.php index fc05104976..56c2836e47 100644 --- a/app/Http/Requests/JournalFormRequest.php +++ b/app/Http/Requests/JournalFormRequest.php @@ -64,7 +64,7 @@ class JournalFormRequest extends Request // transaction / journal data: 'description' => $this->string('description'), - 'amount' => $this->float('amount'), + 'amount' => $this->string('amount'), 'budget_id' => $this->integer('budget_id'), 'category' => $this->string('category'), 'source_account_id' => $this->integer('source_account_id'), @@ -74,9 +74,9 @@ class JournalFormRequest extends Request 'piggy_bank_id' => $this->integer('piggy_bank_id'), // native amount and stuff like that: - 'native_amount' => $this->float('native_amount'), - 'source_amount' => $this->float('source_amount'), - 'destination_amount' => $this->float('destination_amount'), + 'native_amount' => $this->string('native_amount'), + 'source_amount' => $this->string('source_amount'), + 'destination_amount' => $this->string('destination_amount'), ]; return $data; diff --git a/app/Http/Requests/PiggyBankFormRequest.php b/app/Http/Requests/PiggyBankFormRequest.php index 268a0287c8..f882835309 100644 --- a/app/Http/Requests/PiggyBankFormRequest.php +++ b/app/Http/Requests/PiggyBankFormRequest.php @@ -47,7 +47,7 @@ class PiggyBankFormRequest extends Request 'name' => $this->string('name'), 'startdate' => new Carbon, 'account_id' => $this->integer('account_id'), - 'targetamount' => $this->float('targetamount'), + 'targetamount' => $this->string('targetamount'), 'targetdate' => $this->date('targetdate'), 'note' => $this->string('note'), ]; diff --git a/public/js/ff/transactions/list.js b/public/js/ff/transactions/list.js index 7004447dfa..eb5a8f0acf 100644 --- a/public/js/ff/transactions/list.js +++ b/public/js/ff/transactions/list.js @@ -147,7 +147,7 @@ function countChecked() { $('.mass_delete span').text(delete_selected_txt + ' (' + checked + ')'); // get amount for the transactions: - getAmounts(); + //getAmounts(); $('.mass_button_options').show(); diff --git a/resources/views/index.twig b/resources/views/index.twig index 89b03ae452..ba892acac2 100644 --- a/resources/views/index.twig +++ b/resources/views/index.twig @@ -79,7 +79,7 @@ {% endfor %} From 0812901745b98a6cb26ea4ad632a023a46106312 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 05:46:19 +0100 Subject: [PATCH 185/258] Various code cleanup. --- app/Exceptions/Handler.php | 2 ++ app/Http/Controllers/Auth/LoginController.php | 3 +++ app/Http/Controllers/Json/FrontpageController.php | 2 ++ app/Http/Controllers/NewUserController.php | 6 ++++-- app/Http/Controllers/ProfileController.php | 1 + app/Http/Controllers/TransactionController.php | 3 ++- app/Repositories/Journal/JournalRepository.php | 1 + 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 322ae31e26..02e1670b03 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -85,6 +85,8 @@ class Handler extends ExceptionHandler * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine. * * @param \Exception $exception + * + * @return mixed|void */ public function report(Exception $exception) { diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 1a4aa09918..c826709f8f 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -74,6 +74,9 @@ class LoginController extends Controller /** * Show the application's login form. * + * @param Request $request + * @param CookieJar $cookieJar + * * @return \Illuminate\Http\Response */ public function showLoginForm(Request $request, CookieJar $cookieJar) diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index 4f187f4eab..c0390c6ffd 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -33,6 +33,8 @@ use Response; class FrontpageController extends Controller { /** + * @param PiggyBankRepositoryInterface $repository + * * @return \Illuminate\Http\JsonResponse */ public function piggyBanks(PiggyBankRepositoryInterface $repository) diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 6589f22769..d1f9df1556 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -70,8 +70,10 @@ class NewUserController extends Controller } /** - * @param NewUserFormRequest $request - * @param AccountRepositoryInterface $repository + * @param NewUserFormRequest $request + * @param AccountRepositoryInterface $repository + * + * @param CurrencyRepositoryInterface $currencyRepository * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index c8fe9ed92e..0ee347e9fb 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -260,6 +260,7 @@ class ProfileController extends Controller * @param string $token * @param string $hash * + * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * @throws FireflyException */ public function undoEmailChange(string $token, string $hash) diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index ed2cf98897..47eb0e690e 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -126,7 +126,8 @@ class TransactionController extends Controller } /** - * @param Request $request + * @param Request $request + * @param JournalRepositoryInterface $repository */ public function reconcile(Request $request, JournalRepositoryInterface $repository) { diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index 2e03e96231..c1b3fee1cc 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -264,6 +264,7 @@ class JournalRepository implements JournalRepositoryInterface $this->storeBudgetWithJournal($journal, $data['budget_id']); // store two transactions: + $one = [ 'journal' => $journal, 'account' => $accounts['source'], From 64fc6b65232dbcc327a30719bc4b6a44c096ff4e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 06:02:15 +0100 Subject: [PATCH 186/258] Some charts will render correctly #1000 --- app/Http/Controllers/JavascriptController.php | 20 ++++++++++++++----- resources/views/layout/default.twig | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index 2e4ea3b92b..4c310de894 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -92,20 +92,30 @@ class JavascriptController extends Controller * * @return \Illuminate\Http\Response */ - public function variables(Request $request) + public function variables(Request $request, AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository) { + $account = $repository->find(intval($request->get('account'))); + $currencyId = 0; + if (null !== $account) { + $currencyId = intval($account->getMeta('currency_id')); + } + /** @var TransactionCurrency $currency */ + $currency = $currencyRepository->find($currencyId); + if (0 === $currencyId) { + $currency = app('amount')->getDefaultCurrency(); + } + $localeconv = localeconv(); $accounting = app('amount')->getJsConfig($localeconv); $localeconv = localeconv(); - $defaultCurrency = app('amount')->getDefaultCurrency(); - $localeconv['frac_digits'] = $defaultCurrency->decimal_places; + $localeconv['frac_digits'] = $currency->decimal_places; $pref = Preferences::get('language', config('firefly.default_language', 'en_US')); $lang = $pref->data; $dateRange = $this->getDateRangeConfig(); $data = [ - 'currencyCode' => app('amount')->getCurrencyCode(), - 'currencySymbol' => app('amount')->getCurrencySymbol(), + 'currencyCode' => $currency->code, + 'currencySymbol' => $currency->symbol, 'accounting' => $accounting, 'localeconv' => $localeconv, 'language' => $lang, diff --git a/resources/views/layout/default.twig b/resources/views/layout/default.twig index 1c900ad955..bf3f982760 100644 --- a/resources/views/layout/default.twig +++ b/resources/views/layout/default.twig @@ -185,7 +185,7 @@ - + {% if not shownDemo %} From 1045ed13fa9be24d4f3c50b7041631692d4b370f Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 11:32:35 +0100 Subject: [PATCH 187/258] Fix #996 --- app/Http/Controllers/BudgetController.php | 2 +- app/Repositories/Budget/BudgetRepository.php | 9 +++++---- app/Repositories/Budget/BudgetRepositoryInterface.php | 2 +- resources/views/budgets/index.twig | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index 63b12faeaa..76d3683f16 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -81,7 +81,7 @@ class BudgetController extends Controller */ public function amount(Request $request, Budget $budget) { - $amount = intval($request->get('amount')); + $amount = strval($request->get('amount')); $start = Carbon::createFromFormat('Y-m-d', $request->get('start')); $end = Carbon::createFromFormat('Y-m-d', $request->get('end')); $budgetLimit = $this->repository->updateLimitAmount($budget, $start, $end, $amount); diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index e4be053696..88c2872307 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -87,6 +87,7 @@ class BudgetRepository implements BudgetRepositoryInterface /** @var AccountRepositoryInterface $accountRepository */ $accountRepository = app(AccountRepositoryInterface::class); $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $defaultCurrency = app('amount')->getDefaultCurrency(); $return = []; /** @var Budget $budget */ foreach ($budgets as $budget) { @@ -105,7 +106,7 @@ class BudgetRepository implements BudgetRepositoryInterface if ($limit->start_date->isSameDay($start) && $limit->end_date->isSameDay($end) ) { $return[$budgetId]['currentLimit'] = $limit; - $return[$budgetId]['budgeted'] = $limit->amount; + $return[$budgetId]['budgeted'] = round($limit->amount, $defaultCurrency->decimal_places); continue; } // otherwise it's just one of the many relevant repetitions: @@ -599,11 +600,11 @@ class BudgetRepository implements BudgetRepositoryInterface * @param Budget $budget * @param Carbon $start * @param Carbon $end - * @param int $amount + * @param string $amount * * @return BudgetLimit */ - public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, int $amount): BudgetLimit + public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): BudgetLimit { // count the limits: $limits = $budget->budgetlimits() @@ -626,7 +627,7 @@ class BudgetRepository implements BudgetRepositoryInterface } // delete if amount is zero. - if (null !== $limit && $amount <= 0.0) { + if (null !== $limit && bccomp('0', $amount) < 0) { $limit->delete(); return new BudgetLimit; diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index ee4a15d9d2..473c363512 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -214,5 +214,5 @@ interface BudgetRepositoryInterface * * @return BudgetLimit */ - public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, int $amount): BudgetLimit; + public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): BudgetLimit; } diff --git a/resources/views/budgets/index.twig b/resources/views/budgets/index.twig index 71ba5fd301..6c071bd65a 100644 --- a/resources/views/budgets/index.twig +++ b/resources/views/budgets/index.twig @@ -164,7 +164,7 @@ {% endif %} {% if budgetInformation[budget.id]['currentLimit'] %} - {% set repAmount = budgetInformation[budget.id]['currentLimit'].amount %} + {% set repAmount = budgetInformation[budget.id]['budgeted'] %} {% else %} {% set repAmount = '0' %} {% endif %} @@ -174,8 +174,8 @@
{{ defaultCurrency.symbol|raw }}
+ data-id="{{ budget.id }}" value="{{ repAmount }}" autocomplete="off" + min="0" name="amount" type="number"> Date: Sat, 18 Nov 2017 15:34:11 +0100 Subject: [PATCH 188/258] Fix #1001 --- resources/views/piggy-banks/show.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/piggy-banks/show.twig b/resources/views/piggy-banks/show.twig index f85fa79d5f..c429a24e14 100644 --- a/resources/views/piggy-banks/show.twig +++ b/resources/views/piggy-banks/show.twig @@ -83,7 +83,7 @@
-

{{ 'table'|_ }}

+

{{ 'transactions'|_ }}

{% include 'list/piggy-bank-events' %} From 5cfe3cf8a986b03a330cb880d81335f37d742f0a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 15:50:21 +0100 Subject: [PATCH 189/258] Fix entry fields --- app/Export/Entry/Entry.php | 58 +++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/app/Export/Entry/Entry.php b/app/Export/Entry/Entry.php index 6b43d3408e..c61dfe6cb8 100644 --- a/app/Export/Entry/Entry.php +++ b/app/Export/Entry/Entry.php @@ -45,35 +45,47 @@ use FireflyIII\Models\Transaction; final class Entry { // @formatter:off - public $amount; - public $asset_account_bic; - public $asset_account_iban; - public $asset_account_id; - public $asset_account_name; - public $asset_account_number; - public $asset_currency_code; - public $bill_id; - public $bill_name; - public $budget_id; - public $budget_name; - public $category_id; - public $category_name; - public $currency_code; + public $journal_id; + public $transaction_id = 0; + public $date; public $description; - public $foreign_amount = '0'; + + public $currency_code; + public $amount; public $foreign_currency_code = ''; - public $journal_id; - public $notes; - public $opposing_account_bic; - public $opposing_account_iban; + public $foreign_amount = '0'; + + public $transaction_type; + + public $asset_account_id; + public $asset_account_name; + public $asset_account_iban; + public $asset_account_bic; + public $asset_account_number; + public $asset_currency_code; + public $opposing_account_id; public $opposing_account_name; + public $opposing_account_iban; + public $opposing_account_bic; public $opposing_account_number; public $opposing_currency_code; + + public $budget_id; + public $budget_name; + + public $category_id; + public $category_name; + + public $bill_id; + public $bill_name; + + public $notes; + public $tags; - public $transaction_id = 0; - public $transaction_type; + + // @formatter:on /** @@ -93,9 +105,9 @@ final class Entry * * @return Entry */ - public static function fromTransaction(Transaction $transaction): Entry + public static function fromTransaction(Transaction $transaction): self { - $entry = new self; + $entry = new self(); $entry->journal_id = $transaction->journal_id; $entry->transaction_id = $transaction->id; $entry->date = $transaction->date->format('Ymd'); From 03edf6c0a0c0dd87885c18db8a22988b33aff43b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 15:51:11 +0100 Subject: [PATCH 190/258] Create new account and transaction types. --- app/Console/Commands/UpgradeDatabase.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/UpgradeDatabase.php b/app/Console/Commands/UpgradeDatabase.php index c50664836d..2123a65a24 100644 --- a/app/Console/Commands/UpgradeDatabase.php +++ b/app/Console/Commands/UpgradeDatabase.php @@ -81,6 +81,7 @@ class UpgradeDatabase extends Command $this->setTransactionIdentifier(); $this->migrateRepetitions(); $this->updateAccountCurrencies(); + $this->createNewTypes(); $this->line('Updating currency information..'); $this->updateTransferCurrencies(); $this->updateOtherCurrencies(); @@ -289,6 +290,19 @@ class UpgradeDatabase extends Command ); } + private function createNewTypes(): void + { + // create transaction type "Reconciliation". + $type = TransactionType::where('type', TransactionType::RECONCILIATION)->first(); + if (is_null($type)) { + TransactionType::create(['type' => TransactionType::RECONCILIATION]); + } + $account = AccountType::where('type', AccountType::RECONCILIATION)->first(); + if (is_null($account)) { + AccountType::create(['type' => AccountType::RECONCILIATION]); + } + } + /** * Move all the journal_meta notes to their note object counter parts. */ @@ -300,7 +314,7 @@ class UpgradeDatabase extends Command $journal = $meta->transactionJournal; $note = $journal->notes()->first(); if (null === $note) { - $note = new Note; + $note = new Note(); $note->noteable()->associate($journal); } From 5f127b7becdfc6545a67cde18cefae00e44eb538 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 15:53:27 +0100 Subject: [PATCH 191/258] Expand types. --- app/Models/AccountType.php | 2 ++ app/Models/TransactionType.php | 5 +++-- database/seeds/AccountTypeSeeder.php | 19 ++++++++++--------- database/seeds/TransactionTypeSeeder.php | 1 + 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 0b00a1bce4..40b9a872eb 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -38,6 +38,8 @@ class AccountType extends Model const INITIAL_BALANCE = 'Initial balance account'; const BENEFICIARY = 'Beneficiary account'; const IMPORT = 'Import account'; + const RECONCILIATION = 'Reconciliation account'; + const LOAN = 'Loan'; /** * The attributes that should be casted to native types. diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index a915e849a0..33f5dc58eb 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -37,6 +37,7 @@ class TransactionType extends Model const DEPOSIT = 'Deposit'; const TRANSFER = 'Transfer'; const OPENING_BALANCE = 'Opening balance'; + const RECONCILIATION = 'Reconciliation'; /** * The attributes that should be casted to native types. @@ -58,13 +59,13 @@ class TransactionType extends Model public static function routeBinder(string $type) { if (!auth()->check()) { - throw new NotFoundHttpException; + throw new NotFoundHttpException(); } $transactionType = self::where('type', ucfirst($type))->first(); if (null !== $transactionType) { return $transactionType; } - throw new NotFoundHttpException; + throw new NotFoundHttpException(); } /** diff --git a/database/seeds/AccountTypeSeeder.php b/database/seeds/AccountTypeSeeder.php index 721dffaafb..9ebbbfa91d 100644 --- a/database/seeds/AccountTypeSeeder.php +++ b/database/seeds/AccountTypeSeeder.php @@ -21,14 +21,15 @@ class AccountTypeSeeder extends Seeder { public function run() { - AccountType::create(['type' => 'Default account']); - AccountType::create(['type' => 'Cash account']); - AccountType::create(['type' => 'Asset account']); - AccountType::create(['type' => 'Expense account']); - AccountType::create(['type' => 'Revenue account']); - AccountType::create(['type' => 'Initial balance account']); - AccountType::create(['type' => 'Beneficiary account']); - AccountType::create(['type' => 'Import account']); - AccountType::create(['type' => 'Loan']); + AccountType::create(['type' => AccountType::DEFAULT]); + AccountType::create(['type' => AccountType::CASH]); + AccountType::create(['type' => AccountType::ASSET]); + AccountType::create(['type' => AccountType::EXPENSE]); + AccountType::create(['type' => AccountType::REVENUE]); + AccountType::create(['type' => AccountType::INITIAL_BALANCE]); + AccountType::create(['type' => AccountType::BENEFICIARY]); + AccountType::create(['type' => AccountType::IMPORT]); + AccountType::create(['type' => AccountType::LOAN]); + AccountType::create(['type' => AccountType::RECONCILIATION]); } } diff --git a/database/seeds/TransactionTypeSeeder.php b/database/seeds/TransactionTypeSeeder.php index af070ba825..c9d9cc37df 100644 --- a/database/seeds/TransactionTypeSeeder.php +++ b/database/seeds/TransactionTypeSeeder.php @@ -25,5 +25,6 @@ class TransactionTypeSeeder extends Seeder TransactionType::create(['type' => TransactionType::DEPOSIT]); TransactionType::create(['type' => TransactionType::TRANSFER]); TransactionType::create(['type' => TransactionType::OPENING_BALANCE]); + TransactionType::create(['type' => TransactionType::RECONCILIATION]); } } From e8e0a44cca480f31f3f3c7c4d66ca122e1ca4e0f Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 16:30:45 +0100 Subject: [PATCH 192/258] Fix for #1002 --- app/Http/Controllers/AccountController.php | 2 +- app/Http/Controllers/Auth/LoginController.php | 5 +++-- app/Http/Controllers/Auth/TwoFactorController.php | 6 +++--- app/Http/Controllers/HomeController.php | 4 ++-- app/Http/Controllers/JavascriptController.php | 2 +- app/Http/Controllers/NewUserController.php | 1 - app/Http/Controllers/ProfileController.php | 1 + app/Http/Controllers/Transaction/MassController.php | 4 +--- app/Http/Middleware/AuthenticateTwoFactor.php | 4 ++-- app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php | 4 ++-- app/Repositories/Budget/BudgetRepository.php | 2 +- 11 files changed, 17 insertions(+), 18 deletions(-) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index ebbd721bbe..ea1c6ba692 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -409,7 +409,7 @@ class AccountController extends Controller * and for each period, the amount of money spent and earned. This is a complex operation which is cached for * performance reasons. * - * @param Account $account The account involved. + * @param Account $account the account involved * * @return Collection * diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index c826709f8f..b6d80cf1ca 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -101,7 +101,7 @@ class LoginController extends Controller } // forget 2fa cookie: - $cookie = $cookieJar->forever('twoFactorAuthenticated', 'false'); + $request->session()->forget('twoFactorAuthenticated'); // is allowed to? $singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data; @@ -114,6 +114,7 @@ class LoginController extends Controller $email = $request->old('email'); $remember = $request->old('remember'); - return view('auth.login', compact('allowRegistration', 'email', 'remember'))->withCookie($cookie); + + return view('auth.login', compact('allowRegistration', 'email', 'remember'));//->withCookie($cookie); } } diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index 79bc49041e..5924d5be9e 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -96,9 +96,9 @@ class TwoFactorController extends Controller */ public function postIndex(TokenFormRequest $request, CookieJar $cookieJar) { - // set cookie! - $cookie = $cookieJar->forever('twoFactorAuthenticated', 'true'); + // update session, not cookie: + $request->session()->put('twoFactorAuthenticated', true); - return redirect(route('home'))->withCookie($cookie); + return redirect(route('home')); } } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index dec3344e4b..0632f35c37 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -94,7 +94,7 @@ class HomeController extends Controller { $phpVersion = PHP_VERSION; $phpOs = php_uname(); - $interface = php_sapi_name(); + $interface = PHP_SAPI; $now = Carbon::create()->format('Y-m-d H:i:s e'); $extensions = join(', ', get_loaded_extensions()); $drivers = join(', ', DB::availableDrivers()); @@ -211,7 +211,7 @@ class HomeController extends Controller return view( 'index', - compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount','start','end','today') + compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount', 'start', 'end', 'today') ); } diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index 4c310de894..6ec063da76 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -100,7 +100,7 @@ class JavascriptController extends Controller $currencyId = intval($account->getMeta('currency_id')); } /** @var TransactionCurrency $currency */ - $currency = $currencyRepository->find($currencyId); + $currency = $currencyRepository->find($currencyId); if (0 === $currencyId) { $currency = app('amount')->getDefaultCurrency(); } diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index d1f9df1556..efa5ae5ab7 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -72,7 +72,6 @@ class NewUserController extends Controller /** * @param NewUserFormRequest $request * @param AccountRepositoryInterface $repository - * * @param CurrencyRepositoryInterface $currencyRepository * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 0ee347e9fb..95d9fe440c 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -261,6 +261,7 @@ class ProfileController extends Controller * @param string $hash * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + * * @throws FireflyException */ public function undoEmailChange(string $token, string $hash) diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index d7dc44935b..ed25b29bf6 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -133,9 +133,7 @@ class MassController extends Controller // skip transactions that have multiple destinations, multiple sources or are an opening balance. $filtered = new Collection; $messages = []; - /** - * @var TransactionJournal - */ + // @var TransactionJournal foreach ($journals as $journal) { $sources = $journal->sourceAccountList(); $destinations = $journal->destinationAccountList(); diff --git a/app/Http/Middleware/AuthenticateTwoFactor.php b/app/Http/Middleware/AuthenticateTwoFactor.php index 970e834cbc..8b0ae9e071 100644 --- a/app/Http/Middleware/AuthenticateTwoFactor.php +++ b/app/Http/Middleware/AuthenticateTwoFactor.php @@ -64,8 +64,8 @@ class AuthenticateTwoFactor $is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; $has2faSecret = null !== Preferences::get('twoFactorAuthSecret'); - // grab 2auth information from cookie, not from session. - $is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated'); + // grab 2auth information from session. + $is2faAuthed = true === $request->session()->get('twoFactorAuthenticated'); if ($is2faEnabled && $has2faSecret && !$is2faAuthed) { Log::debug('Does not seem to be 2 factor authed, redirect.'); diff --git a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php index 1e63bb21da..7b379fd462 100644 --- a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php +++ b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php @@ -47,8 +47,8 @@ class RedirectIfTwoFactorAuthenticated $is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; $has2faSecret = null !== Preferences::get('twoFactorAuthSecret'); - // grab 2auth information from cookie - $is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated'); + // grab 2auth information from session. + $is2faAuthed = true === $request->session()->get('twoFactorAuthenticated'); if ($is2faEnabled && $has2faSecret && $is2faAuthed) { return redirect('/'); diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 88c2872307..f5329ab466 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -87,7 +87,7 @@ class BudgetRepository implements BudgetRepositoryInterface /** @var AccountRepositoryInterface $accountRepository */ $accountRepository = app(AccountRepositoryInterface::class); $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); - $defaultCurrency = app('amount')->getDefaultCurrency(); + $defaultCurrency = app('amount')->getDefaultCurrency(); $return = []; /** @var Budget $budget */ foreach ($budgets as $budget) { From ee45cc2f73e4cfb0e4a52948d87bcc7ea138df6a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 16:36:22 +0100 Subject: [PATCH 193/258] Fix upgrade database thing. --- app/Models/AccountType.php | 3 +++ app/Models/TransactionType.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 40b9a872eb..1ba108a8ce 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -41,6 +41,9 @@ class AccountType extends Model const RECONCILIATION = 'Reconciliation account'; const LOAN = 'Loan'; + /** @var array */ + protected $fillable = ['type']; + /** * The attributes that should be casted to native types. * diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index 33f5dc58eb..9668384b2f 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -39,6 +39,9 @@ class TransactionType extends Model const OPENING_BALANCE = 'Opening balance'; const RECONCILIATION = 'Reconciliation'; + /** @var array */ + protected $fillable = ['type']; + /** * The attributes that should be casted to native types. * From 9db83bc6ad2312d76173f76c2e4e00343cd09046 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 16:51:57 +0100 Subject: [PATCH 194/258] Session lifetime is a week. --- config/session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/session.php b/config/session.php index 3ca75340f1..0dd3edfc10 100644 --- a/config/session.php +++ b/config/session.php @@ -24,7 +24,7 @@ declare(strict_types=1); return [ 'driver' => env('SESSION_DRIVER', 'file'), - 'lifetime' => 120, + 'lifetime' => 10080, 'expire_on_close' => false, 'encrypt' => true, 'files' => storage_path('framework/sessions'), From 6bda5c2d537faaa799bbdcb791110b626988b83c Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 16:55:12 +0100 Subject: [PATCH 195/258] New version [skip ci] --- .sandstorm/sandstorm-pkgdef.capnp | 4 ++-- config/firefly.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index eece9d80c3..c73fcbd69a 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -15,8 +15,8 @@ const pkgdef :Spk.PackageDefinition = ( manifest = ( appTitle = (defaultText = "Firefly III"), - appVersion = 3, - appMarketingVersion = (defaultText = "4.6.10"), + appVersion = 4, + appMarketingVersion = (defaultText = "4.6.11"), actions = [ # Define your "new document" handlers here. diff --git a/config/firefly.php b/config/firefly.php index 2a518e3e4f..7fad830168 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -33,7 +33,7 @@ return [ 'is_demo_site' => false, ], 'encryption' => (is_null(env('USE_ENCRYPTION')) || env('USE_ENCRYPTION') === true), - 'version' => '4.6.10', + 'version' => '4.6.11', 'maxUploadSize' => 15242880, 'allowedMimes' => ['image/png', 'image/jpeg', 'application/pdf'], 'list_length' => 10, From cd42399c292f8d7ccc50321a4ce6feda85d921f6 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 20:26:42 +0100 Subject: [PATCH 196/258] Fix #931 --- app/Import/Converter/Amount.php | 3 +- app/Import/Converter/AmountCredit.php | 44 +++++++++++++++++ app/Import/Converter/AmountDebet.php | 45 ++++++++++++++++++ app/Import/Object/ImportJournal.php | 47 +++++++++++++++++-- .../Currency/CurrencyRepository.php | 4 +- app/Repositories/Tag/TagRepository.php | 10 ++-- .../Import/Configuration/Csv/Roles.php | 2 +- config/csv.php | 12 +++++ resources/lang/en_US/csv.php | 2 + 9 files changed, 158 insertions(+), 11 deletions(-) create mode 100644 app/Import/Converter/AmountCredit.php create mode 100644 app/Import/Converter/AmountDebet.php diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php index e3180d9368..8bf70ba9dd 100644 --- a/app/Import/Converter/Amount.php +++ b/app/Import/Converter/Amount.php @@ -88,6 +88,7 @@ class Amount implements ConverterInterface Log::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $oldValue, $value)); } - return strval(round(floatval($value), 12)); + $number = strval(number_format(round(floatval($value), 12), 12)); + return $number; } } diff --git a/app/Import/Converter/AmountCredit.php b/app/Import/Converter/AmountCredit.php new file mode 100644 index 0000000000..2e37f42706 --- /dev/null +++ b/app/Import/Converter/AmountCredit.php @@ -0,0 +1,44 @@ +. + */ +declare(strict_types=1); + +namespace FireflyIII\Import\Converter; + +/** + * Class AmountCredit + */ +class AmountCredit implements ConverterInterface +{ + /** + * @param $value + * + * @return string + */ + public function convert($value): string + { + /** @var ConverterInterface $converter */ + $converter = app(Amount::class); + $result = $converter->convert($value); + $result = app('steam')->positive($result); + + return $result; + } +} diff --git a/app/Import/Converter/AmountDebet.php b/app/Import/Converter/AmountDebet.php new file mode 100644 index 0000000000..a890ae3209 --- /dev/null +++ b/app/Import/Converter/AmountDebet.php @@ -0,0 +1,45 @@ +. + */ +declare(strict_types=1); + +namespace FireflyIII\Import\Converter; + +/** + * Class AmountDebet + */ +class AmountDebet implements ConverterInterface +{ + /** + * @param $value + * + * @return string + */ + public function convert($value): string + { + /** @var ConverterInterface $converter */ + $converter = app(Amount::class); + $result = $converter->convert($value); + $result = app('steam')->positive($result); + $result = bcmul($result, '-1'); + + return $result; + } +} diff --git a/app/Import/Object/ImportJournal.php b/app/Import/Object/ImportJournal.php index b78fe908e8..3f27e1ab49 100644 --- a/app/Import/Object/ImportJournal.php +++ b/app/Import/Object/ImportJournal.php @@ -59,8 +59,12 @@ class ImportJournal public $opposing; /** @var array */ public $tags = []; - /** @var string */ + /** @var array */ private $amount; + /** @var array */ + private $amountCredit; + /** @var array */ + private $amountDebet; /** @var string */ private $convertedAmount = null; /** @var string */ @@ -101,11 +105,40 @@ class ImportJournal public function getAmount(): string { Log::debug('Now in getAmount()'); + Log::debug(sprintf('amount is %s', var_export($this->amount, true))); + Log::debug(sprintf('debet amount is %s', var_export($this->amountDebet, true))); + Log::debug(sprintf('credit amount is %s', var_export($this->amountCredit, true))); + if (null === $this->convertedAmount) { + // first check if the amount is set: Log::debug('convertedAmount is NULL'); + + $info = []; + $converterClass = ''; + + if (!is_null($this->amount)) { + Log::debug('Amount value is not NULL, assume this is the correct value.'); + $converterClass = sprintf('FireflyIII\Import\Converter\%s', config(sprintf('csv.import_roles.%s.converter', $this->amount['role']))); + $info = $this->amount; + } + if (!is_null($this->amountDebet)) { + Log::debug('Amount DEBET value is not NULL, assume this is the correct value (overrules Amount).'); + $converterClass = sprintf('FireflyIII\Import\Converter\%s', config(sprintf('csv.import_roles.%s.converter', $this->amountDebet['role']))); + $info = $this->amountDebet; + } + if (!is_null($this->amountCredit)) { + Log::debug('Amount CREDIT value is not NULL, assume this is the correct value (overrules Amount and AmountDebet).'); + $converterClass = sprintf('FireflyIII\Import\Converter\%s', config(sprintf('csv.import_roles.%s.converter', $this->amountCredit['role']))); + $info = $this->amountCredit; + } + if (count($info) === 0) { + throw new FireflyException('No amount information for this row.'); + } + + Log::debug(sprintf('Converter class is %s', $converterClass)); /** @var ConverterInterface $amountConverter */ - $amountConverter = app(Amount::class); - $this->convertedAmount = $amountConverter->convert($this->amount); + $amountConverter = app($converterClass); + $this->convertedAmount = $amountConverter->convert($info['value']); Log::debug(sprintf('First attempt to convert gives "%s"', $this->convertedAmount)); // modify foreach ($this->modifiers as $modifier) { @@ -196,7 +229,13 @@ class ImportJournal $this->asset->setAccountId($array); break; case 'amount': - $this->amount = $array['value']; + $this->amount = $array; + break; + case 'amount_debet': + $this->amountDebet = $array; + break; + case 'amount_credit': + $this->amountCredit = $array; break; case 'account-iban': $this->asset->setAccountIban($array); diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index 0edb00f25a..7862a2fdba 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -168,7 +168,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface */ public function get(): Collection { - return TransactionCurrency::get(); + return TransactionCurrency::orderBy('code', 'ASC')->get(); } /** @@ -178,7 +178,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface */ public function getByIds(array $ids): Collection { - return TransactionCurrency::whereIn('id', $ids)->get(); + return TransactionCurrency::orderBy('code', 'ASC')->whereIn('id', $ids)->get(); } /** diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 981ee5ba21..05f4807096 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -351,7 +351,7 @@ class TagRepository implements TagRepositoryInterface $tagsWithAmounts[$tag->id] = strval($tag->amount_sum); } - $tags = $query->orderBy('tags.id', 'desc')->get(['tags.id', 'tags.tag']); + $tags = $allTags->orderBy('tags.id', 'desc')->get(['tags.id', 'tags.tag']); $temporary = []; /** @var Tag $tag */ foreach ($tags as $tag) { @@ -364,13 +364,17 @@ class TagRepository implements TagRepositoryInterface $temporary[] = [ 'amount' => $amount, - 'tag' => $tag, + 'tag' => [ + 'id' => $tag->id, + 'tag' => $tag->tag, + ], ]; } + /** @var array $entry */ foreach ($temporary as $entry) { $scale = $this->cloudScale([12, 20], floatval($entry['amount']), floatval($min), floatval($max)); - $tagId = $entry['tag']->id; + $tagId = $entry['tag']['id']; $return[$tagId] = [ 'scale' => $scale, 'tag' => $entry['tag'], diff --git a/app/Support/Import/Configuration/Csv/Roles.php b/app/Support/Import/Configuration/Csv/Roles.php index 2f03e3f1a5..e15b2cf898 100644 --- a/app/Support/Import/Configuration/Csv/Roles.php +++ b/app/Support/Import/Configuration/Csv/Roles.php @@ -258,7 +258,7 @@ class Roles implements ConfigurationInterface if ('_ignore' !== $role) { ++$assigned; } - if ('amount' === $role) { + if (in_array($role, ['amount','amount_credit','amount_debet'])) { $hasAmount = true; } } diff --git a/config/csv.php b/config/csv.php index edba7b4714..fa296fe055 100644 --- a/config/csv.php +++ b/config/csv.php @@ -280,6 +280,18 @@ return [ 'converter' => 'Amount', 'field' => 'amount', ], + 'amount_debet' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'AmountDebet', + 'field' => 'amount_debet', + ], + 'amount_credit' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'AmountCredit', + 'field' => 'amount_credit', + ], 'sepa-ct-id' => [ 'mappable' => false, 'pre-process-map' => false, diff --git a/resources/lang/en_US/csv.php b/resources/lang/en_US/csv.php index eb7fe230b1..094df1e9a2 100644 --- a/resources/lang/en_US/csv.php +++ b/resources/lang/en_US/csv.php @@ -51,6 +51,8 @@ return [ 'column_account-id' => 'Asset account ID (matching Firefly)', 'column_account-name' => 'Asset account (name)', 'column_amount' => 'Amount', + 'column_amount_debet' => 'Amount (debet column)', + 'column_amount_credit' => 'Amount (credit column)', 'column_amount-comma-separated' => 'Amount (comma as decimal separator)', 'column_bill-id' => 'Bill ID (matching Firefly)', 'column_bill-name' => 'Bill name', From 7e66794cf5c02a29dadc81f1ccbab4e58bd0c2b7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 20:26:57 +0100 Subject: [PATCH 197/258] Fix #958 --- app/Support/Twig/General.php | 18 ++++++++++++++++++ resources/views/form/location.twig | 2 +- resources/views/rules/index.twig | 2 +- resources/views/rules/rule/create.twig | 2 +- resources/views/rules/rule/edit.twig | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 98c37aa162..38da2546ed 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -25,6 +25,7 @@ namespace FireflyIII\Support\Twig; use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Models\TransactionJournal; +use League\CommonMark\CommonMarkConverter; use Route; use Steam; use Twig_Extension; @@ -45,6 +46,7 @@ class General extends Twig_Extension $this->balance(), $this->formatFilesize(), $this->mimeIcon(), + $this->markdown(), ]; } @@ -146,6 +148,21 @@ class General extends Twig_Extension ); } + /** + * @return Twig_SimpleFilter + */ + protected function markdown(): Twig_SimpleFilter + { + return new Twig_SimpleFilter( + 'markdown', + function (string $text): string { + $converter = new CommonMarkConverter; + + return $converter->convertToHtml($text); + },['is_safe' => ['html']] + ); + } + /** * @return Twig_SimpleFilter */ @@ -164,6 +181,7 @@ class General extends Twig_Extension ); } + /** * @return Twig_SimpleFunction */ diff --git a/resources/views/form/location.twig b/resources/views/form/location.twig index 9b1328ac67..c8201e641f 100644 --- a/resources/views/form/location.twig +++ b/resources/views/form/location.twig @@ -3,7 +3,7 @@
{% if env('MAPBOX_API_KEY','') == '' %}

- {{ trans('mapbox_api_key')|raw }} + {{ trans('firefly.mapbox_api_key')|raw }}

{% else %}
diff --git a/resources/views/rules/index.twig b/resources/views/rules/index.twig index 217d342bab..ecafa6dfea 100644 --- a/resources/views/rules/index.twig +++ b/resources/views/rules/index.twig @@ -130,7 +130,7 @@ {% if not rule.active %} class="text-muted" {% endif %} - >
{{ rule.description }} + >
{{ rule.description|markdown }} {% endif %} diff --git a/resources/views/rules/rule/create.twig b/resources/views/rules/rule/create.twig index 1ca0b13927..15fdc6740d 100644 --- a/resources/views/rules/rule/create.twig +++ b/resources/views/rules/rule/create.twig @@ -31,7 +31,7 @@

{{ 'optionalFields'|_ }}

- {{ ExpandedForm.textarea('description') }} + {{ ExpandedForm.textarea('description', null, {helpText: trans('firefly.field_supports_markdown')}) }}
diff --git a/resources/views/rules/rule/edit.twig b/resources/views/rules/rule/edit.twig index 129c8b03fa..3946a2fae4 100644 --- a/resources/views/rules/rule/edit.twig +++ b/resources/views/rules/rule/edit.twig @@ -30,7 +30,7 @@

{{ 'optionalFields'|_ }}

- {{ ExpandedForm.textarea('description') }} + {{ ExpandedForm.textarea('description', null, {helpText: trans('firefly.field_supports_markdown')}) }}
From 7f27e3ce67b824b356b45521c0e51221cd4a94d0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 21:03:28 +0100 Subject: [PATCH 198/258] Update currencies #994 --- database/seeds/TransactionCurrencySeeder.php | 33 ++++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/database/seeds/TransactionCurrencySeeder.php b/database/seeds/TransactionCurrencySeeder.php index 93f63d1e42..369e642aee 100644 --- a/database/seeds/TransactionCurrencySeeder.php +++ b/database/seeds/TransactionCurrencySeeder.php @@ -21,13 +21,40 @@ class TransactionCurrencySeeder extends Seeder { public function run() { + // european currencies TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€', 'decimal_places' => 2]); - TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$', 'decimal_places' => 2]); TransactionCurrency::create(['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft', 'decimal_places' => 2]); - TransactionCurrency::create(['code' => 'BRL', 'name' => 'Real', 'symbol' => 'R$', 'decimal_places' => 2]); TransactionCurrency::create(['code' => 'GBP', 'name' => 'British Pound', 'symbol' => '£', 'decimal_places' => 2]); + + // american currencies + TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$', 'decimal_places' => 2]); + TransactionCurrency::create(['code' => 'BRL', 'name' => 'Brazilian real', 'symbol' => 'R$', 'decimal_places' => 2]); + TransactionCurrency::create(['code' => 'CAD', 'name' => 'Canadian dollar', 'symbol' => 'C$', 'decimal_places' => 2]); + + // oceanian currencies TransactionCurrency::create(['code' => 'IDR', 'name' => 'Indonesian rupiah', 'symbol' => 'Rp', 'decimal_places' => 2]); - TransactionCurrency::create(['code' => 'XBT', 'name' => 'Bitcoin', 'symbol' => 'B', 'decimal_places' => 8]); + TransactionCurrency::create(['code' => 'AUD', 'name' => 'Australian dollar', 'symbol' => 'A$', 'decimal_places' => 2]); + TransactionCurrency::create(['code' => 'AUD', 'name' => 'New Zealand dollar', 'symbol' => 'NZ$', 'decimal_places' => 2]); + + // african currencies + TransactionCurrency::create(['code' => 'EGP', 'name' => 'Egyptian pound', 'symbol' => 'E£', 'decimal_places' => 2]); + TransactionCurrency::create(['code' => 'MAD', 'name' => 'Moroccan dirham', 'symbol' => 'DH', 'decimal_places' => 2]); + TransactionCurrency::create(['code' => 'ZAR', 'name' => 'South African rand', 'symbol' => 'R', 'decimal_places' => 2]); + + // asian currencies TransactionCurrency::create(['code' => 'JPY', 'name' => 'Japanese yen', 'symbol' => '¥', 'decimal_places' => 2]); + TransactionCurrency::create(['code' => 'RMB', 'name' => 'Chinese yuan', 'symbol' => '元', 'decimal_places' => 2]); + TransactionCurrency::create(['code' => 'RUB', 'name' => 'Russian ruble ', 'symbol' => '₽', 'decimal_places' => 2]); + + // international currencies + TransactionCurrency::create(['code' => 'XBT', 'name' => 'Bitcoin', 'symbol' => '₿', 'decimal_places' => 8]); + TransactionCurrency::create(['code' => 'BCH', 'name' => 'Bitcoin cash', 'symbol' => '₿C', 'decimal_places' => 8]); + TransactionCurrency::create(['code' => 'ETH', 'name' => 'Ethereum', 'symbol' => 'Ξ', 'decimal_places' => 12]); + + + + + + } } From c357d253353614f6f4c39a552c3104ad6821cbca Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Nov 2017 21:03:41 +0100 Subject: [PATCH 199/258] Update CSS --- public/lib/adminlte/css/AdminLTE.css | 6638 ++++++++--------- .../adminlte/css/skins/skin-blue-light.css | 193 +- .../css/skins/skin-blue-light.min.css | 2 +- 3 files changed, 3294 insertions(+), 3539 deletions(-) diff --git a/public/lib/adminlte/css/AdminLTE.css b/public/lib/adminlte/css/AdminLTE.css index c8158d0d10..1b9c78398d 100755 --- a/public/lib/adminlte/css/AdminLTE.css +++ b/public/lib/adminlte/css/AdminLTE.css @@ -1,178 +1,181 @@ -@import url('../../../css/google-fonts.css'); +/* + * AdminLTE.css + * Copyright (c) 2017 thegrumpydictator@gmail.com + * + * This file is part of Firefly III. + * + * Firefly III is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Firefly III is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Firefly III. If not, see . + */ /*! - * AdminLTE v2.3.7 + * AdminLTE v2.4.0 * Author: Almsaeed Studio - * Website: Almsaeed Studio + * Website: Almsaeed Studio * License: Open source - MIT * Please visit http://opensource.org/licenses/MIT for more information -!*/ + */ /* * Core: General Layout Style * ------------------------- */ + +@import url('../../../css/google-fonts.css'); + html, body { - min-height: 100%; + height: 100%; } - .layout-boxed html, .layout-boxed body { - height: 100%; + height: 100%; } - body { - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-weight: 400; - overflow-x: hidden; - overflow-y: auto; + font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: 400; + overflow-x: hidden; + overflow-y: auto; } - /* Layout */ .wrapper { - min-height: 100%; - position: relative; - overflow: hidden; + height: 100%; + position: relative; + overflow-x: hidden; + overflow-y: auto; } - .wrapper:before, .wrapper:after { - content: " "; - display: table; + content: " "; + display: table; } - .wrapper:after { - clear: both; + clear: both; +} +.wrapper:before, +.wrapper:after { + content: " "; + display: table; +} +.wrapper:after { + clear: both; } - .layout-boxed .wrapper { - max-width: 1250px; - margin: 0 auto; - min-height: 100%; - box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); - position: relative; + max-width: 1250px; + margin: 0 auto; + min-height: 100%; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); + position: relative; } - .layout-boxed { - background: url('../img/boxed-bg.jpg') repeat fixed; + background: url('../img/boxed-bg.jpg') repeat fixed; } - /* * Content Wrapper - contains the main content - * ```.right-side has been deprecated as of v2.0.0 in favor of .content-wrapper ``` */ .content-wrapper, -.right-side, .main-footer { - -webkit-transition: -webkit-transform 0.3s ease-in-out, margin 0.3s ease-in-out; - -moz-transition: -moz-transform 0.3s ease-in-out, margin 0.3s ease-in-out; - -o-transition: -o-transform 0.3s ease-in-out, margin 0.3s ease-in-out; - transition: transform 0.3s ease-in-out, margin 0.3s ease-in-out; - margin-left: 230px; - z-index: 820; + -webkit-transition: -webkit-transform 0.3s ease-in-out, margin 0.3s ease-in-out; + -moz-transition: -moz-transform 0.3s ease-in-out, margin 0.3s ease-in-out; + -o-transition: -o-transform 0.3s ease-in-out, margin 0.3s ease-in-out; + transition: transform 0.3s ease-in-out, margin 0.3s ease-in-out; + margin-left: 230px; + z-index: 820; } - .layout-top-nav .content-wrapper, -.layout-top-nav .right-side, .layout-top-nav .main-footer { + margin-left: 0; +} +@media (max-width: 767px) { + .content-wrapper, + .main-footer { margin-left: 0; + } } - -@media (max-width: 767px) { - .content-wrapper, - .right-side, - .main-footer { - margin-left: 0; - } -} - @media (min-width: 768px) { - .sidebar-collapse .content-wrapper, - .sidebar-collapse .right-side, - .sidebar-collapse .main-footer { - margin-left: 0; - } + .sidebar-collapse .content-wrapper, + .sidebar-collapse .main-footer { + margin-left: 0; + } } - @media (max-width: 767px) { - .sidebar-open .content-wrapper, - .sidebar-open .right-side, - .sidebar-open .main-footer { - -webkit-transform: translate(230px, 0); - -ms-transform: translate(230px, 0); - -o-transform: translate(230px, 0); - transform: translate(230px, 0); - } + .sidebar-open .content-wrapper, + .sidebar-open .main-footer { + -webkit-transform: translate(230px, 0); + -ms-transform: translate(230px, 0); + -o-transform: translate(230px, 0); + transform: translate(230px, 0); + } } - -.content-wrapper, -.right-side { - min-height: 100%; - background-color: #ecf0f5; - z-index: 800; +.content-wrapper { + min-height: 100%; + background-color: #ecf0f5; + z-index: 800; } - .main-footer { - background: #fff; - padding: 15px; - color: #444; - border-top: 1px solid #d2d6de; + background: #fff; + padding: 15px; + color: #444; + border-top: 1px solid #d2d6de; } - /* Fixed layout */ .fixed .main-header, .fixed .main-sidebar, .fixed .left-side { - position: fixed; + position: fixed; } - .fixed .main-header { - top: 0; - right: 0; - left: 0; + top: 0; + right: 0; + left: 0; } - .fixed .content-wrapper, .fixed .right-side { - padding-top: 50px; + padding-top: 50px; } - @media (max-width: 767px) { - .fixed .content-wrapper, - .fixed .right-side { - padding-top: 100px; - } + .fixed .content-wrapper, + .fixed .right-side { + padding-top: 100px; + } } - .fixed.layout-boxed .wrapper { - max-width: 100%; + max-width: 100%; } - -body.hold-transition .content-wrapper, -body.hold-transition .right-side, -body.hold-transition .main-footer, -body.hold-transition .main-sidebar, -body.hold-transition .left-side, -body.hold-transition .main-header .navbar, -body.hold-transition .main-header .logo { - /* Fix for IE */ - -webkit-transition: none; - -o-transition: none; - transition: none; +.fixed .wrapper { + overflow: hidden; +} +.hold-transition .content-wrapper, +.hold-transition .right-side, +.hold-transition .main-footer, +.hold-transition .main-sidebar, +.hold-transition .left-side, +.hold-transition .main-header .navbar, +.hold-transition .main-header .logo, +.hold-transition .menu-open .fa-angle-left { + /* Fix for IE */ + -webkit-transition: none; + -o-transition: none; + transition: none; } - /* Content */ .content { - min-height: 250px; - padding: 15px; - margin-right: auto; - margin-left: auto; - padding-left: 15px; - padding-right: 15px; + min-height: 250px; + padding: 15px; + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; } - /* H1 - H6 font */ h1, h2, @@ -186,2710 +189,2373 @@ h6, .h4, .h5, .h6 { - font-family: 'Source Sans Pro', sans-serif; + font-family: 'Source Sans Pro', sans-serif; } - /* General Links */ a { - color: #3c8dbc; + color: #337ab7; } - a:hover, a:active, a:focus { - outline: none; - text-decoration: none; - color: #72afd2; + outline: none; + text-decoration: none; + color: #23527c; } - /* Page Header */ .page-header { - margin: 10px 0 20px 0; - font-size: 22px; + margin: 10px 0 20px 0; + font-size: 22px; } - .page-header > small { - color: #666; - display: block; - margin-top: 5px; + color: #666; + display: block; + margin-top: 5px; } - /* * Component: Main Header * ---------------------- */ .main-header { - position: relative; - max-height: 100px; - z-index: 1030; + position: relative; + max-height: 100px; + z-index: 1030; } - .main-header .navbar { - -webkit-transition: margin-left 0.3s ease-in-out; - -o-transition: margin-left 0.3s ease-in-out; - transition: margin-left 0.3s ease-in-out; - margin-bottom: 0; - margin-left: 230px; - border: none; - min-height: 50px; - border-radius: 0; + -webkit-transition: margin-left 0.3s ease-in-out; + -o-transition: margin-left 0.3s ease-in-out; + transition: margin-left 0.3s ease-in-out; + margin-bottom: 0; + margin-left: 230px; + border: none; + min-height: 50px; + border-radius: 0; } - .layout-top-nav .main-header .navbar { - margin-left: 0; + margin-left: 0; } - .main-header #navbar-search-input.form-control { - background: rgba(255, 255, 255, 0.2); - border-color: transparent; + background: rgba(255, 255, 255, 0.2); + border-color: transparent; } - .main-header #navbar-search-input.form-control:focus, .main-header #navbar-search-input.form-control:active { - border-color: rgba(0, 0, 0, 0.1); - background: rgba(255, 255, 255, 0.9); + border-color: rgba(0, 0, 0, 0.1); + background: rgba(255, 255, 255, 0.9); } - .main-header #navbar-search-input.form-control::-moz-placeholder { - color: #ccc; - opacity: 1; + color: #ccc; + opacity: 1; } - .main-header #navbar-search-input.form-control:-ms-input-placeholder { - color: #ccc; + color: #ccc; } - .main-header #navbar-search-input.form-control::-webkit-input-placeholder { - color: #ccc; + color: #ccc; } - .main-header .navbar-custom-menu, .main-header .navbar-right { - float: right; + float: right; } - @media (max-width: 991px) { - .main-header .navbar-custom-menu a, - .main-header .navbar-right a { - color: inherit; - background: transparent; - } + .main-header .navbar-custom-menu a, + .main-header .navbar-right a { + color: inherit; + background: transparent; + } } - @media (max-width: 767px) { - .main-header .navbar-right { - float: none; - } - - .navbar-collapse .main-header .navbar-right { - margin: 7.5px -15px; - } - - .main-header .navbar-right > li { - color: inherit; - border: 0; - } + .main-header .navbar-right { + float: none; + } + .navbar-collapse .main-header .navbar-right { + margin: 7.5px -15px; + } + .main-header .navbar-right > li { + color: inherit; + border: 0; + } } - .main-header .sidebar-toggle { - float: left; - background-color: transparent; - background-image: none; - padding: 15px 15px; - font-family: fontAwesome; + float: left; + background-color: transparent; + background-image: none; + padding: 15px 15px; + font-family: fontAwesome; } - .main-header .sidebar-toggle:before { - content: "\f0c9"; + content: "\f0c9"; } - .main-header .sidebar-toggle:hover { - color: #fff; + color: #fff; } - .main-header .sidebar-toggle:focus, .main-header .sidebar-toggle:active { - background: transparent; + background: transparent; } - .main-header .sidebar-toggle .icon-bar { - display: none; + display: none; } - .main-header .navbar .nav > li.user > a > .fa, .main-header .navbar .nav > li.user > a > .glyphicon, .main-header .navbar .nav > li.user > a > .ion { - margin-right: 5px; + margin-right: 5px; } - .main-header .navbar .nav > li > a > .label { - position: absolute; - top: 9px; - right: 7px; - text-align: center; - font-size: 9px; - padding: 2px 3px; - line-height: .9; + position: absolute; + top: 9px; + right: 7px; + text-align: center; + font-size: 9px; + padding: 2px 3px; + line-height: .9; } - .main-header .logo { - -webkit-transition: width 0.3s ease-in-out; - -o-transition: width 0.3s ease-in-out; - transition: width 0.3s ease-in-out; - display: block; - float: left; - height: 50px; - font-size: 20px; - line-height: 50px; - text-align: center; - width: 230px; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - padding: 0 15px; - font-weight: 300; - overflow: hidden; + -webkit-transition: width 0.3s ease-in-out; + -o-transition: width 0.3s ease-in-out; + transition: width 0.3s ease-in-out; + display: block; + float: left; + height: 50px; + font-size: 20px; + line-height: 50px; + text-align: center; + width: 230px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 15px; + font-weight: 300; + overflow: hidden; } - .main-header .logo .logo-lg { - display: block; + display: block; } - .main-header .logo .logo-mini { - display: none; + display: none; } - .main-header .navbar-brand { - color: #fff; + color: #fff; } - .content-header { - position: relative; - padding: 15px 15px 0 15px; + position: relative; + padding: 15px 15px 0 15px; } - .content-header > h1 { - margin: 0; - font-size: 24px; + margin: 0; + font-size: 24px; } - .content-header > h1 > small { - font-size: 15px; - display: inline-block; - padding-left: 4px; - font-weight: 300; + font-size: 15px; + display: inline-block; + padding-left: 4px; + font-weight: 300; } - .content-header > .breadcrumb { - float: right; - background: transparent; - margin-top: 0; - margin-bottom: 0; - font-size: 12px; - padding: 7px 5px; - position: absolute; - top: 15px; - right: 10px; - border-radius: 2px; + float: right; + background: transparent; + margin-top: 0; + margin-bottom: 0; + font-size: 12px; + padding: 7px 5px; + position: absolute; + top: 15px; + right: 10px; + border-radius: 2px; } - .content-header > .breadcrumb > li > a { - color: #444; - text-decoration: none; - display: inline-block; + color: #444; + text-decoration: none; + display: inline-block; } - .content-header > .breadcrumb > li > a > .fa, .content-header > .breadcrumb > li > a > .glyphicon, .content-header > .breadcrumb > li > a > .ion { - margin-right: 5px; + margin-right: 5px; } - .content-header > .breadcrumb > li + li:before { - content: '>\00a0'; + content: '>\00a0'; } - @media (max-width: 991px) { - .content-header > .breadcrumb { - position: relative; - margin-top: 5px; - top: 0; - right: 0; - float: none; - background: #d2d6de; - padding-left: 10px; - } - - .content-header > .breadcrumb li:before { - color: #97a0b3; - } + .content-header > .breadcrumb { + position: relative; + margin-top: 5px; + top: 0; + right: 0; + float: none; + background: #d2d6de; + padding-left: 10px; + } + .content-header > .breadcrumb li:before { + color: #97a0b3; + } } - .navbar-toggle { - color: #fff; - border: 0; + color: #fff; + border: 0; + margin: 0; + padding: 15px 15px; +} +@media (max-width: 991px) { + .navbar-custom-menu .navbar-nav > li { + float: left; + } + .navbar-custom-menu .navbar-nav { margin: 0; - padding: 15px 15px; + float: left; + } + .navbar-custom-menu .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + line-height: 20px; + } } - -@media (max-width: 991px) { - .navbar-custom-menu .navbar-nav > li { - float: left; - } - - .navbar-custom-menu .navbar-nav { - margin: 0; - float: left; - } - - .navbar-custom-menu .navbar-nav > li > a { - padding-top: 15px; - padding-bottom: 15px; - line-height: 20px; - } -} - @media (max-width: 767px) { - .main-header { - position: relative; - } - - .main-header .logo, - .main-header .navbar { - width: 100%; - float: none; - } - - .main-header .navbar { - margin: 0; - } - - .main-header .navbar-custom-menu { - float: right; - } + .main-header { + position: relative; + } + .main-header .logo, + .main-header .navbar { + width: 100%; + float: none; + } + .main-header .navbar { + margin: 0; + } + .main-header .navbar-custom-menu { + float: right; + } } - @media (max-width: 991px) { - .navbar-collapse.pull-left { - float: none !important; - } - - .navbar-collapse.pull-left + .navbar-custom-menu { - display: block; - position: absolute; - top: 0; - right: 40px; - } + .navbar-collapse.pull-left { + float: none !important; + } + .navbar-collapse.pull-left + .navbar-custom-menu { + display: block; + position: absolute; + top: 0; + right: 40px; + } } - /* * Component: Sidebar * ------------------ */ -.main-sidebar, -.left-side { - position: absolute; - top: 0; - left: 0; - padding-top: 50px; - min-height: 100%; - width: 230px; - z-index: 810; - -webkit-transition: -webkit-transform 0.3s ease-in-out, width 0.3s ease-in-out; - -moz-transition: -moz-transform 0.3s ease-in-out, width 0.3s ease-in-out; - -o-transition: -o-transform 0.3s ease-in-out, width 0.3s ease-in-out; - transition: transform 0.3s ease-in-out, width 0.3s ease-in-out; +.main-sidebar { + position: absolute; + top: 0; + left: 0; + padding-top: 50px; + min-height: 100%; + width: 230px; + z-index: 810; + -webkit-transition: -webkit-transform 0.3s ease-in-out, width 0.3s ease-in-out; + -moz-transition: -moz-transform 0.3s ease-in-out, width 0.3s ease-in-out; + -o-transition: -o-transform 0.3s ease-in-out, width 0.3s ease-in-out; + transition: transform 0.3s ease-in-out, width 0.3s ease-in-out; } - @media (max-width: 767px) { - .main-sidebar, - .left-side { - padding-top: 100px; - } + .main-sidebar { + padding-top: 100px; + } } - @media (max-width: 767px) { - .main-sidebar, - .left-side { - -webkit-transform: translate(-230px, 0); - -ms-transform: translate(-230px, 0); - -o-transform: translate(-230px, 0); - transform: translate(-230px, 0); - } + .main-sidebar { + -webkit-transform: translate(-230px, 0); + -ms-transform: translate(-230px, 0); + -o-transform: translate(-230px, 0); + transform: translate(-230px, 0); + } } - @media (min-width: 768px) { - .sidebar-collapse .main-sidebar, - .sidebar-collapse .left-side { - -webkit-transform: translate(-230px, 0); - -ms-transform: translate(-230px, 0); - -o-transform: translate(-230px, 0); - transform: translate(-230px, 0); - } + .sidebar-collapse .main-sidebar { + -webkit-transform: translate(-230px, 0); + -ms-transform: translate(-230px, 0); + -o-transform: translate(-230px, 0); + transform: translate(-230px, 0); + } } - @media (max-width: 767px) { - .sidebar-open .main-sidebar, - .sidebar-open .left-side { - -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - -o-transform: translate(0, 0); - transform: translate(0, 0); - } + .sidebar-open .main-sidebar { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); + } } - .sidebar { - padding-bottom: 10px; + padding-bottom: 10px; } - .sidebar-form input:focus { - border-color: transparent; + border-color: transparent; } - .user-panel { - position: relative; - width: 100%; - padding: 10px; - overflow: hidden; + position: relative; + width: 100%; + padding: 10px; + overflow: hidden; } - .user-panel:before, .user-panel:after { - content: " "; - display: table; + content: " "; + display: table; } - .user-panel:after { - clear: both; + clear: both; +} +.user-panel:before, +.user-panel:after { + content: " "; + display: table; +} +.user-panel:after { + clear: both; } - .user-panel > .image > img { - width: 100%; - max-width: 45px; - height: auto; + width: 100%; + max-width: 45px; + height: auto; } - .user-panel > .info { - padding: 5px 5px 5px 15px; - line-height: 1; - position: absolute; - left: 55px; + padding: 5px 5px 5px 15px; + line-height: 1; + position: absolute; + left: 55px; } - .user-panel > .info > p { - font-weight: 600; - margin-bottom: 9px; + font-weight: 600; + margin-bottom: 9px; } - .user-panel > .info > a { - text-decoration: none; - padding-right: 5px; - margin-top: 3px; - font-size: 11px; + text-decoration: none; + padding-right: 5px; + margin-top: 3px; + font-size: 11px; } - .user-panel > .info > a > .fa, .user-panel > .info > a > .ion, .user-panel > .info > a > .glyphicon { - margin-right: 3px; + margin-right: 3px; } - .sidebar-menu { - list-style: none; - margin: 0; - padding: 0; + list-style: none; + margin: 0; + padding: 0; } - .sidebar-menu > li { - position: relative; - margin: 0; - padding: 0; + position: relative; + margin: 0; + padding: 0; } - .sidebar-menu > li > a { - padding: 12px 5px 12px 15px; - display: block; + padding: 12px 5px 12px 15px; + display: block; } - .sidebar-menu > li > a > .fa, .sidebar-menu > li > a > .glyphicon, .sidebar-menu > li > a > .ion { - width: 20px; + width: 20px; } - .sidebar-menu > li .label, .sidebar-menu > li .badge { - margin-right: 5px; + margin-right: 5px; } - .sidebar-menu > li .badge { - margin-top: 3px; + margin-top: 3px; } - .sidebar-menu li.header { - padding: 10px 25px 10px 15px; - font-size: 12px; + padding: 10px 25px 10px 15px; + font-size: 12px; } - .sidebar-menu li > a > .fa-angle-left, .sidebar-menu li > a > .pull-right-container > .fa-angle-left { - width: auto; - height: auto; - padding: 0; - margin-right: 10px; + width: auto; + height: auto; + padding: 0; + margin-right: 10px; + -webkit-transition: transform 0.5s ease; + -o-transition: transform 0.5s ease; + transition: transform 0.5s ease; } - -.sidebar-menu li.active > a > .fa-angle-left, -.sidebar-menu li.active > a > .pull-right-container > .fa-angle-left { - -webkit-transform: rotate(-90deg); - -ms-transform: rotate(-90deg); - -o-transform: rotate(-90deg); - transform: rotate(-90deg); +.sidebar-menu li > a > .fa-angle-left { + position: absolute; + top: 50%; + right: 10px; + margin-top: -8px; } - -.sidebar-menu li.active > .treeview-menu { - display: block; +.sidebar-menu .menu-open > a > .fa-angle-left, +.sidebar-menu .menu-open > a > .pull-right-container > .fa-angle-left { + -webkit-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + transform: rotate(-90deg); } - -.sidebar-menu .treeview-menu { - display: none; - list-style: none; - padding: 0; - margin: 0; - padding-left: 5px; +.sidebar-menu .active > .treeview-menu { + display: block; } - -.sidebar-menu .treeview-menu .treeview-menu { - padding-left: 20px; -} - -.sidebar-menu .treeview-menu > li { - margin: 0; -} - -.sidebar-menu .treeview-menu > li > a { - padding: 5px 5px 5px 15px; - display: block; - font-size: 14px; -} - -.sidebar-menu .treeview-menu > li > a > .fa, -.sidebar-menu .treeview-menu > li > a > .glyphicon, -.sidebar-menu .treeview-menu > li > a > .ion { - width: 20px; -} - -.sidebar-menu .treeview-menu > li > a > .pull-right-container > .fa-angle-left, -.sidebar-menu .treeview-menu > li > a > .pull-right-container > .fa-angle-down, -.sidebar-menu .treeview-menu > li > a > .fa-angle-left, -.sidebar-menu .treeview-menu > li > a > .fa-angle-down { - width: auto; -} - /* * Component: Sidebar Mini */ @media (min-width: 768px) { - .sidebar-mini.sidebar-collapse .content-wrapper, - .sidebar-mini.sidebar-collapse .right-side, - .sidebar-mini.sidebar-collapse .main-footer { - margin-left: 50px !important; - z-index: 840; - } - - .sidebar-mini.sidebar-collapse .main-sidebar { - -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - -o-transform: translate(0, 0); - transform: translate(0, 0); - width: 50px !important; - z-index: 850; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li { - position: relative; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li > a { - margin-right: 0; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > span { - border-top-right-radius: 4px; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li:not(.treeview) > a > span { - border-bottom-right-radius: 4px; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { - padding-top: 5px; - padding-bottom: 5px; - border-bottom-right-radius: 4px; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right), - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu { - display: block !important; - position: absolute; - width: 180px; - left: 50px; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span { - top: 0; - margin-left: -3px; - padding: 12px 5px 12px 20px; - background-color: inherit; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container { - float: right; - width: auto !important; - left: 200px !important; - top: 10px !important; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container > .label:not(:first-of-type) { - display: none; - } - - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu { - top: 44px; - margin-left: 0; - } - - .sidebar-mini.sidebar-collapse .main-sidebar .user-panel > .info, - .sidebar-mini.sidebar-collapse .sidebar-form, - .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > span, - .sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu, - .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > .pull-right, - .sidebar-mini.sidebar-collapse .sidebar-menu li.header { - display: none !important; - -webkit-transform: translateZ(0); - } - - .sidebar-mini.sidebar-collapse .main-header .logo { - width: 50px; - } - - .sidebar-mini.sidebar-collapse .main-header .logo > .logo-mini { - display: block; - margin-left: -15px; - margin-right: -15px; - font-size: 18px; - } - - .sidebar-mini.sidebar-collapse .main-header .logo > .logo-lg { - display: none; - } - - .sidebar-mini.sidebar-collapse .main-header .navbar { - margin-left: 50px; - } + .sidebar-mini.sidebar-collapse .content-wrapper, + .sidebar-mini.sidebar-collapse .right-side, + .sidebar-mini.sidebar-collapse .main-footer { + margin-left: 50px !important; + z-index: 840; + } + .sidebar-mini.sidebar-collapse .main-sidebar { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); + width: 50px !important; + z-index: 850; + } + .sidebar-mini.sidebar-collapse .sidebar-menu > li { + position: relative; + } + .sidebar-mini.sidebar-collapse .sidebar-menu > li > a { + margin-right: 0; + } + .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > span { + border-top-right-radius: 4px; + } + .sidebar-mini.sidebar-collapse .sidebar-menu > li:not(.treeview) > a > span { + border-bottom-right-radius: 4px; + } + .sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { + padding-top: 5px; + padding-bottom: 5px; + border-bottom-right-radius: 4px; + } + .sidebar-mini.sidebar-collapse .main-sidebar .user-panel > .info, + .sidebar-mini.sidebar-collapse .sidebar-form, + .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > span, + .sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu, + .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > .pull-right, + .sidebar-mini.sidebar-collapse .sidebar-menu li.header { + display: none !important; + -webkit-transform: translateZ(0); + } + .sidebar-mini.sidebar-collapse .main-header .logo { + width: 50px; + } + .sidebar-mini.sidebar-collapse .main-header .logo > .logo-mini { + display: block; + margin-left: -15px; + margin-right: -15px; + font-size: 18px; + } + .sidebar-mini.sidebar-collapse .main-header .logo > .logo-lg { + display: none; + } + .sidebar-mini.sidebar-collapse .main-header .navbar { + margin-left: 50px; + } +} +.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right), +.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li:hover > .treeview-menu { + display: block !important; + position: absolute; + width: 180px; + left: 50px; +} +.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li:hover > a > span { + top: 0; + margin-left: -3px; + padding: 12px 5px 12px 20px; + background-color: inherit; +} +.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container { + position: relative !important; + float: right; + width: auto !important; + left: 180px !important; + top: -22px !important; + z-index: 900; +} +.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container > .label:not(:first-of-type) { + display: none; +} +.sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse .sidebar-menu > li:hover > .treeview-menu { + top: 44px; + margin-left: 0; +} +.sidebar-expanded-on-hover .main-footer, +.sidebar-expanded-on-hover .content-wrapper { + margin-left: 50px; +} +.sidebar-expanded-on-hover .main-sidebar { + box-shadow: 3px 0 8px rgba(0, 0, 0, 0.125); } - .sidebar-menu, .main-sidebar .user-panel, .sidebar-menu > li.header { - white-space: nowrap; - overflow: hidden; + white-space: nowrap; + overflow: hidden; } - .sidebar-menu:hover { - overflow: visible; + overflow: visible; } - .sidebar-form, .sidebar-menu > li.header { - overflow: hidden; - text-overflow: clip; + overflow: hidden; + text-overflow: clip; } - .sidebar-menu li > a { - position: relative; + position: relative; } - .sidebar-menu li > a > .pull-right-container { - position: absolute; - right: 10px; - top: 50%; - margin-top: -7px; + position: absolute; + right: 10px; + top: 50%; + margin-top: -7px; } - /* * Component: Control sidebar. By default, this is the right sidebar. */ .control-sidebar-bg { - position: fixed; - z-index: 1000; - bottom: 0; + position: fixed; + z-index: 1000; + bottom: 0; } - .control-sidebar-bg, .control-sidebar { - top: 0; - right: -230px; - width: 230px; - -webkit-transition: right 0.3s ease-in-out; - -o-transition: right 0.3s ease-in-out; - transition: right 0.3s ease-in-out; + top: 0; + right: -230px; + width: 230px; + -webkit-transition: right 0.3s ease-in-out; + -o-transition: right 0.3s ease-in-out; + transition: right 0.3s ease-in-out; } - .control-sidebar { - position: absolute; - padding-top: 50px; - z-index: 1010; + position: absolute; + padding-top: 50px; + z-index: 1010; } - @media (max-width: 768px) { - .control-sidebar { - padding-top: 100px; - } + .control-sidebar { + padding-top: 100px; + } } - .control-sidebar > .tab-content { - padding: 10px 15px; + padding: 10px 15px; } - .control-sidebar.control-sidebar-open, .control-sidebar.control-sidebar-open + .control-sidebar-bg { - right: 0; + right: 0; } - .control-sidebar-open .control-sidebar-bg, .control-sidebar-open .control-sidebar { - right: 0; + right: 0; } - @media (min-width: 768px) { - .control-sidebar-open .content-wrapper, - .control-sidebar-open .right-side, - .control-sidebar-open .main-footer { - margin-right: 230px; - } + .control-sidebar-open .content-wrapper, + .control-sidebar-open .right-side, + .control-sidebar-open .main-footer { + margin-right: 230px; + } +} +.fixed .control-sidebar { + position: fixed; + height: 100%; + overflow-y: auto; + padding-bottom: 50px; } - .nav-tabs.control-sidebar-tabs > li:first-of-type > a, .nav-tabs.control-sidebar-tabs > li:first-of-type > a:hover, .nav-tabs.control-sidebar-tabs > li:first-of-type > a:focus { - border-left-width: 0; + border-left-width: 0; } - .nav-tabs.control-sidebar-tabs > li > a { - border-radius: 0; + border-radius: 0; } - .nav-tabs.control-sidebar-tabs > li > a, .nav-tabs.control-sidebar-tabs > li > a:hover { - border-top: none; - border-right: none; - border-left: 1px solid transparent; - border-bottom: 1px solid transparent; + border-top: none; + border-right: none; + border-left: 1px solid transparent; + border-bottom: 1px solid transparent; } - .nav-tabs.control-sidebar-tabs > li > a .icon { - font-size: 16px; + font-size: 16px; } - .nav-tabs.control-sidebar-tabs > li.active > a, .nav-tabs.control-sidebar-tabs > li.active > a:hover, .nav-tabs.control-sidebar-tabs > li.active > a:focus, .nav-tabs.control-sidebar-tabs > li.active > a:active { - border-top: none; - border-right: none; - border-bottom: none; + border-top: none; + border-right: none; + border-bottom: none; } - @media (max-width: 768px) { - .nav-tabs.control-sidebar-tabs { - display: table; - } - - .nav-tabs.control-sidebar-tabs > li { - display: table-cell; - } + .nav-tabs.control-sidebar-tabs { + display: table; + } + .nav-tabs.control-sidebar-tabs > li { + display: table-cell; + } } - .control-sidebar-heading { - font-weight: 400; - font-size: 16px; - padding: 10px 0; - margin-bottom: 10px; + font-weight: 400; + font-size: 16px; + padding: 10px 0; + margin-bottom: 10px; } - .control-sidebar-subheading { - display: block; - font-weight: 400; - font-size: 14px; + display: block; + font-weight: 400; + font-size: 14px; } - .control-sidebar-menu { - list-style: none; - padding: 0; - margin: 0 -15px; + list-style: none; + padding: 0; + margin: 0 -15px; } - .control-sidebar-menu > li > a { - display: block; - padding: 10px 15px; + display: block; + padding: 10px 15px; } - .control-sidebar-menu > li > a:before, .control-sidebar-menu > li > a:after { - content: " "; - display: table; + content: " "; + display: table; } - .control-sidebar-menu > li > a:after { - clear: both; + clear: both; +} +.control-sidebar-menu > li > a:before, +.control-sidebar-menu > li > a:after { + content: " "; + display: table; +} +.control-sidebar-menu > li > a:after { + clear: both; } - .control-sidebar-menu > li > a > .control-sidebar-subheading { - margin-top: 0; + margin-top: 0; } - .control-sidebar-menu .menu-icon { - float: left; - width: 35px; - height: 35px; - border-radius: 50%; - text-align: center; - line-height: 35px; + float: left; + width: 35px; + height: 35px; + border-radius: 50%; + text-align: center; + line-height: 35px; } - .control-sidebar-menu .menu-info { - margin-left: 45px; - margin-top: 3px; + margin-left: 45px; + margin-top: 3px; } - .control-sidebar-menu .menu-info > .control-sidebar-subheading { - margin: 0; + margin: 0; } - .control-sidebar-menu .menu-info > p { - margin: 0; - font-size: 11px; + margin: 0; + font-size: 11px; } - .control-sidebar-menu .progress { - margin: 0; + margin: 0; } - .control-sidebar-dark { - color: #b8c7ce; + color: #b8c7ce; } - .control-sidebar-dark, .control-sidebar-dark + .control-sidebar-bg { - background: #222d32; + background: #222d32; } - .control-sidebar-dark .nav-tabs.control-sidebar-tabs { - border-bottom: #1c2529; + border-bottom: #1c2529; } - .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li > a { - background: #181f23; - color: #b8c7ce; + background: #181f23; + color: #b8c7ce; } - .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li > a, .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li > a:hover, .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li > a:focus { - border-left-color: #141a1d; - border-bottom-color: #141a1d; + border-left-color: #141a1d; + border-bottom-color: #141a1d; } - .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li > a:hover, .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li > a:focus, .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li > a:active { - background: #1c2529; + background: #1c2529; } - .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li > a:hover { - color: #fff; + color: #fff; } - .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li.active > a, .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li.active > a:hover, .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li.active > a:focus, .control-sidebar-dark .nav-tabs.control-sidebar-tabs > li.active > a:active { - background: #222d32; - color: #fff; + background: #222d32; + color: #fff; } - .control-sidebar-dark .control-sidebar-heading, .control-sidebar-dark .control-sidebar-subheading { - color: #fff; + color: #fff; } - .control-sidebar-dark .control-sidebar-menu > li > a:hover { - background: #1e282c; + background: #1e282c; } - .control-sidebar-dark .control-sidebar-menu > li > a .menu-info > p { - color: #b8c7ce; + color: #b8c7ce; } - .control-sidebar-light { - color: #5e5e5e; + color: #5e5e5e; } - .control-sidebar-light, .control-sidebar-light + .control-sidebar-bg { - background: #f9fafc; - border-left: 1px solid #d2d6de; + background: #f9fafc; + border-left: 1px solid #d2d6de; } - .control-sidebar-light .nav-tabs.control-sidebar-tabs { - border-bottom: #d2d6de; + border-bottom: #d2d6de; } - .control-sidebar-light .nav-tabs.control-sidebar-tabs > li > a { - background: #e8ecf4; - color: #444444; + background: #e8ecf4; + color: #444444; } - .control-sidebar-light .nav-tabs.control-sidebar-tabs > li > a, .control-sidebar-light .nav-tabs.control-sidebar-tabs > li > a:hover, .control-sidebar-light .nav-tabs.control-sidebar-tabs > li > a:focus { - border-left-color: #d2d6de; - border-bottom-color: #d2d6de; + border-left-color: #d2d6de; + border-bottom-color: #d2d6de; } - .control-sidebar-light .nav-tabs.control-sidebar-tabs > li > a:hover, .control-sidebar-light .nav-tabs.control-sidebar-tabs > li > a:focus, .control-sidebar-light .nav-tabs.control-sidebar-tabs > li > a:active { - background: #eff1f7; + background: #eff1f7; } - .control-sidebar-light .nav-tabs.control-sidebar-tabs > li.active > a, .control-sidebar-light .nav-tabs.control-sidebar-tabs > li.active > a:hover, .control-sidebar-light .nav-tabs.control-sidebar-tabs > li.active > a:focus, .control-sidebar-light .nav-tabs.control-sidebar-tabs > li.active > a:active { - background: #f9fafc; - color: #111; + background: #f9fafc; + color: #111; } - .control-sidebar-light .control-sidebar-heading, .control-sidebar-light .control-sidebar-subheading { - color: #111; + color: #111; } - .control-sidebar-light .control-sidebar-menu { - margin-left: -14px; + margin-left: -14px; } - .control-sidebar-light .control-sidebar-menu > li > a:hover { - background: #f4f4f5; + background: #f4f4f5; } - .control-sidebar-light .control-sidebar-menu > li > a .menu-info > p { - color: #5e5e5e; + color: #5e5e5e; } - /* * Component: Dropdown menus * ------------------------- */ /*Dropdowns in general*/ .dropdown-menu { - box-shadow: none; - border-color: #eee; + box-shadow: none; + border-color: #eee; } - .dropdown-menu > li > a { - color: #777; + color: #777; } - .dropdown-menu > li > a > .glyphicon, .dropdown-menu > li > a > .fa, .dropdown-menu > li > a > .ion { - margin-right: 10px; + margin-right: 10px; } - .dropdown-menu > li > a:hover { - background-color: #e1e3e9; - color: #333; + background-color: #e1e3e9; + color: #333; } - .dropdown-menu > .divider { - background-color: #eee; + background-color: #eee; } - .navbar-nav > .notifications-menu > .dropdown-menu, .navbar-nav > .messages-menu > .dropdown-menu, .navbar-nav > .tasks-menu > .dropdown-menu { - width: 280px; - padding: 0 0 0 0; - margin: 0; - top: 100%; + width: 280px; + padding: 0 0 0 0; + margin: 0; + top: 100%; } - .navbar-nav > .notifications-menu > .dropdown-menu > li, .navbar-nav > .messages-menu > .dropdown-menu > li, .navbar-nav > .tasks-menu > .dropdown-menu > li { - position: relative; + position: relative; } - .navbar-nav > .notifications-menu > .dropdown-menu > li.header, .navbar-nav > .messages-menu > .dropdown-menu > li.header, .navbar-nav > .tasks-menu > .dropdown-menu > li.header { - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - background-color: #ffffff; - padding: 7px 10px; - border-bottom: 1px solid #f4f4f4; - color: #444444; - font-size: 14px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background-color: #ffffff; + padding: 7px 10px; + border-bottom: 1px solid #f4f4f4; + color: #444444; + font-size: 14px; } - .navbar-nav > .notifications-menu > .dropdown-menu > li.footer > a, .navbar-nav > .messages-menu > .dropdown-menu > li.footer > a, .navbar-nav > .tasks-menu > .dropdown-menu > li.footer > a { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - font-size: 12px; - background-color: #fff; - padding: 7px 10px; - border-bottom: 1px solid #eeeeee; - color: #444 !important; - text-align: center; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + font-size: 12px; + background-color: #fff; + padding: 7px 10px; + border-bottom: 1px solid #eeeeee; + color: #444 !important; + text-align: center; } - @media (max-width: 991px) { - .navbar-nav > .notifications-menu > .dropdown-menu > li.footer > a, - .navbar-nav > .messages-menu > .dropdown-menu > li.footer > a, - .navbar-nav > .tasks-menu > .dropdown-menu > li.footer > a { - background: #fff !important; - color: #444 !important; - } + .navbar-nav > .notifications-menu > .dropdown-menu > li.footer > a, + .navbar-nav > .messages-menu > .dropdown-menu > li.footer > a, + .navbar-nav > .tasks-menu > .dropdown-menu > li.footer > a { + background: #fff !important; + color: #444 !important; + } } - .navbar-nav > .notifications-menu > .dropdown-menu > li.footer > a:hover, .navbar-nav > .messages-menu > .dropdown-menu > li.footer > a:hover, .navbar-nav > .tasks-menu > .dropdown-menu > li.footer > a:hover { - text-decoration: none; - font-weight: normal; + text-decoration: none; + font-weight: normal; } - .navbar-nav > .notifications-menu > .dropdown-menu > li .menu, .navbar-nav > .messages-menu > .dropdown-menu > li .menu, .navbar-nav > .tasks-menu > .dropdown-menu > li .menu { - max-height: 200px; - margin: 0; - padding: 0; - list-style: none; - overflow-x: hidden; + max-height: 200px; + margin: 0; + padding: 0; + list-style: none; + overflow-x: hidden; } - .navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a, .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a, .navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a { - display: block; - white-space: nowrap; - /* Prevent text from breaking */ - border-bottom: 1px solid #f4f4f4; + display: block; + white-space: nowrap; + /* Prevent text from breaking */ + border-bottom: 1px solid #f4f4f4; } - .navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a:hover, .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:hover, .navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a:hover { - background: #f4f4f4; - text-decoration: none; + background: #f4f4f4; + text-decoration: none; } - .navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a { - color: #444444; - overflow: hidden; - text-overflow: ellipsis; - padding: 10px; + color: #444444; + overflow: hidden; + text-overflow: ellipsis; + padding: 10px; } - .navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .glyphicon, .navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .fa, .navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a > .ion { - width: 20px; + width: 20px; } - .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a { - margin: 0; - padding: 10px 10px; + margin: 0; + padding: 10px 10px; } - .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > div > img { - margin: auto 10px auto auto; - width: 40px; - height: 40px; + margin: auto 10px auto auto; + width: 40px; + height: 40px; } - .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > h4 { - padding: 0; - margin: 0 0 0 45px; - color: #444444; - font-size: 15px; - position: relative; + padding: 0; + margin: 0 0 0 45px; + color: #444444; + font-size: 15px; + position: relative; } - .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > h4 > small { - color: #999999; - font-size: 10px; - position: absolute; - top: 0; - right: 0; + color: #999999; + font-size: 10px; + position: absolute; + top: 0; + right: 0; } - .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a > p { - margin: 0 0 0 45px; - font-size: 12px; - color: #888888; + margin: 0 0 0 45px; + font-size: 12px; + color: #888888; } - .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:before, .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:after { - content: " "; - display: table; + content: " "; + display: table; } - .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:after { - clear: both; + clear: both; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:before, +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:after { + content: " "; + display: table; +} +.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a:after { + clear: both; } - .navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a { - padding: 10px; + padding: 10px; } - .navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a > h3 { - font-size: 14px; - padding: 0; - margin: 0 0 10px 0; - color: #666666; + font-size: 14px; + padding: 0; + margin: 0 0 10px 0; + color: #666666; } - .navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a > .progress { - padding: 0; - margin: 0; + padding: 0; + margin: 0; } - .navbar-nav > .user-menu > .dropdown-menu { - border-top-right-radius: 0; - border-top-left-radius: 0; - padding: 1px 0 0 0; - border-top-width: 0; - width: 280px; + border-top-right-radius: 0; + border-top-left-radius: 0; + padding: 1px 0 0 0; + border-top-width: 0; + width: 280px; } - .navbar-nav > .user-menu > .dropdown-menu, .navbar-nav > .user-menu > .dropdown-menu > .user-body { - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; } - .navbar-nav > .user-menu > .dropdown-menu > li.user-header { - height: 175px; - padding: 10px; - text-align: center; + height: 175px; + padding: 10px; + text-align: center; } - .navbar-nav > .user-menu > .dropdown-menu > li.user-header > img { - z-index: 5; - height: 90px; - width: 90px; - border: 3px solid; - border-color: transparent; - border-color: rgba(255, 255, 255, 0.2); + z-index: 5; + height: 90px; + width: 90px; + border: 3px solid; + border-color: transparent; + border-color: rgba(255, 255, 255, 0.2); } - .navbar-nav > .user-menu > .dropdown-menu > li.user-header > p { - z-index: 5; - color: #fff; - color: rgba(255, 255, 255, 0.8); - font-size: 17px; - margin-top: 10px; + z-index: 5; + color: #fff; + color: rgba(255, 255, 255, 0.8); + font-size: 17px; + margin-top: 10px; } - .navbar-nav > .user-menu > .dropdown-menu > li.user-header > p > small { - display: block; - font-size: 12px; + display: block; + font-size: 12px; } - .navbar-nav > .user-menu > .dropdown-menu > .user-body { - padding: 15px; - border-bottom: 1px solid #f4f4f4; - border-top: 1px solid #dddddd; + padding: 15px; + border-bottom: 1px solid #f4f4f4; + border-top: 1px solid #dddddd; } - .navbar-nav > .user-menu > .dropdown-menu > .user-body:before, .navbar-nav > .user-menu > .dropdown-menu > .user-body:after { - content: " "; - display: table; + content: " "; + display: table; } - .navbar-nav > .user-menu > .dropdown-menu > .user-body:after { - clear: both; + clear: both; +} +.navbar-nav > .user-menu > .dropdown-menu > .user-body:before, +.navbar-nav > .user-menu > .dropdown-menu > .user-body:after { + content: " "; + display: table; +} +.navbar-nav > .user-menu > .dropdown-menu > .user-body:after { + clear: both; } - .navbar-nav > .user-menu > .dropdown-menu > .user-body a { - color: #444 !important; + color: #444 !important; } - @media (max-width: 991px) { - .navbar-nav > .user-menu > .dropdown-menu > .user-body a { - background: #fff !important; - color: #444 !important; - } + .navbar-nav > .user-menu > .dropdown-menu > .user-body a { + background: #fff !important; + color: #444 !important; + } } - .navbar-nav > .user-menu > .dropdown-menu > .user-footer { - background-color: #f9f9f9; - padding: 10px; + background-color: #f9f9f9; + padding: 10px; } - .navbar-nav > .user-menu > .dropdown-menu > .user-footer:before, .navbar-nav > .user-menu > .dropdown-menu > .user-footer:after { - content: " "; - display: table; + content: " "; + display: table; } - .navbar-nav > .user-menu > .dropdown-menu > .user-footer:after { - clear: both; + clear: both; +} +.navbar-nav > .user-menu > .dropdown-menu > .user-footer:before, +.navbar-nav > .user-menu > .dropdown-menu > .user-footer:after { + content: " "; + display: table; +} +.navbar-nav > .user-menu > .dropdown-menu > .user-footer:after { + clear: both; } - .navbar-nav > .user-menu > .dropdown-menu > .user-footer .btn-default { - color: #666666; + color: #666666; } - @media (max-width: 991px) { - .navbar-nav > .user-menu > .dropdown-menu > .user-footer .btn-default:hover { - background-color: #f9f9f9; - } + .navbar-nav > .user-menu > .dropdown-menu > .user-footer .btn-default:hover { + background-color: #f9f9f9; + } } - .navbar-nav > .user-menu .user-image { - float: left; - width: 25px; - height: 25px; - border-radius: 50%; - margin-right: 10px; - margin-top: -2px; + float: left; + width: 25px; + height: 25px; + border-radius: 50%; + margin-right: 10px; + margin-top: -2px; } - @media (max-width: 767px) { - .navbar-nav > .user-menu .user-image { - float: none; - margin-right: 0; - margin-top: -8px; - line-height: 10px; - } + .navbar-nav > .user-menu .user-image { + float: none; + margin-right: 0; + margin-top: -8px; + line-height: 10px; + } } - /* Add fade animation to dropdown menus by appending the class .animated-dropdown-menu to the .dropdown-menu ul (or ol)*/ .open:not(.dropup) > .animated-dropdown-menu { - backface-visibility: visible !important; - -webkit-animation: flipInX 0.7s both; - -o-animation: flipInX 0.7s both; - animation: flipInX 0.7s both; + backface-visibility: visible !important; + -webkit-animation: flipInX 0.7s both; + -o-animation: flipInX 0.7s both; + animation: flipInX 0.7s both; } - @keyframes flipInX { - 0% { - transform: perspective(400px) rotate3d(1, 0, 0, 90deg); - transition-timing-function: ease-in; - opacity: 0; - } - 40% { - transform: perspective(400px) rotate3d(1, 0, 0, -20deg); - transition-timing-function: ease-in; - } - 60% { - transform: perspective(400px) rotate3d(1, 0, 0, 10deg); - opacity: 1; - } - 80% { - transform: perspective(400px) rotate3d(1, 0, 0, -5deg); - } - 100% { - transform: perspective(400px); - } + 0% { + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transition-timing-function: ease-in; + opacity: 0; + } + 40% { + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transition-timing-function: ease-in; + } + 60% { + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + 80% { + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + 100% { + transform: perspective(400px); + } } - @-webkit-keyframes flipInX { - 0% { - -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); - -webkit-transition-timing-function: ease-in; - opacity: 0; - } - 40% { - -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); - -webkit-transition-timing-function: ease-in; - } - 60% { - -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); - opacity: 1; - } - 80% { - -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); - } - 100% { - -webkit-transform: perspective(400px); - } + 0% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + -webkit-transition-timing-function: ease-in; + opacity: 0; + } + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + -webkit-transition-timing-function: ease-in; + } + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + 100% { + -webkit-transform: perspective(400px); + } } - /* Fix dropdown menu in navbars */ .navbar-custom-menu > .navbar-nav > li { - position: relative; + position: relative; } - .navbar-custom-menu > .navbar-nav > li > .dropdown-menu { - position: absolute; - right: 0; - left: auto; + position: absolute; + right: 0; + left: auto; } - @media (max-width: 991px) { - .navbar-custom-menu > .navbar-nav { - float: right; - } - - .navbar-custom-menu > .navbar-nav > li { - position: static; - } - - .navbar-custom-menu > .navbar-nav > li > .dropdown-menu { - position: absolute; - right: 5%; - left: auto; - border: 1px solid #ddd; - background: #fff; - } + .navbar-custom-menu > .navbar-nav { + float: right; + } + .navbar-custom-menu > .navbar-nav > li { + position: static; + } + .navbar-custom-menu > .navbar-nav > li > .dropdown-menu { + position: absolute; + right: 5%; + left: auto; + border: 1px solid #ddd; + background: #fff; + } } - /* * Component: Form * --------------- */ .form-control { - border-radius: 0; - box-shadow: none; - border-color: #d2d6de; + border-radius: 0; + box-shadow: none; + border-color: #d2d6de; } - .form-control:focus { - border-color: #3c8dbc; - box-shadow: none; + border-color: #3c8dbc; + box-shadow: none; } - .form-control::-moz-placeholder, .form-control:-ms-input-placeholder, .form-control::-webkit-input-placeholder { - color: #bbb; - opacity: 1; + color: #bbb; + opacity: 1; } - .form-control:not(select) { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } - .form-group.has-success label { - color: #00a65a; + color: #00a65a; } - .form-group.has-success .form-control, .form-group.has-success .input-group-addon { - border-color: #00a65a; - box-shadow: none; + border-color: #00a65a; + box-shadow: none; } - .form-group.has-success .help-block { - color: #00a65a; + color: #00a65a; } - .form-group.has-warning label { - color: #f39c12; + color: #f39c12; } - .form-group.has-warning .form-control, .form-group.has-warning .input-group-addon { - border-color: #f39c12; - box-shadow: none; + border-color: #f39c12; + box-shadow: none; } - .form-group.has-warning .help-block { - color: #f39c12; + color: #f39c12; } - .form-group.has-error label { - color: #dd4b39; + color: #dd4b39; } - .form-group.has-error .form-control, .form-group.has-error .input-group-addon { - border-color: #dd4b39; - box-shadow: none; + border-color: #dd4b39; + box-shadow: none; } - .form-group.has-error .help-block { - color: #dd4b39; + color: #dd4b39; } - /* Input group */ .input-group .input-group-addon { - border-radius: 0; - border-color: #d2d6de; - background-color: #fff; + border-radius: 0; + border-color: #d2d6de; + background-color: #fff; } - /* button groups */ .btn-group-vertical .btn.btn-flat:first-of-type, .btn-group-vertical .btn.btn-flat:last-of-type { - border-radius: 0; + border-radius: 0; } - .icheck > label { - padding-left: 0; + padding-left: 0; } - /* support Font Awesome icons in form-control */ .form-control-feedback.fa { - line-height: 34px; + line-height: 34px; } - .input-lg + .form-control-feedback.fa, .input-group-lg + .form-control-feedback.fa, .form-group-lg .form-control + .form-control-feedback.fa { - line-height: 46px; + line-height: 46px; } - .input-sm + .form-control-feedback.fa, .input-group-sm + .form-control-feedback.fa, .form-group-sm .form-control + .form-control-feedback.fa { - line-height: 30px; + line-height: 30px; } - /* * Component: Progress Bar * ----------------------- */ .progress, .progress > .progress-bar { - -webkit-box-shadow: none; - box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; } - .progress, .progress > .progress-bar, .progress .progress-bar, .progress > .progress-bar .progress-bar { - border-radius: 1px; + border-radius: 1px; } - /* size variation */ .progress.sm, .progress-sm { - height: 10px; + height: 10px; } - .progress.sm, .progress-sm, .progress.sm .progress-bar, .progress-sm .progress-bar { - border-radius: 1px; + border-radius: 1px; } - .progress.xs, .progress-xs { - height: 7px; + height: 7px; } - .progress.xs, .progress-xs, .progress.xs .progress-bar, .progress-xs .progress-bar { - border-radius: 1px; + border-radius: 1px; } - .progress.xxs, .progress-xxs { - height: 3px; + height: 3px; } - .progress.xxs, .progress-xxs, .progress.xxs .progress-bar, .progress-xxs .progress-bar { - border-radius: 1px; + border-radius: 1px; } - /* Vertical bars */ .progress.vertical { - position: relative; - width: 30px; - height: 200px; - display: inline-block; - margin-right: 10px; + position: relative; + width: 30px; + height: 200px; + display: inline-block; + margin-right: 10px; } - .progress.vertical > .progress-bar { - width: 100%; - position: absolute; - bottom: 0; + width: 100%; + position: absolute; + bottom: 0; } - .progress.vertical.sm, .progress.vertical.progress-sm { - width: 20px; + width: 20px; } - .progress.vertical.xs, .progress.vertical.progress-xs { - width: 10px; + width: 10px; } - .progress.vertical.xxs, .progress.vertical.progress-xxs { - width: 3px; + width: 3px; } - .progress-group .progress-text { - font-weight: 600; + font-weight: 600; } - .progress-group .progress-number { - float: right; + float: right; } - /* Remove margins from progress bars when put in a table */ .table tr > td .progress { - margin: 0; + margin: 0; } - .progress-bar-light-blue, .progress-bar-primary { - background-color: #3c8dbc; + background-color: #3c8dbc; } - .progress-striped .progress-bar-light-blue, .progress-striped .progress-bar-primary { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-striped .progress-bar-light-blue, +.progress-striped .progress-bar-primary { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } - .progress-bar-green, .progress-bar-success { - background-color: #00a65a; + background-color: #00a65a; } - .progress-striped .progress-bar-green, .progress-striped .progress-bar-success { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-striped .progress-bar-green, +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } - .progress-bar-aqua, .progress-bar-info { - background-color: #00c0ef; + background-color: #00c0ef; } - .progress-striped .progress-bar-aqua, .progress-striped .progress-bar-info { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-striped .progress-bar-aqua, +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } - .progress-bar-yellow, .progress-bar-warning { - background-color: #f39c12; + background-color: #f39c12; } - .progress-striped .progress-bar-yellow, .progress-striped .progress-bar-warning { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-striped .progress-bar-yellow, +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } - .progress-bar-red, .progress-bar-danger { - background-color: #dd4b39; + background-color: #dd4b39; } - .progress-striped .progress-bar-red, .progress-striped .progress-bar-danger { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-striped .progress-bar-red, +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } - /* * Component: Small Box * -------------------- */ .small-box { - border-radius: 2px; - position: relative; - display: block; - margin-bottom: 20px; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + border-radius: 2px; + position: relative; + display: block; + margin-bottom: 20px; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); } - .small-box > .inner { - padding: 10px; + padding: 10px; } - .small-box > .small-box-footer { - position: relative; - text-align: center; - padding: 3px 0; - color: #fff; - color: rgba(255, 255, 255, 0.8); - display: block; - z-index: 10; - background: rgba(0, 0, 0, 0.1); - text-decoration: none; + position: relative; + text-align: center; + padding: 3px 0; + color: #fff; + color: rgba(255, 255, 255, 0.8); + display: block; + z-index: 10; + background: rgba(0, 0, 0, 0.1); + text-decoration: none; } - .small-box > .small-box-footer:hover { - color: #fff; - background: rgba(0, 0, 0, 0.15); + color: #fff; + background: rgba(0, 0, 0, 0.15); } - .small-box h3 { - font-size: 38px; - font-weight: bold; - margin: 0 0 10px 0; - white-space: nowrap; - padding: 0; + font-size: 38px; + font-weight: bold; + margin: 0 0 10px 0; + white-space: nowrap; + padding: 0; } - .small-box p { - font-size: 15px; + font-size: 15px; } - .small-box p > small { - display: block; - color: #f9f9f9; - font-size: 13px; - margin-top: 5px; + display: block; + color: #f9f9f9; + font-size: 13px; + margin-top: 5px; } - .small-box h3, .small-box p { - z-index: 5; + z-index: 5; } - .small-box .icon { - -webkit-transition: all 0.3s linear; - -o-transition: all 0.3s linear; - transition: all 0.3s linear; - position: absolute; - top: -10px; - right: 10px; - z-index: 0; - font-size: 90px; - color: rgba(0, 0, 0, 0.15); + -webkit-transition: all 0.3s linear; + -o-transition: all 0.3s linear; + transition: all 0.3s linear; + position: absolute; + top: -10px; + right: 10px; + z-index: 0; + font-size: 90px; + color: rgba(0, 0, 0, 0.15); } - .small-box:hover { - text-decoration: none; - color: #f9f9f9; + text-decoration: none; + color: #f9f9f9; } - .small-box:hover .icon { - font-size: 95px; + font-size: 95px; } - @media (max-width: 767px) { - .small-box { - text-align: center; - } - - .small-box .icon { - display: none; - } - - .small-box p { - font-size: 12px; - } + .small-box { + text-align: center; + } + .small-box .icon { + display: none; + } + .small-box p { + font-size: 12px; + } } - /* * Component: Box * -------------- */ .box { - position: relative; - border-radius: 3px; - background: #ffffff; - border-top: 3px solid #d2d6de; - margin-bottom: 20px; - width: 100%; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + position: relative; + border-radius: 3px; + background: #ffffff; + border-top: 3px solid #d2d6de; + margin-bottom: 20px; + width: 100%; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); } - .box.box-primary { - border-top-color: #3c8dbc; + border-top-color: #3c8dbc; } - .box.box-info { - border-top-color: #00c0ef; + border-top-color: #00c0ef; } - .box.box-danger { - border-top-color: #dd4b39; + border-top-color: #dd4b39; } - .box.box-warning { - border-top-color: #f39c12; + border-top-color: #f39c12; } - .box.box-success { - border-top-color: #00a65a; + border-top-color: #00a65a; } - .box.box-default { - border-top-color: #d2d6de; + border-top-color: #d2d6de; } - .box.collapsed-box .box-body, .box.collapsed-box .box-footer { - display: none; + display: none; } - .box .nav-stacked > li { - border-bottom: 1px solid #f4f4f4; - margin: 0; + border-bottom: 1px solid #f4f4f4; + margin: 0; } - .box .nav-stacked > li:last-of-type { - border-bottom: none; + border-bottom: none; } - .box.height-control .box-body { - max-height: 300px; - overflow: auto; + max-height: 300px; + overflow: auto; } - .box .border-right { - border-right: 1px solid #f4f4f4; + border-right: 1px solid #f4f4f4; } - .box .border-left { - border-left: 1px solid #f4f4f4; + border-left: 1px solid #f4f4f4; } - .box.box-solid { - border-top: 0; + border-top: 0; } - .box.box-solid > .box-header .btn.btn-default { - background: transparent; + background: transparent; } - .box.box-solid > .box-header .btn:hover, .box.box-solid > .box-header a:hover { - background: rgba(0, 0, 0, 0.1); + background: rgba(0, 0, 0, 0.1); } - .box.box-solid.box-default { - border: 1px solid #d2d6de; + border: 1px solid #d2d6de; } - .box.box-solid.box-default > .box-header { - color: #444444; - background: #d2d6de; - background-color: #d2d6de; + color: #444444; + background: #d2d6de; + background-color: #d2d6de; } - .box.box-solid.box-default > .box-header a, .box.box-solid.box-default > .box-header .btn { - color: #444444; + color: #444444; } - .box.box-solid.box-primary { - border: 1px solid #3c8dbc; + border: 1px solid #3c8dbc; } - .box.box-solid.box-primary > .box-header { - color: #ffffff; - background: #3c8dbc; - background-color: #3c8dbc; + color: #ffffff; + background: #3c8dbc; + background-color: #3c8dbc; } - .box.box-solid.box-primary > .box-header a, .box.box-solid.box-primary > .box-header .btn { - color: #ffffff; + color: #ffffff; } - .box.box-solid.box-info { - border: 1px solid #00c0ef; + border: 1px solid #00c0ef; } - .box.box-solid.box-info > .box-header { - color: #ffffff; - background: #00c0ef; - background-color: #00c0ef; + color: #ffffff; + background: #00c0ef; + background-color: #00c0ef; } - .box.box-solid.box-info > .box-header a, .box.box-solid.box-info > .box-header .btn { - color: #ffffff; + color: #ffffff; } - .box.box-solid.box-danger { - border: 1px solid #dd4b39; + border: 1px solid #dd4b39; } - .box.box-solid.box-danger > .box-header { - color: #ffffff; - background: #dd4b39; - background-color: #dd4b39; + color: #ffffff; + background: #dd4b39; + background-color: #dd4b39; } - .box.box-solid.box-danger > .box-header a, .box.box-solid.box-danger > .box-header .btn { - color: #ffffff; + color: #ffffff; } - .box.box-solid.box-warning { - border: 1px solid #f39c12; + border: 1px solid #f39c12; } - .box.box-solid.box-warning > .box-header { - color: #ffffff; - background: #f39c12; - background-color: #f39c12; + color: #ffffff; + background: #f39c12; + background-color: #f39c12; } - .box.box-solid.box-warning > .box-header a, .box.box-solid.box-warning > .box-header .btn { - color: #ffffff; + color: #ffffff; } - .box.box-solid.box-success { - border: 1px solid #00a65a; + border: 1px solid #00a65a; } - .box.box-solid.box-success > .box-header { - color: #ffffff; - background: #00a65a; - background-color: #00a65a; + color: #ffffff; + background: #00a65a; + background-color: #00a65a; } - .box.box-solid.box-success > .box-header a, .box.box-solid.box-success > .box-header .btn { - color: #ffffff; + color: #ffffff; } - .box.box-solid > .box-header > .box-tools .btn { - border: 0; - box-shadow: none; + border: 0; + box-shadow: none; } - .box.box-solid[class*='bg'] > .box-header { - color: #fff; + color: #fff; } - .box .box-group > .box { - margin-bottom: 5px; + margin-bottom: 5px; } - .box .knob-label { - text-align: center; - color: #333; - font-weight: 100; - font-size: 12px; - margin-bottom: 0.3em; + text-align: center; + color: #333; + font-weight: 100; + font-size: 12px; + margin-bottom: 0.3em; } - .box > .overlay, .overlay-wrapper > .overlay, .box > .loading-img, .overlay-wrapper > .loading-img { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } - .box .overlay, .overlay-wrapper .overlay { - z-index: 50; - background: rgba(255, 255, 255, 0.7); - border-radius: 3px; + z-index: 50; + background: rgba(255, 255, 255, 0.7); + border-radius: 3px; } - .box .overlay > .fa, .overlay-wrapper .overlay > .fa { - position: absolute; - top: 50%; - left: 50%; - margin-left: -15px; - margin-top: -15px; - color: #000; - font-size: 30px; + position: absolute; + top: 50%; + left: 50%; + margin-left: -15px; + margin-top: -15px; + color: #000; + font-size: 30px; } - .box .overlay.dark, .overlay-wrapper .overlay.dark { - background: rgba(0, 0, 0, 0.5); + background: rgba(0, 0, 0, 0.5); } - .box-header:before, .box-body:before, .box-footer:before, .box-header:after, .box-body:after, .box-footer:after { - content: " "; - display: table; + content: " "; + display: table; } - .box-header:after, .box-body:after, .box-footer:after { - clear: both; + clear: both; +} +.box-header:before, +.box-body:before, +.box-footer:before, +.box-header:after, +.box-body:after, +.box-footer:after { + content: " "; + display: table; +} +.box-header:after, +.box-body:after, +.box-footer:after { + clear: both; } - .box-header { - color: #444; - display: block; - padding: 10px; - position: relative; + color: #444; + display: block; + padding: 10px; + position: relative; } - .box-header.with-border { - border-bottom: 1px solid #f4f4f4; + border-bottom: 1px solid #f4f4f4; } - .collapsed-box .box-header.with-border { - border-bottom: none; + border-bottom: none; } - .box-header > .fa, .box-header > .glyphicon, .box-header > .ion, .box-header .box-title { - display: inline-block; - font-size: 18px; - margin: 0; - line-height: 1; + display: inline-block; + font-size: 18px; + margin: 0; + line-height: 1; } - .box-header > .fa, .box-header > .glyphicon, .box-header > .ion { - margin-right: 5px; + margin-right: 5px; } - .box-header > .box-tools { - position: absolute; - right: 10px; - top: 5px; + position: absolute; + right: 10px; + top: 5px; } - .box-header > .box-tools [data-toggle="tooltip"] { - position: relative; + position: relative; } - .box-header > .box-tools.pull-right .dropdown-menu { - right: 0; - left: auto; + right: 0; + left: auto; +} +.box-header > .box-tools .dropdown-menu > li > a { + color: #444!important; } - .btn-box-tool { - padding: 5px; - font-size: 12px; - background: transparent; - color: #97a0b3; + padding: 5px; + font-size: 12px; + background: transparent; + color: #97a0b3; } - .open .btn-box-tool, .btn-box-tool:hover { - color: #606c84; + color: #606c84; } - .btn-box-tool.btn:active { - box-shadow: none; + box-shadow: none; } - .box-body { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; - padding: 10px; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + padding: 10px; } - .no-header .box-body { - border-top-right-radius: 3px; - border-top-left-radius: 3px; + border-top-right-radius: 3px; + border-top-left-radius: 3px; } - .box-body > .table { - margin-bottom: 0; + margin-bottom: 0; } - .box-body .fc { - margin-top: 5px; + margin-top: 5px; } - .box-body .full-width-chart { - margin: -19px; + margin: -19px; } - .box-body.no-padding .full-width-chart { - margin: -9px; + margin: -9px; } - .box-body .box-pane { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 3px; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 3px; } - .box-body .box-pane-right { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 0; } - .box-footer { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; - border-top: 1px solid #f4f4f4; - padding: 10px; - background-color: #ffffff; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + border-top: 1px solid #f4f4f4; + padding: 10px; + background-color: #ffffff; } - .chart-legend { - margin: 10px 0; + margin: 10px 0; } - @media (max-width: 991px) { - .chart-legend > li { - float: left; - margin-right: 10px; - } + .chart-legend > li { + float: left; + margin-right: 10px; + } } - .box-comments { - background: #f7f7f7; + background: #f7f7f7; } - .box-comments .box-comment { - padding: 8px 0; - border-bottom: 1px solid #eee; + padding: 8px 0; + border-bottom: 1px solid #eee; } - .box-comments .box-comment:before, .box-comments .box-comment:after { - content: " "; - display: table; + content: " "; + display: table; } - .box-comments .box-comment:after { - clear: both; + clear: both; +} +.box-comments .box-comment:before, +.box-comments .box-comment:after { + content: " "; + display: table; +} +.box-comments .box-comment:after { + clear: both; } - .box-comments .box-comment:last-of-type { - border-bottom: 0; + border-bottom: 0; } - .box-comments .box-comment:first-of-type { - padding-top: 0; + padding-top: 0; } - .box-comments .box-comment img { - float: left; + float: left; } - .box-comments .comment-text { - margin-left: 40px; - color: #555; + margin-left: 40px; + color: #555; } - .box-comments .username { - color: #444; - display: block; - font-weight: 600; + color: #444; + display: block; + font-weight: 600; } - .box-comments .text-muted { - font-weight: 400; - font-size: 12px; + font-weight: 400; + font-size: 12px; } - /* Widget: TODO LIST */ .todo-list { - margin: 0; - padding: 0; - list-style: none; - overflow: auto; + margin: 0; + padding: 0; + list-style: none; + overflow: auto; } - .todo-list > li { - border-radius: 2px; - padding: 10px; - background: #f4f4f4; - margin-bottom: 2px; - border-left: 2px solid #e6e7e8; - color: #444; + border-radius: 2px; + padding: 10px; + background: #f4f4f4; + margin-bottom: 2px; + border-left: 2px solid #e6e7e8; + color: #444; } - .todo-list > li:last-of-type { - margin-bottom: 0; + margin-bottom: 0; } - .todo-list > li > input[type='checkbox'] { - margin: 0 10px 0 5px; + margin: 0 10px 0 5px; } - .todo-list > li .text { - display: inline-block; - margin-left: 5px; - font-weight: 600; + display: inline-block; + margin-left: 5px; + font-weight: 600; } - .todo-list > li .label { - margin-left: 10px; - font-size: 9px; + margin-left: 10px; + font-size: 9px; } - .todo-list > li .tools { - display: none; - float: right; - color: #dd4b39; + display: none; + float: right; + color: #dd4b39; } - .todo-list > li .tools > .fa, .todo-list > li .tools > .glyphicon, .todo-list > li .tools > .ion { - margin-right: 5px; - cursor: pointer; + margin-right: 5px; + cursor: pointer; } - .todo-list > li:hover .tools { - display: inline-block; + display: inline-block; } - .todo-list > li.done { - color: #999; + color: #999; } - .todo-list > li.done .text { - text-decoration: line-through; - font-weight: 500; + text-decoration: line-through; + font-weight: 500; } - .todo-list > li.done .label { - background: #d2d6de !important; + background: #d2d6de !important; } - .todo-list .danger { - border-left-color: #dd4b39; + border-left-color: #dd4b39; } - .todo-list .warning { - border-left-color: #f39c12; + border-left-color: #f39c12; } - .todo-list .info { - border-left-color: #00c0ef; + border-left-color: #00c0ef; } - .todo-list .success { - border-left-color: #00a65a; + border-left-color: #00a65a; } - .todo-list .primary { - border-left-color: #3c8dbc; + border-left-color: #3c8dbc; } - .todo-list .handle { - display: inline-block; - cursor: move; - margin: 0 5px; + display: inline-block; + cursor: move; + margin: 0 5px; } - /* Chat widget (DEPRECATED - this will be removed in the next major release. Use Direct Chat instead)*/ .chat { - padding: 5px 20px 5px 10px; + padding: 5px 20px 5px 10px; } - .chat .item { - margin-bottom: 10px; + margin-bottom: 10px; } - .chat .item:before, .chat .item:after { - content: " "; - display: table; + content: " "; + display: table; } - .chat .item:after { - clear: both; + clear: both; +} +.chat .item:before, +.chat .item:after { + content: " "; + display: table; +} +.chat .item:after { + clear: both; } - .chat .item > img { - width: 40px; - height: 40px; - border: 2px solid transparent; - border-radius: 50%; + width: 40px; + height: 40px; + border: 2px solid transparent; + border-radius: 50%; } - .chat .item > .online { - border: 2px solid #00a65a; + border: 2px solid #00a65a; } - .chat .item > .offline { - border: 2px solid #dd4b39; + border: 2px solid #dd4b39; } - .chat .item > .message { - margin-left: 55px; - margin-top: -40px; + margin-left: 55px; + margin-top: -40px; } - .chat .item > .message > .name { - display: block; - font-weight: 600; + display: block; + font-weight: 600; } - .chat .item > .attachment { - border-radius: 3px; - background: #f4f4f4; - margin-left: 65px; - margin-right: 15px; - padding: 10px; + border-radius: 3px; + background: #f4f4f4; + margin-left: 65px; + margin-right: 15px; + padding: 10px; } - .chat .item > .attachment > h4 { - margin: 0 0 5px 0; - font-weight: 600; - font-size: 14px; + margin: 0 0 5px 0; + font-weight: 600; + font-size: 14px; } - .chat .item > .attachment > p, .chat .item > .attachment > .filename { - font-weight: 600; - font-size: 13px; - font-style: italic; - margin: 0; + font-weight: 600; + font-size: 13px; + font-style: italic; + margin: 0; } - .chat .item > .attachment:before, .chat .item > .attachment:after { - content: " "; - display: table; + content: " "; + display: table; } - .chat .item > .attachment:after { - clear: both; + clear: both; +} +.chat .item > .attachment:before, +.chat .item > .attachment:after { + content: " "; + display: table; +} +.chat .item > .attachment:after { + clear: both; } - .box-input { - max-width: 200px; + max-width: 200px; } - .modal .panel-body { - color: #444; + color: #444; } - /* * Component: Info Box * ------------------- */ .info-box { - display: block; - min-height: 90px; - background: #fff; - width: 100%; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - border-radius: 2px; - margin-bottom: 15px; + display: block; + min-height: 90px; + background: #fff; + width: 100%; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + border-radius: 2px; + margin-bottom: 15px; } - .info-box small { - font-size: 14px; + font-size: 14px; } - .info-box .progress { - background: rgba(0, 0, 0, 0.2); - margin: 5px -10px 5px -10px; - height: 2px; + background: rgba(0, 0, 0, 0.2); + margin: 5px -10px 5px -10px; + height: 2px; } - .info-box .progress, .info-box .progress .progress-bar { - border-radius: 0; + border-radius: 0; } - .info-box .progress .progress-bar { - background: #fff; + background: #fff; } - .info-box-icon { - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; - display: block; - float: left; - height: 90px; - width: 90px; - text-align: center; - font-size: 45px; - line-height: 90px; - background: rgba(0, 0, 0, 0.2); + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; + display: block; + float: left; + height: 90px; + width: 90px; + text-align: center; + font-size: 45px; + line-height: 90px; + background: rgba(0, 0, 0, 0.2); } - .info-box-icon > img { - max-width: 100%; + max-width: 100%; } - .info-box-content { - padding: 5px 10px; - margin-left: 90px; + padding: 5px 10px; + margin-left: 90px; } - .info-box-number { - display: block; - font-weight: bold; - font-size: 18px; + display: block; + font-weight: bold; + font-size: 18px; } - .progress-description, .info-box-text { - display: block; - font-size: 14px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + display: block; + font-size: 14px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } - .info-box-text { - text-transform: uppercase; + text-transform: uppercase; } - .info-box-more { - display: block; + display: block; } - .progress-description { - margin: 0; + margin: 0; } - /* * Component: Timeline * ------------------- */ .timeline { - position: relative; - margin: 0 0 30px 0; - padding: 0; - list-style: none; + position: relative; + margin: 0 0 30px 0; + padding: 0; + list-style: none; } - .timeline:before { - content: ''; - position: absolute; - top: 0; - bottom: 0; - width: 4px; - background: #ddd; - left: 31px; - margin: 0; - border-radius: 2px; + content: ''; + position: absolute; + top: 0; + bottom: 0; + width: 4px; + background: #ddd; + left: 31px; + margin: 0; + border-radius: 2px; } - .timeline > li { - position: relative; - margin-right: 10px; - margin-bottom: 15px; + position: relative; + margin-right: 10px; + margin-bottom: 15px; } - .timeline > li:before, .timeline > li:after { - content: " "; - display: table; + content: " "; + display: table; } - .timeline > li:after { - clear: both; + clear: both; +} +.timeline > li:before, +.timeline > li:after { + content: " "; + display: table; +} +.timeline > li:after { + clear: both; } - .timeline > li > .timeline-item { - -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - border-radius: 3px; - margin-top: 0; - background: #fff; - color: #444; - margin-left: 60px; - margin-right: 15px; - padding: 0; - position: relative; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + border-radius: 3px; + margin-top: 0; + background: #fff; + color: #444; + margin-left: 60px; + margin-right: 15px; + padding: 0; + position: relative; } - .timeline > li > .timeline-item > .time { - color: #999; - float: right; - padding: 10px; - font-size: 12px; + color: #999; + float: right; + padding: 10px; + font-size: 12px; } - .timeline > li > .timeline-item > .timeline-header { - margin: 0; - color: #555; - border-bottom: 1px solid #f4f4f4; - padding: 10px; - font-size: 16px; - line-height: 1.1; + margin: 0; + color: #555; + border-bottom: 1px solid #f4f4f4; + padding: 10px; + font-size: 16px; + line-height: 1.1; } - .timeline > li > .timeline-item > .timeline-header > a { - font-weight: 600; + font-weight: 600; } - .timeline > li > .timeline-item > .timeline-body, .timeline > li > .timeline-item > .timeline-footer { - padding: 10px; + padding: 10px; } - .timeline > li > .fa, .timeline > li > .glyphicon, .timeline > li > .ion { - width: 30px; - height: 30px; - font-size: 15px; - line-height: 30px; - position: absolute; - color: #666; - background: #d2d6de; - border-radius: 50%; - text-align: center; - left: 18px; - top: 0; + width: 30px; + height: 30px; + font-size: 15px; + line-height: 30px; + position: absolute; + color: #666; + background: #d2d6de; + border-radius: 50%; + text-align: center; + left: 18px; + top: 0; } - .timeline > .time-label > span { - font-weight: 600; - padding: 5px; - display: inline-block; - background-color: #fff; - border-radius: 4px; + font-weight: 600; + padding: 5px; + display: inline-block; + background-color: #fff; + border-radius: 4px; } - .timeline-inverse > li > .timeline-item { - background: #f0f0f0; - border: 1px solid #ddd; - -webkit-box-shadow: none; - box-shadow: none; + background: #f0f0f0; + border: 1px solid #ddd; + -webkit-box-shadow: none; + box-shadow: none; } - .timeline-inverse > li > .timeline-item > .timeline-header { - border-bottom-color: #ddd; + border-bottom-color: #ddd; } - /* * Component: Button * ----------------- */ .btn { - border-radius: 3px; - -webkit-box-shadow: none; - box-shadow: none; - border: 1px solid transparent; + border-radius: 3px; + -webkit-box-shadow: none; + box-shadow: none; + border: 1px solid transparent; } - .btn.uppercase { - text-transform: uppercase; + text-transform: uppercase; } - .btn.btn-flat { - border-radius: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - border-width: 1px; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + border-width: 1px; } - .btn:active { - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); - -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } - .btn:focus { - outline: none; + outline: none; } - .btn.btn-file { - position: relative; - overflow: hidden; + position: relative; + overflow: hidden; } - .btn.btn-file > input[type='file'] { - position: absolute; - top: 0; - right: 0; - min-width: 100%; - min-height: 100%; - font-size: 100px; - text-align: right; - opacity: 0; - filter: alpha(opacity=0); - outline: none; - background: white; - cursor: inherit; - display: block; + position: absolute; + top: 0; + right: 0; + min-width: 100%; + min-height: 100%; + font-size: 100px; + text-align: right; + opacity: 0; + filter: alpha(opacity=0); + outline: none; + background: white; + cursor: inherit; + display: block; } - .btn-default { - background-color: #f4f4f4; - color: #444; - border-color: #ddd; + background-color: #f4f4f4; + color: #444; + border-color: #ddd; } - .btn-default:hover, .btn-default:active, .btn-default.hover { - background-color: #e7e7e7; + background-color: #e7e7e7; } - .btn-primary { - background-color: #3c8dbc; - border-color: #367fa9; + background-color: #3c8dbc; + border-color: #367fa9; } - .btn-primary:hover, .btn-primary:active, .btn-primary.hover { - background-color: #367fa9; + background-color: #367fa9; } - .btn-success { - background-color: #00a65a; - border-color: #008d4c; + background-color: #00a65a; + border-color: #008d4c; } - .btn-success:hover, .btn-success:active, .btn-success.hover { - background-color: #008d4c; + background-color: #008d4c; } - .btn-info { - background-color: #00c0ef; - border-color: #00acd6; + background-color: #00c0ef; + border-color: #00acd6; } - .btn-info:hover, .btn-info:active, .btn-info.hover { - background-color: #00acd6; + background-color: #00acd6; } - .btn-danger { - background-color: #dd4b39; - border-color: #d73925; + background-color: #dd4b39; + border-color: #d73925; } - .btn-danger:hover, .btn-danger:active, .btn-danger.hover { - background-color: #d73925; + background-color: #d73925; } - .btn-warning { - background-color: #f39c12; - border-color: #e08e0b; + background-color: #f39c12; + border-color: #e08e0b; } - .btn-warning:hover, .btn-warning:active, .btn-warning.hover { - background-color: #e08e0b; + background-color: #e08e0b; } - .btn-outline { - border: 1px solid #fff; - background: transparent; - color: #fff; + border: 1px solid #fff; + background: transparent; + color: #fff; } - .btn-outline:hover, .btn-outline:focus, .btn-outline:active { - color: rgba(255, 255, 255, 0.7); - border-color: rgba(255, 255, 255, 0.7); + color: rgba(255, 255, 255, 0.7); + border-color: rgba(255, 255, 255, 0.7); } - .btn-link { - -webkit-box-shadow: none; - box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; } - .btn[class*='bg-']:hover { - -webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2); - box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2); + box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2); } - .btn-app { - border-radius: 3px; - position: relative; - padding: 15px 5px; - margin: 0 0 10px 10px; - min-width: 80px; - height: 60px; - text-align: center; - color: #666; - border: 1px solid #ddd; - background-color: #f4f4f4; - font-size: 12px; + border-radius: 3px; + position: relative; + padding: 15px 5px; + margin: 0 0 10px 10px; + min-width: 80px; + height: 60px; + text-align: center; + color: #666; + border: 1px solid #ddd; + background-color: #f4f4f4; + font-size: 12px; } - .btn-app > .fa, .btn-app > .glyphicon, .btn-app > .ion { - font-size: 20px; - display: block; + font-size: 20px; + display: block; } - .btn-app:hover { - background: #f4f4f4; - color: #444; - border-color: #aaa; + background: #f4f4f4; + color: #444; + border-color: #aaa; } - .btn-app:active, .btn-app:focus { - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); - -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } - .btn-app > .badge { - position: absolute; - top: -3px; - right: -10px; - font-size: 10px; - font-weight: 400; + position: absolute; + top: -3px; + right: -10px; + font-size: 10px; + font-weight: 400; } - /* * Component: Callout * ------------------ */ .callout { - border-radius: 3px; - margin: 0 0 20px 0; - padding: 15px 30px 15px 15px; - border-left: 5px solid #eee; + border-radius: 3px; + margin: 0 0 20px 0; + padding: 15px 30px 15px 15px; + border-left: 5px solid #eee; } - .callout a { - color: #fff; - text-decoration: underline; + color: #fff; + text-decoration: underline; } - .callout a:hover { - color: #eee; + color: #eee; } - .callout h4 { - margin-top: 0; - font-weight: 600; + margin-top: 0; + font-weight: 600; } - .callout p:last-child { - margin-bottom: 0; + margin-bottom: 0; } - .callout code, .callout .highlight { - background-color: #fff; + background-color: #fff; } - .callout.callout-danger { - border-color: #c23321; + border-color: #c23321; } - .callout.callout-warning { - border-color: #c87f0a; + border-color: #c87f0a; } - .callout.callout-info { - border-color: #0097bc; + border-color: #0097bc; } - .callout.callout-success { - border-color: #00733e; + border-color: #00733e; } - /* * Component: alert * ---------------- */ .alert { - border-radius: 3px; + border-radius: 3px; } - .alert h4 { - font-weight: 600; + font-weight: 600; } - .alert .icon { - margin-right: 10px; + margin-right: 10px; } - .alert .close { - color: #000; - opacity: 0.2; - filter: alpha(opacity=20); + color: #000; + opacity: 0.2; + filter: alpha(opacity=20); } - .alert .close:hover { - opacity: 0.5; - filter: alpha(opacity=50); + opacity: 0.5; + filter: alpha(opacity=50); } - .alert a { - color: #fff; - text-decoration: underline; + color: #fff; + text-decoration: underline; } - .alert-success { - border-color: #008d4c; + border-color: #008d4c; } - .alert-danger, .alert-error { - border-color: #d73925; + border-color: #d73925; } - .alert-warning { - border-color: #e08e0b; + border-color: #e08e0b; } - .alert-info { - border-color: #00acd6; + border-color: #00acd6; } - /* * Component: Nav * -------------- @@ -2897,272 +2563,234 @@ a:focus { .nav > li > a:hover, .nav > li > a:active, .nav > li > a:focus { - color: #444; - background: #f7f7f7; + color: #444; + background: #f7f7f7; } - /* NAV PILLS */ .nav-pills > li > a { - border-radius: 0; - border-top: 3px solid transparent; - color: #444; + border-radius: 0; + border-top: 3px solid transparent; + color: #444; } - .nav-pills > li > a > .fa, .nav-pills > li > a > .glyphicon, .nav-pills > li > a > .ion { - margin-right: 5px; + margin-right: 5px; } - .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { - border-top-color: #3c8dbc; + border-top-color: #3c8dbc; } - .nav-pills > li.active > a { - font-weight: 600; + font-weight: 600; } - /* NAV STACKED */ .nav-stacked > li > a { - border-radius: 0; - border-top: 0; - border-left: 3px solid transparent; - color: #444; + border-radius: 0; + border-top: 0; + border-left: 3px solid transparent; + color: #444; } - .nav-stacked > li.active > a, .nav-stacked > li.active > a:hover { - background: transparent; - color: #444; - border-top: 0; - border-left-color: #3c8dbc; + background: transparent; + color: #444; + border-top: 0; + border-left-color: #3c8dbc; } - .nav-stacked > li.header { - border-bottom: 1px solid #ddd; - color: #777; - margin-bottom: 10px; - padding: 5px 10px; - text-transform: uppercase; + border-bottom: 1px solid #ddd; + color: #777; + margin-bottom: 10px; + padding: 5px 10px; + text-transform: uppercase; } - /* NAV TABS */ .nav-tabs-custom { - margin-bottom: 20px; - background: #fff; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - border-radius: 3px; + margin-bottom: 20px; + background: #fff; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + border-radius: 3px; } - .nav-tabs-custom > .nav-tabs { - margin: 0; - border-bottom-color: #f4f4f4; - border-top-right-radius: 3px; - border-top-left-radius: 3px; + margin: 0; + border-bottom-color: #f4f4f4; + border-top-right-radius: 3px; + border-top-left-radius: 3px; } - .nav-tabs-custom > .nav-tabs > li { - border-top: 3px solid transparent; - margin-bottom: -2px; - margin-right: 5px; + border-top: 3px solid transparent; + margin-bottom: -2px; + margin-right: 5px; +} +.nav-tabs-custom > .nav-tabs > li.disabled > a { + color: #777; } - .nav-tabs-custom > .nav-tabs > li > a { - color: #444; - border-radius: 0; + color: #444; + border-radius: 0; } - .nav-tabs-custom > .nav-tabs > li > a.text-muted { - color: #999; + color: #999; } - .nav-tabs-custom > .nav-tabs > li > a, .nav-tabs-custom > .nav-tabs > li > a:hover { - background: transparent; - margin: 0; + background: transparent; + margin: 0; } - .nav-tabs-custom > .nav-tabs > li > a:hover { - color: #999; + color: #999; } - .nav-tabs-custom > .nav-tabs > li:not(.active) > a:hover, .nav-tabs-custom > .nav-tabs > li:not(.active) > a:focus, .nav-tabs-custom > .nav-tabs > li:not(.active) > a:active { - border-color: transparent; + border-color: transparent; } - .nav-tabs-custom > .nav-tabs > li.active { - border-top-color: #3c8dbc; + border-top-color: #3c8dbc; } - .nav-tabs-custom > .nav-tabs > li.active > a, .nav-tabs-custom > .nav-tabs > li.active:hover > a { - background-color: #fff; - color: #444; + background-color: #fff; + color: #444; } - .nav-tabs-custom > .nav-tabs > li.active > a { - border-top-color: transparent; - border-left-color: #f4f4f4; - border-right-color: #f4f4f4; + border-top-color: transparent; + border-left-color: #f4f4f4; + border-right-color: #f4f4f4; } - .nav-tabs-custom > .nav-tabs > li:first-of-type { - margin-left: 0; + margin-left: 0; } - .nav-tabs-custom > .nav-tabs > li:first-of-type.active > a { - border-left-color: transparent; + border-left-color: transparent; } - .nav-tabs-custom > .nav-tabs.pull-right { - float: none !important; + float: none !important; } - .nav-tabs-custom > .nav-tabs.pull-right > li { - float: right; + float: right; } - .nav-tabs-custom > .nav-tabs.pull-right > li:first-of-type { - margin-right: 0; + margin-right: 0; } - .nav-tabs-custom > .nav-tabs.pull-right > li:first-of-type > a { - border-left-width: 1px; + border-left-width: 1px; } - .nav-tabs-custom > .nav-tabs.pull-right > li:first-of-type.active > a { - border-left-color: #f4f4f4; - border-right-color: transparent; + border-left-color: #f4f4f4; + border-right-color: transparent; } - .nav-tabs-custom > .nav-tabs > li.header { - line-height: 35px; - padding: 0 10px; - font-size: 20px; - color: #444; + line-height: 35px; + padding: 0 10px; + font-size: 20px; + color: #444; } - .nav-tabs-custom > .nav-tabs > li.header > .fa, .nav-tabs-custom > .nav-tabs > li.header > .glyphicon, .nav-tabs-custom > .nav-tabs > li.header > .ion { - margin-right: 5px; + margin-right: 5px; } - .nav-tabs-custom > .tab-content { - background: #fff; - padding: 10px; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; + background: #fff; + padding: 10px; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; } - .nav-tabs-custom .dropdown.open > a:active, .nav-tabs-custom .dropdown.open > a:focus { - background: transparent; - color: #999; + background: transparent; + color: #999; } - .nav-tabs-custom.tab-primary > .nav-tabs > li.active { - border-top-color: #3c8dbc; + border-top-color: #3c8dbc; } - .nav-tabs-custom.tab-info > .nav-tabs > li.active { - border-top-color: #00c0ef; + border-top-color: #00c0ef; } - .nav-tabs-custom.tab-danger > .nav-tabs > li.active { - border-top-color: #dd4b39; + border-top-color: #dd4b39; } - .nav-tabs-custom.tab-warning > .nav-tabs > li.active { - border-top-color: #f39c12; + border-top-color: #f39c12; } - .nav-tabs-custom.tab-success > .nav-tabs > li.active { - border-top-color: #00a65a; + border-top-color: #00a65a; } - .nav-tabs-custom.tab-default > .nav-tabs > li.active { - border-top-color: #d2d6de; + border-top-color: #d2d6de; } - /* PAGINATION */ .pagination > li > a { - background: #fafafa; - color: #666; + background: #fafafa; + color: #666; } - .pagination.pagination-flat > li > a { - border-radius: 0 !important; + border-radius: 0 !important; } - /* * Component: Products List * ------------------------ */ .products-list { - list-style: none; - margin: 0; - padding: 0; + list-style: none; + margin: 0; + padding: 0; } - .products-list > .item { - border-radius: 3px; - -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - padding: 10px 0; - background: #fff; + border-radius: 3px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + padding: 10px 0; + background: #fff; } - .products-list > .item:before, .products-list > .item:after { - content: " "; - display: table; + content: " "; + display: table; } - .products-list > .item:after { - clear: both; + clear: both; +} +.products-list > .item:before, +.products-list > .item:after { + content: " "; + display: table; +} +.products-list > .item:after { + clear: both; } - .products-list .product-img { - float: left; + float: left; } - .products-list .product-img img { - width: 50px; - height: 50px; + width: 50px; + height: 50px; } - .products-list .product-info { - margin-left: 60px; + margin-left: 60px; } - .products-list .product-title { - font-weight: 600; + font-weight: 600; } - .products-list .product-description { - display: block; - color: #999; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; + display: block; + color: #999; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } - .product-list-in-box > .item { - -webkit-box-shadow: none; - box-shadow: none; - border-radius: 0; - border-bottom: 1px solid #f4f4f4; + -webkit-box-shadow: none; + box-shadow: none; + border-radius: 0; + border-bottom: 1px solid #f4f4f4; } - .product-list-in-box > .item:last-of-type { - border-bottom-width: 0; + border-bottom-width: 0; } - /* * Component: Table * ---------------- @@ -3173,1841 +2801,2125 @@ a:focus { .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { - border-top: 1px solid #f4f4f4; + border-top: 1px solid #f4f4f4; } - .table > thead > tr > th { - border-bottom: 2px solid #f4f4f4; + border-bottom: 2px solid #f4f4f4; } - .table tr td .progress { - margin-top: 5px; + margin-top: 5px; } - .table-bordered { - border: 1px solid #f4f4f4; + border: 1px solid #f4f4f4; } - .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { - border: 1px solid #f4f4f4; + border: 1px solid #f4f4f4; } - .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { - border-bottom-width: 2px; + border-bottom-width: 2px; } - .table.no-border, .table.no-border td, .table.no-border th { - border: 0; + border: 0; } - /* .text-center in tables */ table.text-center, table.text-center td, table.text-center th { - text-align: center; + text-align: center; } - .table.align th { - text-align: left; + text-align: left; } - .table.align td { - text-align: right; + text-align: right; } - /* * Component: Label * ---------------- */ .label-default { - background-color: #d2d6de; - color: #444; + background-color: #d2d6de; + color: #444; } - /* * Component: Direct Chat * ---------------------- */ .direct-chat .box-body { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - position: relative; - overflow-x: hidden; - padding: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + position: relative; + overflow-x: hidden; + padding: 0; } - .direct-chat.chat-pane-open .direct-chat-contacts { - -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - -o-transform: translate(0, 0); - transform: translate(0, 0); + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); } - .direct-chat-messages { - -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - -o-transform: translate(0, 0); - transform: translate(0, 0); - padding: 10px; - height: 250px; - overflow: auto; + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); + padding: 10px; + height: 250px; + overflow: auto; } - .direct-chat-msg, .direct-chat-text { - display: block; + display: block; } - .direct-chat-msg { - margin-bottom: 10px; + margin-bottom: 10px; } - .direct-chat-msg:before, .direct-chat-msg:after { - content: " "; - display: table; + content: " "; + display: table; } - .direct-chat-msg:after { - clear: both; + clear: both; +} +.direct-chat-msg:before, +.direct-chat-msg:after { + content: " "; + display: table; +} +.direct-chat-msg:after { + clear: both; } - .direct-chat-messages, .direct-chat-contacts { - -webkit-transition: -webkit-transform 0.5s ease-in-out; - -moz-transition: -moz-transform 0.5s ease-in-out; - -o-transition: -o-transform 0.5s ease-in-out; - transition: transform 0.5s ease-in-out; + -webkit-transition: -webkit-transform 0.5s ease-in-out; + -moz-transition: -moz-transform 0.5s ease-in-out; + -o-transition: -o-transform 0.5s ease-in-out; + transition: transform 0.5s ease-in-out; } - .direct-chat-text { - border-radius: 5px; - position: relative; - padding: 5px 10px; - background: #d2d6de; - border: 1px solid #d2d6de; - margin: 5px 0 0 50px; - color: #444444; + border-radius: 5px; + position: relative; + padding: 5px 10px; + background: #d2d6de; + border: 1px solid #d2d6de; + margin: 5px 0 0 50px; + color: #444444; } - .direct-chat-text:after, .direct-chat-text:before { - position: absolute; - right: 100%; - top: 15px; - border: solid transparent; - border-right-color: #d2d6de; - content: ' '; - height: 0; - width: 0; - pointer-events: none; + position: absolute; + right: 100%; + top: 15px; + border: solid transparent; + border-right-color: #d2d6de; + content: ' '; + height: 0; + width: 0; + pointer-events: none; } - .direct-chat-text:after { - border-width: 5px; - margin-top: -5px; + border-width: 5px; + margin-top: -5px; } - .direct-chat-text:before { - border-width: 6px; - margin-top: -6px; + border-width: 6px; + margin-top: -6px; } - .right .direct-chat-text { - margin-right: 50px; - margin-left: 0; + margin-right: 50px; + margin-left: 0; } - .right .direct-chat-text:after, .right .direct-chat-text:before { - right: auto; - left: 100%; - border-right-color: transparent; - border-left-color: #d2d6de; + right: auto; + left: 100%; + border-right-color: transparent; + border-left-color: #d2d6de; } - .direct-chat-img { - border-radius: 50%; - float: left; - width: 40px; - height: 40px; + border-radius: 50%; + float: left; + width: 40px; + height: 40px; } - .right .direct-chat-img { - float: right; + float: right; } - .direct-chat-info { - display: block; - margin-bottom: 2px; - font-size: 12px; + display: block; + margin-bottom: 2px; + font-size: 12px; } - .direct-chat-name { - font-weight: 600; + font-weight: 600; } - .direct-chat-timestamp { - color: #999; + color: #999; } - .direct-chat-contacts-open .direct-chat-contacts { - -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - -o-transform: translate(0, 0); - transform: translate(0, 0); + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); } - .direct-chat-contacts { - -webkit-transform: translate(101%, 0); - -ms-transform: translate(101%, 0); - -o-transform: translate(101%, 0); - transform: translate(101%, 0); - position: absolute; - top: 0; - bottom: 0; - height: 250px; - width: 100%; - background: #222d32; - color: #fff; - overflow: auto; + -webkit-transform: translate(101%, 0); + -ms-transform: translate(101%, 0); + -o-transform: translate(101%, 0); + transform: translate(101%, 0); + position: absolute; + top: 0; + bottom: 0; + height: 250px; + width: 100%; + background: #222d32; + color: #fff; + overflow: auto; } - .contacts-list > li { - border-bottom: 1px solid rgba(0, 0, 0, 0.2); - padding: 10px; - margin: 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); + padding: 10px; + margin: 0; } - .contacts-list > li:before, .contacts-list > li:after { - content: " "; - display: table; + content: " "; + display: table; } - .contacts-list > li:after { - clear: both; + clear: both; +} +.contacts-list > li:before, +.contacts-list > li:after { + content: " "; + display: table; +} +.contacts-list > li:after { + clear: both; } - .contacts-list > li:last-of-type { - border-bottom: none; + border-bottom: none; } - .contacts-list-img { - border-radius: 50%; - width: 40px; - float: left; + border-radius: 50%; + width: 40px; + float: left; } - .contacts-list-info { - margin-left: 45px; - color: #fff; + margin-left: 45px; + color: #fff; } - .contacts-list-name, .contacts-list-status { - display: block; + display: block; } - .contacts-list-name { - font-weight: 600; + font-weight: 600; } - .contacts-list-status { - font-size: 12px; + font-size: 12px; } - .contacts-list-date { - color: #aaa; - font-weight: normal; + color: #aaa; + font-weight: normal; } - .contacts-list-msg { - color: #999; + color: #999; } - .direct-chat-danger .right > .direct-chat-text { - background: #dd4b39; - border-color: #dd4b39; - color: #ffffff; + background: #dd4b39; + border-color: #dd4b39; + color: #ffffff; } - .direct-chat-danger .right > .direct-chat-text:after, .direct-chat-danger .right > .direct-chat-text:before { - border-left-color: #dd4b39; + border-left-color: #dd4b39; } - .direct-chat-primary .right > .direct-chat-text { - background: #3c8dbc; - border-color: #3c8dbc; - color: #ffffff; + background: #3c8dbc; + border-color: #3c8dbc; + color: #ffffff; } - .direct-chat-primary .right > .direct-chat-text:after, .direct-chat-primary .right > .direct-chat-text:before { - border-left-color: #3c8dbc; + border-left-color: #3c8dbc; } - .direct-chat-warning .right > .direct-chat-text { - background: #f39c12; - border-color: #f39c12; - color: #ffffff; + background: #f39c12; + border-color: #f39c12; + color: #ffffff; } - .direct-chat-warning .right > .direct-chat-text:after, .direct-chat-warning .right > .direct-chat-text:before { - border-left-color: #f39c12; + border-left-color: #f39c12; } - .direct-chat-info .right > .direct-chat-text { - background: #00c0ef; - border-color: #00c0ef; - color: #ffffff; + background: #00c0ef; + border-color: #00c0ef; + color: #ffffff; } - .direct-chat-info .right > .direct-chat-text:after, .direct-chat-info .right > .direct-chat-text:before { - border-left-color: #00c0ef; + border-left-color: #00c0ef; } - .direct-chat-success .right > .direct-chat-text { - background: #00a65a; - border-color: #00a65a; - color: #ffffff; + background: #00a65a; + border-color: #00a65a; + color: #ffffff; } - .direct-chat-success .right > .direct-chat-text:after, .direct-chat-success .right > .direct-chat-text:before { - border-left-color: #00a65a; + border-left-color: #00a65a; } - /* * Component: Users List * --------------------- */ .users-list > li { - width: 25%; - float: left; - padding: 10px; - text-align: center; + width: 25%; + float: left; + padding: 10px; + text-align: center; } - .users-list > li img { - border-radius: 50%; - max-width: 100%; - height: auto; + border-radius: 50%; + max-width: 100%; + height: auto; } - .users-list > li > a:hover, .users-list > li > a:hover .users-list-name { - color: #999; + color: #999; } - .users-list-name, .users-list-date { - display: block; + display: block; } - .users-list-name { - font-weight: 600; - color: #444; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; + font-weight: 600; + color: #444; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } - .users-list-date { - color: #999; - font-size: 12px; + color: #999; + font-size: 12px; } - /* * Component: Carousel * ------------------- */ .carousel-control.left, .carousel-control.right { - background-image: none; + background-image: none; } - .carousel-control > .fa { - font-size: 40px; - position: absolute; - top: 50%; - z-index: 5; - display: inline-block; - margin-top: -20px; + font-size: 40px; + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; + margin-top: -20px; } - /* * Component: modal * ---------------- */ .modal { - background: rgba(0, 0, 0, 0.3); + background: rgba(0, 0, 0, 0.3); } - .modal-content { - border-radius: 0; + border-radius: 0; + -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.125); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.125); + border: 0; +} +@media (min-width: 768px) { + .modal-content { -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.125); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.125); - border: 0; + } } - -@media (min-width: 768px) { - .modal-content { - -webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.125); - box-shadow: 0 2px 3px rgba(0, 0, 0, 0.125); - } -} - .modal-header { - border-bottom-color: #f4f4f4; + border-bottom-color: #f4f4f4; } - .modal-footer { - border-top-color: #f4f4f4; + border-top-color: #f4f4f4; } - .modal-primary .modal-header, .modal-primary .modal-footer { - border-color: #307095; + border-color: #307095; } - .modal-warning .modal-header, .modal-warning .modal-footer { - border-color: #c87f0a; + border-color: #c87f0a; } - .modal-info .modal-header, .modal-info .modal-footer { - border-color: #0097bc; + border-color: #0097bc; } - .modal-success .modal-header, .modal-success .modal-footer { - border-color: #00733e; + border-color: #00733e; } - .modal-danger .modal-header, .modal-danger .modal-footer { - border-color: #c23321; + border-color: #c23321; } - /* * Component: Social Widgets * ------------------------- */ .box-widget { - border: none; - position: relative; + border: none; + position: relative; } - .widget-user .widget-user-header { - padding: 20px; - height: 120px; - border-top-right-radius: 3px; - border-top-left-radius: 3px; + padding: 20px; + height: 120px; + border-top-right-radius: 3px; + border-top-left-radius: 3px; } - .widget-user .widget-user-username { - margin-top: 0; - margin-bottom: 5px; - font-size: 25px; - font-weight: 300; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + margin-top: 0; + margin-bottom: 5px; + font-size: 25px; + font-weight: 300; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } - .widget-user .widget-user-desc { - margin-top: 0; + margin-top: 0; } - .widget-user .widget-user-image { - position: absolute; - top: 65px; - left: 50%; - margin-left: -45px; + position: absolute; + top: 65px; + left: 50%; + margin-left: -45px; } - .widget-user .widget-user-image > img { - width: 90px; - height: auto; - border: 3px solid #fff; + width: 90px; + height: auto; + border: 3px solid #fff; } - .widget-user .box-footer { - padding-top: 30px; + padding-top: 30px; } - .widget-user-2 .widget-user-header { - padding: 20px; - border-top-right-radius: 3px; - border-top-left-radius: 3px; + padding: 20px; + border-top-right-radius: 3px; + border-top-left-radius: 3px; } - .widget-user-2 .widget-user-username { - margin-top: 5px; - margin-bottom: 5px; - font-size: 25px; - font-weight: 300; + margin-top: 5px; + margin-bottom: 5px; + font-size: 25px; + font-weight: 300; } - .widget-user-2 .widget-user-desc { - margin-top: 0; + margin-top: 0; } - .widget-user-2 .widget-user-username, .widget-user-2 .widget-user-desc { - margin-left: 75px; + margin-left: 75px; } - .widget-user-2 .widget-user-image > img { - width: 65px; - height: auto; - float: left; + width: 65px; + height: auto; + float: left; +} +.treeview-menu { + display: none; + list-style: none; + padding: 0; + margin: 0; + padding-left: 5px; +} +.treeview-menu .treeview-menu { + padding-left: 20px; +} +.treeview-menu > li { + margin: 0; +} +.treeview-menu > li > a { + padding: 5px 5px 5px 15px; + display: block; + font-size: 14px; +} +.treeview-menu > li > a > .fa, +.treeview-menu > li > a > .glyphicon, +.treeview-menu > li > a > .ion { + width: 20px; +} +.treeview-menu > li > a > .pull-right-container > .fa-angle-left, +.treeview-menu > li > a > .pull-right-container > .fa-angle-down, +.treeview-menu > li > a > .fa-angle-left, +.treeview-menu > li > a > .fa-angle-down { + width: auto; } - /* * Page: Mailbox * ------------- */ .mailbox-messages > .table { - margin: 0; + margin: 0; } - .mailbox-controls { - padding: 5px; + padding: 5px; } - .mailbox-controls.with-border { - border-bottom: 1px solid #f4f4f4; + border-bottom: 1px solid #f4f4f4; } - .mailbox-read-info { - border-bottom: 1px solid #f4f4f4; - padding: 10px; + border-bottom: 1px solid #f4f4f4; + padding: 10px; } - .mailbox-read-info h3 { - font-size: 20px; - margin: 0; + font-size: 20px; + margin: 0; } - .mailbox-read-info h5 { - margin: 0; - padding: 5px 0 0 0; + margin: 0; + padding: 5px 0 0 0; } - .mailbox-read-time { - color: #999; - font-size: 13px; + color: #999; + font-size: 13px; } - .mailbox-read-message { - padding: 10px; + padding: 10px; } - .mailbox-attachments li { - float: left; - width: 200px; - border: 1px solid #eee; - margin-bottom: 10px; - margin-right: 10px; + float: left; + width: 200px; + border: 1px solid #eee; + margin-bottom: 10px; + margin-right: 10px; } - .mailbox-attachment-name { - font-weight: bold; - color: #666; + font-weight: bold; + color: #666; } - .mailbox-attachment-icon, .mailbox-attachment-info, .mailbox-attachment-size { - display: block; + display: block; } - .mailbox-attachment-info { - padding: 10px; - background: #f4f4f4; + padding: 10px; + background: #f4f4f4; } - .mailbox-attachment-size { - color: #999; - font-size: 12px; + color: #999; + font-size: 12px; } - .mailbox-attachment-icon { - text-align: center; - font-size: 65px; - color: #666; - padding: 20px 10px; + text-align: center; + font-size: 65px; + color: #666; + padding: 20px 10px; } - .mailbox-attachment-icon.has-img { - padding: 0; + padding: 0; } - .mailbox-attachment-icon.has-img > img { - max-width: 100%; - height: auto; + max-width: 100%; + height: auto; } - /* * Page: Lock Screen * ----------------- */ /* ADD THIS CLASS TO THE TAG */ .lockscreen { - background: #d2d6de; + background: #d2d6de; } - .lockscreen-logo { - font-size: 35px; - text-align: center; - margin-bottom: 25px; - font-weight: 300; + font-size: 35px; + text-align: center; + margin-bottom: 25px; + font-weight: 300; } - .lockscreen-logo a { - color: #444; + color: #444; } - .lockscreen-wrapper { - max-width: 400px; - margin: 0 auto; - margin-top: 10%; + max-width: 400px; + margin: 0 auto; + margin-top: 10%; } - /* User name [optional] */ .lockscreen .lockscreen-name { - text-align: center; - font-weight: 600; + text-align: center; + font-weight: 600; } - /* Will contain the image and the sign in form */ .lockscreen-item { - border-radius: 4px; - padding: 0; - background: #fff; - position: relative; - margin: 10px auto 30px auto; - width: 290px; + border-radius: 4px; + padding: 0; + background: #fff; + position: relative; + margin: 10px auto 30px auto; + width: 290px; } - /* User image */ .lockscreen-image { - border-radius: 50%; - position: absolute; - left: -10px; - top: -25px; - background: #fff; - padding: 5px; - z-index: 10; + border-radius: 50%; + position: absolute; + left: -10px; + top: -25px; + background: #fff; + padding: 5px; + z-index: 10; } - .lockscreen-image > img { - border-radius: 50%; - width: 70px; - height: 70px; + border-radius: 50%; + width: 70px; + height: 70px; } - /* Contains the password input and the login button */ .lockscreen-credentials { - margin-left: 70px; + margin-left: 70px; } - .lockscreen-credentials .form-control { - border: 0; + border: 0; } - .lockscreen-credentials .btn { - background-color: #fff; - border: 0; - padding: 0 10px; + background-color: #fff; + border: 0; + padding: 0 10px; } - .lockscreen-footer { - margin-top: 10px; + margin-top: 10px; } - /* * Page: Login & Register * ---------------------- */ .login-logo, .register-logo { - font-size: 35px; - text-align: center; - margin-bottom: 25px; - font-weight: 300; + font-size: 35px; + text-align: center; + margin-bottom: 25px; + font-weight: 300; } - .login-logo a, .register-logo a { - color: #444; + color: #444; } - .login-page, .register-page { - background: #d2d6de; + background: #d2d6de; } - .login-box, .register-box { - width: 360px; - margin: 7% auto; + width: 360px; + margin: 7% auto; } - @media (max-width: 768px) { - .login-box, - .register-box { - width: 90%; - margin-top: 20px; - } + .login-box, + .register-box { + width: 90%; + margin-top: 20px; + } } - .login-box-body, .register-box-body { - background: #fff; - padding: 20px; - border-top: 0; - color: #666; + background: #fff; + padding: 20px; + border-top: 0; + color: #666; } - .login-box-body .form-control-feedback, .register-box-body .form-control-feedback { - color: #777; + color: #777; } - .login-box-msg, .register-box-msg { - margin: 0; - text-align: center; - padding: 0 20px 20px 20px; + margin: 0; + text-align: center; + padding: 0 20px 20px 20px; } - .social-auth-links { - margin: 10px 0; + margin: 10px 0; } - /* * Page: 400 and 500 error pages * ------------------------------ */ .error-page { - width: 600px; - margin: 20px auto 0 auto; + width: 600px; + margin: 20px auto 0 auto; } - @media (max-width: 991px) { - .error-page { - width: 100%; - } + .error-page { + width: 100%; + } } - .error-page > .headline { - float: left; - font-size: 100px; - font-weight: 300; + float: left; + font-size: 100px; + font-weight: 300; } - @media (max-width: 991px) { - .error-page > .headline { - float: none; - text-align: center; - } + .error-page > .headline { + float: none; + text-align: center; + } } - .error-page > .error-content { - margin-left: 190px; - display: block; + margin-left: 190px; + display: block; } - @media (max-width: 991px) { - .error-page > .error-content { - margin-left: 0; - } + .error-page > .error-content { + margin-left: 0; + } } - .error-page > .error-content > h3 { - font-weight: 300; - font-size: 25px; + font-weight: 300; + font-size: 25px; } - @media (max-width: 991px) { - .error-page > .error-content > h3 { - text-align: center; - } + .error-page > .error-content > h3 { + text-align: center; + } } - /* * Page: Invoice * ------------- */ .invoice { - position: relative; - background: #fff; - border: 1px solid #f4f4f4; - padding: 20px; - margin: 10px 25px; + position: relative; + background: #fff; + border: 1px solid #f4f4f4; + padding: 20px; + margin: 10px 25px; } - .invoice-title { - margin-top: 0; + margin-top: 0; } - /* * Page: Profile * ------------- */ .profile-user-img { - margin: 0 auto; - width: 100px; - padding: 3px; - border: 3px solid #d2d6de; + margin: 0 auto; + width: 100px; + padding: 3px; + border: 3px solid #d2d6de; } - .profile-username { - font-size: 21px; - margin-top: 5px; + font-size: 21px; + margin-top: 5px; } - .post { - border-bottom: 1px solid #d2d6de; - margin-bottom: 15px; - padding-bottom: 15px; - color: #666; + border-bottom: 1px solid #d2d6de; + margin-bottom: 15px; + padding-bottom: 15px; + color: #666; } - .post:last-of-type { - border-bottom: 0; - margin-bottom: 0; - padding-bottom: 0; + border-bottom: 0; + margin-bottom: 0; + padding-bottom: 0; } - .post .user-block { - margin-bottom: 15px; + margin-bottom: 15px; } - -/* - * Social Buttons for Bootstrap - * - * Copyright 2013-2015 Panayiotis Lipiridis - * Licensed under the MIT License - * - * https://github.com/lipis/bootstrap-social - */ .btn-social { - position: relative; - padding-left: 44px; - text-align: left; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + position: relative; + padding-left: 44px; + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } - .btn-social > :first-child { - position: absolute; - left: 0; - top: 0; - bottom: 0; - width: 32px; - line-height: 34px; - font-size: 1.6em; - text-align: center; - border-right: 1px solid rgba(0, 0, 0, 0.2); + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 32px; + line-height: 34px; + font-size: 1.6em; + text-align: center; + border-right: 1px solid rgba(0, 0, 0, 0.2); } - .btn-social.btn-lg { - padding-left: 61px; + padding-left: 61px; } - .btn-social.btn-lg > :first-child { - line-height: 45px; - width: 45px; - font-size: 1.8em; + line-height: 45px; + width: 45px; + font-size: 1.8em; } - .btn-social.btn-sm { - padding-left: 38px; + padding-left: 38px; } - .btn-social.btn-sm > :first-child { - line-height: 28px; - width: 28px; - font-size: 1.4em; + line-height: 28px; + width: 28px; + font-size: 1.4em; } - .btn-social.btn-xs { - padding-left: 30px; + padding-left: 30px; } - .btn-social.btn-xs > :first-child { - line-height: 20px; - width: 20px; - font-size: 1.2em; + line-height: 20px; + width: 20px; + font-size: 1.2em; } - .btn-social-icon { - position: relative; - padding-left: 44px; - text-align: left; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - height: 34px; - width: 34px; - padding: 0; + position: relative; + padding-left: 44px; + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + height: 34px; + width: 34px; + padding: 0; } - .btn-social-icon > :first-child { - position: absolute; - left: 0; - top: 0; - bottom: 0; - width: 32px; - line-height: 34px; - font-size: 1.6em; - text-align: center; - border-right: 1px solid rgba(0, 0, 0, 0.2); + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 32px; + line-height: 34px; + font-size: 1.6em; + text-align: center; + border-right: 1px solid rgba(0, 0, 0, 0.2); } - .btn-social-icon.btn-lg { - padding-left: 61px; + padding-left: 61px; } - .btn-social-icon.btn-lg > :first-child { - line-height: 45px; - width: 45px; - font-size: 1.8em; + line-height: 45px; + width: 45px; + font-size: 1.8em; } - .btn-social-icon.btn-sm { - padding-left: 38px; + padding-left: 38px; } - .btn-social-icon.btn-sm > :first-child { - line-height: 28px; - width: 28px; - font-size: 1.4em; + line-height: 28px; + width: 28px; + font-size: 1.4em; } - .btn-social-icon.btn-xs { - padding-left: 30px; + padding-left: 30px; } - .btn-social-icon.btn-xs > :first-child { - line-height: 20px; - width: 20px; - font-size: 1.2em; + line-height: 20px; + width: 20px; + font-size: 1.2em; } - .btn-social-icon > :first-child { - border: none; - text-align: center; - width: 100%; + border: none; + text-align: center; + width: 100%; } - .btn-social-icon.btn-lg { - height: 45px; - width: 45px; - padding-left: 0; - padding-right: 0; + height: 45px; + width: 45px; + padding-left: 0; + padding-right: 0; } - .btn-social-icon.btn-sm { - height: 30px; - width: 30px; - padding-left: 0; - padding-right: 0; + height: 30px; + width: 30px; + padding-left: 0; + padding-right: 0; } - .btn-social-icon.btn-xs { - height: 22px; - width: 22px; - padding-left: 0; - padding-right: 0; + height: 22px; + width: 22px; + padding-left: 0; + padding-right: 0; } - .btn-adn { - color: #ffffff; - background-color: #d87a68; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #d87a68; + border-color: rgba(0, 0, 0, 0.2); } - .btn-adn:focus, .btn-adn.focus { - color: #ffffff; - background-color: #ce563f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #ce563f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-adn:hover { - color: #ffffff; - background-color: #ce563f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #ce563f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-adn:active, .btn-adn.active, .open > .dropdown-toggle.btn-adn { - color: #ffffff; - background-color: #ce563f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #ce563f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-adn:active, .btn-adn.active, .open > .dropdown-toggle.btn-adn { - background-image: none; + background-image: none; } - .btn-adn .badge { - color: #d87a68; - background-color: #ffffff; + color: #d87a68; + background-color: #ffffff; +} +.btn-adn:focus, +.btn-adn.focus { + color: #ffffff; + background-color: #ce563f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-adn:hover { + color: #ffffff; + background-color: #ce563f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-adn:active, +.btn-adn.active, +.open > .dropdown-toggle.btn-adn { + color: #ffffff; + background-color: #ce563f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-adn:active, +.btn-adn.active, +.open > .dropdown-toggle.btn-adn { + background-image: none; +} +.btn-adn .badge { + color: #d87a68; + background-color: #ffffff; } - .btn-bitbucket { - color: #ffffff; - background-color: #205081; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #205081; + border-color: rgba(0, 0, 0, 0.2); } - .btn-bitbucket:focus, .btn-bitbucket.focus { - color: #ffffff; - background-color: #163758; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #163758; + border-color: rgba(0, 0, 0, 0.2); } - .btn-bitbucket:hover { - color: #ffffff; - background-color: #163758; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #163758; + border-color: rgba(0, 0, 0, 0.2); } - .btn-bitbucket:active, .btn-bitbucket.active, .open > .dropdown-toggle.btn-bitbucket { - color: #ffffff; - background-color: #163758; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #163758; + border-color: rgba(0, 0, 0, 0.2); } - .btn-bitbucket:active, .btn-bitbucket.active, .open > .dropdown-toggle.btn-bitbucket { - background-image: none; + background-image: none; } - .btn-bitbucket .badge { - color: #205081; - background-color: #ffffff; + color: #205081; + background-color: #ffffff; +} +.btn-bitbucket:focus, +.btn-bitbucket.focus { + color: #ffffff; + background-color: #163758; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-bitbucket:hover { + color: #ffffff; + background-color: #163758; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-bitbucket:active, +.btn-bitbucket.active, +.open > .dropdown-toggle.btn-bitbucket { + color: #ffffff; + background-color: #163758; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-bitbucket:active, +.btn-bitbucket.active, +.open > .dropdown-toggle.btn-bitbucket { + background-image: none; +} +.btn-bitbucket .badge { + color: #205081; + background-color: #ffffff; } - .btn-dropbox { - color: #ffffff; - background-color: #1087dd; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #1087dd; + border-color: rgba(0, 0, 0, 0.2); } - .btn-dropbox:focus, .btn-dropbox.focus { - color: #ffffff; - background-color: #0d6aad; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #0d6aad; + border-color: rgba(0, 0, 0, 0.2); } - .btn-dropbox:hover { - color: #ffffff; - background-color: #0d6aad; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #0d6aad; + border-color: rgba(0, 0, 0, 0.2); } - .btn-dropbox:active, .btn-dropbox.active, .open > .dropdown-toggle.btn-dropbox { - color: #ffffff; - background-color: #0d6aad; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #0d6aad; + border-color: rgba(0, 0, 0, 0.2); } - .btn-dropbox:active, .btn-dropbox.active, .open > .dropdown-toggle.btn-dropbox { - background-image: none; + background-image: none; } - .btn-dropbox .badge { - color: #1087dd; - background-color: #ffffff; + color: #1087dd; + background-color: #ffffff; +} +.btn-dropbox:focus, +.btn-dropbox.focus { + color: #ffffff; + background-color: #0d6aad; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-dropbox:hover { + color: #ffffff; + background-color: #0d6aad; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-dropbox:active, +.btn-dropbox.active, +.open > .dropdown-toggle.btn-dropbox { + color: #ffffff; + background-color: #0d6aad; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-dropbox:active, +.btn-dropbox.active, +.open > .dropdown-toggle.btn-dropbox { + background-image: none; +} +.btn-dropbox .badge { + color: #1087dd; + background-color: #ffffff; } - .btn-facebook { - color: #ffffff; - background-color: #3b5998; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #3b5998; + border-color: rgba(0, 0, 0, 0.2); } - .btn-facebook:focus, .btn-facebook.focus { - color: #ffffff; - background-color: #2d4373; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2d4373; + border-color: rgba(0, 0, 0, 0.2); } - .btn-facebook:hover { - color: #ffffff; - background-color: #2d4373; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2d4373; + border-color: rgba(0, 0, 0, 0.2); } - .btn-facebook:active, .btn-facebook.active, .open > .dropdown-toggle.btn-facebook { - color: #ffffff; - background-color: #2d4373; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2d4373; + border-color: rgba(0, 0, 0, 0.2); } - .btn-facebook:active, .btn-facebook.active, .open > .dropdown-toggle.btn-facebook { - background-image: none; + background-image: none; } - .btn-facebook .badge { - color: #3b5998; - background-color: #ffffff; + color: #3b5998; + background-color: #ffffff; +} +.btn-facebook:focus, +.btn-facebook.focus { + color: #ffffff; + background-color: #2d4373; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-facebook:hover { + color: #ffffff; + background-color: #2d4373; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-facebook:active, +.btn-facebook.active, +.open > .dropdown-toggle.btn-facebook { + color: #ffffff; + background-color: #2d4373; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-facebook:active, +.btn-facebook.active, +.open > .dropdown-toggle.btn-facebook { + background-image: none; +} +.btn-facebook .badge { + color: #3b5998; + background-color: #ffffff; } - .btn-flickr { - color: #ffffff; - background-color: #ff0084; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #ff0084; + border-color: rgba(0, 0, 0, 0.2); } - .btn-flickr:focus, .btn-flickr.focus { - color: #ffffff; - background-color: #cc006a; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #cc006a; + border-color: rgba(0, 0, 0, 0.2); } - .btn-flickr:hover { - color: #ffffff; - background-color: #cc006a; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #cc006a; + border-color: rgba(0, 0, 0, 0.2); } - .btn-flickr:active, .btn-flickr.active, .open > .dropdown-toggle.btn-flickr { - color: #ffffff; - background-color: #cc006a; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #cc006a; + border-color: rgba(0, 0, 0, 0.2); } - .btn-flickr:active, .btn-flickr.active, .open > .dropdown-toggle.btn-flickr { - background-image: none; + background-image: none; } - .btn-flickr .badge { - color: #ff0084; - background-color: #ffffff; + color: #ff0084; + background-color: #ffffff; +} +.btn-flickr:focus, +.btn-flickr.focus { + color: #ffffff; + background-color: #cc006a; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-flickr:hover { + color: #ffffff; + background-color: #cc006a; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-flickr:active, +.btn-flickr.active, +.open > .dropdown-toggle.btn-flickr { + color: #ffffff; + background-color: #cc006a; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-flickr:active, +.btn-flickr.active, +.open > .dropdown-toggle.btn-flickr { + background-image: none; +} +.btn-flickr .badge { + color: #ff0084; + background-color: #ffffff; } - .btn-foursquare { - color: #ffffff; - background-color: #f94877; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #f94877; + border-color: rgba(0, 0, 0, 0.2); } - .btn-foursquare:focus, .btn-foursquare.focus { - color: #ffffff; - background-color: #f71752; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #f71752; + border-color: rgba(0, 0, 0, 0.2); } - .btn-foursquare:hover { - color: #ffffff; - background-color: #f71752; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #f71752; + border-color: rgba(0, 0, 0, 0.2); } - .btn-foursquare:active, .btn-foursquare.active, .open > .dropdown-toggle.btn-foursquare { - color: #ffffff; - background-color: #f71752; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #f71752; + border-color: rgba(0, 0, 0, 0.2); } - .btn-foursquare:active, .btn-foursquare.active, .open > .dropdown-toggle.btn-foursquare { - background-image: none; + background-image: none; } - .btn-foursquare .badge { - color: #f94877; - background-color: #ffffff; + color: #f94877; + background-color: #ffffff; +} +.btn-foursquare:focus, +.btn-foursquare.focus { + color: #ffffff; + background-color: #f71752; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-foursquare:hover { + color: #ffffff; + background-color: #f71752; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-foursquare:active, +.btn-foursquare.active, +.open > .dropdown-toggle.btn-foursquare { + color: #ffffff; + background-color: #f71752; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-foursquare:active, +.btn-foursquare.active, +.open > .dropdown-toggle.btn-foursquare { + background-image: none; +} +.btn-foursquare .badge { + color: #f94877; + background-color: #ffffff; } - .btn-github { - color: #ffffff; - background-color: #444444; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #444444; + border-color: rgba(0, 0, 0, 0.2); } - .btn-github:focus, .btn-github.focus { - color: #ffffff; - background-color: #2b2b2b; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2b2b2b; + border-color: rgba(0, 0, 0, 0.2); } - .btn-github:hover { - color: #ffffff; - background-color: #2b2b2b; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2b2b2b; + border-color: rgba(0, 0, 0, 0.2); } - .btn-github:active, .btn-github.active, .open > .dropdown-toggle.btn-github { - color: #ffffff; - background-color: #2b2b2b; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2b2b2b; + border-color: rgba(0, 0, 0, 0.2); } - .btn-github:active, .btn-github.active, .open > .dropdown-toggle.btn-github { - background-image: none; + background-image: none; } - .btn-github .badge { - color: #444444; - background-color: #ffffff; + color: #444444; + background-color: #ffffff; +} +.btn-github:focus, +.btn-github.focus { + color: #ffffff; + background-color: #2b2b2b; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-github:hover { + color: #ffffff; + background-color: #2b2b2b; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-github:active, +.btn-github.active, +.open > .dropdown-toggle.btn-github { + color: #ffffff; + background-color: #2b2b2b; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-github:active, +.btn-github.active, +.open > .dropdown-toggle.btn-github { + background-image: none; +} +.btn-github .badge { + color: #444444; + background-color: #ffffff; } - .btn-google { - color: #ffffff; - background-color: #dd4b39; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #dd4b39; + border-color: rgba(0, 0, 0, 0.2); } - .btn-google:focus, .btn-google.focus { - color: #ffffff; - background-color: #c23321; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #c23321; + border-color: rgba(0, 0, 0, 0.2); } - .btn-google:hover { - color: #ffffff; - background-color: #c23321; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #c23321; + border-color: rgba(0, 0, 0, 0.2); } - .btn-google:active, .btn-google.active, .open > .dropdown-toggle.btn-google { - color: #ffffff; - background-color: #c23321; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #c23321; + border-color: rgba(0, 0, 0, 0.2); } - .btn-google:active, .btn-google.active, .open > .dropdown-toggle.btn-google { - background-image: none; + background-image: none; } - .btn-google .badge { - color: #dd4b39; - background-color: #ffffff; + color: #dd4b39; + background-color: #ffffff; +} +.btn-google:focus, +.btn-google.focus { + color: #ffffff; + background-color: #c23321; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-google:hover { + color: #ffffff; + background-color: #c23321; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-google:active, +.btn-google.active, +.open > .dropdown-toggle.btn-google { + color: #ffffff; + background-color: #c23321; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-google:active, +.btn-google.active, +.open > .dropdown-toggle.btn-google { + background-image: none; +} +.btn-google .badge { + color: #dd4b39; + background-color: #ffffff; } - .btn-instagram { - color: #ffffff; - background-color: #3f729b; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #3f729b; + border-color: rgba(0, 0, 0, 0.2); } - .btn-instagram:focus, .btn-instagram.focus { - color: #ffffff; - background-color: #305777; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #305777; + border-color: rgba(0, 0, 0, 0.2); } - .btn-instagram:hover { - color: #ffffff; - background-color: #305777; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #305777; + border-color: rgba(0, 0, 0, 0.2); } - .btn-instagram:active, .btn-instagram.active, .open > .dropdown-toggle.btn-instagram { - color: #ffffff; - background-color: #305777; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #305777; + border-color: rgba(0, 0, 0, 0.2); } - .btn-instagram:active, .btn-instagram.active, .open > .dropdown-toggle.btn-instagram { - background-image: none; + background-image: none; } - .btn-instagram .badge { - color: #3f729b; - background-color: #ffffff; + color: #3f729b; + background-color: #ffffff; +} +.btn-instagram:focus, +.btn-instagram.focus { + color: #ffffff; + background-color: #305777; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-instagram:hover { + color: #ffffff; + background-color: #305777; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-instagram:active, +.btn-instagram.active, +.open > .dropdown-toggle.btn-instagram { + color: #ffffff; + background-color: #305777; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-instagram:active, +.btn-instagram.active, +.open > .dropdown-toggle.btn-instagram { + background-image: none; +} +.btn-instagram .badge { + color: #3f729b; + background-color: #ffffff; } - .btn-linkedin { - color: #ffffff; - background-color: #007bb6; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #007bb6; + border-color: rgba(0, 0, 0, 0.2); } - .btn-linkedin:focus, .btn-linkedin.focus { - color: #ffffff; - background-color: #005983; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #005983; + border-color: rgba(0, 0, 0, 0.2); } - .btn-linkedin:hover { - color: #ffffff; - background-color: #005983; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #005983; + border-color: rgba(0, 0, 0, 0.2); } - .btn-linkedin:active, .btn-linkedin.active, .open > .dropdown-toggle.btn-linkedin { - color: #ffffff; - background-color: #005983; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #005983; + border-color: rgba(0, 0, 0, 0.2); } - .btn-linkedin:active, .btn-linkedin.active, .open > .dropdown-toggle.btn-linkedin { - background-image: none; + background-image: none; } - .btn-linkedin .badge { - color: #007bb6; - background-color: #ffffff; + color: #007bb6; + background-color: #ffffff; +} +.btn-linkedin:focus, +.btn-linkedin.focus { + color: #ffffff; + background-color: #005983; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-linkedin:hover { + color: #ffffff; + background-color: #005983; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-linkedin:active, +.btn-linkedin.active, +.open > .dropdown-toggle.btn-linkedin { + color: #ffffff; + background-color: #005983; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-linkedin:active, +.btn-linkedin.active, +.open > .dropdown-toggle.btn-linkedin { + background-image: none; +} +.btn-linkedin .badge { + color: #007bb6; + background-color: #ffffff; } - .btn-microsoft { - color: #ffffff; - background-color: #2672ec; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2672ec; + border-color: rgba(0, 0, 0, 0.2); } - .btn-microsoft:focus, .btn-microsoft.focus { - color: #ffffff; - background-color: #125acd; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #125acd; + border-color: rgba(0, 0, 0, 0.2); } - .btn-microsoft:hover { - color: #ffffff; - background-color: #125acd; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #125acd; + border-color: rgba(0, 0, 0, 0.2); } - .btn-microsoft:active, .btn-microsoft.active, .open > .dropdown-toggle.btn-microsoft { - color: #ffffff; - background-color: #125acd; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #125acd; + border-color: rgba(0, 0, 0, 0.2); } - .btn-microsoft:active, .btn-microsoft.active, .open > .dropdown-toggle.btn-microsoft { - background-image: none; + background-image: none; } - .btn-microsoft .badge { - color: #2672ec; - background-color: #ffffff; + color: #2672ec; + background-color: #ffffff; +} +.btn-microsoft:focus, +.btn-microsoft.focus { + color: #ffffff; + background-color: #125acd; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-microsoft:hover { + color: #ffffff; + background-color: #125acd; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-microsoft:active, +.btn-microsoft.active, +.open > .dropdown-toggle.btn-microsoft { + color: #ffffff; + background-color: #125acd; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-microsoft:active, +.btn-microsoft.active, +.open > .dropdown-toggle.btn-microsoft { + background-image: none; +} +.btn-microsoft .badge { + color: #2672ec; + background-color: #ffffff; } - .btn-openid { - color: #ffffff; - background-color: #f7931e; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #f7931e; + border-color: rgba(0, 0, 0, 0.2); } - .btn-openid:focus, .btn-openid.focus { - color: #ffffff; - background-color: #da7908; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #da7908; + border-color: rgba(0, 0, 0, 0.2); } - .btn-openid:hover { - color: #ffffff; - background-color: #da7908; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #da7908; + border-color: rgba(0, 0, 0, 0.2); } - .btn-openid:active, .btn-openid.active, .open > .dropdown-toggle.btn-openid { - color: #ffffff; - background-color: #da7908; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #da7908; + border-color: rgba(0, 0, 0, 0.2); } - .btn-openid:active, .btn-openid.active, .open > .dropdown-toggle.btn-openid { - background-image: none; + background-image: none; } - .btn-openid .badge { - color: #f7931e; - background-color: #ffffff; + color: #f7931e; + background-color: #ffffff; +} +.btn-openid:focus, +.btn-openid.focus { + color: #ffffff; + background-color: #da7908; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-openid:hover { + color: #ffffff; + background-color: #da7908; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-openid:active, +.btn-openid.active, +.open > .dropdown-toggle.btn-openid { + color: #ffffff; + background-color: #da7908; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-openid:active, +.btn-openid.active, +.open > .dropdown-toggle.btn-openid { + background-image: none; +} +.btn-openid .badge { + color: #f7931e; + background-color: #ffffff; } - .btn-pinterest { - color: #ffffff; - background-color: #cb2027; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #cb2027; + border-color: rgba(0, 0, 0, 0.2); } - .btn-pinterest:focus, .btn-pinterest.focus { - color: #ffffff; - background-color: #9f191f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #9f191f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-pinterest:hover { - color: #ffffff; - background-color: #9f191f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #9f191f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-pinterest:active, .btn-pinterest.active, .open > .dropdown-toggle.btn-pinterest { - color: #ffffff; - background-color: #9f191f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #9f191f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-pinterest:active, .btn-pinterest.active, .open > .dropdown-toggle.btn-pinterest { - background-image: none; + background-image: none; } - .btn-pinterest .badge { - color: #cb2027; - background-color: #ffffff; + color: #cb2027; + background-color: #ffffff; +} +.btn-pinterest:focus, +.btn-pinterest.focus { + color: #ffffff; + background-color: #9f191f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-pinterest:hover { + color: #ffffff; + background-color: #9f191f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-pinterest:active, +.btn-pinterest.active, +.open > .dropdown-toggle.btn-pinterest { + color: #ffffff; + background-color: #9f191f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-pinterest:active, +.btn-pinterest.active, +.open > .dropdown-toggle.btn-pinterest { + background-image: none; +} +.btn-pinterest .badge { + color: #cb2027; + background-color: #ffffff; } - .btn-reddit { - color: #000000; - background-color: #eff7ff; - border-color: rgba(0, 0, 0, 0.2); + color: #000000; + background-color: #eff7ff; + border-color: rgba(0, 0, 0, 0.2); } - .btn-reddit:focus, .btn-reddit.focus { - color: #000000; - background-color: #bcddff; - border-color: rgba(0, 0, 0, 0.2); + color: #000000; + background-color: #bcddff; + border-color: rgba(0, 0, 0, 0.2); } - .btn-reddit:hover { - color: #000000; - background-color: #bcddff; - border-color: rgba(0, 0, 0, 0.2); + color: #000000; + background-color: #bcddff; + border-color: rgba(0, 0, 0, 0.2); } - .btn-reddit:active, .btn-reddit.active, .open > .dropdown-toggle.btn-reddit { - color: #000000; - background-color: #bcddff; - border-color: rgba(0, 0, 0, 0.2); + color: #000000; + background-color: #bcddff; + border-color: rgba(0, 0, 0, 0.2); } - .btn-reddit:active, .btn-reddit.active, .open > .dropdown-toggle.btn-reddit { - background-image: none; + background-image: none; } - .btn-reddit .badge { - color: #eff7ff; - background-color: #000000; + color: #eff7ff; + background-color: #000000; +} +.btn-reddit:focus, +.btn-reddit.focus { + color: #000000; + background-color: #bcddff; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-reddit:hover { + color: #000000; + background-color: #bcddff; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-reddit:active, +.btn-reddit.active, +.open > .dropdown-toggle.btn-reddit { + color: #000000; + background-color: #bcddff; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-reddit:active, +.btn-reddit.active, +.open > .dropdown-toggle.btn-reddit { + background-image: none; +} +.btn-reddit .badge { + color: #eff7ff; + background-color: #000000; } - .btn-soundcloud { - color: #ffffff; - background-color: #ff5500; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #ff5500; + border-color: rgba(0, 0, 0, 0.2); } - .btn-soundcloud:focus, .btn-soundcloud.focus { - color: #ffffff; - background-color: #cc4400; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #cc4400; + border-color: rgba(0, 0, 0, 0.2); } - .btn-soundcloud:hover { - color: #ffffff; - background-color: #cc4400; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #cc4400; + border-color: rgba(0, 0, 0, 0.2); } - .btn-soundcloud:active, .btn-soundcloud.active, .open > .dropdown-toggle.btn-soundcloud { - color: #ffffff; - background-color: #cc4400; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #cc4400; + border-color: rgba(0, 0, 0, 0.2); } - .btn-soundcloud:active, .btn-soundcloud.active, .open > .dropdown-toggle.btn-soundcloud { - background-image: none; + background-image: none; } - .btn-soundcloud .badge { - color: #ff5500; - background-color: #ffffff; + color: #ff5500; + background-color: #ffffff; +} +.btn-soundcloud:focus, +.btn-soundcloud.focus { + color: #ffffff; + background-color: #cc4400; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-soundcloud:hover { + color: #ffffff; + background-color: #cc4400; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-soundcloud:active, +.btn-soundcloud.active, +.open > .dropdown-toggle.btn-soundcloud { + color: #ffffff; + background-color: #cc4400; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-soundcloud:active, +.btn-soundcloud.active, +.open > .dropdown-toggle.btn-soundcloud { + background-image: none; +} +.btn-soundcloud .badge { + color: #ff5500; + background-color: #ffffff; } - .btn-tumblr { - color: #ffffff; - background-color: #2c4762; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2c4762; + border-color: rgba(0, 0, 0, 0.2); } - .btn-tumblr:focus, .btn-tumblr.focus { - color: #ffffff; - background-color: #1c2d3f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #1c2d3f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-tumblr:hover { - color: #ffffff; - background-color: #1c2d3f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #1c2d3f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-tumblr:active, .btn-tumblr.active, .open > .dropdown-toggle.btn-tumblr { - color: #ffffff; - background-color: #1c2d3f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #1c2d3f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-tumblr:active, .btn-tumblr.active, .open > .dropdown-toggle.btn-tumblr { - background-image: none; + background-image: none; } - .btn-tumblr .badge { - color: #2c4762; - background-color: #ffffff; + color: #2c4762; + background-color: #ffffff; +} +.btn-tumblr:focus, +.btn-tumblr.focus { + color: #ffffff; + background-color: #1c2d3f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-tumblr:hover { + color: #ffffff; + background-color: #1c2d3f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-tumblr:active, +.btn-tumblr.active, +.open > .dropdown-toggle.btn-tumblr { + color: #ffffff; + background-color: #1c2d3f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-tumblr:active, +.btn-tumblr.active, +.open > .dropdown-toggle.btn-tumblr { + background-image: none; +} +.btn-tumblr .badge { + color: #2c4762; + background-color: #ffffff; } - .btn-twitter { - color: #ffffff; - background-color: #55acee; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #55acee; + border-color: rgba(0, 0, 0, 0.2); } - .btn-twitter:focus, .btn-twitter.focus { - color: #ffffff; - background-color: #2795e9; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2795e9; + border-color: rgba(0, 0, 0, 0.2); } - .btn-twitter:hover { - color: #ffffff; - background-color: #2795e9; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2795e9; + border-color: rgba(0, 0, 0, 0.2); } - .btn-twitter:active, .btn-twitter.active, .open > .dropdown-toggle.btn-twitter { - color: #ffffff; - background-color: #2795e9; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #2795e9; + border-color: rgba(0, 0, 0, 0.2); } - .btn-twitter:active, .btn-twitter.active, .open > .dropdown-toggle.btn-twitter { - background-image: none; + background-image: none; } - .btn-twitter .badge { - color: #55acee; - background-color: #ffffff; + color: #55acee; + background-color: #ffffff; +} +.btn-twitter:focus, +.btn-twitter.focus { + color: #ffffff; + background-color: #2795e9; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-twitter:hover { + color: #ffffff; + background-color: #2795e9; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-twitter:active, +.btn-twitter.active, +.open > .dropdown-toggle.btn-twitter { + color: #ffffff; + background-color: #2795e9; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-twitter:active, +.btn-twitter.active, +.open > .dropdown-toggle.btn-twitter { + background-image: none; +} +.btn-twitter .badge { + color: #55acee; + background-color: #ffffff; } - .btn-vimeo { - color: #ffffff; - background-color: #1ab7ea; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #1ab7ea; + border-color: rgba(0, 0, 0, 0.2); } - .btn-vimeo:focus, .btn-vimeo.focus { - color: #ffffff; - background-color: #1295bf; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #1295bf; + border-color: rgba(0, 0, 0, 0.2); } - .btn-vimeo:hover { - color: #ffffff; - background-color: #1295bf; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #1295bf; + border-color: rgba(0, 0, 0, 0.2); } - .btn-vimeo:active, .btn-vimeo.active, .open > .dropdown-toggle.btn-vimeo { - color: #ffffff; - background-color: #1295bf; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #1295bf; + border-color: rgba(0, 0, 0, 0.2); } - .btn-vimeo:active, .btn-vimeo.active, .open > .dropdown-toggle.btn-vimeo { - background-image: none; + background-image: none; } - .btn-vimeo .badge { - color: #1ab7ea; - background-color: #ffffff; + color: #1ab7ea; + background-color: #ffffff; +} +.btn-vimeo:focus, +.btn-vimeo.focus { + color: #ffffff; + background-color: #1295bf; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vimeo:hover { + color: #ffffff; + background-color: #1295bf; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vimeo:active, +.btn-vimeo.active, +.open > .dropdown-toggle.btn-vimeo { + color: #ffffff; + background-color: #1295bf; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vimeo:active, +.btn-vimeo.active, +.open > .dropdown-toggle.btn-vimeo { + background-image: none; +} +.btn-vimeo .badge { + color: #1ab7ea; + background-color: #ffffff; } - .btn-vk { - color: #ffffff; - background-color: #587ea3; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #587ea3; + border-color: rgba(0, 0, 0, 0.2); } - .btn-vk:focus, .btn-vk.focus { - color: #ffffff; - background-color: #466482; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #466482; + border-color: rgba(0, 0, 0, 0.2); } - .btn-vk:hover { - color: #ffffff; - background-color: #466482; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #466482; + border-color: rgba(0, 0, 0, 0.2); } - .btn-vk:active, .btn-vk.active, .open > .dropdown-toggle.btn-vk { - color: #ffffff; - background-color: #466482; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #466482; + border-color: rgba(0, 0, 0, 0.2); } - .btn-vk:active, .btn-vk.active, .open > .dropdown-toggle.btn-vk { - background-image: none; + background-image: none; } - .btn-vk .badge { - color: #587ea3; - background-color: #ffffff; + color: #587ea3; + background-color: #ffffff; +} +.btn-vk:focus, +.btn-vk.focus { + color: #ffffff; + background-color: #466482; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vk:hover { + color: #ffffff; + background-color: #466482; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vk:active, +.btn-vk.active, +.open > .dropdown-toggle.btn-vk { + color: #ffffff; + background-color: #466482; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-vk:active, +.btn-vk.active, +.open > .dropdown-toggle.btn-vk { + background-image: none; +} +.btn-vk .badge { + color: #587ea3; + background-color: #ffffff; } - .btn-yahoo { - color: #ffffff; - background-color: #720e9e; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #720e9e; + border-color: rgba(0, 0, 0, 0.2); } - .btn-yahoo:focus, .btn-yahoo.focus { - color: #ffffff; - background-color: #500a6f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #500a6f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-yahoo:hover { - color: #ffffff; - background-color: #500a6f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #500a6f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-yahoo:active, .btn-yahoo.active, .open > .dropdown-toggle.btn-yahoo { - color: #ffffff; - background-color: #500a6f; - border-color: rgba(0, 0, 0, 0.2); + color: #ffffff; + background-color: #500a6f; + border-color: rgba(0, 0, 0, 0.2); } - .btn-yahoo:active, .btn-yahoo.active, .open > .dropdown-toggle.btn-yahoo { - background-image: none; + background-image: none; } - .btn-yahoo .badge { - color: #720e9e; - background-color: #ffffff; + color: #720e9e; + background-color: #ffffff; +} +.btn-yahoo:focus, +.btn-yahoo.focus { + color: #ffffff; + background-color: #500a6f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-yahoo:hover { + color: #ffffff; + background-color: #500a6f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-yahoo:active, +.btn-yahoo.active, +.open > .dropdown-toggle.btn-yahoo { + color: #ffffff; + background-color: #500a6f; + border-color: rgba(0, 0, 0, 0.2); +} +.btn-yahoo:active, +.btn-yahoo.active, +.open > .dropdown-toggle.btn-yahoo { + background-image: none; +} +.btn-yahoo .badge { + color: #720e9e; + background-color: #ffffff; } - /* * Plugin: Full Calendar * --------------------- */ .fc-button { - background: #f4f4f4; - background-image: none; - color: #444; - border-color: #ddd; - border-bottom-color: #ddd; + background: #f4f4f4; + background-image: none; + color: #444; + border-color: #ddd; + border-bottom-color: #ddd; } - .fc-button:hover, .fc-button:active, .fc-button.hover { - background-color: #e9e9e9; + background-color: #e9e9e9; } - .fc-header-title h2 { - font-size: 15px; - line-height: 1.6em; - color: #666; - margin-left: 10px; + font-size: 15px; + line-height: 1.6em; + color: #666; + margin-left: 10px; } - .fc-header-right { - padding-right: 10px; + padding-right: 10px; } - .fc-header-left { - padding-left: 10px; + padding-left: 10px; } - .fc-widget-header { - background: #fafafa; + background: #fafafa; } - .fc-grid { - width: 100%; - border: 0; + width: 100%; + border: 0; } - .fc-widget-header:first-of-type, .fc-widget-content:first-of-type { - border-left: 0; - border-right: 0; + border-left: 0; + border-right: 0; } - .fc-widget-header:last-of-type, .fc-widget-content:last-of-type { - border-right: 0; + border-right: 0; } - .fc-toolbar { - padding: 10px; - margin: 0; + padding: 10px; + margin: 0; } - .fc-day-number { - font-size: 20px; - font-weight: 300; - padding-right: 10px; + font-size: 20px; + font-weight: 300; + padding-right: 10px; } - .fc-color-picker { - list-style: none; - margin: 0; - padding: 0; + list-style: none; + margin: 0; + padding: 0; } - .fc-color-picker > li { - float: left; - font-size: 30px; - margin-right: 5px; - line-height: 30px; + float: left; + font-size: 30px; + margin-right: 5px; + line-height: 30px; } - .fc-color-picker > li .fa { - -webkit-transition: -webkit-transform linear 0.3s; - -moz-transition: -moz-transform linear 0.3s; - -o-transition: -o-transform linear 0.3s; - transition: transform linear 0.3s; + -webkit-transition: -webkit-transform linear 0.3s; + -moz-transition: -moz-transform linear 0.3s; + -o-transition: -o-transform linear 0.3s; + transition: transform linear 0.3s; } - .fc-color-picker > li .fa:hover { - -webkit-transform: rotate(30deg); - -ms-transform: rotate(30deg); - -o-transform: rotate(30deg); - transform: rotate(30deg); + -webkit-transform: rotate(30deg); + -ms-transform: rotate(30deg); + -o-transform: rotate(30deg); + transform: rotate(30deg); } - #add-new-event { - -webkit-transition: all linear 0.3s; - -o-transition: all linear 0.3s; - transition: all linear 0.3s; + -webkit-transition: all linear 0.3s; + -o-transition: all linear 0.3s; + transition: all linear 0.3s; } - .external-event { - padding: 5px 10px; - font-weight: bold; - margin-bottom: 4px; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - border-radius: 3px; - cursor: move; + padding: 5px 10px; + font-weight: bold; + margin-bottom: 4px; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); + border-radius: 3px; + cursor: move; } - .external-event:hover { - box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.2); + box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.2); } - /* * Plugin: Select2 * --------------- @@ -5018,164 +4930,157 @@ table.text-center th { .select2-selection:focus, .select2-container--default:active, .select2-selection:active { - outline: none; + outline: none; } - .select2-container--default .select2-selection--single, .select2-selection .select2-selection--single { - border: 1px solid #d2d6de; - border-radius: 0; - padding: 6px 12px; - height: 34px; + border: 1px solid #d2d6de; + border-radius: 0; + padding: 6px 12px; + height: 34px; } - .select2-container--default.select2-container--open { - border-color: #3c8dbc; + border-color: #3c8dbc; } - .select2-dropdown { - border: 1px solid #d2d6de; - border-radius: 0; + border: 1px solid #d2d6de; + border-radius: 0; } - .select2-container--default .select2-results__option--highlighted[aria-selected] { - background-color: #3c8dbc; - color: white; + background-color: #3c8dbc; + color: white; } - .select2-results__option { - padding: 6px 12px; - user-select: none; - -webkit-user-select: none; + padding: 6px 12px; + user-select: none; + -webkit-user-select: none; } - .select2-container .select2-selection--single .select2-selection__rendered { - padding-left: 0; - padding-right: 0; - height: auto; - margin-top: -4px; + padding-left: 0; + padding-right: 0; + height: auto; + margin-top: -4px; } - .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { - padding-right: 6px; - padding-left: 20px; + padding-right: 6px; + padding-left: 20px; } - .select2-container--default .select2-selection--single .select2-selection__arrow { - height: 28px; - right: 3px; + height: 28px; + right: 3px; } - .select2-container--default .select2-selection--single .select2-selection__arrow b { - margin-top: 0; + margin-top: 0; } - .select2-dropdown .select2-search__field, .select2-search--inline .select2-search__field { - border: 1px solid #d2d6de; + border: 1px solid #d2d6de; } - .select2-dropdown .select2-search__field:focus, .select2-search--inline .select2-search__field:focus { - outline: none; - border: 1px solid #3c8dbc; + outline: none; +} +.select2-container--default.select2-container--focus .select2-selection--multiple, +.select2-container--default .select2-search--dropdown .select2-search__field { + border-color: #3c8dbc !important; } - .select2-container--default .select2-results__option[aria-disabled=true] { - color: #999; + color: #999; } - .select2-container--default .select2-results__option[aria-selected=true] { - background-color: #ddd; + background-color: #ddd; } - .select2-container--default .select2-results__option[aria-selected=true], .select2-container--default .select2-results__option[aria-selected=true]:hover { - color: #444; + color: #444; } - .select2-container--default .select2-selection--multiple { - border: 1px solid #d2d6de; - border-radius: 0; + border: 1px solid #d2d6de; + border-radius: 0; } - .select2-container--default .select2-selection--multiple:focus { - border-color: #3c8dbc; + border-color: #3c8dbc; } - .select2-container--default.select2-container--focus .select2-selection--multiple { - border-color: #d2d6de; + border-color: #d2d6de; } - .select2-container--default .select2-selection--multiple .select2-selection__choice { - background-color: #3c8dbc; - border-color: #367fa9; - padding: 1px 10px; - color: #fff; + background-color: #3c8dbc; + border-color: #367fa9; + padding: 1px 10px; + color: #fff; } - .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { - margin-right: 5px; - color: rgba(255, 255, 255, 0.7); + margin-right: 5px; + color: rgba(255, 255, 255, 0.7); } - .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { - color: #fff; + color: #fff; } - .select2-container .select2-selection--single .select2-selection__rendered { - padding-right: 10px; + padding-right: 10px; +} +.box .datepicker-inline, +.box .datepicker-inline .datepicker-days, +.box .datepicker-inline > table, +.box .datepicker-inline .datepicker-days > table { + width: 100%; +} +.box .datepicker-inline td:hover, +.box .datepicker-inline .datepicker-days td:hover, +.box .datepicker-inline > table td:hover, +.box .datepicker-inline .datepicker-days > table td:hover { + background-color: rgba(255, 255, 255, 0.3); +} +.box .datepicker-inline td.day.old, +.box .datepicker-inline .datepicker-days td.day.old, +.box .datepicker-inline > table td.day.old, +.box .datepicker-inline .datepicker-days > table td.day.old, +.box .datepicker-inline td.day.new, +.box .datepicker-inline .datepicker-days td.day.new, +.box .datepicker-inline > table td.day.new, +.box .datepicker-inline .datepicker-days > table td.day.new { + color: #777; } - /* * General: Miscellaneous * ---------------------- */ .pad { - padding: 10px; + padding: 10px; } - .margin { - margin: 10px; + margin: 10px; } - .margin-bottom { - margin-bottom: 20px; + margin-bottom: 20px; } - .margin-bottom-none { - margin-bottom: 0; + margin-bottom: 0; } - .margin-r-5 { - margin-right: 5px; + margin-right: 5px; } - .inline { - display: inline; + display: inline; } - .description-block { - display: block; - margin: 10px 0; - text-align: center; + display: block; + margin: 10px 0; + text-align: center; } - .description-block.margin-bottom { - margin-bottom: 25px; + margin-bottom: 25px; } - .description-block > .description-header { - margin: 0; - padding: 0; - font-weight: 600; - font-size: 16px; + margin: 0; + padding: 0; + font-weight: 600; + font-size: 16px; } - .description-block > .description-text { - text-transform: uppercase; + text-transform: uppercase; } - .bg-red, .bg-yellow, .bg-aqua, @@ -5235,660 +5140,549 @@ table.text-center th { .modal-danger .modal-body, .modal-danger .modal-header, .modal-danger .modal-footer { - color: #fff !important; + color: #fff !important; } - .bg-gray { - color: #000; - background-color: #d2d6de !important; + color: #000; + background-color: #d2d6de !important; } - .bg-gray-light { - background-color: #f7f7f7; + background-color: #f7f7f7; } - .bg-black { - background-color: #111111 !important; + background-color: #111111 !important; } - .bg-red, .callout.callout-danger, .alert-danger, .alert-error, .label-danger, .modal-danger .modal-body { - background-color: #dd4b39 !important; + background-color: #dd4b39 !important; } - .bg-yellow, .callout.callout-warning, .alert-warning, .label-warning, .modal-warning .modal-body { - background-color: #f39c12 !important; + background-color: #f39c12 !important; } - .bg-aqua, .callout.callout-info, .alert-info, .label-info, .modal-info .modal-body { - background-color: #00c0ef !important; + background-color: #00c0ef !important; } - .bg-blue { - background-color: #0073b7 !important; + background-color: #0073b7 !important; } - .bg-light-blue, .label-primary, .modal-primary .modal-body { - background-color: #3c8dbc !important; + background-color: #3c8dbc !important; } - .bg-green, .callout.callout-success, .alert-success, .label-success, .modal-success .modal-body { - background-color: #00a65a !important; + background-color: #00a65a !important; } - .bg-navy { - background-color: #001f3f !important; + background-color: #001f3f !important; } - .bg-teal { - background-color: #39cccc !important; + background-color: #39cccc !important; } - .bg-olive { - background-color: #3d9970 !important; + background-color: #3d9970 !important; } - .bg-lime { - background-color: #01ff70 !important; + background-color: #01ff70 !important; } - .bg-orange { - background-color: #ff851b !important; + background-color: #ff851b !important; } - .bg-fuchsia { - background-color: #f012be !important; + background-color: #f012be !important; } - .bg-purple { - background-color: #605ca8 !important; + background-color: #605ca8 !important; } - .bg-maroon { - background-color: #d81b60 !important; + background-color: #d81b60 !important; } - .bg-gray-active { - color: #000; - background-color: #b5bbc8 !important; + color: #000; + background-color: #b5bbc8 !important; } - .bg-black-active { - background-color: #000000 !important; + background-color: #000000 !important; } - .bg-red-active, .modal-danger .modal-header, .modal-danger .modal-footer { - background-color: #d33724 !important; + background-color: #d33724 !important; } - .bg-yellow-active, .modal-warning .modal-header, .modal-warning .modal-footer { - background-color: #db8b0b !important; + background-color: #db8b0b !important; } - .bg-aqua-active, .modal-info .modal-header, .modal-info .modal-footer { - background-color: #00a7d0 !important; + background-color: #00a7d0 !important; } - .bg-blue-active { - background-color: #005384 !important; + background-color: #005384 !important; } - .bg-light-blue-active, .modal-primary .modal-header, .modal-primary .modal-footer { - background-color: #357ca5 !important; + background-color: #357ca5 !important; } - .bg-green-active, .modal-success .modal-header, .modal-success .modal-footer { - background-color: #008d4c !important; + background-color: #008d4c !important; } - .bg-navy-active { - background-color: #001a35 !important; + background-color: #001a35 !important; } - .bg-teal-active { - background-color: #30bbbb !important; + background-color: #30bbbb !important; } - .bg-olive-active { - background-color: #368763 !important; + background-color: #368763 !important; } - .bg-lime-active { - background-color: #00e765 !important; + background-color: #00e765 !important; } - .bg-orange-active { - background-color: #ff7701 !important; + background-color: #ff7701 !important; } - .bg-fuchsia-active { - background-color: #db0ead !important; + background-color: #db0ead !important; } - .bg-purple-active { - background-color: #555299 !important; + background-color: #555299 !important; } - .bg-maroon-active { - background-color: #ca195a !important; + background-color: #ca195a !important; } - [class^="bg-"].disabled { - opacity: 0.65; - filter: alpha(opacity=65); + opacity: 0.65; + filter: alpha(opacity=65); } - .text-red { - color: #dd4b39 !important; + color: #dd4b39 !important; } - .text-yellow { - color: #f39c12 !important; + color: #f39c12 !important; } - .text-aqua { - color: #00c0ef !important; + color: #00c0ef !important; } - .text-blue { - color: #0073b7 !important; + color: #0073b7 !important; } - .text-black { - color: #111111 !important; + color: #111111 !important; } - .text-light-blue { - color: #3c8dbc !important; + color: #3c8dbc !important; } - .text-green { - color: #00a65a !important; + color: #00a65a !important; } - .text-gray { - color: #d2d6de !important; + color: #d2d6de !important; } - .text-navy { - color: #001f3f !important; + color: #001f3f !important; } - .text-teal { - color: #39cccc !important; + color: #39cccc !important; } - .text-olive { - color: #3d9970 !important; + color: #3d9970 !important; } - .text-lime { - color: #01ff70 !important; + color: #01ff70 !important; } - .text-orange { - color: #ff851b !important; + color: #ff851b !important; } - .text-fuchsia { - color: #f012be !important; + color: #f012be !important; } - .text-purple { - color: #605ca8 !important; + color: #605ca8 !important; } - .text-maroon { - color: #d81b60 !important; + color: #d81b60 !important; } - .link-muted { - color: #7a869d; + color: #7a869d; } - .link-muted:hover, .link-muted:focus { - color: #606c84; + color: #606c84; } - .link-black { - color: #666; + color: #666; } - .link-black:hover, .link-black:focus { - color: #999; + color: #999; } - .hide { - display: none !important; + display: none !important; } - .no-border { - border: 0 !important; + border: 0 !important; } - .no-padding { - padding: 0 !important; + padding: 0 !important; } - .no-margin { - margin: 0 !important; + margin: 0 !important; } - .no-shadow { - box-shadow: none !important; + box-shadow: none !important; } - .list-unstyled, .chart-legend, .contacts-list, .users-list, .mailbox-attachments { - list-style: none; - margin: 0; - padding: 0; + list-style: none; + margin: 0; + padding: 0; } - .list-group-unbordered > .list-group-item { - border-left: 0; - border-right: 0; - border-radius: 0; - padding-left: 0; - padding-right: 0; + border-left: 0; + border-right: 0; + border-radius: 0; + padding-left: 0; + padding-right: 0; } - .flat { - border-radius: 0 !important; + border-radius: 0 !important; } - .text-bold, .text-bold.table td, .text-bold.table th { - font-weight: 700; + font-weight: 700; } - .text-sm { - font-size: 12px; + font-size: 12px; } - .jqstooltip { - padding: 5px !important; - width: auto !important; - height: auto !important; + padding: 5px !important; + width: auto !important; + height: auto !important; } - .bg-teal-gradient { - background: #39cccc !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #39cccc), color-stop(1, #7adddd)) !important; - background: -ms-linear-gradient(bottom, #39cccc, #7adddd) !important; - background: -moz-linear-gradient(center bottom, #39cccc 0%, #7adddd 100%) !important; - background: -o-linear-gradient(#7adddd, #39cccc) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39cccc', GradientType=0) !important; - color: #fff; + background: #39cccc !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #39cccc), color-stop(1, #7adddd)) !important; + background: -ms-linear-gradient(bottom, #39cccc, #7adddd) !important; + background: -moz-linear-gradient(center bottom, #39cccc 0%, #7adddd 100%) !important; + background: -o-linear-gradient(#7adddd, #39cccc) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39cccc', GradientType=0) !important; + color: #fff; } - .bg-light-blue-gradient { - background: #3c8dbc !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #3c8dbc), color-stop(1, #67a8ce)) !important; - background: -ms-linear-gradient(bottom, #3c8dbc, #67a8ce) !important; - background: -moz-linear-gradient(center bottom, #3c8dbc 0%, #67a8ce 100%) !important; - background: -o-linear-gradient(#67a8ce, #3c8dbc) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#67a8ce', endColorstr='#3c8dbc', GradientType=0) !important; - color: #fff; + background: #3c8dbc !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #3c8dbc), color-stop(1, #67a8ce)) !important; + background: -ms-linear-gradient(bottom, #3c8dbc, #67a8ce) !important; + background: -moz-linear-gradient(center bottom, #3c8dbc 0%, #67a8ce 100%) !important; + background: -o-linear-gradient(#67a8ce, #3c8dbc) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#67a8ce', endColorstr='#3c8dbc', GradientType=0) !important; + color: #fff; } - .bg-blue-gradient { - background: #0073b7 !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #0073b7), color-stop(1, #0089db)) !important; - background: -ms-linear-gradient(bottom, #0073b7, #0089db) !important; - background: -moz-linear-gradient(center bottom, #0073b7 0%, #0089db 100%) !important; - background: -o-linear-gradient(#0089db, #0073b7) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0089db', endColorstr='#0073b7', GradientType=0) !important; - color: #fff; + background: #0073b7 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #0073b7), color-stop(1, #0089db)) !important; + background: -ms-linear-gradient(bottom, #0073b7, #0089db) !important; + background: -moz-linear-gradient(center bottom, #0073b7 0%, #0089db 100%) !important; + background: -o-linear-gradient(#0089db, #0073b7) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0089db', endColorstr='#0073b7', GradientType=0) !important; + color: #fff; } - .bg-aqua-gradient { - background: #00c0ef !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #00c0ef), color-stop(1, #14d1ff)) !important; - background: -ms-linear-gradient(bottom, #00c0ef, #14d1ff) !important; - background: -moz-linear-gradient(center bottom, #00c0ef 0%, #14d1ff 100%) !important; - background: -o-linear-gradient(#14d1ff, #00c0ef) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#14d1ff', endColorstr='#00c0ef', GradientType=0) !important; - color: #fff; + background: #00c0ef !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #00c0ef), color-stop(1, #14d1ff)) !important; + background: -ms-linear-gradient(bottom, #00c0ef, #14d1ff) !important; + background: -moz-linear-gradient(center bottom, #00c0ef 0%, #14d1ff 100%) !important; + background: -o-linear-gradient(#14d1ff, #00c0ef) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#14d1ff', endColorstr='#00c0ef', GradientType=0) !important; + color: #fff; } - .bg-yellow-gradient { - background: #f39c12 !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #f39c12), color-stop(1, #f7bc60)) !important; - background: -ms-linear-gradient(bottom, #f39c12, #f7bc60) !important; - background: -moz-linear-gradient(center bottom, #f39c12 0%, #f7bc60 100%) !important; - background: -o-linear-gradient(#f7bc60, #f39c12) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7bc60', endColorstr='#f39c12', GradientType=0) !important; - color: #fff; + background: #f39c12 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #f39c12), color-stop(1, #f7bc60)) !important; + background: -ms-linear-gradient(bottom, #f39c12, #f7bc60) !important; + background: -moz-linear-gradient(center bottom, #f39c12 0%, #f7bc60 100%) !important; + background: -o-linear-gradient(#f7bc60, #f39c12) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7bc60', endColorstr='#f39c12', GradientType=0) !important; + color: #fff; } - .bg-purple-gradient { - background: #605ca8 !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #605ca8), color-stop(1, #9491c4)) !important; - background: -ms-linear-gradient(bottom, #605ca8, #9491c4) !important; - background: -moz-linear-gradient(center bottom, #605ca8 0%, #9491c4 100%) !important; - background: -o-linear-gradient(#9491c4, #605ca8) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#9491c4', endColorstr='#605ca8', GradientType=0) !important; - color: #fff; + background: #605ca8 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #605ca8), color-stop(1, #9491c4)) !important; + background: -ms-linear-gradient(bottom, #605ca8, #9491c4) !important; + background: -moz-linear-gradient(center bottom, #605ca8 0%, #9491c4 100%) !important; + background: -o-linear-gradient(#9491c4, #605ca8) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#9491c4', endColorstr='#605ca8', GradientType=0) !important; + color: #fff; } - .bg-green-gradient { - background: #00a65a !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #00a65a), color-stop(1, #00ca6d)) !important; - background: -ms-linear-gradient(bottom, #00a65a, #00ca6d) !important; - background: -moz-linear-gradient(center bottom, #00a65a 0%, #00ca6d 100%) !important; - background: -o-linear-gradient(#00ca6d, #00a65a) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ca6d', endColorstr='#00a65a', GradientType=0) !important; - color: #fff; + background: #00a65a !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #00a65a), color-stop(1, #00ca6d)) !important; + background: -ms-linear-gradient(bottom, #00a65a, #00ca6d) !important; + background: -moz-linear-gradient(center bottom, #00a65a 0%, #00ca6d 100%) !important; + background: -o-linear-gradient(#00ca6d, #00a65a) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ca6d', endColorstr='#00a65a', GradientType=0) !important; + color: #fff; } - .bg-red-gradient { - background: #dd4b39 !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #dd4b39), color-stop(1, #e47365)) !important; - background: -ms-linear-gradient(bottom, #dd4b39, #e47365) !important; - background: -moz-linear-gradient(center bottom, #dd4b39 0%, #e47365 100%) !important; - background: -o-linear-gradient(#e47365, #dd4b39) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e47365', endColorstr='#dd4b39', GradientType=0) !important; - color: #fff; + background: #dd4b39 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #dd4b39), color-stop(1, #e47365)) !important; + background: -ms-linear-gradient(bottom, #dd4b39, #e47365) !important; + background: -moz-linear-gradient(center bottom, #dd4b39 0%, #e47365 100%) !important; + background: -o-linear-gradient(#e47365, #dd4b39) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e47365', endColorstr='#dd4b39', GradientType=0) !important; + color: #fff; } - .bg-black-gradient { - background: #111111 !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #111111), color-stop(1, #2b2b2b)) !important; - background: -ms-linear-gradient(bottom, #111111, #2b2b2b) !important; - background: -moz-linear-gradient(center bottom, #111111 0%, #2b2b2b 100%) !important; - background: -o-linear-gradient(#2b2b2b, #111111) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2b2b2b', endColorstr='#111111', GradientType=0) !important; - color: #fff; + background: #111111 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #111111), color-stop(1, #2b2b2b)) !important; + background: -ms-linear-gradient(bottom, #111111, #2b2b2b) !important; + background: -moz-linear-gradient(center bottom, #111111 0%, #2b2b2b 100%) !important; + background: -o-linear-gradient(#2b2b2b, #111111) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2b2b2b', endColorstr='#111111', GradientType=0) !important; + color: #fff; } - .bg-maroon-gradient { - background: #d81b60 !important; - background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #d81b60), color-stop(1, #e73f7c)) !important; - background: -ms-linear-gradient(bottom, #d81b60, #e73f7c) !important; - background: -moz-linear-gradient(center bottom, #d81b60 0%, #e73f7c 100%) !important; - background: -o-linear-gradient(#e73f7c, #d81b60) !important; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e73f7c', endColorstr='#d81b60', GradientType=0) !important; - color: #fff; + background: #d81b60 !important; + background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #d81b60), color-stop(1, #e73f7c)) !important; + background: -ms-linear-gradient(bottom, #d81b60, #e73f7c) !important; + background: -moz-linear-gradient(center bottom, #d81b60 0%, #e73f7c 100%) !important; + background: -o-linear-gradient(#e73f7c, #d81b60) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e73f7c', endColorstr='#d81b60', GradientType=0) !important; + color: #fff; } - .description-block .description-icon { - font-size: 16px; + font-size: 16px; } - .no-pad-top { - padding-top: 0; + padding-top: 0; } - .position-static { - position: static !important; + position: static !important; } - .list-header { - font-size: 15px; - padding: 10px 4px; - font-weight: bold; - color: #666; + font-size: 15px; + padding: 10px 4px; + font-weight: bold; + color: #666; } - .list-seperator { - height: 1px; - background: #f4f4f4; - margin: 15px 0 9px 0; + height: 1px; + background: #f4f4f4; + margin: 15px 0 9px 0; } - .list-link > a { - padding: 4px; - color: #777; + padding: 4px; + color: #777; } - .list-link > a:hover { - color: #222; + color: #222; } - .font-light { - font-weight: 300; + font-weight: 300; } - .user-block:before, .user-block:after { - content: " "; - display: table; + content: " "; + display: table; } - .user-block:after { - clear: both; + clear: both; +} +.user-block:before, +.user-block:after { + content: " "; + display: table; +} +.user-block:after { + clear: both; } - .user-block img { - width: 40px; - height: 40px; - float: left; + width: 40px; + height: 40px; + float: left; } - .user-block .username, .user-block .description, .user-block .comment { - display: block; - margin-left: 50px; + display: block; + margin-left: 50px; } - .user-block .username { - font-size: 16px; - font-weight: 600; + font-size: 16px; + font-weight: 600; } - .user-block .description { - color: #999; - font-size: 13px; + color: #999; + font-size: 13px; } - .user-block.user-block-sm .username, .user-block.user-block-sm .description, .user-block.user-block-sm .comment { - margin-left: 40px; + margin-left: 40px; } - .user-block.user-block-sm .username { - font-size: 14px; + font-size: 14px; } - .img-sm, .img-md, .img-lg, .box-comments .box-comment img, .user-block.user-block-sm img { - float: left; + float: left; } - .img-sm, .box-comments .box-comment img, .user-block.user-block-sm img { - width: 30px !important; - height: 30px !important; + width: 30px !important; + height: 30px !important; } - .img-sm + .img-push { - margin-left: 40px; + margin-left: 40px; } - .img-md { - width: 60px; - height: 60px; + width: 60px; + height: 60px; } - .img-md + .img-push { - margin-left: 70px; + margin-left: 70px; } - .img-lg { - width: 100px; - height: 100px; + width: 100px; + height: 100px; } - .img-lg + .img-push { - margin-left: 110px; + margin-left: 110px; } - .img-bordered { - border: 3px solid #d2d6de; - padding: 3px; + border: 3px solid #d2d6de; + padding: 3px; } - .img-bordered-sm { - border: 2px solid #d2d6de; - padding: 2px; + border: 2px solid #d2d6de; + padding: 2px; } - .attachment-block { - border: 1px solid #f4f4f4; - padding: 5px; - margin-bottom: 10px; - background: #f7f7f7; + border: 1px solid #f4f4f4; + padding: 5px; + margin-bottom: 10px; + background: #f7f7f7; } - .attachment-block .attachment-img { - max-width: 100px; - max-height: 100px; - height: auto; - float: left; + max-width: 100px; + max-height: 100px; + height: auto; + float: left; } - .attachment-block .attachment-pushed { - margin-left: 110px; + margin-left: 110px; } - .attachment-block .attachment-heading { - margin: 0; + margin: 0; } - .attachment-block .attachment-text { - color: #555; + color: #555; } - .connectedSortable { - min-height: 100px; + min-height: 100px; } - .ui-helper-hidden-accessible { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; } - .sort-highlight { - background: #f4f4f4; - border: 1px dashed #ddd; - margin-bottom: 10px; + background: #f4f4f4; + border: 1px dashed #ddd; + margin-bottom: 10px; } - .full-opacity-hover { - opacity: 0.65; - filter: alpha(opacity=65); + opacity: 0.65; + filter: alpha(opacity=65); } - .full-opacity-hover:hover { - opacity: 1; - filter: alpha(opacity=100); + opacity: 1; + filter: alpha(opacity=100); } - .chart { - position: relative; - overflow: hidden; - width: 100%; + position: relative; + overflow: hidden; + width: 100%; } - .chart svg, .chart canvas { - width: 100% !important; + width: 100% !important; } - /* * Misc: print * ----------- */ @media print { - .no-print, - .main-sidebar, - .left-side, - .main-header, - .content-header { - display: none !important; - } - - .content-wrapper, - .right-side, - .main-footer { - margin-left: 0 !important; - min-height: 0 !important; - -webkit-transform: translate(0, 0) !important; - -ms-transform: translate(0, 0) !important; - -o-transform: translate(0, 0) !important; - transform: translate(0, 0) !important; - } - - .fixed .content-wrapper, - .fixed .right-side { - padding-top: 0 !important; - } - - .invoice { - width: 100%; - border: 0; - margin: 0; - padding: 0; - } - - .invoice-col { - float: left; - width: 33.3333333%; - } - - .table-responsive { - overflow: auto; - } - - .table-responsive > .table tr th, - .table-responsive > .table tr td { - white-space: normal !important; - } + .no-print, + .main-sidebar, + .left-side, + .main-header, + .content-header { + display: none !important; + } + .content-wrapper, + .right-side, + .main-footer { + margin-left: 0 !important; + min-height: 0 !important; + -webkit-transform: translate(0, 0) !important; + -ms-transform: translate(0, 0) !important; + -o-transform: translate(0, 0) !important; + transform: translate(0, 0) !important; + } + .fixed .content-wrapper, + .fixed .right-side { + padding-top: 0 !important; + } + .invoice { + width: 100%; + border: 0; + margin: 0; + padding: 0; + } + .invoice-col { + float: left; + width: 33.3333333%; + } + .table-responsive { + overflow: auto; + } + .table-responsive > .table tr th, + .table-responsive > .table tr td { + white-space: normal !important; + } } diff --git a/public/lib/adminlte/css/skins/skin-blue-light.css b/public/lib/adminlte/css/skins/skin-blue-light.css index be502018b6..580644081b 100755 --- a/public/lib/adminlte/css/skins/skin-blue-light.css +++ b/public/lib/adminlte/css/skins/skin-blue-light.css @@ -3,13 +3,11 @@ * ---------- */ .skin-blue-light .main-header .navbar { - background-color: #3c8dbc; + background-color: #3c8dbc; } - .skin-blue-light .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } - .skin-blue-light .main-header .navbar .nav > li > a:hover, .skin-blue-light .main-header .navbar .nav > li > a:active, .skin-blue-light .main-header .navbar .nav > li > a:focus, @@ -17,186 +15,149 @@ .skin-blue-light .main-header .navbar .nav .open > a:hover, .skin-blue-light .main-header .navbar .nav .open > a:focus, .skin-blue-light .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } - .skin-blue-light .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } - .skin-blue-light .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } - .skin-blue-light .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } - .skin-blue-light .main-header .navbar .sidebar-toggle:hover { - background-color: #367fa9; + background-color: #367fa9; } - @media (max-width: 767px) { - .skin-blue-light .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - - .skin-blue-light .main-header .navbar .dropdown-menu li a { - color: #fff; - } - - .skin-blue-light .main-header .navbar .dropdown-menu li a:hover { - background: #367fa9; - } + .skin-blue-light .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + .skin-blue-light .main-header .navbar .dropdown-menu li a { + color: #fff; + } + .skin-blue-light .main-header .navbar .dropdown-menu li a:hover { + background: #367fa9; + } } - .skin-blue-light .main-header .logo { - background-color: #3c8dbc; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #3c8dbc; + color: #ffffff; + border-bottom: 0 solid transparent; } - .skin-blue-light .main-header .logo:hover { - background-color: #3b8ab8; + background-color: #3b8ab8; } - .skin-blue-light .main-header li.user-header { - background-color: #3c8dbc; + background-color: #3c8dbc; } - .skin-blue-light .content-header { - background: transparent; + background: transparent; } - .skin-blue-light .wrapper, .skin-blue-light .main-sidebar, .skin-blue-light .left-side { - background-color: #f9fafc; + background-color: #f9fafc; } - -.skin-blue-light .content-wrapper, -.skin-blue-light .main-footer { - border-left: 1px solid #d2d6de; +.skin-blue-light .main-sidebar { + border-right: 1px solid #d2d6de; } - .skin-blue-light .user-panel > .info, .skin-blue-light .user-panel > .info > a { - color: #444444; + color: #444444; } - .skin-blue-light .sidebar-menu > li { - -webkit-transition: border-left-color 0.3s ease; - -o-transition: border-left-color 0.3s ease; - transition: border-left-color 0.3s ease; + -webkit-transition: border-left-color 0.3s ease; + -o-transition: border-left-color 0.3s ease; + transition: border-left-color 0.3s ease; } - .skin-blue-light .sidebar-menu > li.header { - color: #848484; - background: #f9fafc; + color: #848484; + background: #f9fafc; } - .skin-blue-light .sidebar-menu > li > a { - border-left: 3px solid transparent; - font-weight: 600; + border-left: 3px solid transparent; + font-weight: 600; } - .skin-blue-light .sidebar-menu > li:hover > a, .skin-blue-light .sidebar-menu > li.active > a { - color: #000000; - background: #f4f4f5; + color: #000000; + background: #f4f4f5; } - .skin-blue-light .sidebar-menu > li.active { - border-left-color: #3c8dbc; + border-left-color: #3c8dbc; } - .skin-blue-light .sidebar-menu > li.active > a { - font-weight: 600; + font-weight: 600; } - .skin-blue-light .sidebar-menu > li > .treeview-menu { - background: #f4f4f5; + background: #f4f4f5; } - .skin-blue-light .sidebar a { - color: #444444; + color: #444444; } - .skin-blue-light .sidebar a:hover { - text-decoration: none; + text-decoration: none; } - -.skin-blue-light .treeview-menu > li > a { - color: #777777; +.skin-blue-light .sidebar-menu .treeview-menu > li > a { + color: #777777; } - -.skin-blue-light .treeview-menu > li.active > a, -.skin-blue-light .treeview-menu > li > a:hover { - color: #000000; +.skin-blue-light .sidebar-menu .treeview-menu > li.active > a, +.skin-blue-light .sidebar-menu .treeview-menu > li > a:hover { + color: #000000; } - -.skin-blue-light .treeview-menu > li.active > a { - font-weight: 600; +.skin-blue-light .sidebar-menu .treeview-menu > li.active > a { + font-weight: 600; } - .skin-blue-light .sidebar-form { - border-radius: 3px; - border: 1px solid #d2d6de; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #d2d6de; + margin: 10px 10px; } - .skin-blue-light .sidebar-form input[type="text"], .skin-blue-light .sidebar-form .btn { - box-shadow: none; - background-color: #fff; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #fff; + border: 1px solid transparent; + height: 35px; } - .skin-blue-light .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } - .skin-blue-light .sidebar-form input[type="text"]:focus, .skin-blue-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } - .skin-blue-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } - .skin-blue-light .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } - @media (min-width: 768px) { - .skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { - border-left: 1px solid #d2d6de; - } + .skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { + border-left: 1px solid #d2d6de; + } } - .skin-blue-light .main-footer { - border-top-color: #d2d6de; + border-top-color: #d2d6de; } - .skin-blue.layout-top-nav .main-header > .logo { - background-color: #3c8dbc; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #3c8dbc; + color: #ffffff; + border-bottom: 0 solid transparent; } - .skin-blue.layout-top-nav .main-header > .logo:hover { - background-color: #3b8ab8; + background-color: #3b8ab8; } diff --git a/public/lib/adminlte/css/skins/skin-blue-light.min.css b/public/lib/adminlte/css/skins/skin-blue-light.min.css index c41ca33fa1..033834e29f 100755 --- a/public/lib/adminlte/css/skins/skin-blue-light.min.css +++ b/public/lib/adminlte/css/skins/skin-blue-light.min.css @@ -1 +1 @@ -.skin-blue-light .main-header .navbar{background-color:#3c8dbc}.skin-blue-light .main-header .navbar .nav>li>a{color:#fff}.skin-blue-light .main-header .navbar .nav>li>a:hover,.skin-blue-light .main-header .navbar .nav>li>a:active,.skin-blue-light .main-header .navbar .nav>li>a:focus,.skin-blue-light .main-header .navbar .nav .open>a,.skin-blue-light .main-header .navbar .nav .open>a:hover,.skin-blue-light .main-header .navbar .nav .open>a:focus,.skin-blue-light .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-blue-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-blue-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue-light .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue-light .main-header .logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue-light .main-header .logo:hover{background-color:#3b8ab8}.skin-blue-light .main-header li.user-header{background-color:#3c8dbc}.skin-blue-light .content-header{background:transparent}.skin-blue-light .wrapper,.skin-blue-light .main-sidebar,.skin-blue-light .left-side{background-color:#f9fafc}.skin-blue-light .content-wrapper,.skin-blue-light .main-footer{border-left:1px solid #d2d6de}.skin-blue-light .user-panel>.info,.skin-blue-light .user-panel>.info>a{color:#444}.skin-blue-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-blue-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-blue-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-blue-light .sidebar-menu>li:hover>a,.skin-blue-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-blue-light .sidebar-menu>li.active{border-left-color:#3c8dbc}.skin-blue-light .sidebar-menu>li.active>a{font-weight:600}.skin-blue-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-blue-light .sidebar a{color:#444}.skin-blue-light .sidebar a:hover{text-decoration:none}.skin-blue-light .treeview-menu>li>a{color:#777}.skin-blue-light .treeview-menu>li.active>a,.skin-blue-light .treeview-menu>li>a:hover{color:#000}.skin-blue-light .treeview-menu>li.active>a{font-weight:600}.skin-blue-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-blue-light .sidebar-form input[type="text"],.skin-blue-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-blue-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-blue-light .sidebar-form input[type="text"]:focus,.skin-blue-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue-light .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-blue-light .main-footer{border-top-color:#d2d6de}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8} \ No newline at end of file +.skin-blue-light .main-header .navbar{background-color:#3c8dbc}.skin-blue-light .main-header .navbar .nav>li>a{color:#fff}.skin-blue-light .main-header .navbar .nav>li>a:hover,.skin-blue-light .main-header .navbar .nav>li>a:active,.skin-blue-light .main-header .navbar .nav>li>a:focus,.skin-blue-light .main-header .navbar .nav .open>a,.skin-blue-light .main-header .navbar .nav .open>a:hover,.skin-blue-light .main-header .navbar .nav .open>a:focus,.skin-blue-light .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-blue-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-blue-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue-light .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue-light .main-header .logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue-light .main-header .logo:hover{background-color:#3b8ab8}.skin-blue-light .main-header li.user-header{background-color:#3c8dbc}.skin-blue-light .content-header{background:transparent}.skin-blue-light .wrapper,.skin-blue-light .main-sidebar,.skin-blue-light .left-side{background-color:#f9fafc}.skin-blue-light .main-sidebar{border-right:1px solid #d2d6de}.skin-blue-light .user-panel>.info,.skin-blue-light .user-panel>.info>a{color:#444}.skin-blue-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-blue-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-blue-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-blue-light .sidebar-menu>li:hover>a,.skin-blue-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-blue-light .sidebar-menu>li.active{border-left-color:#3c8dbc}.skin-blue-light .sidebar-menu>li.active>a{font-weight:600}.skin-blue-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-blue-light .sidebar a{color:#444}.skin-blue-light .sidebar a:hover{text-decoration:none}.skin-blue-light .sidebar-menu .treeview-menu>li>a{color:#777}.skin-blue-light .sidebar-menu .treeview-menu>li.active>a,.skin-blue-light .sidebar-menu .treeview-menu>li>a:hover{color:#000}.skin-blue-light .sidebar-menu .treeview-menu>li.active>a{font-weight:600}.skin-blue-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-blue-light .sidebar-form input[type="text"],.skin-blue-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-blue-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-blue-light .sidebar-form input[type="text"]:focus,.skin-blue-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue-light .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-blue-light .main-footer{border-top-color:#d2d6de}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8} \ No newline at end of file From 6a880645489be60da18718c1291d1a4b8db2f118 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 19 Nov 2017 08:53:08 +0100 Subject: [PATCH 200/258] Fix currency code. --- database/seeds/TransactionCurrencySeeder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/seeds/TransactionCurrencySeeder.php b/database/seeds/TransactionCurrencySeeder.php index 369e642aee..9b82d9fcb8 100644 --- a/database/seeds/TransactionCurrencySeeder.php +++ b/database/seeds/TransactionCurrencySeeder.php @@ -34,7 +34,7 @@ class TransactionCurrencySeeder extends Seeder // oceanian currencies TransactionCurrency::create(['code' => 'IDR', 'name' => 'Indonesian rupiah', 'symbol' => 'Rp', 'decimal_places' => 2]); TransactionCurrency::create(['code' => 'AUD', 'name' => 'Australian dollar', 'symbol' => 'A$', 'decimal_places' => 2]); - TransactionCurrency::create(['code' => 'AUD', 'name' => 'New Zealand dollar', 'symbol' => 'NZ$', 'decimal_places' => 2]); + TransactionCurrency::create(['code' => 'NZD', 'name' => 'New Zealand dollar', 'symbol' => 'NZ$', 'decimal_places' => 2]); // african currencies TransactionCurrency::create(['code' => 'EGP', 'name' => 'Egyptian pound', 'symbol' => 'E£', 'decimal_places' => 2]); From 8f6ea6a73f5b95ab8fb324e697085809e632ea2a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 19 Nov 2017 09:20:29 +0100 Subject: [PATCH 201/258] Fix #1003 --- app/Support/Preferences.php | 4 +++- resources/views/preferences/index.twig | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index 0750c44394..9acfcad9ce 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -84,12 +84,13 @@ class Preferences */ public function get($name, $default = null) { + /** @var User $user */ $user = auth()->user(); if (null === $user) { return $default; } - return $this->getForUser(auth()->user(), $name, $default); + return $this->getForUser($user, $name, $default); } /** @@ -126,6 +127,7 @@ class Preferences { $fullName = sprintf('preference%s%s', $user->id, $name); if (Cache::has($fullName)) { + return Cache::get($fullName); } diff --git a/resources/views/preferences/index.twig b/resources/views/preferences/index.twig index 99601a950e..c8fa8d80ca 100644 --- a/resources/views/preferences/index.twig +++ b/resources/views/preferences/index.twig @@ -129,7 +129,7 @@