Compare commits

..

146 Commits

Author SHA1 Message Date
James Cole
1e212c6da2 Merge branch 'hotfix/4.7.3.2' 2018-05-16 21:55:41 +02:00
James Cole
7d8fc54351 Fix version number. 2018-05-16 21:55:24 +02:00
James Cole
a826b0e0fb Merge branch 'hotfix/4.7.3.1' 2018-05-14 19:24:53 +02:00
James Cole
4aaec0e379 Fix an issue where new users would be given a rule that always triggers. 2018-05-14 19:24:35 +02:00
James Cole
84ac3df580 Merge branch 'release/4.7.3' 2018-04-28 16:27:55 +02:00
James Cole
7f459df9e9 Last minute sanity check. 2018-04-28 16:24:24 +02:00
James Cole
3625f3293a Code for 4.7.3 release. 2018-04-28 15:35:43 +02:00
James Cole
0a2308592f New language strings. 2018-04-28 15:26:45 +02:00
James Cole
8ef3f18da7 Update language strings for English. 2018-04-28 10:29:31 +02:00
James Cole
e126427809 Improve code quality and fix test coverage. 2018-04-28 10:27:33 +02:00
James Cole
7b39828980 Improve attachment list. 2018-04-28 06:53:37 +02:00
James Cole
d03de52735 New buttons and links [skip ci] 2018-04-28 06:44:37 +02:00
James Cole
cabe90b2dd Attachment controller basic index. 2018-04-28 06:34:01 +02:00
James Cole
13b78bdc20 Code cleanup 2018-04-28 06:23:13 +02:00
James Cole
6f0e1c79ac Fix #1353 2018-04-28 05:42:47 +02:00
James Cole
b66daad3d3 Fix coverage. 2018-04-28 05:40:23 +02:00
James Cole
9c5523252d Clean up old JS. 2018-04-28 05:40:08 +02:00
James Cole
bc8bcf7a1a Upgrade spectre to v4 2018-04-28 05:25:29 +02:00
James Cole
85d655d3e2 Upgrade Spectre to v4 2018-04-27 13:07:46 +02:00
James Cole
ac419e01d3 Catch open basedir errors. 2018-04-27 12:58:43 +02:00
James Cole
5d4467a6c0 Improve test speed. 2018-04-27 12:39:25 +02:00
James Cole
81da7f3667 Move to correct directory [skip ci] 2018-04-27 11:53:22 +02:00
James Cole
9734196eb9 Updated translations. 2018-04-27 11:48:52 +02:00
James Cole
7e0f9b9b8e Update packages. 2018-04-27 11:29:19 +02:00
James Cole
bb25132865 Fix tests 2018-04-27 11:29:09 +02:00
James Cole
28bcff99f6 Add config for stale bot. 2018-04-27 08:50:49 +02:00
James Cole
246cb36836 Expand support for trusted proxies configuration. 2018-04-27 07:01:03 +02:00
James Cole
9a0c0f6d21 Fix #1383 2018-04-27 06:50:41 +02:00
James Cole
a9dd8eb9e7 Fix #1382 2018-04-27 06:26:37 +02:00
James Cole
9026c9d6f1 Update docker file. 2018-04-26 21:16:45 +02:00
James Cole
d5f7430723 Move and update security txt [skip ci] 2018-04-26 21:00:29 +02:00
James Cole
5a53249fbb Merge pull request #1380 from paul999/fix_1378
iban returned from bunq might be empty.
2018-04-25 19:16:12 +02:00
Paul Sohier
d2848cf569 getIban might return null from the bunq API. Fixes #1378 as it gets imported now :) 2018-04-25 19:11:32 +02:00
James Cole
71f39f55f2 Push some more fixes for #1378 2018-04-25 17:02:43 +02:00
James Cole
490c817fc1 Some fixes for #1378 2018-04-25 16:01:51 +02:00
James Cole
2e1a777811 Fix small deprecated function call. [skip ci] 2018-04-24 19:49:54 +02:00
James Cole
48357d1cc9 Fix #1273 and #1272 2018-04-24 19:48:42 +02:00
James Cole
846df21764 Fix #1372 2018-04-24 19:26:31 +02:00
James Cole
f78b8f9267 Some code for #1272 2018-04-24 19:26:16 +02:00
James Cole
798d9ee876 Mail to logbooks. 2018-04-24 19:23:32 +02:00
James Cole
1eea81e9dd Update readme [skip ci] 2018-04-22 19:18:57 +02:00
James Cole
4fcdfd41fa Update readme [skip ci] 2018-04-22 19:17:43 +02:00
James Cole
36a5f17af2 Code cleanup as described in #1272 2018-04-22 17:12:22 +02:00
James Cole
8032684ad0 Some code cleanup for #1272 2018-04-22 17:10:11 +02:00
James Cole
f7d3d4a010 Updated language strings [skip ci] 2018-04-22 13:14:36 +02:00
James Cole
9975e0b3f3 And now without var_dump. 2018-04-22 12:01:34 +02:00
James Cole
ea484a7787 Small bill related fixes. 2018-04-22 12:01:18 +02:00
James Cole
c2e8a67330 Code for #1367 2018-04-22 11:29:20 +02:00
James Cole
8f3e4a2dee Code for #1356 2018-04-22 11:17:30 +02:00
James Cole
07768a43c8 Code for #1321 2018-04-22 09:40:03 +02:00
James Cole
01c10e320c Fix for #1364 2018-04-22 09:16:51 +02:00
James Cole
f16b2257c6 Custom input for amount. 2018-04-22 08:08:09 +02:00
James Cole
e005fe7ce1 Also show foreign amount. 2018-04-22 08:07:57 +02:00
James Cole
c682e69ee7 Keep order 2018-04-22 08:07:46 +02:00
James Cole
49421f50ac Will not store fields with empty strings or weird value 2018-04-22 08:07:33 +02:00
James Cole
529dd490b7 Fix #1336 2018-04-22 07:16:09 +02:00
James Cole
36329e596e Fix #1334 2018-04-21 23:48:54 +02:00
James Cole
fb75e2ef02 Move to MariaDB. [skip ci] #1366 2018-04-21 21:09:56 +02:00
James Cole
352171e339 New language strings [skip ci] 2018-04-21 20:48:18 +02:00
James Cole
592901b143 Code for @1346 2018-04-21 20:36:42 +02:00
James Cole
769b4819b2 Add timezone to Docker file. 2018-04-21 20:30:36 +02:00
James Cole
77fa2bcc39 Call test at wrong position [skip ci] 2018-04-21 20:30:07 +02:00
James Cole
1129001bc6 Possible solution for #1353 2018-04-21 20:29:44 +02:00
James Cole
8dd765ee89 Remove deprecated method. 2018-04-21 20:28:41 +02:00
James Cole
479648e7c1 Fix #1352 2018-04-21 20:28:30 +02:00
James Cole
45cd19d1e3 Fix #1363 2018-04-21 20:27:35 +02:00
James Cole
f8718e0b7b Fix some issues with verify database code. 2018-04-21 20:26:41 +02:00
James Cole
dcc45631da New language strings [skip ci] 2018-04-19 20:04:04 +02:00
James Cole
c6d3a5bedc Code for #1351 2018-04-19 20:03:02 +02:00
James Cole
7cc8539298 Fix for #1349, thanks to @NyKoF 2018-04-19 18:27:39 +02:00
James Cole
900e8202e6 Remove some deprecated functions. 2018-04-16 20:21:28 +02:00
James Cole
eb6ac7d1d1 Remove unused methods. 2018-04-16 20:12:30 +02:00
James Cole
178f917a49 Fix #1348 2018-04-16 19:29:26 +02:00
James Cole
1a8293d9ef Fix view for transaction controller. 2018-04-16 19:25:33 +02:00
James Cole
ecdc00dcb7 Debug code for transaction view. [skip ci] 2018-04-16 19:24:46 +02:00
James Cole
147e04ecd2 Debug code for transaction view. [skip ci] 2018-04-16 18:06:53 +02:00
James Cole
49e48725a5 Debug code for transaction view. [skip ci] 2018-04-16 18:03:56 +02:00
James Cole
b3af744041 Debug code for transaction view. [skip ci] 2018-04-16 18:02:35 +02:00
James Cole
58a6a95d90 Debug code for transaction view. [skip ci] 2018-04-16 17:59:35 +02:00
James Cole
1aa9461370 Fix reference to unknown method. 2018-04-16 17:51:37 +02:00
James Cole
1f78b9d4bc Add today as well. #1328 2018-04-15 19:24:20 +02:00
James Cole
6f974fe285 Improve API and test coverage. 2018-04-15 19:20:24 +02:00
James Cole
f4f3c8798e Fix for #1328 2018-04-15 19:20:04 +02:00
James Cole
ce1614f4e7 Fix chart range. 2018-04-15 19:11:10 +02:00
James Cole
91494584c2 Fix #1327 2018-04-15 17:58:39 +02:00
James Cole
a85ebb49b2 Improve test coverage. 2018-04-15 14:03:23 +02:00
James Cole
ae273f8320 Also test PHP 7.2 2018-04-15 10:44:47 +02:00
James Cole
ef62e31b61 Fix #1246 2018-04-15 10:12:04 +02:00
James Cole
0c2c5d5344 Code for #1326 2018-04-15 08:52:58 +02:00
James Cole
11e93eac3d Merge pull request #1341 from bconte/develop
Remove the 'php artisan optimize' line from .deploy/docker/entroypoin…
2018-04-15 08:52:04 +02:00
Brenden Conte
dbe17debb4 Remove the 'php artisan optimize' line from .deploy/docker/entroypoint.sh because the command was removed in artisan 5.6 2018-04-15 02:35:47 -04:00
James Cole
6c12337317 Improve transaction linking [skip ci] 2018-04-14 23:25:28 +02:00
James Cole
b2aa73b31e Improve transaction linking [skip ci] 2018-04-14 23:23:47 +02:00
James Cole
38b1fc7aa6 Improve logging [skip ci] 2018-04-14 23:12:54 +02:00
James Cole
f4afcb4d50 Add debug logging [skip ci] 2018-04-14 23:09:24 +02:00
James Cole
4b019fe38b Limit scope in transaction matcher. 2018-04-14 23:06:27 +02:00
James Cole
191401f32b Fix division by zero. 2018-04-14 22:37:20 +02:00
James Cole
62b68c6a21 Fix tests. 2018-04-14 21:21:20 +02:00
James Cole
15a22f0bfc Expand rules and bills. 2018-04-14 20:31:31 +02:00
James Cole
926c03986c Remove references to bill scanning. 2018-04-14 13:00:24 +02:00
James Cole
d8a00f4314 Various code for bills and rules. 2018-04-14 09:59:04 +02:00
James Cole
5862b832d9 Fix issue with API 2018-04-14 09:38:58 +02:00
James Cole
67fa4a0fc7 Add currency controls to API 2018-04-13 17:28:11 +02:00
James Cole
90cf7a3bf5 Fix several issues with bunq import #1330 2018-04-10 21:18:38 +02:00
James Cole
0847040017 Correct access rights #1320 2018-04-09 18:59:06 +02:00
James Cole
69b577048e New string [skip ci] 2018-04-08 18:35:13 +02:00
James Cole
3fbd2f93c8 Code for #1324 2018-04-08 17:36:37 +02:00
James Cole
8f0e36a8e4 Code for #1324 2018-04-08 16:27:52 +02:00
James Cole
7583698ee5 Remove hard exit from upgrade routine. 2018-04-08 16:26:26 +02:00
James Cole
b561e79a6c Catch null in currency pref. [skip ci] 2018-04-08 16:21:17 +02:00
James Cole
5850ad06b1 More debug [skip ci] 2018-04-08 16:18:35 +02:00
James Cole
e597f04b0d Add debug logging. 2018-04-08 16:17:29 +02:00
James Cole
7b715925cf Code for #1324 2018-04-07 22:23:16 +02:00
James Cole
d3701837e3 Possible fix for #1325 2018-04-07 18:00:09 +02:00
James Cole
7af10aca9e Add new action to link a transaction to a bill. 2018-04-07 06:20:45 +02:00
James Cole
b54e99642b Refactor some auto complete routes. 2018-04-07 06:19:40 +02:00
James Cole
b1ad0668cc Clean overview for bills. 2018-04-07 05:58:59 +02:00
James Cole
6583d0f69b Fix JS in installer. 2018-04-07 05:30:29 +02:00
James Cole
cee6bbf134 Update files for Sandstorm. 2018-04-06 22:24:57 +02:00
James Cole
43e49bf14a Fire middleware on index. 2018-04-06 21:38:43 +02:00
James Cole
371b58a807 Make upgrade routine not trigger everywhere. 2018-04-06 21:38:17 +02:00
James Cole
7812a1bb51 Fix for #1320 2018-04-06 18:14:48 +02:00
James Cole
538e045e4c Give error for proc_close. 2018-04-06 13:36:36 +02:00
James Cole
91fe1493a7 Improve edit routine for split transactions. 2018-04-06 12:44:43 +02:00
James Cole
4650a2ea52 Merge branch 'release/4.7.2.2' 2018-04-04 19:26:51 +02:00
James Cole
7cd51a7747 Update version. 2018-04-04 19:18:59 +02:00
James Cole
b55545b959 Fix #1317 2018-04-04 19:18:01 +02:00
James Cole
2685256c93 Fix split edit. 2018-04-04 19:15:05 +02:00
James Cole
3819de4e74 Fix security issue with markdown, thanks to @simhnna 2018-04-04 19:14:47 +02:00
James Cole
73fee4eb6b Fix #1313 2018-04-03 19:15:06 +02:00
James Cole
609c193b88 Fix #1312 2018-04-03 19:12:59 +02:00
James Cole
03a42976b1 Configure logging for Slack. [skip ci] 2018-04-02 20:05:18 +02:00
James Cole
6db0efdfbc Fix extremely specific piggy bank percentage. 2018-04-02 17:30:30 +02:00
James Cole
ebbbe1a620 Merge branch 'release/4.7.2.1' 2018-04-02 16:52:23 +02:00
James Cole
5d1c77cb16 New version: 4.7.2.1 2018-04-02 15:40:43 +02:00
James Cole
d48fb3ba55 Create keys by hand if not existing. 2018-04-02 15:26:33 +02:00
James Cole
8c024a1ae9 Create default token if none exist. 2018-04-02 15:17:03 +02:00
James Cole
a3c34e6b3c Code cleanup 2018-04-02 15:10:40 +02:00
James Cole
fa7ab45a40 Code cleanup 2018-04-02 14:50:17 +02:00
James Cole
379b104778 Refer to classes directly. 2018-04-02 14:43:06 +02:00
James Cole
d956c795a4 Vue components will now work in subdirs too. 2018-04-02 14:42:30 +02:00
James Cole
7d02d0f762 Code cleanup. 2018-04-02 14:42:07 +02:00
James Cole
f96f38b172 Code cleanup. 2018-04-02 14:17:11 +02:00
James Cole
4cea5d65a6 Expand language list #1310 2018-04-02 06:56:19 +02:00
James Cole
40d94e7a62 Avoid using serialised preferences for security purposes. This might break existing preferences. 2018-04-01 19:22:30 +02:00
James Cole
66019fdbbf Code for #1309 2018-04-01 16:00:15 +02:00
750 changed files with 9984 additions and 5709 deletions

View File

@@ -1,12 +1,14 @@
#!/bin/bash
# make sure we own the volumes:
chown -R www-data:www-data $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
chmod -R 775 $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
chown -R www-data:www-data -R $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload $FIREFLY_PATH/storage/logs $FIREFLY_PATH/storage/cache
chmod -R 775 $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload $FIREFLY_PATH/storage/upload $FIREFLY_PATH/storage/logs $FIREFLY_PATH/storage/cache
# remove any lingering files that may break upgrades:
rm -f $FIREFLY_PATH/storage/logs/laravel.log
cat .env.docker | envsubst > .env && cat .env
composer dump-autoload
php artisan optimize
php artisan package:discover
php artisan firefly:instructions install
exec apache2-foreground

View File

@@ -22,7 +22,7 @@ LOG_CHANNEL=${LOG_CHANNEL}
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.
DB_CONNECTION=mysql
DB_CONNECTION=${FF_DB_CONNECTION}
DB_HOST=${FF_DB_HOST}
DB_PORT=${FF_DB_PORT}
DB_DATABASE=${FF_DB_NAME}

View File

@@ -54,7 +54,7 @@ COOKIE_DOMAIN=
COOKIE_SECURE=false
# If you want Firefly III to mail you, update these settings
MAIL_DRIVER=smtp
MAIL_DRIVER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_FROM=changeme@example.com

View File

@@ -54,7 +54,7 @@ COOKIE_DOMAIN=
COOKIE_SECURE=false
# If you want Firefly III to mail you, update these settings
MAIL_DRIVER=smtp
MAIL_DRIVER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_FROM=changeme@example.com

View File

@@ -54,7 +54,7 @@ COOKIE_DOMAIN=
COOKIE_SECURE=false
# If you want Firefly III to mail you, update these settings
MAIL_DRIVER=smtp
MAIL_DRIVER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_FROM=changeme@example.com

55
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale Issue or Pull Request is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 7
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
# - "[Status] Maybe Later"
exemptLabels:
- enhancement
- feature
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.
# Comment to post when closing a stale Issue or Pull Request.
# closeComment: >
# Your comment here.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.
# issues:
# exemptLabels:
# - confirmed

View File

@@ -1,3 +1,49 @@
# 4.7.3.2
- Forgot to increase the version number :(.
# 4.7.3.1
- Fixed a critical bug where the rules-engine would fire inadvertently.
# 4.7.3
- Currency added to API
- Firfely III will also generate a cash wallet for new users.
- Can now reset Spectre and bunq settings
- Docker file has a time zone
- Allow database connection to be configured in Docker file
- Can now view and edit attachments in edit-screen
- User can visit hidden `/attachments` page
- [Issue 1356](https://github.com/firefly-iii/firefly-iii/issues/1356): Budgets will show the remaining amount per day
- [Issue 1367](https://github.com/firefly-iii/firefly-iii/issues/1367): Rules now come in strict and non-strict mode.
- Added a security.txt
- More support for trusted proxies
- Improved edit routine for split transactions.
- Upgrade routine can handle `proc_close` being disabled.
- Bills now use rules to match transactions, making it more flexible.
- [Issue 1328](https://github.com/firefly-iii/firefly-iii/issues/1328): piggy banks no have a more useful chart.
- Spectre API upgraded to v4
- Move to MariaDB ([issue 1366](https://github.com/firefly-iii/firefly-iii/issues/1366))
- Piggy banks take currency from parent account ([issue 1334](https://github.com/firefly-iii/firefly-iii/issues/1334))
- [Issue 1341](https://github.com/firefly-iii/firefly-iii/issues/1341): Removed depricated command from dockerfile
- Several issues with docker image ([issue 1320](https://github.com/firefly-iii/firefly-iii/issues/1320), [issue 1382](https://github.com/firefly-iii/firefly-iii/issues/1382)).
- Fix giant tags and division by zero ([issue 1325](https://github.com/firefly-iii/firefly-iii/issues/1325) and others)
- Several issues with bunq import ([issue 1352](https://github.com/firefly-iii/firefly-iii/issues/1352), [issue 1330](https://github.com/firefly-iii/firefly-iii/issues/1330), [issue 1378](https://github.com/firefly-iii/firefly-iii/issues/1378), [issue 1380](https://github.com/firefly-iii/firefly-iii/issues/1380))
- [Issue 1246](https://github.com/firefly-iii/firefly-iii/issues/1246): date picker is internationalised
- [Issue 1327](https://github.com/firefly-iii/firefly-iii/issues/1327): fix formattting issues in piggy banks
- [Issue 1348](https://github.com/firefly-iii/firefly-iii/issues/1348): 500 error in API
- [Issue 1349](https://github.com/firefly-iii/firefly-iii/issues/1349): Errors in import routine
- Several fixes for (multi-currency) reconciliation ([issue 1336](https://github.com/firefly-iii/firefly-iii/issues/1336), [issue 1363](https://github.com/firefly-iii/firefly-iii/issues/1363))
- [Issue 1353](https://github.com/firefly-iii/firefly-iii/issues/1353): return NULL values in range-indicator
- Bug in split transaction edit routine
- Piggy bank percentage was very specific.
- Logging in Slack is easier to config.
- [Issue 1312](https://github.com/firefly-iii/firefly-iii/issues/1312) Import broken for ING accounts
- [Issue 1313](https://github.com/firefly-iii/firefly-iii/issues/1313) Error when creating new asset account
- [Issue 1317](https://github.com/firefly-iii/firefly-iii/issues/1317) Forgot an include :(
- Null pointer exception in transaction overview.
- Installations running in subdirs were incapable of creating OAuth tokens.
- OAuth keys were not created in all cases.
# 4.7.2
- [Issue 1123](https://github.com/firefly-iii/firefly-iii/issues/1123) First browser based update routine.
- Add support for Italian.
@@ -40,8 +86,6 @@
- [Issue 1297](https://github.com/firefly-iii/firefly-iii/issues/1297) Could not convert to withdrawal
- [Issue 1226](https://github.com/firefly-iii/firefly-iii/issues/1226) Category overview in default report shows no income.
- Various other bugs and problems ([issue 1198](https://github.com/firefly-iii/firefly-iii/issues/1198), [issue 1213](https://github.com/firefly-iii/firefly-iii/issues/1213), [issue 1237](https://github.com/firefly-iii/firefly-iii/issues/1237), [issue 1238](https://github.com/firefly-iii/firefly-iii/issues/1238), [issue 1199](https://github.com/firefly-iii/firefly-iii/issues/1199), [issue 1200](https://github.com/firefly-iii/firefly-iii/issues/1200))
### Security
- Fixed an issue with token validation on the command line.
# 4.7.1

View File

@@ -202,7 +202,6 @@ lib/x86_64-linux-gnu/libz.so.1.2.8
lib64/ld-linux-x86-64.so.2
opt/app/.codeclimate.yml
opt/app/.env
opt/app/.env.current
opt/app/.env.docker
opt/app/.env.example
opt/app/.env.heroku
@@ -341,12 +340,14 @@ opt/app/app/Helpers/Collection/Category.php
opt/app/app/Helpers/Collector/JournalCollector.php
opt/app/app/Helpers/Collector/JournalCollectorInterface.php
opt/app/app/Helpers/Filter/AmountFilter.php
opt/app/app/Helpers/Filter/CountAttachmentsFilter.php
opt/app/app/Helpers/Filter/EmptyFilter.php
opt/app/app/Helpers/Filter/FilterInterface.php
opt/app/app/Helpers/Filter/InternalTransferFilter.php
opt/app/app/Helpers/Filter/NegativeAmountFilter.php
opt/app/app/Helpers/Filter/OpposingAccountFilter.php
opt/app/app/Helpers/Filter/PositiveAmountFilter.php
opt/app/app/Helpers/Filter/SplitIndicatorFilter.php
opt/app/app/Helpers/Filter/TransferFilter.php
opt/app/app/Helpers/FiscalHelper.php
opt/app/app/Helpers/FiscalHelperInterface.php
@@ -418,6 +419,7 @@ opt/app/app/Http/Controllers/ReportController.php
opt/app/app/Http/Controllers/RuleController.php
opt/app/app/Http/Controllers/RuleGroupController.php
opt/app/app/Http/Controllers/SearchController.php
opt/app/app/Http/Controllers/System/InstallController.php
opt/app/app/Http/Controllers/TagController.php
opt/app/app/Http/Controllers/Transaction/BulkController.php
opt/app/app/Http/Controllers/Transaction/ConvertController.php
@@ -431,6 +433,7 @@ opt/app/app/Http/Middleware/Authenticate.php
opt/app/app/Http/Middleware/AuthenticateTwoFactor.php
opt/app/app/Http/Middleware/Binder.php
opt/app/app/Http/Middleware/EncryptCookies.php
opt/app/app/Http/Middleware/Installer.php
opt/app/app/Http/Middleware/IsAdmin.php
opt/app/app/Http/Middleware/IsDemoUser.php
opt/app/app/Http/Middleware/IsSandStormUser.php
@@ -475,6 +478,7 @@ opt/app/app/Http/Requests/TestRuleFormRequest.php
opt/app/app/Http/Requests/TokenFormRequest.php
opt/app/app/Http/Requests/UserFormRequest.php
opt/app/app/Http/Requests/UserRegistrationRequest.php
opt/app/app/Import/Configuration/BunqConfigurator.php
opt/app/app/Import/Configuration/ConfiguratorInterface.php
opt/app/app/Import/Configuration/FileConfigurator.php
opt/app/app/Import/Configuration/SpectreConfigurator.php
@@ -510,6 +514,7 @@ opt/app/app/Import/Prerequisites/BunqPrerequisites.php
opt/app/app/Import/Prerequisites/FilePrerequisites.php
opt/app/app/Import/Prerequisites/PrerequisitesInterface.php
opt/app/app/Import/Prerequisites/SpectrePrerequisites.php
opt/app/app/Import/Routine/BunqRoutine.php
opt/app/app/Import/Routine/FileRoutine.php
opt/app/app/Import/Routine/RoutineInterface.php
opt/app/app/Import/Routine/SpectreRoutine.php
@@ -605,8 +610,6 @@ opt/app/app/Repositories/ImportJob/ImportJobRepository.php
opt/app/app/Repositories/ImportJob/ImportJobRepositoryInterface.php
opt/app/app/Repositories/Journal/JournalRepository.php
opt/app/app/Repositories/Journal/JournalRepositoryInterface.php
opt/app/app/Repositories/Journal/JournalTasker.php
opt/app/app/Repositories/Journal/JournalTaskerInterface.php
opt/app/app/Repositories/LinkType/LinkTypeRepository.php
opt/app/app/Repositories/LinkType/LinkTypeRepositoryInterface.php
opt/app/app/Repositories/PiggyBank/PiggyBankRepository.php
@@ -633,10 +636,14 @@ opt/app/app/Services/Bunq/Object/Amount.php
opt/app/app/Services/Bunq/Object/Avatar.php
opt/app/app/Services/Bunq/Object/BunqObject.php
opt/app/app/Services/Bunq/Object/DeviceServer.php
opt/app/app/Services/Bunq/Object/Image.php
opt/app/app/Services/Bunq/Object/LabelMonetaryAccount.php
opt/app/app/Services/Bunq/Object/LabelUser.php
opt/app/app/Services/Bunq/Object/MonetaryAccountBank.php
opt/app/app/Services/Bunq/Object/MonetaryAccountProfile.php
opt/app/app/Services/Bunq/Object/MonetaryAccountSetting.php
opt/app/app/Services/Bunq/Object/NotificationFilter.php
opt/app/app/Services/Bunq/Object/Payment.php
opt/app/app/Services/Bunq/Object/ServerPublicKey.php
opt/app/app/Services/Bunq/Object/UserCompany.php
opt/app/app/Services/Bunq/Object/UserLight.php
@@ -648,28 +655,36 @@ opt/app/app/Services/Bunq/Request/DeviceSessionRequest.php
opt/app/app/Services/Bunq/Request/InstallationTokenRequest.php
opt/app/app/Services/Bunq/Request/ListDeviceServerRequest.php
opt/app/app/Services/Bunq/Request/ListMonetaryAccountRequest.php
opt/app/app/Services/Bunq/Request/ListPaymentRequest.php
opt/app/app/Services/Bunq/Request/ListUserRequest.php
opt/app/app/Services/Bunq/Token/BunqToken.php
opt/app/app/Services/Bunq/Token/InstallationToken.php
opt/app/app/Services/Bunq/Token/SessionToken.php
opt/app/app/Services/Currency/ExchangeRateInterface.php
opt/app/app/Services/Currency/FixerIO.php
opt/app/app/Services/Currency/FixerIOv2.php
opt/app/app/Services/Github/Object/GithubObject.php
opt/app/app/Services/Github/Object/Release.php
opt/app/app/Services/Github/Request/GithubRequest.php
opt/app/app/Services/Github/Request/UpdateRequest.php
opt/app/app/Services/Internal/Destroy/AccountDestroyService.php
opt/app/app/Services/Internal/Destroy/BillDestroyService.php
opt/app/app/Services/Internal/Destroy/CategoryDestroyService.php
opt/app/app/Services/Internal/Destroy/CurrencyDestroyService.php
opt/app/app/Services/Internal/Destroy/JournalDestroyService.php
opt/app/app/Services/Internal/File/EncryptService.php
opt/app/app/Services/Internal/Support/AccountServiceTrait.php
opt/app/app/Services/Internal/Support/BillServiceTrait.php
opt/app/app/Services/Internal/Support/JournalServiceTrait.php
opt/app/app/Services/Internal/Support/TransactionServiceTrait.php
opt/app/app/Services/Internal/Update/AccountUpdateService.php
opt/app/app/Services/Internal/Update/BillUpdateService.php
opt/app/app/Services/Internal/Update/CategoryUpdateService.php
opt/app/app/Services/Internal/Update/CurrencyUpdateService.php
opt/app/app/Services/Internal/Update/JournalUpdateService.php
opt/app/app/Services/Internal/Update/TransactionUpdateService.php
opt/app/app/Services/Password/PwndVerifier.php
opt/app/app/Services/Password/PwndVerifierV2.php
opt/app/app/Services/Password/Verifier.php
opt/app/app/Services/Spectre/Exception/DuplicatedCustomerException.php
opt/app/app/Services/Spectre/Exception/SpectreException.php
@@ -711,6 +726,7 @@ opt/app/app/Support/Facades/Navigation.php
opt/app/app/Support/Facades/Preferences.php
opt/app/app/Support/Facades/Steam.php
opt/app/app/Support/FireflyConfig.php
opt/app/app/Support/Import/Configuration/Bunq/HaveAccounts.php
opt/app/app/Support/Import/Configuration/ConfigurationInterface.php
opt/app/app/Support/Import/Configuration/File/Initial.php
opt/app/app/Support/Import/Configuration/File/Map.php
@@ -824,8 +840,10 @@ opt/app/config/database.php
opt/app/config/filesystems.php
opt/app/config/firefly.php
opt/app/config/google2fa.php
opt/app/config/hashing.php
opt/app/config/import.php
opt/app/config/intro.php
opt/app/config/logging.php
opt/app/config/mail.php
opt/app/config/queue.php
opt/app/config/services.php
@@ -834,6 +852,7 @@ opt/app/config/twigbridge.php
opt/app/config/upgrade.php
opt/app/config/view.php
opt/app/database/factories/ModelFactory.php
opt/app/database/migrations
opt/app/database/migrations/2016_06_16_000000_create_support_tables.php
opt/app/database/migrations/2016_06_16_000001_create_users_table.php
opt/app/database/migrations/2016_06_16_000002_create_main_tables.php
@@ -853,7 +872,9 @@ opt/app/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.p
opt/app/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php
opt/app/database/migrations/2018_01_01_000004_create_oauth_clients_table.php
opt/app/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php
opt/app/database/migrations/2018_03_19_141348_changes_for_v472.php
opt/app/database/seeds/AccountTypeSeeder.php
opt/app/database/seeds/ConfigSeeder.php
opt/app/database/seeds/DatabaseSeeder.php
opt/app/database/seeds/LinkTypeSeeder.php
opt/app/database/seeds/PermissionSeeder.php
@@ -1046,6 +1067,7 @@ opt/app/public/js/ff/guest.js
opt/app/public/js/ff/help.js
opt/app/public/js/ff/import/status.js
opt/app/public/js/ff/index.js
opt/app/public/js/ff/install/index.js
opt/app/public/js/ff/intro/intro.js
opt/app/public/js/ff/piggy-banks/create.js
opt/app/public/js/ff/piggy-banks/edit.js
@@ -1085,6 +1107,7 @@ opt/app/public/js/lib/bootstrap-sortable.js
opt/app/public/js/lib/bootstrap-tagsinput.min.js
opt/app/public/js/lib/bootstrap-tagsinput.min.js.map
opt/app/public/js/lib/bootstrap3-typeahead.min.js
opt/app/public/js/lib/chartjs-plugin-annotation.min.js
opt/app/public/js/lib/daterangepicker.js
opt/app/public/js/lib/html5shiv.min.js
opt/app/public/js/lib/jquery-ui.min.js
@@ -1115,7 +1138,6 @@ opt/app/public/lib/leaflet/leaflet.js.map
opt/app/public/manifest.json
opt/app/public/mix-manifest.json
opt/app/public/mstile-150x150.png
opt/app/public/report.html
opt/app/public/robots.txt
opt/app/public/safari-pinned-tab.svg
opt/app/public/web.config
@@ -1128,7 +1150,6 @@ opt/app/resources/assets/js/components/passport/AuthorizedClients.vue
opt/app/resources/assets/js/components/passport/Clients.vue
opt/app/resources/assets/js/components/passport/PersonalAccessTokens.vue
opt/app/resources/assets/js/lang.js
opt/app/resources/assets/js/messages.js
opt/app/resources/assets/sass/_variables.scss
opt/app/resources/assets/sass/app.scss
opt/app/resources/lang/de_DE/auth.php
@@ -1208,6 +1229,21 @@ opt/app/resources/lang/id_ID/list.php
opt/app/resources/lang/id_ID/pagination.php
opt/app/resources/lang/id_ID/passwords.php
opt/app/resources/lang/id_ID/validation.php
opt/app/resources/lang/it_IT/auth.php
opt/app/resources/lang/it_IT/bank.php
opt/app/resources/lang/it_IT/breadcrumbs.php
opt/app/resources/lang/it_IT/components.php
opt/app/resources/lang/it_IT/config.php
opt/app/resources/lang/it_IT/csv.php
opt/app/resources/lang/it_IT/demo.php
opt/app/resources/lang/it_IT/firefly.php
opt/app/resources/lang/it_IT/form.php
opt/app/resources/lang/it_IT/import.php
opt/app/resources/lang/it_IT/intro.php
opt/app/resources/lang/it_IT/list.php
opt/app/resources/lang/it_IT/pagination.php
opt/app/resources/lang/it_IT/passwords.php
opt/app/resources/lang/it_IT/validation.php
opt/app/resources/lang/nl_NL/auth.php
opt/app/resources/lang/nl_NL/bank.php
opt/app/resources/lang/nl_NL/breadcrumbs.php
@@ -1289,7 +1325,6 @@ opt/app/resources/stubs/binary.bin
opt/app/resources/stubs/csv.csv
opt/app/resources/stubs/demo-configuration.json
opt/app/resources/stubs/demo-import.csv
opt/app/resources/tests/blns.base64.json
opt/app/resources/views/accounts/create.twig
opt/app/resources/views/accounts/delete.twig
opt/app/resources/views/accounts/edit.twig
@@ -1400,6 +1435,7 @@ opt/app/resources/views/form/tags.twig
opt/app/resources/views/form/text.twig
opt/app/resources/views/form/textarea.twig
opt/app/resources/views/import/bank/form.twig
opt/app/resources/views/import/bunq/accounts.twig
opt/app/resources/views/import/bunq/prerequisites.twig
opt/app/resources/views/import/file/initial.twig
opt/app/resources/views/import/file/map.twig
@@ -1411,6 +1447,7 @@ opt/app/resources/views/import/spectre/prerequisites.twig
opt/app/resources/views/import/spectre/redirect.twig
opt/app/resources/views/import/status.twig
opt/app/resources/views/index.twig
opt/app/resources/views/install/index.twig
opt/app/resources/views/javascript/accounts.twig
opt/app/resources/views/javascript/currencies.twig
opt/app/resources/views/javascript/variables.twig
@@ -1418,6 +1455,7 @@ opt/app/resources/views/json/piggy-banks.twig
opt/app/resources/views/layout/default.twig
opt/app/resources/views/layout/empty.twig
opt/app/resources/views/layout/guest.twig
opt/app/resources/views/layout/install.twig
opt/app/resources/views/list/accounts.twig
opt/app/resources/views/list/bills.twig
opt/app/resources/views/list/categories.twig
@@ -1451,10 +1489,10 @@ opt/app/resources/views/popup/report/budget-spent-amount.twig
opt/app/resources/views/popup/report/category-entry.twig
opt/app/resources/views/popup/report/expense-entry.twig
opt/app/resources/views/popup/report/income-entry.twig
opt/app/resources/views/preferences/code.twig
opt/app/resources/views/preferences/index.twig
opt/app/resources/views/profile/change-email.twig
opt/app/resources/views/profile/change-password.twig
opt/app/resources/views/profile/code.twig
opt/app/resources/views/profile/delete-account.twig
opt/app/resources/views/profile/index.twig
opt/app/resources/views/reports/account/report.twig
@@ -1523,6 +1561,7 @@ opt/app/routes/breadcrumbs.php
opt/app/routes/channels.php
opt/app/routes/console.php
opt/app/routes/web.php
opt/app/security.txt
opt/app/server.php
opt/app/storage
opt/app/vendor/autoload.php
@@ -1801,6 +1840,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/ColumnCase.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php
@@ -1856,6 +1896,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ServerInfoAwareConnection.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/StatementIterator.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php
@@ -1892,6 +1933,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/SyntaxErrorException.ph
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/TableExistsException.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/TableNotFoundException.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/UniqueConstraintViolationException.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/FetchMode.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGenerator.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php
@@ -1899,16 +1941,20 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/ParameterType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DateIntervalUnit.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MariaDb102Keywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQL57Keywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL100Keywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL91Keywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL92Keywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL94Keywords.php
@@ -1923,9 +1969,11 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2008K
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2012Keywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServerKeywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MariaDb1027Platform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySQL57Platform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL100Platform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL94Platform.php
@@ -1940,6 +1988,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.p
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/TrimMode.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Statement.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php
@@ -2000,6 +2049,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWor
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/TransactionIsolationLevel.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BigIntType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BinaryType.php
@@ -2020,6 +2070,8 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/IntegerType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/JsonArrayType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/JsonType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ObjectType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/PhpDateTimeMappingType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/PhpIntegerMappingType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SimpleArrayType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SmallIntType.php
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/StringType.php
@@ -2039,6 +2091,28 @@ opt/app/vendor/doctrine/lexer/LICENSE
opt/app/vendor/doctrine/lexer/README.md
opt/app/vendor/doctrine/lexer/composer.json
opt/app/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php
opt/app/vendor/dragonmantank/cron-expression/.editorconfig
opt/app/vendor/dragonmantank/cron-expression/CHANGELOG.md
opt/app/vendor/dragonmantank/cron-expression/LICENSE
opt/app/vendor/dragonmantank/cron-expression/README.md
opt/app/vendor/dragonmantank/cron-expression/composer.json
opt/app/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php
opt/app/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php
opt/app/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php
opt/app/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php
opt/app/vendor/dragonmantank/cron-expression/src/Cron/FieldFactory.php
opt/app/vendor/dragonmantank/cron-expression/src/Cron/FieldInterface.php
opt/app/vendor/dragonmantank/cron-expression/src/Cron/HoursField.php
opt/app/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php
opt/app/vendor/dragonmantank/cron-expression/src/Cron/MonthField.php
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/AbstractFieldTest.php
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/CronExpressionTest.php
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/DayOfMonthFieldTest.php
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/DayOfWeekFieldTest.php
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/FieldFactoryTest.php
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/HoursFieldTest.php
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/MinutesFieldTest.php
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/MonthFieldTest.php
opt/app/vendor/egulias/email-validator/EmailValidator/EmailLexer.php
opt/app/vendor/egulias/email-validator/EmailValidator/EmailParser.php
opt/app/vendor/egulias/email-validator/EmailValidator/EmailValidator.php
@@ -2323,15 +2397,17 @@ opt/app/vendor/laravel/framework/src/Illuminate/Console/Events/CommandStarting.p
opt/app/vendor/laravel/framework/src/Illuminate/Console/GeneratorCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/OutputStyle.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Parser.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheMutex.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheEventMutex.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CommandBuilder.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/EventMutex.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ManagesFrequencies.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Mutex.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleFinishCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/SchedulingMutex.php
opt/app/vendor/laravel/framework/src/Illuminate/Console/composer.json
opt/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php
opt/app/vendor/laravel/framework/src/Illuminate/Container/Container.php
@@ -2382,7 +2458,6 @@ opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Filesystem/Filesystem.
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Foundation/Application.php
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Hashing/Hasher.php
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Http/Kernel.php
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Logging/Log.php
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Mail/MailQueue.php
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Mail/Mailable.php
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Mail/Mailer.php
@@ -2589,6 +2664,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingChain.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/ComposerScripts.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/AppNameCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ChannelMakeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClosureCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php
@@ -2606,7 +2682,6 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeC
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/MailMakeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ModelMakeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/NotificationMakeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/PackageDiscoverCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/PolicyMakeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/PresetCommand.php
@@ -2635,7 +2710,9 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/StorageLinkCo
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/TestMakeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/UpCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewCacheCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewClearCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/channel.stub
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/console.stub
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/event-handler-queued.stub
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/event-handler.stub
@@ -2671,6 +2748,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/EnvironmentDetector.p
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Events/Dispatchable.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Events/LocaleUpdated.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/WhoopsHandler.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/404.blade.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/419.blade.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/429.blade.php
@@ -2708,6 +2786,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/Inte
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/SeeInOrder.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/SoftDeletedInDatabase.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php
@@ -2722,7 +2801,9 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutMiddle
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/stubs/facade.stub
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/HashManager.php
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/composer.json
opt/app/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php
@@ -2730,17 +2811,20 @@ opt/app/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlash
opt/app/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Exceptions/HttpResponseException.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Exceptions/PostTooLargeException.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Exceptions/ThrottleRequestsException.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/File.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/FileHelpers.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/CheckResponseForModifications.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/FrameGuard.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Request.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/Resource.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php
@@ -2756,8 +2840,9 @@ opt/app/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php
opt/app/vendor/laravel/framework/src/Illuminate/Http/composer.json
opt/app/vendor/laravel/framework/src/Illuminate/Log/Events/MessageLogged.php
opt/app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php
opt/app/vendor/laravel/framework/src/Illuminate/Log/LogServiceProvider.php
opt/app/vendor/laravel/framework/src/Illuminate/Log/Writer.php
opt/app/vendor/laravel/framework/src/Illuminate/Log/Logger.php
opt/app/vendor/laravel/framework/src/Illuminate/Log/composer.json
opt/app/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php
opt/app/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSent.php
@@ -2922,7 +3007,10 @@ opt/app/vendor/laravel/framework/src/Illuminate/Redis/RedisServiceProvider.php
opt/app/vendor/laravel/framework/src/Illuminate/Redis/composer.json
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/MiddlewareMakeCommand.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.api.stub
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.model.api.stub
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.model.stub
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.nested.api.stub
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.nested.stub
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.plain.stub
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.stub
@@ -2932,6 +3020,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/InvalidSignatureException.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/ImplicitRouteBinding.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Matching/HostValidator.php
@@ -2942,6 +3031,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterf
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequestsWithRedis.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ValidateSignature.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/MiddlewareNameResolver.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/PendingResourceRegistration.php
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php
@@ -3043,6 +3133,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/Notificati
opt/app/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php
opt/app/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/QueueFake.php
opt/app/vendor/laravel/framework/src/Illuminate/Support/Traits/CapsuleManagerTrait.php
opt/app/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php
opt/app/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php
opt/app/vendor/laravel/framework/src/Illuminate/Support/ViewErrorBag.php
opt/app/vendor/laravel/framework/src/Illuminate/Support/composer.json
@@ -3083,6 +3174,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/Compiles
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesComponents.php
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesEchos.php
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesInjections.php
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesJson.php
@@ -3265,7 +3357,7 @@ opt/app/vendor/lcobucci/jwt/test/unit/TokenTest.php
opt/app/vendor/lcobucci/jwt/test/unit/ValidationDataTest.php
opt/app/vendor/league/commonmark/.styleci.yml
opt/app/vendor/league/commonmark/CHANGELOG.md
opt/app/vendor/league/commonmark/CONDUCT.md
opt/app/vendor/league/commonmark/CODE_OF_CONDUCT.md
opt/app/vendor/league/commonmark/CONTRIBUTING.md
opt/app/vendor/league/commonmark/LICENSE
opt/app/vendor/league/commonmark/README.md
@@ -3378,6 +3470,7 @@ opt/app/vendor/league/commonmark/src/Util/LinkParserHelper.php
opt/app/vendor/league/commonmark/src/Util/RegexHelper.php
opt/app/vendor/league/commonmark/src/Util/UrlEncoder.php
opt/app/vendor/league/commonmark/src/Util/Xml.php
opt/app/vendor/league/csv/CHANGELOG.md
opt/app/vendor/league/csv/LICENSE
opt/app/vendor/league/csv/autoload.php
opt/app/vendor/league/csv/composer.json
@@ -3721,32 +3814,9 @@ opt/app/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php
opt/app/vendor/monolog/monolog/tests/Monolog/PsrLogCompatTest.php
opt/app/vendor/monolog/monolog/tests/Monolog/RegistryTest.php
opt/app/vendor/monolog/monolog/tests/Monolog/TestCase.php
opt/app/vendor/mtdowling/cron-expression/.editorconfig
opt/app/vendor/mtdowling/cron-expression/CHANGELOG.md
opt/app/vendor/mtdowling/cron-expression/LICENSE
opt/app/vendor/mtdowling/cron-expression/README.md
opt/app/vendor/mtdowling/cron-expression/composer.json
opt/app/vendor/mtdowling/cron-expression/src/Cron/AbstractField.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/DayOfMonthField.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/DayOfWeekField.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/FieldFactory.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/FieldInterface.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/HoursField.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/MinutesField.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/MonthField.php
opt/app/vendor/mtdowling/cron-expression/src/Cron/YearField.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/AbstractFieldTest.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/CronExpressionTest.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/DayOfMonthFieldTest.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/DayOfWeekFieldTest.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/FieldFactoryTest.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/HoursFieldTest.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/MinutesFieldTest.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/MonthFieldTest.php
opt/app/vendor/mtdowling/cron-expression/tests/Cron/YearFieldTest.php
opt/app/vendor/nesbot/carbon/.php_cs.dist
opt/app/vendor/nesbot/carbon/LICENSE
opt/app/vendor/nesbot/carbon/build.php
opt/app/vendor/nesbot/carbon/composer.json
opt/app/vendor/nesbot/carbon/readme.md
opt/app/vendor/nesbot/carbon/src/Carbon/Carbon.php
@@ -3774,6 +3844,7 @@ opt/app/vendor/nesbot/carbon/src/Carbon/Lang/fi.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/fo.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/fr.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/gl.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/gu.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/he.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/hr.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/hu.php
@@ -3815,7 +3886,7 @@ opt/app/vendor/nesbot/carbon/src/Carbon/Lang/uz.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/vi.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/zh.php
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php
opt/app/vendor/nesbot/carbon/trigger
opt/app/vendor/nesbot/carbon/src/Carbon/Translator.php
opt/app/vendor/paragonie/constant_time_encoding/LICENSE.txt
opt/app/vendor/paragonie/constant_time_encoding/README.md
opt/app/vendor/paragonie/constant_time_encoding/composer.json
@@ -3889,16 +3960,23 @@ opt/app/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
opt/app/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
opt/app/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php
opt/app/vendor/phpseclib/phpseclib/phpseclib/openssl.cnf
opt/app/vendor/pragmarx/google2fa-laravel/CHANGELOG.md
opt/app/vendor/pragmarx/google2fa-laravel/LICENSE
opt/app/vendor/pragmarx/google2fa-laravel/changelog.md
opt/app/vendor/pragmarx/google2fa-laravel/README.md
opt/app/vendor/pragmarx/google2fa-laravel/composer.json
opt/app/vendor/pragmarx/google2fa-laravel/docs/middleware.jpg
opt/app/vendor/pragmarx/google2fa-laravel/phpspec.yml
opt/app/vendor/pragmarx/google2fa-laravel/readme.md
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/EmptyOneTimePasswordReceived.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/LoggedOut.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/LoginFailed.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/LoginSucceeded.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/OneTimePasswordExpired.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/OneTimePasswordRequested.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/OneTimePasswordRequested53.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Exceptions/InvalidOneTimePassword.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Exceptions/InvalidSecretKey.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Facade.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Google2FA.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Middleware.php
opt/app/vendor/pragmarx/google2fa-laravel/src/ServiceProvider.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Support/Auth.php
@@ -3911,14 +3989,21 @@ opt/app/vendor/pragmarx/google2fa-laravel/src/Support/Request.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Support/Response.php
opt/app/vendor/pragmarx/google2fa-laravel/src/Support/Session.php
opt/app/vendor/pragmarx/google2fa-laravel/src/config/config.php
opt/app/vendor/pragmarx/google2fa-laravel/tests/spec/Support/AuthenticatorSpec.php
opt/app/vendor/pragmarx/google2fa-laravel/tests/Google2FaLaravelTest.php
opt/app/vendor/pragmarx/google2fa-laravel/tests/Support/User.php
opt/app/vendor/pragmarx/google2fa-laravel/tests/TestCase.php
opt/app/vendor/pragmarx/google2fa-laravel/tests/bootstrap.php
opt/app/vendor/pragmarx/google2fa-laravel/tests/views/google2fa/index.blade.php
opt/app/vendor/pragmarx/google2fa-laravel/upgrading.md
opt/app/vendor/pragmarx/google2fa/LICENSE
opt/app/vendor/pragmarx/google2fa/LICENSE.md
opt/app/vendor/pragmarx/google2fa/README.md
opt/app/vendor/pragmarx/google2fa/RELICENSED.md
opt/app/vendor/pragmarx/google2fa/changelog.md
opt/app/vendor/pragmarx/google2fa/composer.json
opt/app/vendor/pragmarx/google2fa/composer.lock
opt/app/vendor/pragmarx/google2fa/docs/playground.jpg
opt/app/vendor/pragmarx/google2fa/src/Exceptions/IncompatibleWithGoogleAuthenticatorException.php
opt/app/vendor/pragmarx/google2fa/src/Exceptions/InsecureCallException.php
opt/app/vendor/pragmarx/google2fa/src/Exceptions/InvalidCharactersException.php
opt/app/vendor/pragmarx/google2fa/src/Exceptions/SecretKeyTooShortException.php
opt/app/vendor/pragmarx/google2fa/src/Google2FA.php
@@ -4503,7 +4588,6 @@ opt/app/vendor/symfony/console/Descriptor/XmlDescriptor.php
opt/app/vendor/symfony/console/Event/ConsoleCommandEvent.php
opt/app/vendor/symfony/console/Event/ConsoleErrorEvent.php
opt/app/vendor/symfony/console/Event/ConsoleEvent.php
opt/app/vendor/symfony/console/Event/ConsoleExceptionEvent.php
opt/app/vendor/symfony/console/Event/ConsoleTerminateEvent.php
opt/app/vendor/symfony/console/EventListener/ErrorListener.php
opt/app/vendor/symfony/console/Exception/CommandNotFoundException.php
@@ -4877,7 +4961,6 @@ opt/app/vendor/symfony/debug/Debug.php
opt/app/vendor/symfony/debug/DebugClassLoader.php
opt/app/vendor/symfony/debug/ErrorHandler.php
opt/app/vendor/symfony/debug/Exception/ClassNotFoundException.php
opt/app/vendor/symfony/debug/Exception/ContextErrorException.php
opt/app/vendor/symfony/debug/Exception/FatalErrorException.php
opt/app/vendor/symfony/debug/Exception/FatalThrowableError.php
opt/app/vendor/symfony/debug/Exception/FlattenException.php
@@ -4892,15 +4975,6 @@ opt/app/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandle
opt/app/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
opt/app/vendor/symfony/debug/LICENSE
opt/app/vendor/symfony/debug/README.md
opt/app/vendor/symfony/debug/Resources/ext/README.md
opt/app/vendor/symfony/debug/Resources/ext/config.m4
opt/app/vendor/symfony/debug/Resources/ext/config.w32
opt/app/vendor/symfony/debug/Resources/ext/php_symfony_debug.h
opt/app/vendor/symfony/debug/Resources/ext/symfony_debug.c
opt/app/vendor/symfony/debug/Resources/ext/tests/001.phpt
opt/app/vendor/symfony/debug/Resources/ext/tests/002.phpt
opt/app/vendor/symfony/debug/Resources/ext/tests/002_1.phpt
opt/app/vendor/symfony/debug/Resources/ext/tests/003.phpt
opt/app/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
opt/app/vendor/symfony/debug/Tests/ErrorHandlerTest.php
opt/app/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php
@@ -4963,7 +5037,6 @@ opt/app/vendor/symfony/finder/Comparator/Comparator.php
opt/app/vendor/symfony/finder/Comparator/DateComparator.php
opt/app/vendor/symfony/finder/Comparator/NumberComparator.php
opt/app/vendor/symfony/finder/Exception/AccessDeniedException.php
opt/app/vendor/symfony/finder/Exception/ExceptionInterface.php
opt/app/vendor/symfony/finder/Finder.php
opt/app/vendor/symfony/finder/Glob.php
opt/app/vendor/symfony/finder/Iterator/CustomFilterIterator.php
@@ -4973,7 +5046,6 @@ opt/app/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php
opt/app/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php
opt/app/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php
opt/app/vendor/symfony/finder/Iterator/FilenameFilterIterator.php
opt/app/vendor/symfony/finder/Iterator/FilterIterator.php
opt/app/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php
opt/app/vendor/symfony/finder/Iterator/PathFilterIterator.php
opt/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php
@@ -5012,7 +5084,6 @@ opt/app/vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.
opt/app/vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php
opt/app/vendor/symfony/finder/Tests/Iterator/FilecontentFilterIteratorTest.php
opt/app/vendor/symfony/finder/Tests/Iterator/FilenameFilterIteratorTest.php
opt/app/vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php
opt/app/vendor/symfony/finder/Tests/Iterator/Iterator.php
opt/app/vendor/symfony/finder/Tests/Iterator/IteratorTestCase.php
opt/app/vendor/symfony/finder/Tests/Iterator/MockFileListIterator.php
@@ -5076,22 +5147,18 @@ opt/app/vendor/symfony/http-foundation/Session/SessionBagInterface.php
opt/app/vendor/symfony/http-foundation/Session/SessionBagProxy.php
opt/app/vendor/symfony/http-foundation/Session/SessionInterface.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/NativeSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/WriteCheckSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php
opt/app/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php
opt/app/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
opt/app/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
opt/app/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php
opt/app/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php
opt/app/vendor/symfony/http-foundation/StreamedResponse.php
@@ -5142,22 +5209,18 @@ opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/wi
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie_and_session.expected
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie_and_session.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/NativeProxyTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php
opt/app/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php
opt/app/vendor/symfony/http-foundation/Tests/schema/http-status-codes.rng
@@ -5175,7 +5238,6 @@ opt/app/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php
opt/app/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerInterface.php
opt/app/vendor/symfony/http-kernel/CacheWarmer/WarmableInterface.php
opt/app/vendor/symfony/http-kernel/Client.php
opt/app/vendor/symfony/http-kernel/Config/EnvParametersResource.php
opt/app/vendor/symfony/http-kernel/Config/FileLocator.php
opt/app/vendor/symfony/http-kernel/Controller/ArgumentResolver.php
opt/app/vendor/symfony/http-kernel/Controller/ArgumentResolver/DefaultValueResolver.php
@@ -5208,11 +5270,9 @@ opt/app/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.php
opt/app/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php
opt/app/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php
opt/app/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php
opt/app/vendor/symfony/http-kernel/DataCollector/Util/ValueExporter.php
opt/app/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php
opt/app/vendor/symfony/http-kernel/Debug/TraceableEventDispatcher.php
opt/app/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php
opt/app/vendor/symfony/http-kernel/DependencyInjection/AddClassesToCachePass.php
opt/app/vendor/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php
opt/app/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.php
opt/app/vendor/symfony/http-kernel/DependencyInjection/Extension.php
@@ -5307,7 +5367,6 @@ opt/app/vendor/symfony/http-kernel/Tests/CacheClearer/Psr6CacheClearerTest.php
opt/app/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php
opt/app/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerTest.php
opt/app/vendor/symfony/http-kernel/Tests/ClientTest.php
opt/app/vendor/symfony/http-kernel/Tests/Config/EnvParametersResourceTest.php
opt/app/vendor/symfony/http-kernel/Tests/Config/FileLocatorTest.php
opt/app/vendor/symfony/http-kernel/Tests/Controller/ArgumentResolver/ServiceValueResolverTest.php
opt/app/vendor/symfony/http-kernel/Tests/Controller/ArgumentResolverTest.php
@@ -5324,7 +5383,6 @@ opt/app/vendor/symfony/http-kernel/Tests/DataCollector/LoggerDataCollectorTest.p
opt/app/vendor/symfony/http-kernel/Tests/DataCollector/MemoryDataCollectorTest.php
opt/app/vendor/symfony/http-kernel/Tests/DataCollector/RequestDataCollectorTest.php
opt/app/vendor/symfony/http-kernel/Tests/DataCollector/TimeDataCollectorTest.php
opt/app/vendor/symfony/http-kernel/Tests/DataCollector/Util/ValueExporterTest.php
opt/app/vendor/symfony/http-kernel/Tests/Debug/FileLinkFormatterTest.php
opt/app/vendor/symfony/http-kernel/Tests/Debug/TraceableEventDispatcherTest.php
opt/app/vendor/symfony/http-kernel/Tests/DependencyInjection/AddAnnotatedClassesToCachePassTest.php
@@ -5442,18 +5500,11 @@ opt/app/vendor/symfony/polyfill-php56/Php56.php
opt/app/vendor/symfony/polyfill-php56/README.md
opt/app/vendor/symfony/polyfill-php56/bootstrap.php
opt/app/vendor/symfony/polyfill-php56/composer.json
opt/app/vendor/symfony/polyfill-php70/LICENSE
opt/app/vendor/symfony/polyfill-php70/Php70.php
opt/app/vendor/symfony/polyfill-php70/README.md
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/AssertionError.php
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/Error.php
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/ParseError.php
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/TypeError.php
opt/app/vendor/symfony/polyfill-php70/bootstrap.php
opt/app/vendor/symfony/polyfill-php70/composer.json
opt/app/vendor/symfony/polyfill-php72/LICENSE
opt/app/vendor/symfony/polyfill-php72/Php72.php
opt/app/vendor/symfony/polyfill-php72/README.md
opt/app/vendor/symfony/polyfill-php72/bootstrap.php
opt/app/vendor/symfony/polyfill-php72/composer.json
opt/app/vendor/symfony/polyfill-util/Binary.php
opt/app/vendor/symfony/polyfill-util/BinaryNoFuncOverload.php
opt/app/vendor/symfony/polyfill-util/BinaryOnFuncOverload.php
@@ -5480,7 +5531,6 @@ opt/app/vendor/symfony/process/Pipes/PipesInterface.php
opt/app/vendor/symfony/process/Pipes/UnixPipes.php
opt/app/vendor/symfony/process/Pipes/WindowsPipes.php
opt/app/vendor/symfony/process/Process.php
opt/app/vendor/symfony/process/ProcessBuilder.php
opt/app/vendor/symfony/process/ProcessUtils.php
opt/app/vendor/symfony/process/README.md
opt/app/vendor/symfony/process/Tests/ExecutableFinderTest.php
@@ -5488,10 +5538,8 @@ opt/app/vendor/symfony/process/Tests/NonStopableProcess.php
opt/app/vendor/symfony/process/Tests/PhpExecutableFinderTest.php
opt/app/vendor/symfony/process/Tests/PhpProcessTest.php
opt/app/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php
opt/app/vendor/symfony/process/Tests/ProcessBuilderTest.php
opt/app/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php
opt/app/vendor/symfony/process/Tests/ProcessTest.php
opt/app/vendor/symfony/process/Tests/ProcessUtilsTest.php
opt/app/vendor/symfony/process/Tests/SignalListener.php
opt/app/vendor/symfony/process/composer.json
opt/app/vendor/symfony/process/phpunit.xml.dist
@@ -5614,6 +5662,17 @@ opt/app/vendor/symfony/routing/Tests/Fixtures/empty.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/file_resource.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/foo.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/foo1.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/bar.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/bar.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/baz.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/baz.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/import_single.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/import_single.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/php_dsl.php
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/php_dsl_bar.php
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/php_dsl_baz.php
opt/app/vendor/symfony/routing/Tests/Fixtures/incomplete.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/list_defaults.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/list_in_list_defaults.xml
@@ -5863,7 +5922,6 @@ opt/app/vendor/symfony/var-dumper/Caster/EnumStub.php
opt/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
opt/app/vendor/symfony/var-dumper/Caster/FrameStub.php
opt/app/vendor/symfony/var-dumper/Caster/LinkStub.php
opt/app/vendor/symfony/var-dumper/Caster/MongoCaster.php
opt/app/vendor/symfony/var-dumper/Caster/PdoCaster.php
opt/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
opt/app/vendor/symfony/var-dumper/Caster/RedisCaster.php
@@ -6538,6 +6596,7 @@ opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test
@@ -6776,16 +6835,6 @@ opt/app/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php
opt/app/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php
opt/app/vendor/vlucas/phpdotenv/src/Loader.php
opt/app/vendor/vlucas/phpdotenv/src/Validator.php
opt/app/vendor/watson/validating/LICENSE.txt
opt/app/vendor/watson/validating/README.md
opt/app/vendor/watson/validating/composer.json
opt/app/vendor/watson/validating/src/Injectors/UniqueInjector.php
opt/app/vendor/watson/validating/src/Injectors/UniqueWithInjector.php
opt/app/vendor/watson/validating/src/ValidatingInterface.php
opt/app/vendor/watson/validating/src/ValidatingModel.php
opt/app/vendor/watson/validating/src/ValidatingObserver.php
opt/app/vendor/watson/validating/src/ValidatingTrait.php
opt/app/vendor/watson/validating/src/ValidationException.php
opt/app/vendor/zendframework/zend-diactoros/.coveralls.yml
opt/app/vendor/zendframework/zend-diactoros/CHANGELOG.md
opt/app/vendor/zendframework/zend-diactoros/CONDUCT.md

View File

@@ -15,8 +15,8 @@ const pkgdef :Spk.PackageDefinition = (
manifest = (
appTitle = (defaultText = "Firefly III"),
appVersion = 10,
appMarketingVersion = (defaultText = "4.7.2"),
appVersion = 12,
appMarketingVersion = (defaultText = "4.7.3.2"),
actions = [
# Define your "new document" handlers here.

View File

@@ -14,12 +14,17 @@ apt-get install -y python-software-properties software-properties-common
# install all languages
sed -i 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# id_ID.UTF-8 UTF-8/id_ID.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# it_IT.UTF-8 UTF-8/it_IT.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# nl_NL.UTF-8 UTF-8/nl_NL.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# pl_PL.UTF-8 UTF-8/pl_PL.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/# tr_TR.UTF-8 UTF-8/tr_TR.UTF-8 UTF-8/g' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales

View File

@@ -1,6 +1,7 @@
language: php
php:
- 7.1
- 7.2
cache:
directories:

View File

@@ -28,7 +28,7 @@ RUN apt-get update -y && \
RUN docker-php-ext-install -j$(nproc) curl gd intl json readline tidy zip bcmath xml mbstring pdo_sqlite pdo_mysql bz2 pdo_pgsql
# Generate locales supported by Firefly III
RUN echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
RUN echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8pt_BR.UTF-8 UTF-8ru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\n\n" > /etc/locale.gen && locale-gen
# copy Apache config to correct spot.
COPY ./.deploy/docker/apache2.conf /etc/apache2/apache2.conf

View File

@@ -35,16 +35,6 @@ use League\Fractal\Serializer\JsonApiSerializer;
*/
class AboutController extends Controller
{
/**
* AccountController constructor.
*
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function __construct()
{
parent::__construct();
}
/**
* @return \Illuminate\Http\JsonResponse
*/

View File

@@ -103,7 +103,7 @@ class AccountController extends Controller
// types to get, page size:
$types = $this->mapTypes($this->parameters->get('type'));
$pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data);
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of accounts. Count it and split it.
$collection = $this->repository->getAccountsByType($types);
@@ -154,7 +154,7 @@ class AccountController extends Controller
// if currency ID is 0, find the currency by the code:
if (0 === $data['currency_id']) {
$currency = $this->currencyRepository->findByCodeNull($data['currency_code']);
$data['currency_id'] = is_null($currency) ? 0 : $currency->id;
$data['currency_id'] = null === $currency ? 0 : $currency->id;
}
$account = $this->repository->store($data);
$manager = new Manager();
@@ -180,7 +180,7 @@ class AccountController extends Controller
// if currency ID is 0, find the currency by the code:
if (0 === $data['currency_id']) {
$currency = $this->currencyRepository->findByCodeNull($data['currency_code']);
$data['currency_id'] = is_null($currency) ? 0 : $currency->id;
$data['currency_id'] = null === $currency ? 0 : $currency->id;
}
// set correct type:
$data['type'] = config('firefly.shortNamesByFullName.' . $account->accountType->type);

View File

@@ -23,9 +23,11 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use FireflyIII\Api\V1\Requests\BillRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Transformers\BillTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use League\Fractal\Manager;
@@ -46,7 +48,7 @@ class BillController extends Controller
/**
* BillController constructor.
*
* @throws \FireflyIII\Exceptions\FireflyException
* @throws FireflyException
*/
public function __construct()
{
@@ -65,11 +67,11 @@ class BillController extends Controller
/**
* Remove the specified resource from storage.
*
* @param \FireflyIII\Models\Bill $bill
* @param Bill $bill
*
* @return \Illuminate\Http\Response
* @return JsonResponse
*/
public function delete(Bill $bill)
public function delete(Bill $bill): JsonResponse
{
$this->repository->destroy($bill);
@@ -81,11 +83,11 @@ class BillController extends Controller
*
* @param Request $request
*
* @return \Illuminate\Http\JsonResponse
* @return JsonResponse
*/
public function index(Request $request)
public function index(Request $request): JsonResponse
{
$pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data);
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
$paginator = $this->repository->getPaginator($pageSize);
/** @var Collection $bills */
$bills = $paginator->getCollection();
@@ -105,9 +107,9 @@ class BillController extends Controller
* @param Request $request
* @param Bill $bill
*
* @return \Illuminate\Http\JsonResponse
* @return JsonResponse
*/
public function show(Request $request, Bill $bill)
public function show(Request $request, Bill $bill): JsonResponse
{
$manager = new Manager();
// add include parameter:
@@ -125,11 +127,13 @@ class BillController extends Controller
/**
* @param BillRequest $request
*
* @return \Illuminate\Http\JsonResponse
* @return JsonResponse
* @throws FireflyException
*/
public function store(BillRequest $request)
public function store(BillRequest $request): JsonResponse
{
$bill = $this->repository->store($request->getAll());
if (null !== $bill) {
$manager = new Manager();
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
@@ -137,6 +141,8 @@ class BillController extends Controller
$resource = new Item($bill, new BillTransformer($this->parameters), 'bills');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
throw new FireflyException('Could not store new bill.'); // @codeCoverageIgnore
}
@@ -145,9 +151,9 @@ class BillController extends Controller
* @param BillRequest $request
* @param Bill $bill
*
* @return \Illuminate\Http\JsonResponse
* @return JsonResponse
*/
public function update(BillRequest $request, Bill $bill)
public function update(BillRequest $request, Bill $bill): JsonResponse
{
$data = $request->getAll();
$bill = $this->repository->update($bill, $data);

View File

@@ -48,18 +48,9 @@ class Controller extends BaseController
/**
* Controller constructor.
*
* @throws FireflyException
*/
public function __construct()
{
// is site a demo site?
$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
// do not expose API on demo site:
if (true === $isDemoSite) {
throw new FireflyException('The API is not available on the demo site.');
}
// get global parameters
$this->parameters = $this->getParameters();
}
@@ -83,7 +74,7 @@ class Controller extends BaseController
}
}
$return .= http_build_query($params);
if (strlen($return) === 1) {
if (\strlen($return) === 1) {
return '';
}
@@ -107,7 +98,7 @@ class Controller extends BaseController
foreach ($dates as $field) {
$date = request()->get($field);
$obj = null;
if (!is_null($date)) {
if (null !== $date) {
try {
$obj = new Carbon($date);
} catch (InvalidDateException $e) {

View File

@@ -0,0 +1,208 @@
<?php
/**
* CurrencyController.php
* Copyright (c) 2018 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 <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use FireflyIII\Api\V1\Requests\BillRequest;
use FireflyIII\Api\V1\Requests\CurrencyRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Transformers\CurrencyTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Manager;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
use League\Fractal\Serializer\JsonApiSerializer;
use Preferences;
/**
* Class CurrencyController
*/
class CurrencyController extends Controller
{
/** @var CurrencyRepositoryInterface */
private $repository;
/** @var UserRepositoryInterface */
private $userRepository;
/**
* CurrencyRepository constructor.
*
* @throws FireflyException
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var CurrencyRepositoryInterface repository */
$this->repository = app(CurrencyRepositoryInterface::class);
$this->userRepository = app(UserRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param TransactionCurrency $currency
*
* @return JsonResponse
* @throws FireflyException
*/
public function delete(TransactionCurrency $currency): JsonResponse
{
if (!$this->userRepository->hasRole(auth()->user(), 'owner')) {
// access denied:
throw new FireflyException('No access to method, user is not owner.'); // @codeCoverageIgnore
}
if (!$this->repository->canDeleteCurrency($currency)) {
throw new FireflyException('No access to method, currency is in use.'); // @codeCoverageIgnore
}
$this->repository->destroy($currency);
return response()->json([], 204);
}
/**
* Display a listing of the resource.
*
* @param Request $request
*
* @return JsonResponse
*/
public function index(Request $request): JsonResponse
{
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
$collection = $this->repository->get();
$count = $collection->count();
// slice them:
$currencies = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($currencies, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.currencies.index') . $this->buildParams());
$manager = new Manager();
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
$this->parameters->set('defaultCurrency', $defaultCurrency);
$resource = new FractalCollection($currencies, new CurrencyTransformer($this->parameters), 'currencies');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* @param Request $request
* @param TransactionCurrency $currency
*
* @return JsonResponse
*/
public function show(Request $request, TransactionCurrency $currency): JsonResponse
{
$manager = new Manager();
// add include parameter:
$include = $request->get('include') ?? '';
$manager->parseIncludes($include);
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
$this->parameters->set('defaultCurrency', $defaultCurrency);
$resource = new Item($currency, new CurrencyTransformer($this->parameters), 'currencies');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* @param CurrencyRequest $request
*
* @return JsonResponse
* @throws FireflyException
*/
public function store(CurrencyRequest $request): JsonResponse
{
$currency = $this->repository->store($request->getAll());
if ($request->boolean('default') === true) {
Preferences::set('currencyPreference', $currency->code);
Preferences::mark();
}
if (null !== $currency) {
$manager = new Manager();
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
$this->parameters->set('defaultCurrency', $defaultCurrency);
$resource = new Item($currency, new CurrencyTransformer($this->parameters), 'currencies');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
throw new FireflyException('Could not store new currency.'); // @codeCoverageIgnore
}
/**
* @param CurrencyRequest $request
* @param TransactionCurrency $currency
*
* @return JsonResponse
*/
public function update(CurrencyRequest $request, TransactionCurrency $currency): JsonResponse
{
$data = $request->getAll();
$currency = $this->repository->update($currency, $data);
if ($request->boolean('default') === true) {
Preferences::set('currencyPreference', $currency->code);
Preferences::mark();
}
$manager = new Manager();
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
$this->parameters->set('defaultCurrency', $defaultCurrency);
$resource = new Item($currency, new CurrencyTransformer($this->parameters), 'currencies');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
}

View File

@@ -91,7 +91,7 @@ class TransactionController extends Controller
*/
public function index(Request $request)
{
$pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data);
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
// read type from URI
$type = $request->get('type') ?? 'default';
@@ -111,11 +111,11 @@ class TransactionController extends Controller
$collector->setAllAssetAccounts();
// remove internal transfer filter:
if (in_array(TransactionType::TRANSFER, $types)) {
if (\in_array(TransactionType::TRANSFER, $types)) {
$collector->removeFilter(InternalTransferFilter::class);
}
if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) {
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
}
$collector->setLimit($pageSize)->setPage($this->parameters->get('page'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use FireflyIII\Api\V1\Requests\UserRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Transformers\UserTransformer;
use FireflyIII\User;
@@ -35,7 +36,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
use League\Fractal\Serializer\JsonApiSerializer;
use Preferences;
use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException;
/**
* Class UserController
@@ -70,7 +71,7 @@ class UserController extends Controller
* @param \FireflyIII\User $user
*
* @return \Illuminate\Http\Response
* @throws \Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException
* @throws FireflyException
*/
public function delete(User $user)
{
@@ -79,7 +80,7 @@ class UserController extends Controller
return response()->json([], 204);
}
throw new AccessDeniedException(''); // @codeCoverageIgnore
throw new FireflyException('No access to method.'); // @codeCoverageIgnore
}
/**
@@ -92,7 +93,7 @@ class UserController extends Controller
public function index(Request $request)
{
// user preferences
$pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data);
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
// make manager
$manager = new Manager();

View File

@@ -47,11 +47,10 @@ class BillRequest extends Request
{
$data = [
'name' => $this->string('name'),
'match' => $this->string('match'),
'amount_min' => $this->string('amount_min'),
'amount_max' => $this->string('amount_max'),
//'currency_id' => $this->integer('currency_id'),
//'currency_code' => $this->string('currency_code'),
'currency_id' => $this->integer('currency_id'),
'currency_code' => $this->string('currency_code'),
'date' => $this->date('date'),
'repeat_freq' => $this->string('repeat_freq'),
'skip' => $this->integer('skip'),
@@ -70,11 +69,10 @@ class BillRequest extends Request
{
$rules = [
'name' => 'required|between:1,255|uniqueObjectForUser:bills,name',
'match' => 'required|between:1,255|uniqueObjectForUser:bills,match',
'amount_min' => 'required|numeric|more:0',
'amount_max' => 'required|numeric|more:0',
//'currency_id' => 'numeric|exists:transaction_currencies,id|required_without:currency_code',
//'currency_code' => 'min:3|max:3|exists:transaction_currencies,code|required_without:currency_id',
'currency_id' => 'numeric|exists:transaction_currencies,id|required_without:currency_code',
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code|required_without:currency_id',
'date' => 'required|date',
'repeat_freq' => 'required|in:weekly,monthly,quarterly,half-year,yearly',
'skip' => 'required|between:0,31',
@@ -89,7 +87,6 @@ class BillRequest extends Request
case 'PATCH':
$bill = $this->route()->parameter('bill');
$rules['name'] .= ',' . $bill->id;
$rules['match'] .= ',' . $bill->id;
break;
}
@@ -108,8 +105,8 @@ class BillRequest extends Request
$validator->after(
function (Validator $validator) {
$data = $validator->getData();
$min = floatval($data['amount_min'] ?? 0);
$max = floatval($data['amount_max'] ?? 0);
$min = (float)($data['amount_min'] ?? 0);
$max = (float)($data['amount_max'] ?? 0);
if ($min > $max) {
$validator->errors()->add('amount_min', trans('validation.amount_min_over_max'));
}

View File

@@ -0,0 +1,83 @@
<?php
/**
* CurrencyRequest.php
* Copyright (c) 2018 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 <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests;
/**
* Class CurrencyRequest
*/
class CurrencyRequest extends Request
{
/**
* @return bool
*/
public function authorize(): bool
{
// Only allow authenticated users
return auth()->check();
}
/**
* @return array
*/
public function getAll()
{
return [
'name' => $this->string('name'),
'code' => $this->string('code'),
'symbol' => $this->string('symbol'),
'decimal_places' => $this->integer('decimal_places'),
'default' => $this->boolean('default'),
];
}
/**
* @return array
*/
public function rules(): array
{
$rules = [
'name' => 'required|between:1,255|unique:transaction_currencies,name',
'code' => 'required|between:3,3|unique:transaction_currencies,code',
'symbol' => 'required|between:1,5|unique:transaction_currencies,symbol',
'decimal_places' => 'required|between:0,20|numeric|min:0|max:20',
'default' => 'in:true,false',
];
switch ($this->method()) {
default:
break;
case 'PUT':
case 'PATCH':
$currency = $this->route()->parameter('currency');
$rules['name'] = 'required|between:1,255|unique:transaction_currencies,name,' . $currency->id;
$rules['code'] = 'required|between:1,255|unique:transaction_currencies,code,' . $currency->id;
$rules['symbol'] = 'required|between:1,255|unique:transaction_currencies,symbol,' . $currency->id;
break;
}
return $rules;
}
}

View File

@@ -80,19 +80,19 @@ class TransactionRequest extends Request
$array = [
'description' => $transaction['description'] ?? null,
'amount' => $transaction['amount'],
'currency_id' => isset($transaction['currency_id']) ? intval($transaction['currency_id']) : null,
'currency_code' => isset($transaction['currency_code']) ? $transaction['currency_code'] : null,
'currency_id' => isset($transaction['currency_id']) ? (int)$transaction['currency_id'] : null,
'currency_code' => $transaction['currency_code'] ?? null,
'foreign_amount' => $transaction['foreign_amount'] ?? null,
'foreign_currency_id' => isset($transaction['foreign_currency_id']) ? intval($transaction['foreign_currency_id']) : null,
'foreign_currency_id' => isset($transaction['foreign_currency_id']) ? (int)$transaction['foreign_currency_id'] : null,
'foreign_currency_code' => $transaction['foreign_currency_code'] ?? null,
'budget_id' => isset($transaction['budget_id']) ? intval($transaction['budget_id']) : null,
'budget_id' => isset($transaction['budget_id']) ? (int)$transaction['budget_id'] : null,
'budget_name' => $transaction['budget_name'] ?? null,
'category_id' => isset($transaction['category_id']) ? intval($transaction['category_id']) : null,
'category_id' => isset($transaction['category_id']) ? (int)$transaction['category_id'] : null,
'category_name' => $transaction['category_name'] ?? null,
'source_id' => isset($transaction['source_id']) ? intval($transaction['source_id']) : null,
'source_name' => isset($transaction['source_name']) ? strval($transaction['source_name']) : null,
'destination_id' => isset($transaction['destination_id']) ? intval($transaction['destination_id']) : null,
'destination_name' => isset($transaction['destination_name']) ? strval($transaction['destination_name']) : null,
'source_id' => isset($transaction['source_id']) ? (int)$transaction['source_id'] : null,
'source_name' => isset($transaction['source_name']) ? (string)$transaction['source_name'] : null,
'destination_id' => isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : null,
'destination_name' => isset($transaction['destination_name']) ? (string)$transaction['destination_name'] : null,
'reconciled' => $transaction['reconciled'] ?? false,
'identifier' => $index,
];
@@ -168,7 +168,6 @@ class TransactionRequest extends Request
* @param Validator $validator
*
* @return void
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function withValidator(Validator $validator): void
{
@@ -199,10 +198,10 @@ class TransactionRequest extends Request
protected function assetAccountExists(Validator $validator, ?int $accountId, ?string $accountName, string $idField, string $nameField): ?Account
{
$accountId = intval($accountId);
$accountName = strval($accountName);
$accountId = (int)$accountId;
$accountName = (string)$accountName;
// both empty? hard exit.
if ($accountId < 1 && strlen($accountName) === 0) {
if ($accountId < 1 && \strlen($accountName) === 0) {
$validator->errors()->add($idField, trans('validation.filled', ['attribute' => $idField]));
return null;
@@ -225,8 +224,8 @@ class TransactionRequest extends Request
return $first;
}
$account = $repository->findByNameNull($accountName, [AccountType::ASSET]);
if (is_null($account)) {
$account = $repository->findByName($accountName, [AccountType::ASSET]);
if (null === $account) {
$validator->errors()->add($nameField, trans('validation.belongs_user'));
return null;
@@ -245,7 +244,7 @@ class TransactionRequest extends Request
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
// need at least one transaction
if (count($transactions) === 0) {
if (\count($transactions) === 0) {
$validator->errors()->add('description', trans('validation.at_least_one_transaction'));
}
}
@@ -260,16 +259,16 @@ class TransactionRequest extends Request
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
$journalDescription = strval($data['description'] ?? '');
$journalDescription = (string)($data['description'] ?? '');
$validDescriptions = 0;
foreach ($transactions as $index => $transaction) {
if (strlen(strval($transaction['description'] ?? '')) > 0) {
if (\strlen((string)($transaction['description'] ?? '')) > 0) {
$validDescriptions++;
}
}
// no valid descriptions and empty journal description? error.
if ($validDescriptions === 0 && strlen($journalDescription) === 0) {
if ($validDescriptions === 0 && \strlen($journalDescription) === 0) {
$validator->errors()->add('description', trans('validation.filled', ['attribute' => trans('validation.attributes.description')]));
}
@@ -286,9 +285,9 @@ class TransactionRequest extends Request
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
foreach ($transactions as $index => $transaction) {
$description = strval($transaction['description'] ?? '');
$description = (string)($transaction['description'] ?? '');
// filled description is mandatory for split transactions.
if (count($transactions) > 1 && strlen($description) === 0) {
if (\count($transactions) > 1 && \strlen($description) === 0) {
$validator->errors()->add(
'transactions.' . $index . '.description',
trans('validation.filled', ['attribute' => trans('validation.attributes.transaction_description')])
@@ -306,9 +305,9 @@ class TransactionRequest extends Request
{
$data = $validator->getData();
$transactions = $data['transactions'] ?? [];
$journalDescription = strval($data['description'] ?? '');
$journalDescription = (string)($data['description'] ?? '');
foreach ($transactions as $index => $transaction) {
$description = strval($transaction['description'] ?? '');
$description = (string)($transaction['description'] ?? '');
// description cannot be equal to journal description.
if ($description === $journalDescription) {
$validator->errors()->add('transactions.' . $index . '.description', trans('validation.equal_description'));
@@ -352,10 +351,10 @@ class TransactionRequest extends Request
*/
protected function opposingAccountExists(Validator $validator, string $type, ?int $accountId, ?string $accountName, string $idField): ?Account
{
$accountId = intval($accountId);
$accountName = strval($accountName);
$accountId = (int)$accountId;
$accountName = (string)$accountName;
// both empty? done!
if ($accountId < 1 && strlen($accountName) === 0) {
if ($accountId < 1 && \strlen($accountName) === 0) {
return null;
}
if ($accountId !== 0) {
@@ -397,15 +396,15 @@ class TransactionRequest extends Request
// the journal may exist in the request:
/** @var Transaction $transaction */
$transaction = $this->route()->parameter('transaction');
if (is_null($transaction)) {
if (null === $transaction) {
return; // @codeCoverageIgnore
}
$data['type'] = strtolower($transaction->transactionJournal->transactionType->type);
}
foreach ($transactions as $index => $transaction) {
$sourceId = isset($transaction['source_id']) ? intval($transaction['source_id']) : null;
$sourceId = isset($transaction['source_id']) ? (int)$transaction['source_id'] : null;
$sourceName = $transaction['source_name'] ?? null;
$destinationId = isset($transaction['destination_id']) ? intval($transaction['destination_id']) : null;
$destinationId = isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : null;
$destinationName = $transaction['destination_name'] ?? null;
$sourceAccount = null;
$destinationAccount = null;
@@ -457,7 +456,7 @@ class TransactionRequest extends Request
protected function validateSplitAccounts(Validator $validator)
{
$data = $validator->getData();
$count = isset($data['transactions']) ? count($data['transactions']) : 0;
$count = isset($data['transactions']) ? \count($data['transactions']) : 0;
if ($count < 2) {
return;
}
@@ -479,25 +478,25 @@ class TransactionRequest extends Request
$destinations = [];
foreach ($data['transactions'] as $transaction) {
$sources[] = isset($transaction['source_id']) ? intval($transaction['source_id']) : 0;
$destinations[] = isset($transaction['destination_id']) ? intval($transaction['destination_id']) : 0;
$sources[] = isset($transaction['source_id']) ? (int)$transaction['source_id'] : 0;
$destinations[] = isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : 0;
}
$destinations = array_unique($destinations);
$sources = array_unique($sources);
// switch on type:
switch ($data['type']) {
case 'withdrawal':
if (count($sources) > 1) {
if (\count($sources) > 1) {
$validator->errors()->add('transactions.0.source_id', trans('validation.all_accounts_equal'));
}
break;
case 'deposit':
if (count($destinations) > 1) {
if (\count($destinations) > 1) {
$validator->errors()->add('transactions.0.destination_id', trans('validation.all_accounts_equal'));
}
break;
case 'transfer':
if (count($sources) > 1 || count($destinations) > 1) {
if (\count($sources) > 1 || \count($destinations) > 1) {
$validator->errors()->add('transactions.0.source_id', trans('validation.all_accounts_equal'));
$validator->errors()->add('transactions.0.destination_id', trans('validation.all_accounts_equal'));
}

View File

@@ -89,9 +89,9 @@ class CreateExport extends Command
$accountRepository->setUser($user);
// first date
$firstJournal = $journalRepository->first();
$firstJournal = $journalRepository->firstNull();
$first = new Carbon;
if (null !== $firstJournal->id) {
if (null !== $firstJournal) {
$first = $firstJournal->date;
}
@@ -129,5 +129,7 @@ class CreateExport extends Command
$this->line('The export has finished! You can find the ZIP file in this location:');
$this->line(storage_path(sprintf('export/%s', $fileName)));
return 0;
}
}

View File

@@ -47,14 +47,6 @@ 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()
{
parent::__construct();
}
/**
* Execute the console command.
*
@@ -65,7 +57,7 @@ class DecryptAttachment extends Command
{
/** @var AttachmentRepositoryInterface $repository */
$repository = app(AttachmentRepositoryInterface::class);
$attachmentId = intval($this->argument('id'));
$attachmentId = (int)$this->argument('id');
$attachment = $repository->findWithoutUser($attachmentId);
$attachmentName = trim($this->argument('name'));
$storagePath = realpath(trim($this->argument('directory')));
@@ -108,6 +100,5 @@ class DecryptAttachment extends Command
}
$this->info(sprintf('%d bytes written. Exiting now..', $result));
return;
}
}

View File

@@ -48,14 +48,6 @@ class Import extends Command
*/
protected $signature = 'firefly:start-import {key}';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Run the import routine.
*
@@ -101,7 +93,6 @@ class Import extends Command
sprintf('The import has finished. %d transactions have been imported out of %d records.', $routine->getJournals()->count(), $routine->getLines())
);
return;
}
/**

View File

@@ -48,14 +48,6 @@ class ScanAttachments extends Command
*/
protected $signature = 'firefly:scan-attachments';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/

View File

@@ -23,17 +23,25 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands;
use DB;
use Exception;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountMeta;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Attachment;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Note;
use FireflyIII\Models\Preference;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Models\RuleTrigger;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionJournalMeta;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\User;
use Illuminate\Console\Command;
use Illuminate\Database\QueryException;
use Illuminate\Support\Collection;
@@ -64,18 +72,8 @@ class UpgradeDatabase extends Command
*/
protected $signature = 'firefly:upgrade-database';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @throws \Exception
*/
public function handle()
{
@@ -88,9 +86,128 @@ class UpgradeDatabase extends Command
$this->line('Done updating currency information..');
$this->migrateNotes();
$this->migrateAttachmentData();
$this->info('Firefly III database is up to date.');
$this->migrateBillsToRules();
return;
$this->info('Firefly III database is up to date.');
}
public function migrateBillsToRules()
{
foreach (User::get() as $user) {
/** @var Preference $lang */
$lang = Preferences::getForUser($user, 'language', 'en_US');
$groupName = (string)trans('firefly.rulegroup_for_bills_title', [], $lang->data);
$ruleGroup = $user->ruleGroups()->where('title', $groupName)->first();
$currencyPreference = Preferences::getForUser($user, 'currencyPreference', config('firefly.default_currency', 'EUR'));
$currency = TransactionCurrency::where('code', $currencyPreference->data)->first();
if (null === $currency) {
$currency = app('amount')->getDefaultCurrency();
}
if ($ruleGroup === null) {
$array = RuleGroup::get(['order'])->pluck('order')->toArray();
$order = \count($array) > 0 ? max($array) + 1 : 1;
$ruleGroup = RuleGroup::create(
[
'user_id' => $user->id,
'title' => (string)trans('firefly.rulegroup_for_bills_title', [], $lang->data),
'description' => (string)trans('firefly.rulegroup_for_bills_description', [], $lang->data),
'order' => $order,
'active' => 1,
]
);
}
// loop bills.
$order = 1;
/** @var Collection $collection */
$collection = $user->bills()->get();
/** @var Bill $bill */
foreach ($collection as $bill) {
if ($bill->match !== 'MIGRATED_TO_RULES') {
$rule = Rule::create(
[
'user_id' => $user->id,
'rule_group_id' => $ruleGroup->id,
'title' => (string)trans('firefly.rule_for_bill_title', ['name' => $bill->name], $lang->data),
'description' => (string)trans('firefly.rule_for_bill_description', ['name' => $bill->name], $lang->data),
'order' => $order,
'active' => $bill->active,
'stop_processing' => 1,
]
);
// add default trigger
RuleTrigger::create(
[
'rule_id' => $rule->id,
'trigger_type' => 'user_action',
'trigger_value' => 'store-journal',
'active' => 1,
'stop_processing' => 0,
'order' => 1,
]
);
// add trigger for description
$match = implode(' ', explode(',', $bill->match));
RuleTrigger::create(
[
'rule_id' => $rule->id,
'trigger_type' => 'description_contains',
'trigger_value' => $match,
'active' => 1,
'stop_processing' => 0,
'order' => 2,
]
);
// add triggers for amounts:
RuleTrigger::create(
[
'rule_id' => $rule->id,
'trigger_type' => 'amount_less',
'trigger_value' => round($bill->amount_max, $currency->decimal_places),
'active' => 1,
'stop_processing' => 0,
'order' => 3,
]
);
RuleTrigger::create(
[
'rule_id' => $rule->id,
'trigger_type' => 'amount_more',
'trigger_value' => round($bill->amount_min, $currency->decimal_places),
'active' => 1,
'stop_processing' => 0,
'order' => 4,
]
);
// create action
RuleAction::create(
[
'rule_id' => $rule->id,
'action_type' => 'link_to_bill',
'action_value' => $bill->name,
'order' => 1,
'active' => 1,
'stop_processing' => 0,
]
);
$order++;
$bill->match = 'MIGRATED_TO_RULES';
$bill->save();
$this->line(sprintf('Updated bill #%d ("%s") so it will use rules.', $bill->id, $bill->name));
}
// give bills a currency when they dont have one.
if (null === $bill->transaction_currency_id) {
$this->line(sprintf('Gave bill #%d ("%s") a currency (%s).', $bill->id, $bill->name, $currency->name));
$bill->transactionCurrency()->associate($currency);
$bill->save();
}
}
}
}
/**
@@ -120,10 +237,9 @@ class UpgradeDatabase extends Command
$journalIds = array_unique($result->pluck('id')->toArray());
foreach ($journalIds as $journalId) {
$this->updateJournalidentifiers(intval($journalId));
$this->updateJournalidentifiers((int)$journalId);
}
return;
}
/**
@@ -142,9 +258,9 @@ class UpgradeDatabase extends Command
// get users preference, fall back to system pref.
$defaultCurrencyCode = Preferences::getForUser($account->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data;
$defaultCurrency = TransactionCurrency::where('code', $defaultCurrencyCode)->first();
$accountCurrency = intval($account->getMeta('currency_id'));
$accountCurrency = (int)$account->getMeta('currency_id');
$openingBalance = $account->getOpeningBalance();
$obCurrency = intval($openingBalance->transaction_currency_id);
$obCurrency = (int)$openingBalance->transaction_currency_id;
// both 0? set to default currency:
if (0 === $accountCurrency && 0 === $obCurrency) {
@@ -177,7 +293,6 @@ class UpgradeDatabase extends Command
}
);
return;
}
/**
@@ -211,7 +326,7 @@ class UpgradeDatabase extends Command
}
/** @var Account $account */
$account = $transaction->account;
$currency = $repository->find(intval($account->getMeta('currency_id')));
$currency = $repository->find((int)$account->getMeta('currency_id'));
$transactions = $journal->transactions()->get();
$transactions->each(
function (Transaction $transaction) use ($currency) {
@@ -221,8 +336,8 @@ class UpgradeDatabase extends Command
}
// when mismatch in transaction:
if (!(intval($transaction->transaction_currency_id) === intval($currency->id))) {
$transaction->foreign_currency_id = intval($transaction->transaction_currency_id);
if (!((int)$transaction->transaction_currency_id === (int)$currency->id)) {
$transaction->foreign_currency_id = (int)$transaction->transaction_currency_id;
$transaction->foreign_amount = $transaction->amount;
$transaction->transaction_currency_id = $currency->id;
$transaction->save();
@@ -235,7 +350,6 @@ class UpgradeDatabase extends Command
}
);
return;
}
/**
@@ -274,11 +388,11 @@ class UpgradeDatabase extends Command
{
// create transaction type "Reconciliation".
$type = TransactionType::where('type', TransactionType::RECONCILIATION)->first();
if (is_null($type)) {
if (null === $type) {
TransactionType::create(['type' => TransactionType::RECONCILIATION]);
}
$account = AccountType::where('type', AccountType::RECONCILIATION)->first();
if (is_null($account)) {
if (null === $account) {
AccountType::create(['type' => AccountType::RECONCILIATION]);
}
}
@@ -295,11 +409,11 @@ class UpgradeDatabase extends Command
foreach ($attachments as $att) {
// move description:
$description = strval($att->description);
if (strlen($description) > 0) {
$description = (string)$att->description;
if (\strlen($description) > 0) {
// find or create note:
$note = $att->notes()->first();
if (is_null($note)) {
if (null === $note) {
$note = new Note;
$note->noteable()->associate($att);
}
@@ -317,8 +431,6 @@ class UpgradeDatabase extends Command
/**
* Move all the journal_meta notes to their note object counter parts.
*
* @throws \Exception
*/
private function migrateNotes(): void
{
@@ -335,7 +447,11 @@ class UpgradeDatabase extends Command
$note->text = $meta->data;
$note->save();
Log::debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id));
try {
$meta->delete();
} catch (Exception $e) {
Log::error(sprintf('Could not delete old meta entry #%d: %s', $meta->id, $e->getMessage()));
}
}
}
@@ -348,10 +464,10 @@ class UpgradeDatabase extends Command
{
/** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class);
$currency = $repository->find(intval($transaction->account->getMeta('currency_id')));
$currency = $repository->find((int)$transaction->account->getMeta('currency_id'));
$journal = $transaction->transactionJournal;
if (!(intval($currency->id) === intval($journal->transaction_currency_id))) {
if (!((int)$currency->id === (int)$journal->transaction_currency_id)) {
$this->line(
sprintf(
'Transfer #%d ("%s") has been updated to use %s instead of %s.',
@@ -365,7 +481,6 @@ class UpgradeDatabase extends Command
$journal->save();
}
return;
}
/**
@@ -382,7 +497,7 @@ class UpgradeDatabase extends Command
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
// find opposing:
$amount = bcmul(strval($transaction->amount), '-1');
$amount = bcmul((string)$transaction->amount, '-1');
try {
/** @var Transaction $opposing */
@@ -411,7 +526,6 @@ class UpgradeDatabase extends Command
++$identifier;
}
return;
}
/**
@@ -432,18 +546,24 @@ class UpgradeDatabase extends Command
{
/** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class);
$currency = $repository->find(intval($transaction->account->getMeta('currency_id')));
$currency = $repository->findNull((int)$transaction->account->getMeta('currency_id'));
if (null === $currency) {
Log::error(sprintf('Account #%d ("%s") must have currency preference but has none.', $transaction->account->id, $transaction->account->name));
return;
}
// has no currency ID? Must have, so fill in using account preference:
if (null === $transaction->transaction_currency_id) {
$transaction->transaction_currency_id = intval($currency->id);
$transaction->transaction_currency_id = (int)$currency->id;
Log::debug(sprintf('Transaction #%d has no currency setting, now set to %s', $transaction->id, $currency->code));
$transaction->save();
}
// does not match the source account (see above)? Can be fixed
// when mismatch in transaction and NO foreign amount is set:
if (!(intval($transaction->transaction_currency_id) === intval($currency->id)) && null === $transaction->foreign_amount) {
if (!((int)$transaction->transaction_currency_id === (int)$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.',
@@ -453,7 +573,7 @@ class UpgradeDatabase extends Command
$transaction->amount
)
);
$transaction->transaction_currency_id = intval($currency->id);
$transaction->transaction_currency_id = (int)$currency->id;
$transaction->save();
}
@@ -462,16 +582,16 @@ class UpgradeDatabase extends Command
$journal = $transaction->transactionJournal;
/** @var Transaction $opposing */
$opposing = $journal->transactions()->where('amount', '>', 0)->where('identifier', $transaction->identifier)->first();
$opposingCurrency = $repository->find(intval($opposing->account->getMeta('currency_id')));
$opposingCurrency = $repository->findNull((int)$opposing->account->getMeta('currency_id'));
if (null === $opposingCurrency->id) {
if (null === $opposingCurrency) {
Log::error(sprintf('Account #%d ("%s") must have currency preference but has none.', $opposing->account->id, $opposing->account->name));
return;
}
// if the destination account currency is the same, both foreign_amount and foreign_currency_id must be NULL for both transactions:
if (intval($opposingCurrency->id) === intval($currency->id)) {
if ((int)$opposingCurrency->id === (int)$currency->id) {
// update both transactions to match:
$transaction->foreign_amount = null;
$transaction->foreign_currency_id = null;
@@ -480,12 +600,17 @@ class UpgradeDatabase extends Command
$opposing->transaction_currency_id = $currency->id;
$transaction->save();
$opposing->save();
Log::debug(sprintf('Cleaned up transaction #%d and #%d', $transaction->id, $opposing->id));
Log::debug(sprintf('Currency for account "%s" is %s, and currency for account "%s" is also
%s, so %s #%d (#%d and #%d) has been verified to be to %s exclusively.',
$opposing->account->name, $opposingCurrency->code,
$transaction->account->name, $transaction->transactionCurrency->code,
$journal->transactionType->type, $journal->id,
$transaction->id, $opposing->id, $currency->code));
return;
}
// if destination account currency is different, both transactions must have this currency as foreign currency id.
if (!(intval($opposingCurrency->id) === intval($currency->id))) {
if (!((int)$opposingCurrency->id === (int)$currency->id)) {
$transaction->foreign_currency_id = $opposingCurrency->id;
$opposing->foreign_currency_id = $opposingCurrency->id;
$transaction->save();
@@ -495,14 +620,14 @@ class UpgradeDatabase extends Command
// if foreign amount of one is null and the other is not, use this to restore:
if (null === $transaction->foreign_amount && null !== $opposing->foreign_amount) {
$transaction->foreign_amount = bcmul(strval($opposing->foreign_amount), '-1');
$transaction->foreign_amount = bcmul((string)$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 (null === $opposing->foreign_amount && null !== $transaction->foreign_amount) {
$opposing->foreign_amount = bcmul(strval($transaction->foreign_amount), '-1');
$opposing->foreign_amount = bcmul((string)$transaction->foreign_amount, '-1');
$opposing->save();
Log::debug(sprintf('Restored foreign amount of transaction (2) #%d to %s', $opposing->id, $opposing->foreign_amount));
}
@@ -512,14 +637,14 @@ class UpgradeDatabase extends Command
$foreignAmount = $journal->getMeta('foreign_amount');
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');
$transaction->foreign_amount = bcmul((string)$transaction->amount, '-1');
$opposing->foreign_amount = bcmul((string)$opposing->amount, '-1');
$transaction->save();
$opposing->save();
return;
}
$foreignPositive = app('steam')->positive(strval($foreignAmount));
$foreignPositive = app('steam')->positive((string)$foreignAmount);
Log::debug(
sprintf(
'Journal #%d has missing foreign currency info, try to restore from meta-data ("%s").',
@@ -533,7 +658,6 @@ class UpgradeDatabase extends Command
$opposing->save();
}
return;
}
}

View File

@@ -42,14 +42,6 @@ class UpgradeFireflyInstructions extends Command
*/
protected $signature = 'firefly:instructions {task}';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
@@ -100,7 +92,7 @@ class UpgradeFireflyInstructions extends Command
$text = '';
foreach (array_keys($config) as $compare) {
// if string starts with:
$len = strlen($compare);
$len = \strlen($compare);
if (substr($version, 0, $len) === $compare) {
$text = $config[$compare];
}
@@ -147,7 +139,7 @@ class UpgradeFireflyInstructions extends Command
$text = '';
foreach (array_keys($config) as $compare) {
// if string starts with:
$len = strlen($compare);
$len = \strlen($compare);
if (substr($version, 0, $len) === $compare) {
$text = $config[$compare];
}

View File

@@ -44,14 +44,6 @@ class UseEncryption extends Command
*/
protected $signature = 'firefly:use-encryption';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/

View File

@@ -61,14 +61,6 @@ class VerifyDatabase extends Command
*/
protected $signature = 'firefly:verify';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
@@ -95,12 +87,13 @@ class VerifyDatabase extends Command
$this->createLinkTypes();
$this->createAccessTokens();
$this->fixDoubleAmounts();
$this->fixBadMeta();
}
/**
* Create user access tokens, if not present already.
*/
private function createAccessTokens()
private function createAccessTokens(): void
{
$count = 0;
$users = User::get();
@@ -122,7 +115,7 @@ class VerifyDatabase extends Command
/**
* Create default link types if necessary.
*/
private function createLinkTypes()
private function createLinkTypes(): void
{
$count = 0;
$set = [
@@ -148,7 +141,69 @@ class VerifyDatabase extends Command
}
}
private function fixDoubleAmounts()
/**
* Fix the situation where the matching transactions
* of a journal somehow have non-matching categories
* or budgets
*/
private function fixBadMeta(): void
{
// categories
$set = Transaction
::leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id')
->whereNull('transactions.deleted_at')
->get(['transactions.id', 'transaction_journal_id', 'identifier', 'category_transaction.category_id', 'category_transaction.id as ct_id']);
$results = [];
foreach ($set as $obj) {
$key = $obj->transaction_journal_id . '-' . $obj->identifier;
$category = (int)$obj->category_id;
// value exists and is not category:
if (isset($results[$key]) && $results[$key] !== $category) {
$this->error(
sprintf(
'Transaction #%d referred to the wrong category. Was category #%d but is fixed to be category #%d.', $obj->transaction_journal_id, $category, $results[$key]
)
);
DB::table('category_transaction')->where('id', $obj->ct_id)->update(['category_id' => $results[$key]]);
}
// value does not exist:
if ($category > 0 && !isset($results[$key])) {
$results[$key] = $category;
}
}
// budgets
$set = Transaction
::leftJoin('budget_transaction', 'budget_transaction.transaction_id', '=', 'transactions.id')
->whereNull('transactions.deleted_at')
->get(['transactions.id', 'transaction_journal_id', 'identifier', 'budget_transaction.budget_id', 'budget_transaction.id as ct_id']);
$results = [];
foreach ($set as $obj) {
$key = $obj->transaction_journal_id . '-' . $obj->identifier;
$budget = (int)$obj->budget_id;
// value exists and is not budget:
if (isset($results[$key]) && $results[$key] !== $budget) {
$this->error(
sprintf(
'Transaction #%d referred to the wrong budget. Was budget #%d but is fixed to be budget #%d.', $obj->transaction_journal_id, $budget, $results[$key]
)
);
DB::table('budget_transaction')->where('id', $obj->ct_id)->update(['budget_id' => $results[$key]]);
}
// value does not exist:
if ($budget > 0 && !isset($results[$key])) {
$results[$key] = $budget;
}
}
}
private function fixDoubleAmounts(): void
{
$count = 0;
// get invalid journals
@@ -158,7 +213,7 @@ class VerifyDatabase extends Command
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')]);
/** @var stdClass $entry */
foreach ($journals as $entry) {
if (0 !== bccomp(strval($entry->the_sum), '0')) {
if (0 !== bccomp((string)$entry->the_sum, '0')) {
$errored[] = $entry->transaction_journal_id;
}
}
@@ -171,7 +226,7 @@ class VerifyDatabase extends Command
// report about it
/** @var TransactionJournal $journal */
$journal = TransactionJournal::find($journalId);
if (is_null($journal)) {
if (null === $journal) {
continue;
}
if (TransactionType::OPENING_BALANCE === $journal->transactionType->type) {
@@ -194,8 +249,6 @@ class VerifyDatabase extends Command
if (0 === $count) {
$this->info('Amount integrity OK!');
}
return;
}
/**
@@ -225,8 +278,6 @@ class VerifyDatabase extends Command
return true;
}
);
return;
}
/**
@@ -254,7 +305,7 @@ class VerifyDatabase extends Command
/**
* Reports on budgets with no budget limits (which makes them pointless).
*/
private function reportBudgetLimits()
private function reportBudgetLimits(): void
{
$set = Budget::leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budgets.id')
->leftJoin('users', 'budgets.user_id', '=', 'users.id')
@@ -278,7 +329,7 @@ class VerifyDatabase extends Command
/**
* Reports on deleted accounts that still have not deleted transactions or journals attached to them.
*/
private function reportDeletedAccounts()
private function reportDeletedAccounts(): void
{
$set = Account::leftJoin('transactions', 'transactions.account_id', '=', 'accounts.id')
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
@@ -297,7 +348,7 @@ class VerifyDatabase extends Command
);
/** @var stdClass $entry */
foreach ($set as $entry) {
$date = null === $entry->transaction_deleted_at ? $entry->journal_deleted_at : $entry->transaction_deleted_at;
$date = $entry->transaction_deleted_at ?? $entry->journal_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 . '"'
@@ -308,7 +359,7 @@ class VerifyDatabase extends Command
/**
* Report on journals with bad account types linked to them.
*/
private function reportIncorrectJournals()
private function reportIncorrectJournals(): void
{
$configuration = [
// a withdrawal can not have revenue account:
@@ -350,7 +401,7 @@ class VerifyDatabase extends Command
/**
* Any deleted transaction journals that have transactions that are NOT deleted:.
*/
private function reportJournals()
private function reportJournals(): void
{
$count = 0;
$set = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
@@ -381,7 +432,7 @@ class VerifyDatabase extends Command
/**
* Report on journals without transactions.
*/
private function reportNoTransactions()
private function reportNoTransactions(): void
{
$count = 0;
$set = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
@@ -405,7 +456,7 @@ class VerifyDatabase extends Command
*
* @param string $name
*/
private function reportObject(string $name)
private function reportObject(string $name): void
{
$plural = str_plural($name);
$class = sprintf('FireflyIII\Models\%s', ucfirst($name));
@@ -441,14 +492,14 @@ class VerifyDatabase extends Command
/**
* Reports for each user when the sum of their transactions is not zero.
*/
private function reportSum()
private function reportSum(): void
{
/** @var UserRepositoryInterface $userRepository */
$userRepository = app(UserRepositoryInterface::class);
/** @var User $user */
foreach ($userRepository->all() as $user) {
$sum = strval($user->transactions()->sum('amount'));
$sum = (string)$user->transactions()->sum('amount');
if (0 !== bccomp($sum, '0')) {
$this->error('Error: Transactions for user #' . $user->id . ' (' . $user->email . ') are off by ' . $sum . '!');
} else {
@@ -460,7 +511,7 @@ class VerifyDatabase extends Command
/**
* Reports on deleted transactions that are connected to a not deleted journal.
*/
private function reportTransactions()
private function reportTransactions(): void
{
$set = Transaction::leftJoin('transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
->whereNotNull('transactions.deleted_at')

View File

@@ -85,7 +85,7 @@ class Handler extends ExceptionHandler
return response()->json(
[
'message' => $exception->getMessage(),
'exception' => get_class($exception),
'exception' => \get_class($exception),
'line' => $exception->getLine(),
'file' => $exception->getFile(),
'trace' => $exception->getTrace(),
@@ -93,7 +93,7 @@ class Handler extends ExceptionHandler
);
}
return response()->json(['message' => 'Internal Firefly III Exception. See log files.', 'exception' => get_class($exception)], 500);
return response()->json(['message' => 'Internal Firefly III Exception. See log files.', 'exception' => \get_class($exception)], 500);
}
if ($exception instanceof FireflyException || $exception instanceof ErrorException) {
@@ -131,7 +131,7 @@ class Handler extends ExceptionHandler
$userData['email'] = auth()->user()->email;
}
$data = [
'class' => get_class($exception),
'class' => \get_class($exception),
'errorMessage' => $exception->getMessage(),
'time' => date('r'),
'stackTrace' => $exception->getTraceAsString(),

View File

@@ -98,13 +98,15 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
if ($this->uploadDisk->exists($file)) {
try {
$decrypted = Crypt::decrypt($this->uploadDisk->get($file));
} catch (DecryptException $e) {
Log::error('Catchable error: could not decrypt attachment #' . $attachment->id . ' because: ' . $e->getMessage());
return false;
}
}
$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;
}
@@ -118,7 +120,7 @@ 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);
return sprintf('%s-Attachment nr. %s - %s', $this->job->key, (string)$attachment->id, $attachment->filename);
}
/**
@@ -127,8 +129,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
private function getAttachments(): Collection
{
$this->repository->setUser($this->user);
$attachments = $this->repository->getBetween($this->start, $this->end);
return $attachments;
return $this->repository->getBetween($this->start, $this->end);
}
}

View File

@@ -103,7 +103,7 @@ class UploadCollector extends BasicCollector implements CollectorInterface
Log::error(sprintf('Could not decrypt old import file "%s". Skipped because: %s', $key, $e->getMessage()));
}
if (strlen($content) > 0) {
if (\strlen($content) > 0) {
// add to export disk.
$date = $job->created_at->format('Y-m-d');
$file = sprintf('%s-Old %s import dated %s.%s', $this->job->key, strtoupper($job->file_type), $date, $job->file_type);

View File

@@ -199,31 +199,29 @@ final class Entry
$entry->transaction_id = $transaction->id;
$entry->date = $transaction->date->format('Ymd');
$entry->description = $transaction->description;
if (strlen(strval($transaction->transaction_description)) > 0) {
if (\strlen((string)$transaction->transaction_description) > 0) {
$entry->description = $transaction->transaction_description . '(' . $transaction->description . ')';
}
$entry->currency_code = $transaction->transactionCurrency->code;
$entry->amount = strval(round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places));
$entry->amount = (string)round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places);
$entry->foreign_currency_code = null === $transaction->foreign_currency_id ? null : $transaction->foreignCurrency->code;
$entry->foreign_amount = null === $transaction->foreign_currency_id
? null
: strval(
round(
: (string)round(
$transaction->transaction_foreign_amount,
$transaction->foreignCurrency->decimal_places
)
);
$entry->transaction_type = $transaction->transaction_type_type;
$entry->asset_account_id = strval($transaction->account_id);
$entry->asset_account_id = (string)$transaction->account_id;
$entry->asset_account_name = app('steam')->tryDecrypt($transaction->account_name);
$entry->asset_account_iban = $transaction->account_iban;
$entry->asset_account_number = $transaction->account_number;
$entry->asset_account_bic = $transaction->account_bic;
$entry->asset_currency_code = $transaction->account_currency_code;
$entry->opposing_account_id = strval($transaction->opposing_account_id);
$entry->opposing_account_id = (string)$transaction->opposing_account_id;
$entry->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name);
$entry->opposing_account_iban = $transaction->opposing_account_iban;
$entry->opposing_account_number = $transaction->opposing_account_number;
@@ -231,7 +229,7 @@ final class Entry
$entry->opposing_currency_code = $transaction->opposing_currency_code;
// budget
$entry->budget_id = strval($transaction->transaction_budget_id);
$entry->budget_id = (string)$transaction->transaction_budget_id;
$entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_budget_name);
if (null === $transaction->transaction_budget_id) {
$entry->budget_id = $transaction->transaction_journal_budget_id;
@@ -239,7 +237,7 @@ final class Entry
}
// category
$entry->category_id = strval($transaction->transaction_category_id);
$entry->category_id = (string)$transaction->transaction_category_id;
$entry->category_name = app('steam')->tryDecrypt($transaction->transaction_category_name);
if (null === $transaction->transaction_category_id) {
$entry->category_id = $transaction->transaction_journal_category_id;
@@ -247,7 +245,7 @@ final class Entry
}
// budget
$entry->bill_id = strval($transaction->bill_id);
$entry->bill_id = (string)$transaction->bill_id;
$entry->bill_name = app('steam')->tryDecrypt($transaction->bill_name);
$entry->tags = $transaction->tags;

View File

@@ -39,6 +39,7 @@ use Illuminate\Support\Collection;
use Log;
use Storage;
use ZipArchive;
use FireflyIII\Models\TransactionJournal;
/**
* Class ExpandedProcessor.
@@ -118,11 +119,11 @@ class ExpandedProcessor implements ProcessorInterface
$currencies = $this->getAccountCurrencies($ibans);
$transactions->each(
function (Transaction $transaction) use ($notes, $tags, $ibans, $currencies) {
$journalId = intval($transaction->journal_id);
$accountId = intval($transaction->account_id);
$opposingId = intval($transaction->opposing_account_id);
$currencyId = $ibans[$accountId]['currency_id'] ?? 0;
$opposingCurrencyId = $ibans[$opposingId]['currency_id'] ?? 0;
$journalId = (int)$transaction->journal_id;
$accountId = (int)$transaction->account_id;
$opposingId = (int)$transaction->opposing_account_id;
$currencyId = (int)($ibans[$accountId]['currency_id'] ?? 0.0);
$opposingCurrencyId = (int)($ibans[$opposingId]['currency_id'] ?? 0.0);
$transaction->notes = $notes[$journalId] ?? '';
$transaction->tags = implode(',', $tags[$journalId] ?? []);
$transaction->account_number = $ibans[$accountId]['accountNumber'] ?? '';
@@ -263,7 +264,7 @@ class ExpandedProcessor implements ProcessorInterface
$ids = [];
$repository->setUser($this->job->user);
foreach ($array as $value) {
$ids[] = $value['currency_id'] ?? 0;
$ids[] = (int)($value['currency_id'] ?? 0.0);
}
$ids = array_unique($ids);
$result = $repository->getByIds($ids);
@@ -293,7 +294,7 @@ class ExpandedProcessor implements ProcessorInterface
->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data']);
/** @var AccountMeta $meta */
foreach ($set as $meta) {
$id = intval($meta->account_id);
$id = (int)$meta->account_id;
$return[$id][$meta->name] = $meta->data;
}
@@ -310,14 +311,14 @@ class ExpandedProcessor implements ProcessorInterface
private function getNotes(array $array): array
{
$array = array_unique($array);
$notes = Note::where('notes.noteable_type', 'FireflyIII\\Models\\TransactionJournal')
$notes = Note::where('notes.noteable_type', TransactionJournal::class)
->whereIn('notes.noteable_id', $array)
->get(['notes.*']);
$return = [];
/** @var Note $note */
foreach ($notes as $note) {
if (strlen(trim(strval($note->text))) > 0) {
$id = intval($note->noteable_id);
if (\strlen(trim((string)$note->text)) > 0) {
$id = (int)$note->noteable_id;
$return[$id] = $note->text;
}
}
@@ -343,8 +344,8 @@ class ExpandedProcessor implements ProcessorInterface
->get(['tag_transaction_journal.transaction_journal_id', 'tags.tag']);
$result = [];
foreach ($set as $entry) {
$id = intval($entry->transaction_journal_id);
$result[$id] = isset($result[$id]) ? $result[$id] : [];
$id = (int)$entry->transaction_journal_id;
$result[$id] = $result[$id] ?? [];
$result[$id][] = Crypt::decrypt($entry->tag);
}

View File

@@ -34,14 +34,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface
/** @var string */
private $fileName;
/**
* CsvExporter constructor.
*/
public function __construct()
{
parent::__construct();
}
/**
* @return string
*/
@@ -53,7 +45,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface
/**
* @return bool
*
* @throws \TypeError
*/
public function run(): bool
{

View File

@@ -43,7 +43,6 @@ class AccountFactory
* @param array $data
*
* @return Account
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function create(array $data): Account
{
@@ -64,8 +63,8 @@ class AccountFactory
'user_id' => $this->user->id,
'account_type_id' => $type->id,
'name' => $data['name'],
'virtual_balance' => strlen(strval($data['virtualBalance'])) === 0 ? '0' : $data['virtualBalance'],
'active' => true === $data['active'] ? true : false,
'virtual_balance' => $data['virtualBalance'] ?? '0',
'active' => true === $data['active'],
'iban' => $data['iban'],
];
@@ -74,6 +73,11 @@ class AccountFactory
$databaseData['virtual_balance'] = '0';
}
// fix virtual balance when it's empty
if ($databaseData['virtual_balance'] === '') {
$databaseData['virtual_balance'] = '0';
}
$newAccount = Account::create($databaseData);
$this->updateMetaData($newAccount, $data);
@@ -117,8 +121,6 @@ class AccountFactory
* @param string $accountType
*
* @return Account
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function findOrCreate(string $accountName, string $accountType): Account
{
@@ -161,13 +163,13 @@ class AccountFactory
*/
protected function getAccountType(?int $accountTypeId, ?string $accountType): ?AccountType
{
$accountTypeId = intval($accountTypeId);
$accountTypeId = (int)$accountTypeId;
if ($accountTypeId > 0) {
return AccountType::find($accountTypeId);
}
$type = config('firefly.accountTypeByIdentifier.' . strval($accountType));
$type = config('firefly.accountTypeByIdentifier.' . (string)$accountType);
$result = AccountType::whereType($type)->first();
if (is_null($result) && !is_null($accountType)) {
if (null === $result && null !== $accountType) {
// try as full name:
$result = AccountType::whereType($accountType)->first();
}

View File

@@ -45,22 +45,19 @@ class BillFactory
*/
public function create(array $data): ?Bill
{
$matchArray = explode(',', $data['match']);
$matchArray = array_unique($matchArray);
$match = join(',', $matchArray);
/** @var Bill $bill */
$bill = Bill::create(
[
'name' => $data['name'],
'match' => $match,
'match' => 'MIGRATED_TO_RULES',
'amount_min' => $data['amount_min'],
'user_id' => $this->user->id,
'transaction_currency_id' => $data['transaction_currency_id'],
'amount_max' => $data['amount_max'],
'date' => $data['date'],
'repeat_freq' => $data['repeat_freq'],
'skip' => $data['skip'],
'automatch' => $data['automatch'],
'automatch' => true,
'active' => $data['active'],
]
);
@@ -81,22 +78,22 @@ class BillFactory
*/
public function find(?int $billId, ?string $billName): ?Bill
{
$billId = intval($billId);
$billName = strval($billName);
$billId = (int)$billId;
$billName = (string)$billName;
// first find by ID:
if ($billId > 0) {
/** @var Bill $bill */
$bill = $this->user->bills()->find($billId);
if (!is_null($bill)) {
if (null !== $bill) {
return $bill;
}
}
// then find by name:
if (strlen($billName) > 0) {
if (\strlen($billName) > 0) {
$bill = $this->findByName($billName);
if (!is_null($bill)) {
if (null !== $bill) {
return $bill;
}
}

View File

@@ -44,10 +44,10 @@ class BudgetFactory
*/
public function find(?int $budgetId, ?string $budgetName): ?Budget
{
$budgetId = intval($budgetId);
$budgetName = strval($budgetName);
$budgetId = (int)$budgetId;
$budgetName = (string)$budgetName;
if (strlen($budgetName) === 0 && $budgetId === 0) {
if (\strlen($budgetName) === 0 && $budgetId === 0) {
return null;
}
@@ -55,14 +55,14 @@ class BudgetFactory
if ($budgetId > 0) {
/** @var Budget $budget */
$budget = $this->user->budgets()->find($budgetId);
if (!is_null($budget)) {
if (null !== $budget) {
return $budget;
}
}
if (strlen($budgetName) > 0) {
if (\strlen($budgetName) > 0) {
$budget = $this->findByName($budgetName);
if (!is_null($budget)) {
if (null !== $budget) {
return $budget;
}
}

View File

@@ -44,16 +44,18 @@ class CategoryFactory
*/
public function findByName(string $name): ?Category
{
$result = null;
/** @var Collection $collection */
$collection = $this->user->categories()->get();
/** @var Category $category */
foreach ($collection as $category) {
if ($category->name === $name) {
return $category;
$result = $category;
break;
}
}
return null;
return $result;
}
/**
@@ -64,26 +66,26 @@ class CategoryFactory
*/
public function findOrCreate(?int $categoryId, ?string $categoryName): ?Category
{
$categoryId = intval($categoryId);
$categoryName = strval($categoryName);
$categoryId = (int)$categoryId;
$categoryName = (string)$categoryName;
Log::debug(sprintf('Going to find category with ID %d and name "%s"', $categoryId, $categoryName));
if (strlen($categoryName) === 0 && $categoryId === 0) {
if (\strlen($categoryName) === 0 && $categoryId === 0) {
return null;
}
// first by ID:
if ($categoryId > 0) {
/** @var Category $category */
$category = $this->user->categories()->find($categoryId);
if (!is_null($category)) {
if (null !== $category) {
return $category;
}
}
if (strlen($categoryName) > 0) {
if (\strlen($categoryName) > 0) {
$category = $this->findByName($categoryName);
if (!is_null($category)) {
if (null !== $category) {
return $category;
}

View File

@@ -46,7 +46,7 @@ class PiggyBankEventFactory
public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): ?PiggyBankEvent
{
Log::debug(sprintf('Now in PiggyBankEventCreate for a %s', $journal->transactionType->type));
if (is_null($piggyBank)) {
if (null === $piggyBank) {
return null;
}
@@ -62,8 +62,8 @@ class PiggyBankEventFactory
$piggyRepos->setUser($journal->user);
// repetition exists?
$repetition = $piggyRepos->getRepetition($piggyBank, $journal->date);
if (null === $repetition->id) {
$repetition = $piggyRepos->getRepetition($piggyBank);
if (null === $repetition) {
Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d')));
return null;

View File

@@ -43,25 +43,25 @@ class PiggyBankFactory
*/
public function find(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank
{
$piggyBankId = intval($piggyBankId);
$piggyBankName = strval($piggyBankName);
if (strlen($piggyBankName) === 0 && $piggyBankId === 0) {
$piggyBankId = (int)$piggyBankId;
$piggyBankName = (string)$piggyBankName;
if (\strlen($piggyBankName) === 0 && $piggyBankId === 0) {
return null;
}
// first find by ID:
if ($piggyBankId > 0) {
/** @var PiggyBank $piggyBank */
$piggyBank = $this->user->piggyBanks()->find($piggyBankId);
if (!is_null($piggyBank)) {
if (null !== $piggyBank) {
return $piggyBank;
}
}
// then find by name:
if (strlen($piggyBankName) > 0) {
if (\strlen($piggyBankName) > 0) {
/** @var PiggyBank $piggyBank */
$piggyBank = $this->findByName($piggyBankName);
if (!is_null($piggyBank)) {
if (null !== $piggyBank) {
return $piggyBank;
}
}

View File

@@ -65,13 +65,13 @@ class TagFactory
*/
public function findOrCreate(string $tag): ?Tag
{
if (is_null($this->tags)) {
if (null === $this->tags) {
$this->tags = $this->user->tags()->get();
}
/** @var Tag $object */
foreach ($this->tags as $object) {
if ($object->tag === $tag) {
if (strtolower($object->tag) === strtolower($tag)) {
return $object;
}
}

View File

@@ -65,24 +65,24 @@ class TransactionCurrencyFactory
*/
public function find(?int $currencyId, ?string $currencyCode): ?TransactionCurrency
{
$currencyCode = strval($currencyCode);
$currencyId = intval($currencyId);
$currencyCode = (string)$currencyCode;
$currencyId = (int)$currencyId;
if (strlen($currencyCode) === 0 && intval($currencyId) === 0) {
if (\strlen($currencyCode) === 0 && (int)$currencyId === 0) {
return null;
}
// first by ID:
if ($currencyId > 0) {
$currency = TransactionCurrency::find($currencyId);
if (!is_null($currency)) {
if (null !== $currency) {
return $currency;
}
}
// then by code:
if (strlen($currencyCode) > 0) {
if (\strlen($currencyCode) > 0) {
$currency = TransactionCurrency::whereCode($currencyCode)->first();
if (!is_null($currency)) {
if (null !== $currency) {
return $currency;
}
}

View File

@@ -90,7 +90,7 @@ class TransactionFactory
$source = $this->create(
[
'description' => $description,
'amount' => app('steam')->negative(strval($data['amount'])),
'amount' => app('steam')->negative((string)$data['amount']),
'foreign_amount' => null,
'currency' => $currency,
'account' => $sourceAccount,
@@ -103,7 +103,7 @@ class TransactionFactory
$dest = $this->create(
[
'description' => $description,
'amount' => app('steam')->positive(strval($data['amount'])),
'amount' => app('steam')->positive((string)$data['amount']),
'foreign_amount' => null,
'currency' => $currency,
'account' => $destinationAccount,
@@ -119,9 +119,9 @@ class TransactionFactory
$this->setForeignCurrency($dest, $foreign);
// set foreign amount:
if (!is_null($data['foreign_amount'])) {
$this->setForeignAmount($source, app('steam')->negative(strval($data['foreign_amount'])));
$this->setForeignAmount($dest, app('steam')->positive(strval($data['foreign_amount'])));
if (null !== $data['foreign_amount']) {
$this->setForeignAmount($source, app('steam')->negative((string)$data['foreign_amount']));
$this->setForeignAmount($dest, app('steam')->positive((string)$data['foreign_amount']));
}
// set budget:

View File

@@ -40,8 +40,6 @@ class TransactionJournalFactory
private $user;
/**
* Create a new transaction journal and associated transactions.
*
* @param array $data
*
* @return TransactionJournal
@@ -89,11 +87,11 @@ class TransactionJournalFactory
$this->connectTags($journal, $data);
// store note:
$this->storeNote($journal, strval($data['notes']));
$this->storeNote($journal, (string)$data['notes']);
// store date meta fields (if present):
$fields = ['sepa-cc', 'sepa-ct-op', 'sepa-ct-id', 'sepa-db', 'sepa-country', 'sepa-ep', 'sepa-ci', 'interest_date', 'book_date', 'process_date',
'due_date', 'payment_date', 'invoice_date', 'internal_reference','bunq_payment_id'];
'due_date', 'payment_date', 'invoice_date', 'internal_reference', 'bunq_payment_id','importHash'];
foreach ($fields as $field) {
$this->storeMeta($journal, $data, $field);
@@ -124,7 +122,7 @@ class TransactionJournalFactory
$factory->setUser($this->user);
$piggyBank = $factory->find($data['piggy_bank_id'], $data['piggy_bank_name']);
if (!is_null($piggyBank)) {
if (null !== $piggyBank) {
/** @var PiggyBankEventFactory $factory */
$factory = app(PiggyBankEventFactory::class);
$factory->create($journal, $piggyBank);
@@ -144,7 +142,8 @@ class TransactionJournalFactory
{
$factory = app(TransactionTypeFactory::class);
$transactionType = $factory->find($type);
if (is_null($transactionType)) {
if (null === $transactionType) {
Log::error(sprintf('Could not find transaction type for "%s"', $type)); // @codeCoverageIgnore
throw new FireflyException(sprintf('Could not find transaction type for "%s"', $type)); // @codeCoverageIgnore
}

View File

@@ -66,10 +66,10 @@ class ChartJsGenerator implements GeneratorInterface
{
reset($data);
$first = current($data);
$labels = is_array($first['entries']) ? array_keys($first['entries']) : [];
$labels = \is_array($first['entries']) ? array_keys($first['entries']) : [];
$chartData = [
'count' => count($data),
'count' => \count($data),
'labels' => $labels, // take ALL labels from the first set.
'datasets' => [],
];
@@ -119,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) && 1 === bccomp($next, '0')) {
if (!\is_bool($next) && 1 === bccomp($next, '0')) {
// next is positive, sort other way around.
arsort($data);
}
@@ -128,7 +128,7 @@ 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]['data'][] = (float)Steam::positive($value);
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
$chartData['labels'][] = $key;
++$index;

View File

@@ -42,13 +42,11 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* @return string
*
* @throws \Throwable
*/
public function generate(): string
{
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
$expenseIds = join(',', $this->expense->pluck('id')->toArray());
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$expenseIds = implode(',', $this->expense->pluck('id')->toArray());
$reportType = 'account';
$preferredPeriod = $this->preferredPeriod();

View File

@@ -45,7 +45,6 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* @return string
* @throws \Throwable
*/
public function generate(): string
{
@@ -61,7 +60,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
$defaultShow = ['icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'to'];
$reportType = 'audit';
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$hideable = ['buttons', 'icon', 'description', 'balance_before', 'amount', 'balance_after', 'date',
'interest_date', 'book_date', 'process_date',
// three new optional fields.
@@ -173,7 +172,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
$journals = $journals->reverse();
$dayBeforeBalance = Steam::balance($account, $date);
$startBalance = $dayBeforeBalance;
$currency = $currencyRepos->find(intval($account->getMeta('currency_id')));
$currency = $currencyRepos->find((int)$account->getMeta('currency_id'));
/** @var Transaction $transaction */
foreach ($journals as $transaction) {
@@ -193,9 +192,9 @@ class MonthReportGenerator implements ReportGeneratorInterface
$return = [
'journals' => $journals->reverse(),
'exists' => $journals->count() > 0,
'end' => $this->end->formatLocalized(strval(trans('config.month_and_day'))),
'end' => $this->end->formatLocalized((string)trans('config.month_and_day')),
'endBalance' => Steam::balance($account, $this->end),
'dayBefore' => $date->formatLocalized(strval(trans('config.month_and_day'))),
'dayBefore' => $date->formatLocalized((string)trans('config.month_and_day')),
'dayBeforeBalance' => $dayBeforeBalance,
];

View File

@@ -63,12 +63,11 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
/**
* @return string
* @throws \Throwable
*/
public function generate(): string
{
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
$budgetIds = join(',', $this->budgets->pluck('id')->toArray());
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$budgetIds = implode(',', $this->budgets->pluck('id')->toArray());
$expenses = $this->getExpenses();
$accountSummary = $this->summarizeByAccount($expenses);
$budgetSummary = $this->summarizeByBudget($expenses);
@@ -200,8 +199,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
];
/** @var Transaction $transaction */
foreach ($collection as $transaction) {
$jrnlBudId = intval($transaction->transaction_journal_budget_id);
$transBudId = intval($transaction->transaction_budget_id);
$jrnlBudId = (int)$transaction->transaction_journal_budget_id;
$transBudId = (int)$transaction->transaction_budget_id;
$budgetId = max($jrnlBudId, $transBudId);
$result[$budgetId] = $result[$budgetId] ?? '0';
$result[$budgetId] = bcadd($transaction->transaction_amount, $result[$budgetId]);

View File

@@ -64,12 +64,11 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
/**
* @return string
* @throws \Throwable
*/
public function generate(): string
{
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
$categoryIds = join(',', $this->categories->pluck('id')->toArray());
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$categoryIds = implode(',', $this->categories->pluck('id')->toArray());
$reportType = 'category';
$expenses = $this->getExpenses();
$income = $this->getIncome();
@@ -240,8 +239,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
$result = [];
/** @var Transaction $transaction */
foreach ($collection as $transaction) {
$jrnlCatId = intval($transaction->transaction_journal_category_id);
$transCatId = intval($transaction->transaction_category_id);
$jrnlCatId = (int)$transaction->transaction_journal_category_id;
$transCatId = (int)$transaction->transaction_category_id;
$categoryId = max($jrnlCatId, $transCatId);
$result[$categoryId] = $result[$categoryId] ?? '0';
$result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]);

View File

@@ -41,15 +41,13 @@ class MonthReportGenerator implements ReportGeneratorInterface
/**
* @return string
*
* @throws \Throwable
*/
public function generate(): string
{
/** @var ReportHelperInterface $helper */
$helper = app(ReportHelperInterface::class);
$bills = $helper->getBillReport($this->start, $this->end, $this->accounts);
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$reportType = 'default';
// continue!

View File

@@ -40,13 +40,11 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
/**
* @return string
*
* @throws \Throwable
*/
public function generate(): string
{
// and some id's, joined:
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$reportType = 'default';
// continue!

View File

@@ -40,13 +40,11 @@ class YearReportGenerator implements ReportGeneratorInterface
/**
* @return string
*
* @throws \Throwable
*/
public function generate(): string
{
// and some id's, joined:
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$reportType = 'default';
// continue!

View File

@@ -35,9 +35,7 @@ class Support
*/
public function getTopExpenses(): Collection
{
$transactions = $this->getExpenses()->sortBy('transaction_amount');
return $transactions;
return $this->getExpenses()->sortBy('transaction_amount');
}
/**
@@ -45,9 +43,7 @@ class Support
*/
public function getTopIncome(): Collection
{
$transactions = $this->getIncome()->sortByDesc('transaction_amount');
return $transactions;
return $this->getIncome()->sortByDesc('transaction_amount');
}
/**
@@ -78,13 +74,13 @@ class Support
}
++$result[$opposingId]['count'];
$result[$opposingId]['sum'] = bcadd($result[$opposingId]['sum'], $transaction->transaction_amount);
$result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], strval($result[$opposingId]['count']));
$result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], (string)$result[$opposingId]['count']);
}
// sort result by average:
$average = [];
foreach ($result as $key => $row) {
$average[$key] = floatval($row['average']);
$average[$key] = (float)$row['average'];
}
array_multisort($average, $sortFlag, $result);

View File

@@ -65,12 +65,11 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
/**
* @return string
* @throws \Throwable
*/
public function generate(): string
{
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
$tagTags = join(',', $this->tags->pluck('tag')->toArray());
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$tagTags = implode(',', $this->tags->pluck('tag')->toArray());
$reportType = 'tag';
$expenses = $this->getExpenses();
$income = $this->getIncome();

View File

@@ -22,13 +22,13 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events;
use Exception;
use FireflyIII\Events\AdminRequestedTestMessage;
use FireflyIII\Mail\AdminTestMail;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use Log;
use Mail;
use Session;
use Swift_TransportException;
/**
* Class AdminEventHandler.
@@ -61,7 +61,7 @@ class AdminEventHandler
Log::debug('Trying to send message...');
Mail::to($email)->send(new AdminTestMail($email, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Swift_TransportException $e) {
} catch (Exception $e) {
Log::debug('Send message failed! :(');
Log::error($e->getMessage());
Log::error($e->getTraceAsString());

View File

@@ -28,7 +28,6 @@ use FireflyIII\Models\RuleGroup;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface as JRI;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface as PRI;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface as RGRI;
use FireflyIII\Support\Events\BillScanner;
use FireflyIII\TransactionRules\Processor;
/**
@@ -91,18 +90,4 @@ class StoredJournalEventHandler
return true;
}
/**
* This method calls a special bill scanner that will check if the stored journal is part of a bill.
*
* @param StoredTransactionJournal $storedJournalEvent
*
* @return bool
*/
public function scanBills(StoredTransactionJournal $storedJournalEvent): bool
{
$journal = $storedJournalEvent->journal;
BillScanner::scan($journal);
return true;
}
}

View File

@@ -26,7 +26,6 @@ use FireflyIII\Events\UpdatedTransactionJournal;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
use FireflyIII\Support\Events\BillScanner;
use FireflyIII\TransactionRules\Processor;
/**
@@ -80,18 +79,4 @@ class UpdatedJournalEventHandler
return true;
}
/**
* This method calls a special bill scanner that will check if the updated journal is part of a bill.
*
* @param UpdatedTransactionJournal $updatedJournalEvent
*
* @return bool
*/
public function scanBills(UpdatedTransactionJournal $updatedJournalEvent): bool
{
$journal = $updatedJournalEvent->journal;
BillScanner::scan($journal);
return true;
}
}

View File

@@ -22,6 +22,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events;
use Exception;
use FireflyIII\Events\RegisteredUser;
use FireflyIII\Events\RequestedNewPassword;
use FireflyIII\Events\UserChangedEmail;
@@ -36,7 +37,6 @@ use Illuminate\Auth\Events\Login;
use Log;
use Mail;
use Preferences;
use Swift_TransportException;
/**
* Class UserEventHandler.
@@ -95,7 +95,7 @@ class UserEventHandler
}
// user is the only user but does not have role "owner".
$role = $repository->getRole('owner');
if (is_null($role)) {
if (null === $role) {
// create role, does not exist. Very strange situation so let's raise a big fuss about it.
$role = $repository->createRole('owner', 'Site Owner', 'User runs this instance of FF3');
Log::error('Could not find role "owner". This is weird.');
@@ -124,7 +124,7 @@ class UserEventHandler
try {
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Swift_TransportException $e) {
} catch (Exception $e) {
Log::error($e->getMessage());
}
@@ -148,7 +148,7 @@ class UserEventHandler
try {
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Swift_TransportException $e) {
} catch (Exception $e) {
Log::error($e->getMessage());
}
@@ -173,7 +173,7 @@ class UserEventHandler
try {
Mail::to($email)->send(new RequestedNewPasswordMail($url, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Swift_TransportException $e) {
} catch (Exception $e) {
Log::error($e->getMessage());
}
@@ -205,7 +205,7 @@ class UserEventHandler
try {
Mail::to($email)->send(new RegisteredUserMail($uri, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Swift_TransportException $e) {
} catch (Exception $e) {
Log::error($e->getMessage());
}

View File

@@ -99,7 +99,7 @@ class VersionCheckEventHandler
}
$string = 'no result: ' . $check;
if ($check === -2) {
$string = strval(trans('firefly.update_check_error'));
$string = (string)trans('firefly.update_check_error');
}
if ($check === -1) {
// there is a new FF version!

View File

@@ -56,7 +56,7 @@ class AttachmentHelper implements AttachmentHelperInterface
*/
public function __construct()
{
$this->maxUploadSize = intval(config('firefly.maxUploadSize'));
$this->maxUploadSize = (int)config('firefly.maxUploadSize');
$this->allowedMimes = (array)config('firefly.allowedMimes');
$this->errors = new MessageBag;
$this->messages = new MessageBag;
@@ -71,7 +71,7 @@ class AttachmentHelper implements AttachmentHelperInterface
*/
public function getAttachmentLocation(Attachment $attachment): string
{
$path = sprintf('%s%sat-%d.data', storage_path('upload'), DIRECTORY_SEPARATOR, intval($attachment->id));
$path = sprintf('%s%sat-%d.data', storage_path('upload'), DIRECTORY_SEPARATOR, (int)$attachment->id);
return $path;
}
@@ -108,8 +108,8 @@ class AttachmentHelper implements AttachmentHelperInterface
*/
public function saveAttachmentsForModel(Model $model, ?array $files): bool
{
Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', get_class($model)));
if (is_array($files)) {
Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', \get_class($model)));
if (\is_array($files)) {
Log::debug('$files is an array.');
/** @var UploadedFile $entry */
foreach ($files as $entry) {
@@ -136,7 +136,7 @@ class AttachmentHelper implements AttachmentHelperInterface
{
$md5 = md5_file($file->getRealPath());
$name = $file->getClientOriginalName();
$class = get_class($model);
$class = \get_class($model);
$count = $model->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count();
if ($count > 0) {
@@ -180,8 +180,8 @@ class AttachmentHelper implements AttachmentHelperInterface
$fileObject->rewind();
$content = $fileObject->fread($file->getSize());
$encrypted = Crypt::encrypt($content);
Log::debug(sprintf('Full file length is %d and upload size is %d.', strlen($content), $file->getSize()));
Log::debug(sprintf('Encrypted content is %d', strlen($encrypted)));
Log::debug(sprintf('Full file length is %d and upload size is %d.', \strlen($content), $file->getSize()));
Log::debug(sprintf('Encrypted content is %d', \strlen($encrypted)));
// store it:
$this->uploadDisk->put($attachment->fileName(), $encrypted);
@@ -210,7 +210,7 @@ class AttachmentHelper implements AttachmentHelperInterface
Log::debug(sprintf('Name is %s, and mime is %s', $name, $mime));
Log::debug('Valid mimes are', $this->allowedMimes);
if (!in_array($mime, $this->allowedMimes)) {
if (!\in_array($mime, $this->allowedMimes)) {
$msg = (string)trans('validation.file_invalid_mime', ['name' => $name, 'mime' => $mime]);
$this->errors->add('attachments', $msg);
Log::error($msg);

View File

@@ -103,7 +103,7 @@ class MetaPieChart implements MetaPieChartInterface
$transactions = $this->getTransactions($direction);
$grouped = $this->groupByFields($transactions, $this->grouping[$group]);
$chartData = $this->organizeByType($group, $grouped);
$key = strval(trans('firefly.everything_else'));
$key = (string)trans('firefly.everything_else');
// also collect all other transactions
if ($this->collectOtherObjects && 'expense' === $direction) {
@@ -113,7 +113,7 @@ class MetaPieChart implements MetaPieChartInterface
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::WITHDRAWAL]);
$journals = $collector->getJournals();
$sum = strval($journals->sum('transaction_amount'));
$sum = (string)$journals->sum('transaction_amount');
$sum = bcmul($sum, '-1');
$sum = bcsub($sum, $this->total);
$chartData[$key] = $sum;
@@ -125,7 +125,7 @@ class MetaPieChart implements MetaPieChartInterface
$collector->setUser($this->user);
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::DEPOSIT]);
$journals = $collector->getJournals();
$sum = strval($journals->sum('transaction_amount'));
$sum = (string)$journals->sum('transaction_amount');
$sum = bcsub($sum, $this->total);
$chartData[$key] = $sum;
}
@@ -298,7 +298,7 @@ class MetaPieChart implements MetaPieChartInterface
*/
protected function groupByFields(Collection $set, array $fields): array
{
if (0 === count($fields) && $this->tags->count() > 0) {
if (0 === \count($fields) && $this->tags->count() > 0) {
// do a special group on tags:
return $this->groupByTag($set); // @codeCoverageIgnore
}
@@ -308,7 +308,7 @@ class MetaPieChart implements MetaPieChartInterface
foreach ($set as $transaction) {
$values = [];
foreach ($fields as $field) {
$values[] = intval($transaction->$field);
$values[] = (int)$transaction->$field;
}
$value = max($values);
$grouped[$value] = $grouped[$value] ?? '0';
@@ -332,7 +332,7 @@ class MetaPieChart implements MetaPieChartInterface
$repository->setUser($this->user);
foreach ($array as $objectId => $amount) {
if (!isset($names[$objectId])) {
$object = $repository->find(intval($objectId));
$object = $repository->find((int)$objectId);
$names[$objectId] = $object->name ?? $object->tag;
}
$amount = Steam::positive($amount);

View File

@@ -162,13 +162,13 @@ class BalanceLine
return $this->getBudget()->name;
}
if (self::ROLE_DEFAULTROLE === $this->getRole()) {
return strval(trans('firefly.no_budget'));
return (string)trans('firefly.no_budget');
}
if (self::ROLE_TAGROLE === $this->getRole()) {
return strval(trans('firefly.coveredWithTags'));
return (string)trans('firefly.coveredWithTags');
}
if (self::ROLE_DIFFROLE === $this->getRole()) {
return strval(trans('firefly.leftUnbalanced'));
return (string)trans('firefly.leftUnbalanced');
}
return '';

View File

@@ -101,7 +101,7 @@ class Bill
{
$set = $this->bills->sortBy(
function (BillLine $bill) {
$active = 0 === intval($bill->getBill()->active) ? 1 : 0;
$active = 0 === (int)$bill->getBill()->active ? 1 : 0;
$name = $bill->getBill()->name;
return $active . $name;

View File

@@ -190,7 +190,7 @@ class BillLine
*/
public function isActive(): bool
{
return 1 === intval($this->bill->active);
return 1 === (int)$this->bill->active;
}
/**

View File

@@ -136,7 +136,7 @@ class JournalCollector implements JournalCollectorInterface
public function addFilter(string $filter): JournalCollectorInterface
{
$interfaces = class_implements($filter);
if (in_array(FilterInterface::class, $interfaces) && !in_array($filter, $this->filters)) {
if (\in_array(FilterInterface::class, $interfaces) && !\in_array($filter, $this->filters)) {
Log::debug(sprintf('Enabled filter %s', $filter));
$this->filters[] = $filter;
}
@@ -237,7 +237,7 @@ class JournalCollector implements JournalCollectorInterface
$countQuery->getQuery()->groups = null;
$countQuery->getQuery()->orders = null;
$countQuery->groupBy('accounts.user_id');
$this->count = intval($countQuery->count());
$this->count = (int)$countQuery->count();
return $this->count;
}
@@ -254,6 +254,9 @@ class JournalCollector implements JournalCollectorInterface
$key = 'query-' . substr($hash, -8);
$cache = new CacheProperties;
$cache->addProperty($key);
foreach ($this->filters as $filter) {
$cache->addProperty((string)$filter);
}
if ($cache->has()) {
Log::debug(sprintf('Return cache of query with ID "%s".', $key));
@@ -270,10 +273,10 @@ class JournalCollector implements JournalCollectorInterface
$set->each(
function (Transaction $transaction) {
$transaction->date = new Carbon($transaction->date);
$transaction->description = Steam::decrypt(intval($transaction->encrypted), $transaction->description);
$transaction->description = Steam::decrypt((int)$transaction->encrypted, $transaction->description);
if (null !== $transaction->bill_name) {
$transaction->bill_name = Steam::decrypt(intval($transaction->bill_name_encrypted), $transaction->bill_name);
$transaction->bill_name = Steam::decrypt((int)$transaction->bill_name_encrypted, $transaction->bill_name);
}
$transaction->account_name = app('steam')->tryDecrypt($transaction->account_name);
$transaction->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name);
@@ -338,7 +341,7 @@ class JournalCollector implements JournalCollectorInterface
if ($accounts->count() > 0) {
$accountIds = $accounts->pluck('id')->toArray();
$this->query->whereIn('transactions.account_id', $accountIds);
Log::debug(sprintf('setAccounts: %s', join(', ', $accountIds)));
Log::debug(sprintf('setAccounts: %s', implode(', ', $accountIds)));
$this->accountIds = $accountIds;
}
@@ -441,7 +444,7 @@ class JournalCollector implements JournalCollectorInterface
public function setBudgets(Collection $budgets): JournalCollectorInterface
{
$budgetIds = $budgets->pluck('id')->toArray();
if (0 === count($budgetIds)) {
if (0 === \count($budgetIds)) {
return $this;
}
$this->joinBudgetTables();
@@ -465,7 +468,7 @@ class JournalCollector implements JournalCollectorInterface
public function setCategories(Collection $categories): JournalCollectorInterface
{
$categoryIds = $categories->pluck('id')->toArray();
if (0 === count($categoryIds)) {
if (0 === \count($categoryIds)) {
return $this;
}
$this->joinCategoryTables();
@@ -640,7 +643,7 @@ class JournalCollector implements JournalCollectorInterface
*/
public function setTypes(array $types): JournalCollectorInterface
{
if (count($types) > 0) {
if (\count($types) > 0) {
Log::debug('Set query collector types', $types);
$this->query->whereIn('transaction_types.type', $types);
}
@@ -679,6 +682,7 @@ class JournalCollector implements JournalCollectorInterface
->orderBy('transaction_journals.order', 'ASC')
->orderBy('transaction_journals.id', 'DESC')
->orderBy('transaction_journals.description', 'DESC')
->orderBy('transactions.identifier', 'ASC')
->orderBy('transactions.amount', 'DESC');
$this->query = $query;
@@ -765,7 +769,7 @@ class JournalCollector implements JournalCollectorInterface
SplitIndicatorFilter::class => new SplitIndicatorFilter,
CountAttachmentsFilter::class => new CountAttachmentsFilter,
];
Log::debug(sprintf('Will run %d filters on the set.', count($this->filters)));
Log::debug(sprintf('Will run %d filters on the set.', \count($this->filters)));
foreach ($this->filters as $enabled) {
if (isset($filters[$enabled])) {
Log::debug(sprintf('Before filter %s: %d', $enabled, $set->count()));
@@ -834,7 +838,6 @@ class JournalCollector implements JournalCollectorInterface
/**
*
* @throws \InvalidArgumentException
*/
private function joinOpposingTables()
{

View File

@@ -35,7 +35,7 @@ use Log;
class AmountFilter implements FilterInterface
{
/** @var int */
private $modifier = 0;
private $modifier;
/**
* AmountFilter constructor.

View File

@@ -57,7 +57,7 @@ class CountAttachmentsFilter implements FilterInterface
$set->each(
function (Transaction $transaction) use ($counter) {
$id = (int)$transaction->journal_id;
$count = $counter[$id] ?? 0;
$count = (int)($counter[$id] ?? 0.0);
$transaction->attachmentCount = $count;
}
);

View File

@@ -36,7 +36,7 @@ use Log;
class InternalTransferFilter implements FilterInterface
{
/** @var array */
private $accounts = [];
private $accounts;
/**
* InternalTransferFilter constructor.
@@ -61,7 +61,7 @@ class InternalTransferFilter implements FilterInterface
return $transaction;
}
// both id's in $parameters?
if (in_array($transaction->account_id, $this->accounts) && in_array($transaction->opposing_account_id, $this->accounts)) {
if (\in_array($transaction->account_id, $this->accounts) && \in_array($transaction->opposing_account_id, $this->accounts)) {
Log::debug(
sprintf(
'Transaction #%d has #%d and #%d in set, so removed',

View File

@@ -35,7 +35,7 @@ use Log;
class OpposingAccountFilter implements FilterInterface
{
/** @var array */
private $accounts = [];
private $accounts;
/**
* InternalTransferFilter constructor.
@@ -58,7 +58,7 @@ class OpposingAccountFilter implements FilterInterface
function (Transaction $transaction) {
$opposing = $transaction->opposing_account_id;
// remove internal transfer
if (in_array($opposing, $this->accounts)) {
if (\in_array($opposing, $this->accounts)) {
Log::debug(sprintf('Filtered #%d because its opposite is in accounts.', $transaction->id), $this->accounts);
return null;

View File

@@ -54,7 +54,7 @@ class SplitIndicatorFilter implements FilterInterface
$set->each(
function (Transaction $transaction) use ($counter) {
$id = (int)$transaction->journal_id;
$count = $counter[$id] ?? 0;
$count = (int)($counter[$id] ?? 0.0);
$transaction->is_split = false;
if ($count > 2) {
$transaction->is_split = true;

View File

@@ -52,11 +52,11 @@ class TransferFilter implements FilterInterface
// make property string:
$journalId = $transaction->transaction_journal_id;
$amount = Steam::positive($transaction->transaction_amount);
$accountIds = [intval($transaction->account_id), intval($transaction->opposing_account_id)];
$transactionIds = [$transaction->id, intval($transaction->opposing_id)];
$accountIds = [(int)$transaction->account_id, (int)$transaction->opposing_account_id];
$transactionIds = [$transaction->id, (int)$transaction->opposing_id];
sort($accountIds);
sort($transactionIds);
$key = $journalId . '-' . join(',', $transactionIds) . '-' . join(',', $accountIds) . '-' . $amount;
$key = $journalId . '-' . implode(',', $transactionIds) . '-' . implode(',', $accountIds) . '-' . $amount;
if (!isset($count[$key])) {
// not yet counted? add to new set and count it:
$new->push($transaction);

View File

@@ -73,8 +73,8 @@ class FiscalHelper implements FiscalHelperInterface
$startDate = clone $date;
if (true === $this->useCustomFiscalYear) {
$prefStartStr = Preferences::get('fiscalYearStart', '01-01')->data;
list($mth, $day) = explode('-', $prefStartStr);
$startDate->month(intval($mth))->day(intval($day));
[$mth, $day] = explode('-', $prefStartStr);
$startDate->month((int)$mth)->day((int)$day);
// if start date is after passed date, sub 1 year.
if ($startDate > $date) {

View File

@@ -23,10 +23,10 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Help;
use Cache;
use Exception;
use League\CommonMark\CommonMarkConverter;
use Log;
use Requests;
use Requests_Exception;
use Route;
/**
@@ -68,7 +68,7 @@ class Help implements HelpInterface
$content = '';
try {
$result = Requests::get($uri, [], $opt);
} catch (Requests_Exception $e) {
} catch (Exception $e) {
Log::error($e);
return '';
@@ -80,7 +80,7 @@ class Help implements HelpInterface
$content = trim($result->body);
}
if (strlen($content) > 0) {
if (\strlen($content) > 0) {
Log::debug('Content is longer than zero. Expect something.');
$converter = new CommonMarkConverter();
$content = $converter->convertToHtml($content);
@@ -127,7 +127,7 @@ class Help implements HelpInterface
public function putInCache(string $route, string $language, string $content)
{
$key = sprintf(self::CACHEKEY, $route, $language);
if (strlen($content) > 0) {
if (\strlen($content) > 0) {
Log::debug(sprintf('Will store entry in cache: %s', $key));
Cache::put($key, $content, 10080); // a week.

View File

@@ -91,7 +91,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface
'id' => $budget->id,
'name' => $budget->name,
'budgeted' => strval($budgetLimit->amount),
'budgeted' => (string)$budgetLimit->amount,
'spent' => $data['expenses'],
'left' => $data['left'],
'overspent' => $data['overspent'],

View File

@@ -75,9 +75,8 @@ class PopupReport implements PopupReportInterface
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])->setBudget($budget);
$journals = $collector->getJournals();
return $journals;
return $collector->getJournals();
}
/**
@@ -118,9 +117,8 @@ class PopupReport implements PopupReportInterface
if (null !== $budget->id) {
$collector->setBudget($budget);
}
$journals = $collector->getJournals();
return $journals;
return $collector->getJournals();
}
/**
@@ -136,9 +134,8 @@ class PopupReport implements PopupReportInterface
$collector->setAccounts($attributes['accounts'])->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
->setRange($attributes['startDate'], $attributes['endDate'])->withOpposingAccount()
->setCategory($category);
$journals = $collector->getJournals();
return $journals;
return $collector->getJournals();
}
/**

View File

@@ -90,8 +90,8 @@ class ReportHelper implements ReportHelperInterface
$billLine->setBill($bill);
$billLine->setPayDate($payDate);
$billLine->setEndOfPayDate($endOfPayPeriod);
$billLine->setMin(strval($bill->amount_min));
$billLine->setMax(strval($bill->amount_max));
$billLine->setMin((string)$bill->amount_min);
$billLine->setMax((string)$bill->amount_max);
$billLine->setHit(false);
$entry = $journals->filter(
function (Transaction $transaction) use ($bill) {
@@ -119,7 +119,6 @@ class ReportHelper implements ReportHelperInterface
* @param Carbon $date
*
* @return array
* @throws \InvalidArgumentException
*/
public function listOfMonths(Carbon $date): array
{

View File

@@ -41,7 +41,6 @@ use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Log;
use Preferences;
use Session;
/**
* Class ReconcileController.
@@ -100,13 +99,13 @@ class ReconcileController extends Controller
'amount' => $pTransaction->amount,
];
Session::flash('preFilled', $preFilled);
session()->flash('preFilled', $preFilled);
// put previous url in session if not redirect from store (not "return_to_edit").
if (true !== session('reconcile.edit.fromUpdate')) {
$this->rememberPreviousUri('reconcile.edit.uri');
}
Session::forget('reconcile.edit.fromUpdate');
session()->forget('reconcile.edit.fromUpdate');
return view(
'accounts.reconcile.edit',
@@ -185,13 +184,13 @@ class ReconcileController extends Controller
return $this->redirectToOriginalAccount($account);
}
if (AccountType::ASSET !== $account->accountType->type) {
Session::flash('error', trans('firefly.must_be_asset_account'));
session()->flash('error', trans('firefly.must_be_asset_account'));
return redirect(route('accounts.index', [config('firefly.shortNamesByFullName.' . $account->accountType->type)]));
}
$currencyId = intval($this->accountRepos->getMetaValue($account, 'currency_id'));
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
$currency = $this->currencyRepos->findNull($currencyId);
if (0 === $currencyId) {
if (null === $currency) {
$currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore
}
@@ -263,7 +262,7 @@ class ReconcileController extends Controller
/** @var Transaction $transaction */
foreach ($data['transactions'] as $transactionId) {
$repository->reconcileById(intval($transactionId));
$repository->reconcileById((int)$transactionId);
}
Log::debug('Reconciled all transactions.');
@@ -300,7 +299,7 @@ class ReconcileController extends Controller
'tags' => null,
'interest_date' => null,
'transactions' => [[
'currency_id' => intval($this->accountRepos->getMetaValue($account, 'currency_id')),
'currency_id' => (int)$this->accountRepos->getMetaValue($account, 'currency_id'),
'currency_code' => null,
'description' => null,
'amount' => app('steam')->positive($difference),
@@ -322,11 +321,13 @@ class ReconcileController extends Controller
'notes' => implode(', ', $data['transactions']),
];
$journal = $repository->store($journalData);
$repository->store($journalData);
}
Log::debug('End of routine.');
Session::flash('success', trans('firefly.reconciliation_stored'));
Preferences::mark();
session()->flash('success', trans('firefly.reconciliation_stored'));
return redirect(route('accounts.show', [$account->id]));
}
@@ -338,8 +339,8 @@ class ReconcileController extends Controller
*
* @return mixed
*
* @throws \Throwable
* @throws FireflyException
* @throws \Throwable
*/
public function transactions(Account $account, Carbon $start, Carbon $end)
{
@@ -350,9 +351,9 @@ class ReconcileController extends Controller
$startDate = clone $start;
$startDate->subDays(1);
$currencyId = intval($this->accountRepos->getMetaValue($account, 'currency_id'));
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
$currency = $this->currencyRepos->findNull($currencyId);
if (0 === $currencyId) {
if (0 === $currency) {
$currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore
}
@@ -371,7 +372,9 @@ class ReconcileController extends Controller
$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();
$html = view(
'accounts.reconcile.transactions', compact('account', 'transactions', 'currency', 'start', 'end', 'selectionStart', 'selectionEnd')
)->render();
return response()->json(['html' => $html, 'startBalance' => $startBalance, 'endBalance' => $endBalance]);
}
@@ -388,7 +391,7 @@ class ReconcileController extends Controller
return redirect(route('transactions.show', [$journal->id]));
}
if (0 === bccomp('0', $request->get('amount'))) {
Session::flash('error', trans('firefly.amount_cannot_be_zero'));
session()->flash('error', trans('firefly.amount_cannot_be_zero'));
return redirect(route('accounts.reconcile.edit', [$journal->id]))->withInput();
}
@@ -400,7 +403,7 @@ class ReconcileController extends Controller
$destination = $this->repository->getJournalDestinationAccounts($journal)->first();
if (bccomp($submitted['amount'], '0') === 1) {
// amount is positive, switch accounts:
list($source, $destination) = [$destination, $source];
[$source, $destination] = [$destination, $source];
}
// expand data with journal data:
@@ -417,7 +420,7 @@ class ReconcileController extends Controller
'interest_date' => null,
'book_date' => null,
'transactions' => [[
'currency_id' => intval($journal->transaction_currency_id),
'currency_id' => (int)$journal->transaction_currency_id,
'currency_code' => null,
'description' => null,
'amount' => app('steam')->positive($submitted['amount']),
@@ -441,9 +444,10 @@ class ReconcileController extends Controller
$this->repository->update($journal, $data);
// @codeCoverageIgnoreStart
if (1 === intval($request->get('return_to_edit'))) {
Session::put('reconcile.edit.fromUpdate', true);
if (1 === (int)$request->get('return_to_edit')) {
session()->put('reconcile.edit.fromUpdate', true);
return redirect(route('accounts.reconcile.edit', [$journal->id]))->withInput(['return_to_edit' => 1]);
}

View File

@@ -84,12 +84,9 @@ class AccountController extends Controller
* @param string $what
*
* @return View
* @throws \RuntimeException
*/
public function create(Request $request, string $what = 'asset')
{
$allCurrencies = $this->currencyRepos->get();
$currencySelectList = ExpandedForm::makeSelectList($allCurrencies);
$defaultCurrency = app('amount')->getDefaultCurrency();
$subTitleIcon = config('firefly.subIconsByIdentifier.' . $what);
$subTitle = trans('firefly.make_new_' . $what . '_account');
@@ -107,7 +104,7 @@ class AccountController extends Controller
}
$request->session()->forget('accounts.create.fromStore');
return view('accounts.create', compact('subTitleIcon', 'what', 'subTitle', 'currencySelectList', 'allCurrencies', 'roles'));
return view('accounts.create', compact('subTitleIcon', 'what', 'subTitle', 'roles'));
}
/**
@@ -133,18 +130,17 @@ class AccountController extends Controller
* @param Account $account
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function destroy(Request $request, Account $account)
{
$type = $account->accountType->type;
$typeName = config('firefly.shortNamesByFullName.' . $type);
$name = $account->name;
$moveTo = $this->repository->findNull(intval($request->get('move_account_before_delete')));
$moveTo = $this->repository->findNull((int)$request->get('move_account_before_delete'));
$this->repository->destroy($account, $moveTo);
$request->session()->flash('success', strval(trans('firefly.' . $typeName . '_deleted', ['name' => $name])));
$request->session()->flash('success', (string)trans('firefly.' . $typeName . '_deleted', ['name' => $name]));
Preferences::mark();
return redirect($this->getPreviousUri('accounts.delete.uri'));
@@ -163,18 +159,16 @@ class AccountController extends Controller
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // long and complex but not that excessively so.
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @throws \RuntimeException
*/
public function edit(Request $request, Account $account, AccountRepositoryInterface $repository)
{
$what = config('firefly.shortNamesByFullName')[$account->accountType->type];
$subTitle = trans('firefly.edit_' . $what . '_account', ['name' => $account->name]);
$subTitleIcon = config('firefly.subIconsByIdentifier.' . $what);
$allCurrencies = $this->currencyRepos->get();
$currencySelectList = ExpandedForm::makeSelectList($allCurrencies);
$roles = [];
foreach (config('firefly.accountRoles') as $role) {
$roles[$role] = strval(trans('firefly.account_role_' . $role));
$roles[$role] = (string)trans('firefly.account_role_' . $role);
}
// put previous url in session if not redirect from store (not "return_to_edit").
@@ -186,11 +180,11 @@ class AccountController extends Controller
// pre fill some useful values.
// the opening balance is tricky:
$openingBalanceAmount = strval($repository->getOpeningBalanceAmount($account));
$openingBalanceAmount = (string)$repository->getOpeningBalanceAmount($account);
$openingBalanceDate = $repository->getOpeningBalanceDate($account);
$default = app('amount')->getDefaultCurrency();
$currency = $this->currencyRepos->findNull(intval($repository->getMetaValue($account, 'currency_id')));
if (is_null($currency)) {
$currency = $this->currencyRepos->findNull((int)$repository->getMetaValue($account, 'currency_id'));
if (null === $currency) {
$currency = $default;
}
@@ -219,8 +213,6 @@ class AccountController extends Controller
return view(
'accounts.edit',
compact(
'allCurrencies',
'currencySelectList',
'account',
'currency',
'subTitle',
@@ -246,8 +238,8 @@ class AccountController extends Controller
$types = config('firefly.accountTypesByIdentifier.' . $what);
$collection = $this->repository->getAccountsByType($types);
$total = $collection->count();
$page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$accounts = $collection->slice(($page - 1) * $pageSize, $pageSize);
unset($collection);
/** @var Carbon $start */
@@ -378,7 +370,6 @@ class AccountController extends Controller
* @param AccountFormRequest $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function store(AccountFormRequest $request)
{
@@ -389,14 +380,14 @@ class AccountController extends Controller
// update preferences if necessary:
$frontPage = Preferences::get('frontPageAccounts', [])->data;
if (count($frontPage) > 0 && AccountType::ASSET === $account->accountType->type) {
if (AccountType::ASSET === $account->accountType->type && \count($frontPage) > 0) {
// @codeCoverageIgnoreStart
$frontPage[] = $account->id;
Preferences::set('frontPageAccounts', $frontPage);
// @codeCoverageIgnoreEnd
}
if (1 === intval($request->get('create_another'))) {
if (1 === (int)$request->get('create_another')) {
// set value so create routine will not overwrite URL:
$request->session()->put('accounts.create.fromStore', true);
@@ -412,17 +403,16 @@ class AccountController extends Controller
* @param Account $account
*
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function update(AccountFormRequest $request, Account $account)
{
$data = $request->getAccountData();
$this->repository->update($account, $data);
$request->session()->flash('success', strval(trans('firefly.updated_account', ['name' => $account->name])));
$request->session()->flash('success', (string)trans('firefly.updated_account', ['name' => $account->name]));
Preferences::mark();
if (1 === intval($request->get('return_to_edit'))) {
if (1 === (int)$request->get('return_to_edit')) {
// set value so edit routine will not overwrite URL:
$request->session()->put('accounts.edit.fromUpdate', true);
@@ -467,7 +457,7 @@ class AccountController extends Controller
$start = $this->repository->oldestJournalDate($account);
$end = $date ?? new Carbon;
if ($end < $start) {
list($start, $end) = [$end, $start]; // @codeCoverageIgnore
[$start, $end] = [$end, $start]; // @codeCoverageIgnore
}
// properties for cache

View File

@@ -29,7 +29,6 @@ use FireflyIII\Http\Requests\ConfigurationRequest;
use FireflyIII\Support\Facades\FireflyConfig;
use Preferences;
use Redirect;
use Session;
use View;
/**
@@ -46,7 +45,7 @@ class ConfigurationController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('title', strval(trans('firefly.administration')));
app('view')->share('title', (string)trans('firefly.administration'));
app('view')->share('mainTitleIcon', 'fa-hand-spock-o');
return $next($request);
@@ -61,7 +60,7 @@ class ConfigurationController extends Controller
*/
public function index()
{
$subTitle = strval(trans('firefly.instance_configuration'));
$subTitle = (string)trans('firefly.instance_configuration');
$subTitleIcon = 'fa-wrench';
// all available configuration and their default value in case
@@ -91,7 +90,7 @@ class ConfigurationController extends Controller
FireflyConfig::set('is_demo_site', $data['is_demo_site']);
// flash message
Session::flash('success', strval(trans('firefly.configuration_updated')));
session()->flash('success', (string)trans('firefly.configuration_updated'));
Preferences::mark();
return Redirect::route('admin.configuration.index');

View File

@@ -28,7 +28,6 @@ use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Middleware\IsSandStormUser;
use Illuminate\Http\Request;
use Log;
use Session;
/**
* Class HomeController.
@@ -50,7 +49,7 @@ class HomeController extends Controller
*/
public function index()
{
$title = strval(trans('firefly.administration'));
$title = (string)trans('firefly.administration');
$mainTitleIcon = 'fa-hand-spock-o';
return view('admin.index', compact('title', 'mainTitleIcon'));
@@ -66,7 +65,7 @@ class HomeController extends Controller
$ipAddress = $request->ip();
Log::debug(sprintf('Now in testMessage() controller. IP is %s', $ipAddress));
event(new AdminRequestedTestMessage(auth()->user(), $ipAddress));
Session::flash('info', strval(trans('firefly.send_test_triggered')));
session()->flash('info', (string)trans('firefly.send_test_triggered'));
return redirect(route('admin.index'));
}

View File

@@ -45,7 +45,7 @@ class LinkController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('title', strval(trans('firefly.administration')));
app('view')->share('title', (string)trans('firefly.administration'));
app('view')->share('mainTitleIcon', 'fa-hand-spock-o');
return $next($request);
@@ -76,12 +76,11 @@ class LinkController extends Controller
* @param LinkType $linkType
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View
* @throws \RuntimeException
*/
public function delete(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
{
if (!$linkType->editable) {
$request->session()->flash('error', strval(trans('firefly.cannot_edit_link_type', ['name' => $linkType->name])));
$request->session()->flash('error', (string)trans('firefly.cannot_edit_link_type', ['name' => $linkType->name]));
return redirect(route('admin.links.index'));
}
@@ -109,15 +108,14 @@ class LinkController extends Controller
* @param LinkType $linkType
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function destroy(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
{
$name = $linkType->name;
$moveTo = $repository->find(intval($request->get('move_link_type_before_delete')));
$moveTo = $repository->find((int)$request->get('move_link_type_before_delete'));
$repository->destroy($linkType, $moveTo);
$request->session()->flash('success', strval(trans('firefly.deleted_link_type', ['name' => $name])));
$request->session()->flash('success', (string)trans('firefly.deleted_link_type', ['name' => $name]));
Preferences::mark();
return redirect($this->getPreviousUri('link_types.delete.uri'));
@@ -128,12 +126,11 @@ class LinkController extends Controller
* @param LinkType $linkType
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
* @throws \RuntimeException
*/
public function edit(Request $request, LinkType $linkType)
{
if (!$linkType->editable) {
$request->session()->flash('error', strval(trans('firefly.cannot_edit_link_type', ['name' => $linkType->name])));
$request->session()->flash('error', (string)trans('firefly.cannot_edit_link_type', ['name' => $linkType->name]));
return redirect(route('admin.links.index'));
}
@@ -187,7 +184,6 @@ class LinkController extends Controller
* @param LinkTypeRepositoryInterface $repository
*
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function store(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository)
{
@@ -197,9 +193,9 @@ class LinkController extends Controller
'outward' => $request->string('outward'),
];
$linkType = $repository->store($data);
$request->session()->flash('success', strval(trans('firefly.stored_new_link_type', ['name' => $linkType->name])));
$request->session()->flash('success', (string)trans('firefly.stored_new_link_type', ['name' => $linkType->name]));
if (1 === intval($request->get('create_another'))) {
if (1 === (int)$request->get('create_another')) {
// set value so create routine will not overwrite URL:
$request->session()->put('link_types.create.fromStore', true);
@@ -216,12 +212,11 @@ class LinkController extends Controller
* @param LinkType $linkType
*
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function update(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository, LinkType $linkType)
{
if (!$linkType->editable) {
$request->session()->flash('error', strval(trans('firefly.cannot_edit_link_type', ['name' => $linkType->name])));
$request->session()->flash('error', (string)trans('firefly.cannot_edit_link_type', ['name' => $linkType->name]));
return redirect(route('admin.links.index'));
}
@@ -233,10 +228,10 @@ class LinkController extends Controller
];
$repository->update($linkType, $data);
$request->session()->flash('success', strval(trans('firefly.updated_link_type', ['name' => $linkType->name])));
$request->session()->flash('success', (string)trans('firefly.updated_link_type', ['name' => $linkType->name]));
Preferences::mark();
if (1 === intval($request->get('return_to_edit'))) {
if (1 === (int)$request->get('return_to_edit')) {
// set value so edit routine will not overwrite URL:
$request->session()->put('link_types.edit.fromUpdate', true);

View File

@@ -32,7 +32,6 @@ use FireflyIII\Services\Github\Object\Release;
use FireflyIII\Services\Github\Request\UpdateRequest;
use Illuminate\Http\Request;
use Log;
use Session;
/**
* Class HomeController.
@@ -49,7 +48,7 @@ class UpdateController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
app('view')->share('title', strval(trans('firefly.administration')));
app('view')->share('title', (string)trans('firefly.administration'));
app('view')->share('mainTitleIcon', 'fa-hand-spock-o');
return $next($request);
@@ -63,7 +62,6 @@ class UpdateController extends Controller
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Illuminate\Container\EntryNotFoundException
*/
public function index()
{
@@ -87,10 +85,10 @@ class UpdateController extends Controller
*/
public function post(Request $request)
{
$checkForUpdates = intval($request->get('check_for_updates'));
$checkForUpdates = (int)$request->get('check_for_updates');
FireflyConfig::set('permission_update_check', $checkForUpdates);
FireflyConfig::set('last_update_check', time());
Session::flash('success', strval(trans('firefly.configuration_updated')));
session()->flash('success', (string)trans('firefly.configuration_updated'));
return redirect(route('admin.update-check'));
}
@@ -118,7 +116,7 @@ class UpdateController extends Controller
Log::error(sprintf('Could not check for updates: %s', $e->getMessage()));
}
if ($check === -2) {
$string = strval(trans('firefly.update_check_error'));
$string = (string)trans('firefly.update_check_error');
}
if ($check === -1) {
@@ -126,25 +124,23 @@ class UpdateController extends Controller
// has it been released for more than three days?
$today = new Carbon;
if ($today->diffInDays($first->getUpdated(), true) > 3) {
$string = strval(
trans(
$string = (string)trans(
'firefly.update_new_version_alert',
[
'your_version' => $current,
'new_version' => $first->getTitle(),
'date' => $first->getUpdated()->formatLocalized($this->monthAndDayFormat),
]
)
);
}
}
if ($check === 0) {
// you are running the current version!
$string = strval(trans('firefly.update_current_version_alert', ['version' => $current]));
$string = (string)trans('firefly.update_current_version_alert', ['version' => $current]);
}
if ($check === 1) {
// you are running a newer version!
$string = strval(trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $first->getTitle()]));
$string = (string)trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $first->getTitle()]);
}
return response()->json(['result' => $string]);

View File

@@ -30,7 +30,6 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\User;
use Log;
use Preferences;
use Session;
use View;
/**
@@ -47,7 +46,7 @@ class UserController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('title', strval(trans('firefly.administration')));
app('view')->share('title', (string)trans('firefly.administration'));
app('view')->share('mainTitleIcon', 'fa-hand-spock-o');
return $next($request);
@@ -78,7 +77,7 @@ class UserController extends Controller
public function destroy(User $user, UserRepositoryInterface $repository)
{
$repository->destroy($user);
Session::flash('success', strval(trans('firefly.user_deleted')));
session()->flash('success', (string)trans('firefly.user_deleted'));
return redirect(route('admin.users'));
}
@@ -94,15 +93,15 @@ class UserController extends Controller
if (true !== session('users.edit.fromUpdate')) {
$this->rememberPreviousUri('users.edit.uri');
}
Session::forget('users.edit.fromUpdate');
session()->forget('users.edit.fromUpdate');
$subTitle = strval(trans('firefly.edit_user', ['email' => $user->email]));
$subTitle = (string)trans('firefly.edit_user', ['email' => $user->email]);
$subTitleIcon = 'fa-user-o';
$codes = [
'' => strval(trans('firefly.no_block_code')),
'bounced' => strval(trans('firefly.block_code_bounced')),
'expired' => strval(trans('firefly.block_code_expired')),
'email_changed' => strval(trans('firefly.block_code_email_changed')),
'' => (string)trans('firefly.no_block_code'),
'bounced' => (string)trans('firefly.block_code_bounced'),
'expired' => (string)trans('firefly.block_code_expired'),
'email_changed' => (string)trans('firefly.block_code_email_changed'),
];
return view('admin.users.edit', compact('user', 'subTitle', 'subTitleIcon', 'codes'));
@@ -115,7 +114,7 @@ class UserController extends Controller
*/
public function index(UserRepositoryInterface $repository)
{
$subTitle = strval(trans('firefly.user_administration'));
$subTitle = (string)trans('firefly.user_administration');
$subTitleIcon = 'fa-users';
$users = $repository->all();
@@ -143,9 +142,9 @@ class UserController extends Controller
*/
public function show(UserRepositoryInterface $repository, User $user)
{
$title = strval(trans('firefly.administration'));
$title = (string)trans('firefly.administration');
$mainTitleIcon = 'fa-hand-spock-o';
$subTitle = strval(trans('firefly.single_user_administration', ['email' => $user->email]));
$subTitle = (string)trans('firefly.single_user_administration', ['email' => $user->email]);
$subTitleIcon = 'fa-user';
$information = $repository->getUserData($user);
@@ -175,19 +174,19 @@ class UserController extends Controller
$data = $request->getUserData();
// update password
if (strlen($data['password']) > 0) {
if (\strlen($data['password']) > 0) {
$repository->changePassword($user, $data['password']);
}
$repository->changeStatus($user, $data['blocked'], $data['blocked_code']);
$repository->updateEmail($user, $data['email']);
Session::flash('success', strval(trans('firefly.updated_user', ['email' => $user->email])));
session()->flash('success', (string)trans('firefly.updated_user', ['email' => $user->email]));
Preferences::mark();
if (1 === intval($request->get('return_to_edit'))) {
if (1 === (int)$request->get('return_to_edit')) {
// @codeCoverageIgnoreStart
Session::put('users.edit.fromUpdate', true);
session()->put('users.edit.fromUpdate', true);
return redirect(route('admin.users.edit', [$user->id]))->withInput(['return_to_edit' => 1]);
// @codeCoverageIgnoreEnd

View File

@@ -80,7 +80,6 @@ class AttachmentController extends Controller
* @param Attachment $attachment
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function destroy(Request $request, Attachment $attachment)
{
@@ -88,7 +87,7 @@ class AttachmentController extends Controller
$this->repository->destroy($attachment);
$request->session()->flash('success', strval(trans('firefly.attachment_deleted', ['name' => $name])));
$request->session()->flash('success', (string)trans('firefly.attachment_deleted', ['name' => $name]));
Preferences::mark();
return redirect($this->getPreviousUri('attachments.delete.uri'));
@@ -118,7 +117,7 @@ class AttachmentController extends Controller
->header('Expires', '0')
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
->header('Pragma', 'public')
->header('Content-Length', strlen($content));
->header('Content-Length', \strlen($content));
return $response;
}
@@ -130,7 +129,6 @@ class AttachmentController extends Controller
* @param Attachment $attachment
*
* @return View
* @throws \RuntimeException
*/
public function edit(Request $request, Attachment $attachment)
{
@@ -149,22 +147,39 @@ class AttachmentController extends Controller
return view('attachments.edit', compact('attachment', 'subTitleIcon', 'subTitle'));
}
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
$set = $this->repository->get()->reverse();
$set = $set->each(
function (Attachment $attachment) {
$attachment->file_exists = $this->repository->exists($attachment);
return $attachment;
}
);
return view('attachments.index', compact('set'));
}
/**
* @param AttachmentFormRequest $request
* @param Attachment $attachment
*
* @return \Illuminate\Http\RedirectResponse
* @throws \RuntimeException
*/
public function update(AttachmentFormRequest $request, Attachment $attachment)
{
$data = $request->getAttachmentData();
$this->repository->update($attachment, $data);
$request->session()->flash('success', strval(trans('firefly.attachment_updated', ['name' => $attachment->filename])));
$request->session()->flash('success', (string)trans('firefly.attachment_updated', ['name' => $attachment->filename]));
Preferences::mark();
if (1 === intval($request->get('return_to_edit'))) {
if (1 === (int)$request->get('return_to_edit')) {
// @codeCoverageIgnoreStart
$request->session()->put('attachments.edit.fromUpdate', true);

View File

@@ -73,7 +73,7 @@ class ForgotPasswordController extends Controller
// verify if the user is not a demo user. If so, we give him back an error.
$user = User::where('email', $request->get('email'))->first();
if (!is_null($user) && $repository->hasRole($user, 'demo')) {
if (null !== $user && $repository->hasRole($user, 'demo')) {
return back()->withErrors(['email' => trans('firefly.cannot_reset_demo_user')]);
}

View File

@@ -65,7 +65,6 @@ class LoginController extends Controller
*
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
*
* @throws \RuntimeException
* @throws \Illuminate\Validation\ValidationException
*/
public function login(Request $request)
@@ -103,7 +102,6 @@ class LoginController extends Controller
* @param CookieJar $cookieJar
*
* @return $this|\Illuminate\Http\RedirectResponse
* @throws \RuntimeException
*/
public function logout(Request $request, CookieJar $cookieJar)
{
@@ -121,7 +119,6 @@ class LoginController extends Controller
* @param Request $request
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws \RuntimeException
*/
public function showLoginForm(Request $request)
{

View File

@@ -29,7 +29,6 @@ use Illuminate\Auth\Events\Registered;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Session;
/**
* @codeCoverageIgnore
@@ -83,7 +82,7 @@ class RegisterController extends Controller
$this->guard()->login($user);
Session::flash('success', strval(trans('firefly.registered')));
session()->flash('success', (string)trans('firefly.registered'));
return $this->registered($request, $user)
?: redirect($this->redirectPath());

View File

@@ -40,7 +40,6 @@ class TwoFactorController extends Controller
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
*
* @throws \RuntimeException
* @throws FireflyException
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -52,7 +51,7 @@ 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 = null === $secretPreference ? null : $secretPreference->data;
$title = strval(trans('firefly.two_factor_title'));
$title = (string)trans('firefly.two_factor_title');
// make sure the user has two factor configured:
$has2FA = Preferences::get('twoFactorAuthEnabled', false)->data;
@@ -60,7 +59,7 @@ class TwoFactorController extends Controller
return redirect(route('index'));
}
if (0 === strlen(strval($secret))) {
if (0 === \strlen((string)$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);
@@ -75,7 +74,7 @@ class TwoFactorController extends Controller
{
$user = auth()->user();
$siteOwner = env('SITE_OWNER', '');
$title = strval(trans('firefly.two_factor_forgot_title'));
$title = (string)trans('firefly.two_factor_forgot_title');
Log::info(
'To reset the two factor authentication for user #' . $user->id .
@@ -92,7 +91,6 @@ class TwoFactorController extends Controller
*
* @return mixed
* @SuppressWarnings(PHPMD.UnusedFormalParameter) // it's unused but the class does some validation.
* @throws \RuntimeException
*/
public function postIndex(TokenFormRequest $request, CookieJar $cookieJar)
{

View File

@@ -22,13 +22,16 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use ExpandedForm;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Http\Requests\BillFormRequest;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Note;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
use FireflyIII\TransactionRules\TransactionMatcher;
use FireflyIII\Transformers\BillTransformer;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
@@ -74,16 +77,19 @@ class BillController extends Controller
/**
* @param Request $request
*
* @param CurrencyRepositoryInterface $repository
*
* @return View
* @throws \RuntimeException
*/
public function create(Request $request)
public function create(Request $request, CurrencyRepositoryInterface $repository)
{
$periods = [];
foreach (config('firefly.bill_periods') as $current) {
$periods[$current] = trans('firefly.' . $current);
$periods[$current] = strtolower((string)trans('firefly.repeat_freq_' . $current));
}
$subTitle = trans('firefly.create_new_bill');
$defaultCurrency = app('amount')->getDefaultCurrency();
$currencies = ExpandedForm::makeSelectList($repository->get());
// put previous url in session if not redirect from store (not "create another").
if (true !== session('bills.create.fromStore')) {
@@ -91,7 +97,7 @@ class BillController extends Controller
}
$request->session()->forget('bills.create.fromStore');
return view('bills.create', compact('periods', 'subTitle'));
return view('bills.create', compact('periods', 'subTitle', 'currencies', 'defaultCurrency'));
}
/**
@@ -114,14 +120,13 @@ class BillController extends Controller
* @param Bill $bill
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function destroy(Request $request, BillRepositoryInterface $repository, Bill $bill)
{
$name = $bill->name;
$repository->destroy($bill);
$request->session()->flash('success', strval(trans('firefly.deleted_bill', ['name' => $name])));
$request->session()->flash('success', (string)trans('firefly.deleted_bill', ['name' => $name]));
Preferences::mark();
return redirect($this->getPreviousUri('bills.delete.uri'));
@@ -129,12 +134,12 @@ class BillController extends Controller
/**
* @param Request $request
* @param CurrencyRepositoryInterface $repository
* @param Bill $bill
*
* @return View
* @throws \RuntimeException
*/
public function edit(Request $request, Bill $bill)
public function edit(Request $request, CurrencyRepositoryInterface $repository, Bill $bill)
{
$periods = [];
foreach (config('firefly.bill_periods') as $current) {
@@ -150,6 +155,8 @@ class BillController extends Controller
$currency = app('amount')->getDefaultCurrency();
$bill->amount_min = round($bill->amount_min, $currency->decimal_places);
$bill->amount_max = round($bill->amount_max, $currency->decimal_places);
$defaultCurrency = app('amount')->getDefaultCurrency();
$currencies = ExpandedForm::makeSelectList($repository->get());
$preFilled = [
'notes' => '',
@@ -165,7 +172,7 @@ class BillController extends Controller
$request->session()->forget('bills.edit.fromUpdate');
return view('bills.edit', compact('subTitle', 'periods', 'bill'));
return view('bills.edit', compact('subTitle', 'periods', 'bill', 'defaultCurrency', 'currencies'));
}
/**
@@ -177,7 +184,7 @@ class BillController extends Controller
{
$start = session('start');
$end = session('end');
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$paginator = $repository->getPaginator($pageSize);
$parameters = new ParameterBag();
$parameters->set('start', $start);
@@ -189,6 +196,21 @@ class BillController extends Controller
return $transformer->transform($bill);
}
);
$bills = $bills->sortBy(
function (array $bill) {
return (int)!$bill['active'] . strtolower($bill['name']);
}
);
// add info about rules:
$rules = $repository->getRulesForBills($paginator->getCollection());
$bills = $bills->map(
function (array $bill) use ($rules) {
$bill['rules'] = $rules[$bill['id']] ?? [];
return $bill;
}
);
$paginator->setPath(route('bills.index'));
@@ -201,23 +223,31 @@ class BillController extends Controller
* @param Bill $bill
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function rescan(Request $request, BillRepositoryInterface $repository, Bill $bill)
{
if (0 === intval($bill->active)) {
$request->session()->flash('warning', strval(trans('firefly.cannot_scan_inactive_bill')));
if (0 === (int)$bill->active) {
$request->session()->flash('warning', (string)trans('firefly.cannot_scan_inactive_bill'));
return redirect(URL::previous());
}
$journals = $repository->getPossiblyRelatedJournals($bill);
/** @var TransactionJournal $journal */
foreach ($journals as $journal) {
$repository->scan($bill, $journal);
$set = $repository->getRulesForBill($bill);
$total = 0;
foreach ($set as $rule) {
// simply fire off all rules?
/** @var TransactionMatcher $matcher */
$matcher = app(TransactionMatcher::class);
$matcher->setLimit(100000); // large upper limit
$matcher->setRange(100000); // large upper limit
$matcher->setRule($rule);
$matchingTransactions = $matcher->findTransactionsByRule();
$total += $matchingTransactions->count();
$repository->linkCollectionToBill($bill, $matchingTransactions);
}
$request->session()->flash('success', strval(trans('firefly.rescanned_bill')));
$request->session()->flash('success', (string)trans('firefly.rescanned_bill', ['total' => $total]));
Preferences::mark();
return redirect(URL::previous());
@@ -232,17 +262,19 @@ class BillController extends Controller
*/
public function show(Request $request, BillRepositoryInterface $repository, Bill $bill)
{
// add info about rules:
$rules = $repository->getRulesForBill($bill);
$subTitle = $bill->name;
$start = session('start');
$end = session('end');
$year = $start->year;
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$yearAverage = $repository->getYearAverage($bill, $start);
$overallAverage = $repository->getOverallAverage($bill);
$manager = new Manager();
$manager->setSerializer(new DataArraySerializer());
$manager->parseIncludes(['attachments']);
$manager->parseIncludes(['attachments', 'notes']);
// Make a resource out of the data and
$parameters = new ParameterBag();
@@ -260,21 +292,26 @@ class BillController extends Controller
$transactions->setPath(route('bills.show', [$bill->id]));
return view('bills.show', compact('transactions', 'yearAverage', 'overallAverage', 'year', 'object', 'bill', 'subTitle'));
return view('bills.show', compact('transactions', 'rules', 'yearAverage', 'overallAverage', 'year', 'object', 'bill', 'subTitle'));
}
/**
* @param BillFormRequest $request
* @param BillRepositoryInterface $repository
*
* @param RuleGroupRepositoryInterface $ruleGroupRepository
* @return \Illuminate\Http\RedirectResponse
* @throws \RuntimeException
*/
public function store(BillFormRequest $request, BillRepositoryInterface $repository)
public function store(BillFormRequest $request, BillRepositoryInterface $repository, RuleGroupRepositoryInterface $ruleGroupRepository)
{
$billData = $request->getBillData();
$bill = $repository->store($billData);
$request->session()->flash('success', strval(trans('firefly.stored_new_bill', ['name' => $bill->name])));
if (null === $bill) {
$request->session()->flash('error', (string)trans('firefly.bill_store_error'));
return redirect(route('bills.create'))->withInput();
}
$request->session()->flash('success', (string)trans('firefly.stored_new_bill', ['name' => $bill->name]));
Preferences::mark();
/** @var array $files */
@@ -282,20 +319,33 @@ class BillController extends Controller
$this->attachments->saveAttachmentsForModel($bill, $files);
// flash messages
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
if (\count($this->attachments->getMessages()->get('attachments')) > 0) {
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments')); // @codeCoverageIgnore
}
if (1 === intval($request->get('create_another'))) {
// @codeCoverageIgnoreStart
$request->session()->put('bills.create.fromStore', true);
return redirect(route('bills.create'))->withInput();
// @codeCoverageIgnoreEnd
// do return to original bill form?
$return = 'false';
if (1 === (int)$request->get('create_another')) {
$return = 'true';
}
// redirect to previous URL.
return redirect($this->getPreviousUri('bills.create.uri'));
// find first rule group, or create one:
$count = $ruleGroupRepository->count();
if ($count === 0) {
$data = [
'title' => (string)trans('firefly.rulegroup_for_bills_title'),
'description' => (string)trans('firefly.rulegroup_for_bills_description'),
];
$group = $ruleGroupRepository->store($data);
}
if ($count > 0) {
$group = $ruleGroupRepository->getActiveGroups(auth()->user())->first();
}
// redirect to page that will create a new rule.
$params = http_build_query(['fromBill' => $bill->id, 'return' => $return]);
return redirect(route('rules.create', [$group->id]) . '?' . $params);
}
/**
@@ -304,14 +354,13 @@ class BillController extends Controller
* @param Bill $bill
*
* @return \Illuminate\Http\RedirectResponse
* @throws \RuntimeException
*/
public function update(BillFormRequest $request, BillRepositoryInterface $repository, Bill $bill)
{
$billData = $request->getBillData();
$bill = $repository->update($bill, $billData);
$request->session()->flash('success', strval(trans('firefly.updated_bill', ['name' => $bill->name])));
$request->session()->flash('success', (string)trans('firefly.updated_bill', ['name' => $bill->name]));
Preferences::mark();
/** @var array $files */
@@ -319,11 +368,11 @@ class BillController extends Controller
$this->attachments->saveAttachmentsForModel($bill, $files);
// flash messages
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
if (\count($this->attachments->getMessages()->get('attachments')) > 0) {
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments')); // @codeCoverageIgnore
}
if (1 === intval($request->get('return_to_edit'))) {
if (1 === (int)$request->get('return_to_edit')) {
// @codeCoverageIgnoreStart
$request->session()->put('bills.edit.fromUpdate', true);

View File

@@ -78,26 +78,40 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return \Illuminate\Http\JsonResponse
* @throws \InvalidArgumentException
*/
public function amount(Request $request, BudgetRepositoryInterface $repository, Budget $budget)
{
$amount = strval($request->get('amount'));
$amount = (string)$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);
$largeDiff = false;
$warnText = '';
$average = '0';
$current = '0';
if (0 === bccomp($amount, '0')) {
$budgetLimit = null;
}
// if today is between start and end, use the diff in days between end and today (days left)
// otherwise, use diff between start and end.
$today = new Carbon;
if ($today->gte($start) && $today->lte($end)) {
$days = $end->diffInDays($today);
}
if ($today->lte($start) || $today->gte($end)) {
$days = $start->diffInDays($end);
}
$days = $days === 0 ? 1 : $days;
// calculate left in budget:
$spent = $repository->spentInPeriod(new Collection([$budget]), new Collection, $start, $end);
$currency = app('amount')->getDefaultCurrency();
$left = app('amount')->formatAnything($currency, bcadd($amount, $spent), true);
$leftPerDay = 'none';
// is user has money left, calculate.
if (1 === bccomp(bcadd($amount, $spent), '0')) {
$leftPerDay = app('amount')->formatAnything($currency, bcdiv(bcadd($amount, $spent), (string)$days), true);
}
// over or under budgeting, compared to previous budgets?
@@ -106,18 +120,16 @@ class BudgetController extends Controller
$diff = $start->diffInDays($end);
$current = $amount;
if ($diff > 0) {
$current = bcdiv($amount, strval($diff));
$current = bcdiv($amount, (string)$diff);
}
if (bccomp(bcmul('1.1', $average), $current) === -1) {
$largeDiff = true;
$warnText = strval(
trans(
$warnText = (string)trans(
'firefly.over_budget_warn',
[
'amount' => app('amount')->formatAnything($currency, $average, false),
'over_amount' => app('amount')->formatAnything($currency, $current, false),
]
)
);
}
@@ -132,6 +144,7 @@ class BudgetController extends Controller
'current' => $current,
'average' => $average,
'large_diff' => $largeDiff,
'left_per_day' => $leftPerDay,
'warn_text' => $warnText,
]
@@ -142,7 +155,6 @@ class BudgetController extends Controller
* @param Request $request
*
* @return View
* @throws \RuntimeException
*/
public function create(Request $request)
{
@@ -176,13 +188,12 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
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])));
$request->session()->flash('success', (string)trans('firefly.deleted_budget', ['name' => $name]));
Preferences::mark();
return redirect($this->getPreviousUri('budgets.delete.uri'));
@@ -193,7 +204,6 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return View
* @throws \RuntimeException
*/
public function edit(Request $request, Budget $budget)
{
@@ -222,8 +232,19 @@ class BudgetController extends Controller
$range = Preferences::get('viewRange', '1M')->data;
$start = session('start', new Carbon);
$end = session('end', new Carbon);
$page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
// if today is between start and end, use the diff in days between end and today (days left)
// otherwise, use diff between start and end.
$today = new Carbon;
if ($today->gte($start) && $today->lte($end)) {
$days = $end->diffInDays($today);
}
if ($today->lte($start) || $today->gte($end)) {
$days = $start->diffInDays($end);
}
$days = $days === 0 ? 1 : $days;
// make date if present:
if (null !== $moment || '' !== (string)$moment) {
@@ -289,26 +310,10 @@ class BudgetController extends Controller
$prevText = app('navigation')->periodShow($prev, $range);
return view(
'budgets.index',
compact(
'available',
'currentMonth',
'next',
'nextText',
'prev', 'allBudgets',
'prevText',
'periodStart',
'periodEnd',
'page',
'budgets.index', compact(
'available', 'currentMonth', 'next', 'nextText', 'prev', 'allBudgets', 'prevText', 'periodStart', 'periodEnd', 'days', 'page',
'budgetInformation',
'inactive',
'budgets',
'spent',
'budgeted',
'previousLoop',
'nextLoop',
'start',
'end'
'inactive', 'budgets', 'spent', 'budgeted', 'previousLoop', 'nextLoop', 'start', 'end'
)
);
}
@@ -366,7 +371,7 @@ class BudgetController extends Controller
if (0 === $count) {
$count = 1;
}
$result['available'] = bcdiv($total, strval($count));
$result['available'] = bcdiv($total, (string)$count);
// amount earned in this period:
$subDay = clone $end;
@@ -374,13 +379,13 @@ class BudgetController extends Controller
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAllAssetAccounts()->setRange($begin, $subDay)->setTypes([TransactionType::DEPOSIT])->withOpposingAccount();
$result['earned'] = bcdiv(strval($collector->getJournals()->sum('transaction_amount')), strval($count));
$result['earned'] = bcdiv((string)$collector->getJournals()->sum('transaction_amount'), (string)$count);
// amount spent in period
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAllAssetAccounts()->setRange($begin, $subDay)->setTypes([TransactionType::WITHDRAWAL])->withOpposingAccount();
$result['spent'] = bcdiv(strval($collector->getJournals()->sum('transaction_amount')), strval($count));
$result['spent'] = bcdiv((string)$collector->getJournals()->sum('transaction_amount'), (string)$count);
// suggestion starts with the amount spent
$result['suggested'] = bcmul($result['spent'], '-1');
$result['suggested'] = 1 === bccomp($result['suggested'], $result['earned']) ? $result['earned'] : $result['suggested'];
@@ -412,13 +417,13 @@ class BudgetController extends Controller
// prep for "all" view.
if ('all' === $moment) {
$subTitle = trans('firefly.all_journals_without_budget');
$first = $repository->first();
$start = $first->date ?? new Carbon;
$first = $repository->firstNull();
$start = null === $first ? new Carbon : $first->date;
$end = new Carbon;
}
// prep for "specific date" view.
if (strlen($moment) > 0 && 'all' !== $moment) {
if ('all' !== $moment && \strlen($moment) > 0) {
$start = new Carbon($moment);
$end = app('navigation')->endOfPeriod($start, $range);
$subTitle = trans(
@@ -429,7 +434,7 @@ class BudgetController extends Controller
}
// prep for current period
if (0 === strlen($moment)) {
if ('' === $moment) {
$start = clone session('start', app('navigation')->startOfPeriod(new Carbon, $range));
$end = clone session('end', app('navigation')->endOfPeriod(new Carbon, $range));
$periods = $this->getPeriodOverview();
@@ -439,8 +444,8 @@ class BudgetController extends Controller
);
}
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
@@ -456,7 +461,6 @@ class BudgetController extends Controller
* @param BudgetIncomeRequest $request
*
* @return \Illuminate\Http\RedirectResponse
* @throws \InvalidArgumentException
*/
public function postUpdateIncome(BudgetIncomeRequest $request)
{
@@ -477,7 +481,6 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return View
* @throws \InvalidArgumentException
*/
public function show(Request $request, Budget $budget)
{
@@ -508,7 +511,6 @@ class BudgetController extends Controller
*
* @return View
*
* @throws \InvalidArgumentException
* @throws FireflyException
*/
public function showByBudgetLimit(Request $request, Budget $budget, BudgetLimit $budgetLimit)
@@ -517,8 +519,8 @@ class BudgetController extends Controller
throw new FireflyException('This budget limit is not part of this budget.');
}
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$subTitle = trans(
'firefly.budget_in_period',
[
@@ -546,17 +548,16 @@ class BudgetController extends Controller
* @param BudgetFormRequest $request
*
* @return \Illuminate\Http\RedirectResponse
* @throws \RuntimeException
*/
public function store(BudgetFormRequest $request)
{
$data = $request->getBudgetData();
$budget = $this->repository->store($data);
$this->repository->cleanupBudgets();
$request->session()->flash('success', strval(trans('firefly.stored_new_budget', ['name' => $budget->name])));
$request->session()->flash('success', (string)trans('firefly.stored_new_budget', ['name' => $budget->name]));
Preferences::mark();
if (1 === intval($request->get('create_another'))) {
if (1 === (int)$request->get('create_another')) {
// @codeCoverageIgnoreStart
$request->session()->put('budgets.create.fromStore', true);
@@ -572,18 +573,17 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return \Illuminate\Http\RedirectResponse
* @throws \RuntimeException
*/
public function update(BudgetFormRequest $request, Budget $budget)
{
$data = $request->getBudgetData();
$this->repository->update($budget, $data);
$request->session()->flash('success', strval(trans('firefly.updated_budget', ['name' => $budget->name])));
$request->session()->flash('success', (string)trans('firefly.updated_budget', ['name' => $budget->name]));
$this->repository->cleanupBudgets();
Preferences::mark();
if (1 === intval($request->get('return_to_edit'))) {
if (1 === (int)$request->get('return_to_edit')) {
// @codeCoverageIgnoreStart
$request->session()->put('budgets.edit.fromUpdate', true);
@@ -606,7 +606,7 @@ class BudgetController extends Controller
$defaultCurrency = app('amount')->getDefaultCurrency();
$available = $this->repository->getAvailableBudget($defaultCurrency, $start, $end);
$available = round($available, $defaultCurrency->decimal_places);
$page = intval($request->get('page'));
$page = (int)$request->get('page');
return view('budgets.income', compact('available', 'start', 'end', 'page'));
}
@@ -649,9 +649,10 @@ class BudgetController extends Controller
*/
private function getPeriodOverview(): Collection
{
/** @var JournalRepositoryInterface $repository */
$repository = app(JournalRepositoryInterface::class);
$first = $repository->first();
$start = $first->date ?? new Carbon;
$first = $repository->firstNull();
$start = null === $first ? new Carbon : $first->date;
$range = Preferences::get('viewRange', '1M')->data;
$start = app('navigation')->startOfPeriod($start, $range);
$end = app('navigation')->endOfX(new Carbon, $range, null);
@@ -672,7 +673,7 @@ class BudgetController extends Controller
[TransactionType::WITHDRAWAL]
);
$set = $collector->getJournals();
$sum = strval($set->sum('transaction_amount') ?? '0');
$sum = (string)($set->sum('transaction_amount') ?? '0');
$journals = $set->count();
$dateStr = $date['end']->format('Y-m-d');
$dateName = app('navigation')->periodShow($date['end'], $date['period']);

View File

@@ -77,7 +77,6 @@ class CategoryController extends Controller
* @param Request $request
*
* @return View
* @throws \RuntimeException
*/
public function create(Request $request)
{
@@ -110,14 +109,13 @@ class CategoryController extends Controller
* @param Category $category
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function destroy(Request $request, Category $category)
{
$name = $category->name;
$this->repository->destroy($category);
$request->session()->flash('success', strval(trans('firefly.deleted_category', ['name' => $name])));
$request->session()->flash('success', (string)trans('firefly.deleted_category', ['name' => $name]));
Preferences::mark();
return redirect($this->getPreviousUri('categories.delete.uri'));
@@ -128,7 +126,6 @@ class CategoryController extends Controller
* @param Category $category
*
* @return View
* @throws \RuntimeException
*/
public function edit(Request $request, Category $category)
{
@@ -150,8 +147,8 @@ class CategoryController extends Controller
*/
public function index(Request $request)
{
$page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$collection = $this->repository->getCategories();
$total = $collection->count();
$collection = $collection->slice(($page - 1) * $pageSize, $pageSize);
@@ -182,19 +179,19 @@ class CategoryController extends Controller
$start = null;
$end = null;
$periods = new Collection;
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
// prep for "all" view.
if ('all' === $moment) {
$subTitle = trans('firefly.all_journals_without_category');
$first = $this->journalRepos->first();
$start = $first->date ?? new Carbon;
$first = $this->journalRepos->firstNull();
$start = null === $first ? new Carbon : $first->date;
$end = new Carbon;
}
// prep for "specific date" view.
if (strlen($moment) > 0 && 'all' !== $moment) {
if ('all' !== $moment && \strlen($moment) > 0) {
$start = app('navigation')->startOfPeriod(new Carbon($moment), $range);
$end = app('navigation')->endOfPeriod($start, $range);
$subTitle = trans(
@@ -205,7 +202,7 @@ class CategoryController extends Controller
}
// prep for current period
if (0 === strlen($moment)) {
if ('' === $moment) {
$start = clone session('start', app('navigation')->startOfPeriod(new Carbon, $range));
$end = clone session('end', app('navigation')->endOfPeriod(new Carbon, $range));
$periods = $this->getNoCategoryPeriodOverview($start);
@@ -239,8 +236,8 @@ class CategoryController extends Controller
// default values:
$subTitle = $category->name;
$subTitleIcon = 'fa-bar-chart';
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$range = Preferences::get('viewRange', '1M')->data;
$start = null;
$end = null;
@@ -252,13 +249,13 @@ class CategoryController extends Controller
$subTitle = trans('firefly.all_journals_for_category', ['name' => $category->name]);
$first = $repository->firstUseDate($category);
/** @var Carbon $start */
$start = null === $first ? new Carbon : $first;
$start = $first ?? new Carbon;
$end = new Carbon;
$path = route('categories.show', [$category->id, 'all']);
}
// prep for "specific date" view.
if (strlen($moment) > 0 && 'all' !== $moment) {
if (\strlen($moment) > 0 && 'all' !== $moment) {
$start = app('navigation')->startOfPeriod(new Carbon($moment), $range);
$end = app('navigation')->endOfPeriod($start, $range);
$subTitle = trans(
@@ -271,7 +268,7 @@ class CategoryController extends Controller
}
// prep for current period
if (0 === strlen($moment)) {
if (0 === \strlen($moment)) {
/** @var Carbon $start */
$start = clone session('start', app('navigation')->startOfPeriod(new Carbon, $range));
/** @var Carbon $end */
@@ -300,17 +297,16 @@ class CategoryController extends Controller
* @param CategoryRepositoryInterface $repository
*
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function store(CategoryFormRequest $request, CategoryRepositoryInterface $repository)
{
$data = $request->getCategoryData();
$category = $repository->store($data);
$request->session()->flash('success', strval(trans('firefly.stored_category', ['name' => $category->name])));
$request->session()->flash('success', (string)trans('firefly.stored_category', ['name' => $category->name]));
Preferences::mark();
if (1 === intval($request->get('create_another'))) {
if (1 === (int)$request->get('create_another')) {
// @codeCoverageIgnoreStart
$request->session()->put('categories.create.fromStore', true);
@@ -327,17 +323,16 @@ class CategoryController extends Controller
* @param Category $category
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function update(CategoryFormRequest $request, CategoryRepositoryInterface $repository, Category $category)
{
$data = $request->getCategoryData();
$repository->update($category, $data);
$request->session()->flash('success', strval(trans('firefly.updated_category', ['name' => $category->name])));
$request->session()->flash('success', (string)trans('firefly.updated_category', ['name' => $category->name]));
Preferences::mark();
if (1 === intval($request->get('return_to_edit'))) {
if (1 === (int)$request->get('return_to_edit')) {
// @codeCoverageIgnoreStart
$request->session()->put('categories.edit.fromUpdate', true);
@@ -356,8 +351,8 @@ class CategoryController extends Controller
private function getNoCategoryPeriodOverview(Carbon $theDate): Collection
{
$range = Preferences::get('viewRange', '1M')->data;
$first = $this->journalRepos->first();
$start = $first->date ?? new Carbon;
$first = $this->journalRepos->firstNull();
$start = null === $first ? new Carbon : $first->date;
$end = $theDate ?? new Carbon;
// properties for cache
@@ -436,8 +431,8 @@ class CategoryController extends Controller
private function getPeriodOverview(Category $category, Carbon $date): Collection
{
$range = Preferences::get('viewRange', '1M')->data;
$first = $this->journalRepos->first();
$start = $first->date ?? new Carbon;
$first = $this->journalRepos->firstNull();
$start = null === $first ? new Carbon : $first->date;
$end = $date ?? new Carbon;
$accounts = $this->accountRepos->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);

View File

@@ -93,7 +93,7 @@ class AccountController extends Controller
}
arsort($chartData);
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
$data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData);
$cache->store($data);
return response()->json($data);
@@ -124,8 +124,8 @@ class AccountController extends Controller
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
$jrnlBudgetId = intval($transaction->transaction_journal_budget_id);
$transBudgetId = intval($transaction->transaction_budget_id);
$jrnlBudgetId = (int)$transaction->transaction_journal_budget_id;
$transBudgetId = (int)$transaction->transaction_budget_id;
$budgetId = max($jrnlBudgetId, $transBudgetId);
$result[$budgetId] = $result[$budgetId] ?? '0';
$result[$budgetId] = bcadd($transaction->transaction_amount, $result[$budgetId]);
@@ -181,8 +181,8 @@ class AccountController extends Controller
$chartData = [];
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
$jrnlCatId = intval($transaction->transaction_journal_category_id);
$transCatId = intval($transaction->transaction_category_id);
$jrnlCatId = (int)$transaction->transaction_journal_category_id;
$transCatId = (int)$transaction->transaction_category_id;
$categoryId = max($jrnlCatId, $transCatId);
$result[$categoryId] = $result[$categoryId] ?? '0';
$result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]);
@@ -228,7 +228,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 (0 === count($frontPage->data)) {
if (0 === \count($frontPage->data)) {
$frontPage->data = $defaultSet;
Log::debug('frontpage set is empty!');
$frontPage->save();
@@ -264,8 +264,8 @@ class AccountController extends Controller
$chartData = [];
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
$jrnlCatId = intval($transaction->transaction_journal_category_id);
$transCatId = intval($transaction->transaction_category_id);
$jrnlCatId = (int)$transaction->transaction_journal_category_id;
$transCatId = (int)$transaction->transaction_category_id;
$categoryId = max($jrnlCatId, $transCatId);
$result[$categoryId] = $result[$categoryId] ?? '0';
$result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]);
@@ -336,7 +336,7 @@ class AccountController extends Controller
$theDate = $current->format('Y-m-d');
$balance = $range[$theDate] ?? $previous;
$label = $current->formatLocalized($format);
$chartData[$label] = floatval($balance);
$chartData[$label] = (float)$balance;
$previous = $balance;
$current->addDay();
}
@@ -346,10 +346,10 @@ class AccountController extends Controller
case '1M':
case '1Y':
while ($end >= $current) {
$balance = floatval(app('steam')->balance($account, $current));
$balance = (float)app('steam')->balance($account, $current);
$label = app('navigation')->periodShow($current, $step);
$chartData[$label] = $balance;
$current = app('navigation')->addPeriod($current, $step, 1);
$current = app('navigation')->addPeriod($current, $step, 0);
}
break;
// @codeCoverageIgnoreEnd
@@ -411,7 +411,7 @@ class AccountController extends Controller
}
arsort($chartData);
$data = $this->generator->singleSet(strval(trans('firefly.earned')), $chartData);
$data = $this->generator->singleSet((string)trans('firefly.earned'), $chartData);
$cache->store($data);
return response()->json($data);
@@ -439,21 +439,25 @@ class AccountController extends Controller
/** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class);
$default = app('amount')->getDefaultCurrency();
$chartData = [];
foreach ($accounts as $account) {
$currency = $repository->findNull(intval($account->getMeta('currency_id')));
$currency = $repository->findNull((int)$account->getMeta('currency_id'));
if (null === $currency) {
$currency = $default;
}
$currentSet = [
'label' => $account->name,
'currency_symbol' => $currency->symbol,
'entries' => [],
];
$currentStart = clone $start;
$range = app('steam')->balanceInRange($account, $start, clone $end);
$previous = array_values($range)[0];
while ($currentStart <= $end) {
$format = $currentStart->format('Y-m-d');
$label = $currentStart->formatLocalized(strval(trans('config.month_and_day')));
$label = $currentStart->formatLocalized((string)trans('config.month_and_day'));
$balance = isset($range[$format]) ? round($range[$format], 12) : $previous;
$previous = $balance;
$currentStart->addDay();

View File

@@ -71,8 +71,8 @@ class BillController extends Controller
$paid = $repository->getBillsPaidInRange($start, $end); // will be a negative amount.
$unpaid = $repository->getBillsUnpaidInRange($start, $end); // will be a positive amount.
$chartData = [
strval(trans('firefly.unpaid')) => $unpaid,
strval(trans('firefly.paid')) => $paid,
(string)trans('firefly.unpaid') => $unpaid,
(string)trans('firefly.paid') => $paid,
];
$data = $this->generator->pieChart($chartData);
@@ -110,7 +110,7 @@ class BillController extends Controller
/** @var Transaction $entry */
foreach ($results as $entry) {
$date = $entry->date->formatLocalized(strval(trans('config.month_and_day')));
$date = $entry->date->formatLocalized((string)trans('config.month_and_day'));
$chartData[0]['entries'][$date] = $bill->amount_min; // minimum amount of bill
$chartData[1]['entries'][$date] = $bill->amount_max; // maximum amount of bill
$chartData[2]['entries'][$date] = bcmul($entry->transaction_amount, '-1'); // amount of journal

View File

@@ -112,12 +112,12 @@ class BudgetController extends Controller
}
$spent = $this->repository->spentInPeriod($budgetCollection, new Collection, $current, $currentEnd);
$label = app('navigation')->periodShow($current, $step);
$chartData[$label] = floatval(bcmul($spent, '-1'));
$chartData[$label] = (float)bcmul($spent, '-1');
$current = clone $currentEnd;
$current->addDay();
}
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
$data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData);
$cache->store($data);
@@ -161,12 +161,12 @@ class BudgetController extends Controller
while ($start <= $end) {
$spent = $this->repository->spentInPeriod($budgetCollection, new Collection, $start, $start);
$amount = bcadd($amount, $spent);
$format = $start->formatLocalized(strval(trans('config.month_and_day')));
$format = $start->formatLocalized((string)trans('config.month_and_day'));
$entries[$format] = $amount;
$start->addDay();
}
$data = $this->generator->singleSet(strval(trans('firefly.left')), $entries);
$data = $this->generator->singleSet((string)trans('firefly.left'), $entries);
$cache->store($data);
return response()->json($data);
@@ -200,7 +200,7 @@ class BudgetController extends Controller
$chartData = [];
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
$assetId = intval($transaction->account_id);
$assetId = (int)$transaction->account_id;
$result[$assetId] = $result[$assetId] ?? '0';
$result[$assetId] = bcadd($transaction->transaction_amount, $result[$assetId]);
}
@@ -244,8 +244,8 @@ class BudgetController extends Controller
$chartData = [];
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
$jrnlCatId = intval($transaction->transaction_journal_category_id);
$transCatId = intval($transaction->transaction_category_id);
$jrnlCatId = (int)$transaction->transaction_journal_category_id;
$transCatId = (int)$transaction->transaction_category_id;
$categoryId = max($jrnlCatId, $transCatId);
$result[$categoryId] = $result[$categoryId] ?? '0';
$result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]);
@@ -290,7 +290,7 @@ class BudgetController extends Controller
$chartData = [];
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
$opposingId = intval($transaction->opposing_account_id);
$opposingId = (int)$transaction->opposing_account_id;
$result[$opposingId] = $result[$opposingId] ?? '0';
$result[$opposingId] = bcadd($transaction->transaction_amount, $result[$opposingId]);
}
@@ -329,9 +329,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' => (string)trans('firefly.spent_in_budget'), 'entries' => [], 'type' => 'bar'],
['label' => (string)trans('firefly.left_to_spend'), 'entries' => [], 'type' => 'bar'],
['label' => (string)trans('firefly.overspent'), 'entries' => [], 'type' => 'bar'],
];
/** @var Budget $budget */
@@ -348,7 +348,7 @@ class BudgetController extends Controller
}
// for no budget:
$spent = $this->spentInPeriodWithout($start, $end);
$name = strval(trans('firefly.no_budget'));
$name = (string)trans('firefly.no_budget');
if (0 !== bccomp($spent, '0')) {
$chartData[0]['entries'][$name] = bcmul($spent, '-1');
$chartData[1]['entries'][$name] = '0';
@@ -389,14 +389,14 @@ 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' => (string)trans('firefly.spent'), 'type' => 'bar', 'entries' => []],
['label' => (string)trans('firefly.budgeted'), 'type' => 'bar', 'entries' => []],
];
foreach (array_keys($periods) as $period) {
$label = $periods[$period];
$spent = isset($entries[$budget->id]['entries'][$period]) ? $entries[$budget->id]['entries'][$period] : '0';
$limit = isset($budgeted[$period]) ? $budgeted[$period] : 0;
$spent = $entries[$budget->id]['entries'][$period] ?? '0';
$limit = (int)($budgeted[$period] ?? 0);
$chartData[0]['entries'][$label] = round(bcmul($spent, '-1'), 12);
$chartData[1]['entries'][$label] = $limit;
}
@@ -433,10 +433,10 @@ class BudgetController extends Controller
// join them:
foreach (array_keys($periods) as $period) {
$label = $periods[$period];
$spent = isset($entries['entries'][$period]) ? $entries['entries'][$period] : '0';
$spent = $entries['entries'][$period] ?? '0';
$chartData[$label] = bcmul($spent, '-1');
}
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
$data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData);
$cache->store($data);
return response()->json($data);
@@ -568,7 +568,7 @@ class BudgetController extends Controller
private function spentInPeriodMulti(Budget $budget, Collection $limits): array
{
$return = [];
$format = strval(trans('config.month_and_day'));
$format = (string)trans('config.month_and_day');
$name = $budget->name;
/** @var BudgetLimit $budgetLimit */
foreach ($limits as $budgetLimit) {

View File

@@ -83,7 +83,7 @@ class BudgetReportController extends Controller
$helper->setBudgets($budgets);
$helper->setStart($start);
$helper->setEnd($end);
$helper->setCollectOtherObjects(1 === intval($others));
$helper->setCollectOtherObjects(1 === (int)$others);
$chartData = $helper->generate('expense', 'account');
$data = $this->generator->pieChart($chartData);
@@ -107,7 +107,7 @@ class BudgetReportController extends Controller
$helper->setBudgets($budgets);
$helper->setStart($start);
$helper->setEnd($end);
$helper->setCollectOtherObjects(1 === intval($others));
$helper->setCollectOtherObjects(1 === (int)$others);
$chartData = $helper->generate('expense', 'budget');
$data = $this->generator->pieChart($chartData);
@@ -141,20 +141,20 @@ class BudgetReportController extends Controller
// prep chart data:
foreach ($budgets as $budget) {
$chartData[$budget->id] = [
'label' => strval(trans('firefly.spent_in_specific_budget', ['budget' => $budget->name])),
'label' => (string)trans('firefly.spent_in_specific_budget', ['budget' => $budget->name]),
'type' => 'bar',
'yAxisID' => 'y-axis-0',
'entries' => [],
];
$chartData[$budget->id . '-sum'] = [
'label' => strval(trans('firefly.sum_of_expenses_in_budget', ['budget' => $budget->name])),
'label' => (string)trans('firefly.sum_of_expenses_in_budget', ['budget' => $budget->name]),
'type' => 'line',
'fill' => false,
'yAxisID' => 'y-axis-1',
'entries' => [],
];
$chartData[$budget->id . '-left'] = [
'label' => strval(trans('firefly.left_in_budget_limit', ['budget' => $budget->name])),
'label' => (string)trans('firefly.left_in_budget_limit', ['budget' => $budget->name]),
'type' => 'bar',
'fill' => false,
'yAxisID' => 'y-axis-0',
@@ -180,9 +180,9 @@ class BudgetReportController extends Controller
$chartData[$budget->id]['entries'][$label] = bcmul($currentExpenses, '-1');
$chartData[$budget->id . '-sum']['entries'][$label] = bcmul($sumOfExpenses[$budget->id], '-1');
if (count($budgetLimits) > 0) {
if (\count($budgetLimits) > 0) {
$budgetLimitId = $budgetLimits->first()->id;
$leftOfLimits[$budgetLimitId] = $leftOfLimits[$budgetLimitId] ?? strval($budgetLimits->sum('amount'));
$leftOfLimits[$budgetLimitId] = $leftOfLimits[$budgetLimitId] ?? (string)$budgetLimits->sum('amount');
$leftOfLimits[$budgetLimitId] = bcadd($leftOfLimits[$budgetLimitId], $currentExpenses);
$chartData[$budget->id . '-left']['entries'][$label] = $leftOfLimits[$budgetLimitId];
}
@@ -244,9 +244,7 @@ class BudgetReportController extends Controller
$collector->addFilter(OpposingAccountFilter::class);
$collector->addFilter(PositiveAmountFilter::class);
$transactions = $collector->getJournals();
return $transactions;
return $collector->getJournals();
}
/**
@@ -260,8 +258,8 @@ class BudgetReportController extends Controller
$grouped = [];
/** @var Transaction $transaction */
foreach ($set as $transaction) {
$jrnlBudId = intval($transaction->transaction_journal_budget_id);
$transBudId = intval($transaction->transaction_budget_id);
$jrnlBudId = (int)$transaction->transaction_journal_budget_id;
$transBudId = (int)$transaction->transaction_budget_id;
$budgetId = max($jrnlBudId, $transBudId);
$grouped[$budgetId] = $grouped[$budgetId] ?? '0';
$grouped[$budgetId] = bcadd($transaction->transaction_amount, $grouped[$budgetId]);

View File

@@ -81,17 +81,17 @@ class CategoryController extends Controller
$accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
$chartData = [
[
'label' => strval(trans('firefly.spent')),
'label' => (string)trans('firefly.spent'),
'entries' => [],
'type' => 'bar',
],
[
'label' => strval(trans('firefly.earned')),
'label' => (string)trans('firefly.earned'),
'entries' => [],
'type' => 'bar',
],
[
'label' => strval(trans('firefly.sum')),
'label' => (string)trans('firefly.sum'),
'entries' => [],
'type' => 'line',
'fill' => false,
@@ -145,12 +145,12 @@ class CategoryController extends Controller
}
}
$chartData[strval(trans('firefly.no_category'))] = bcmul($repository->spentInPeriodWithoutCategory(new Collection, $start, $end), '-1');
$chartData[(string)trans('firefly.no_category')] = bcmul($repository->spentInPeriodWithoutCategory(new Collection, $start, $end), '-1');
// sort
arsort($chartData);
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
$data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData);
$cache->store($data);
return response()->json($data);
@@ -181,17 +181,17 @@ class CategoryController extends Controller
$periods = app('navigation')->listOfPeriods($start, $end);
$chartData = [
[
'label' => strval(trans('firefly.spent')),
'label' => (string)trans('firefly.spent'),
'entries' => [],
'type' => 'bar',
],
[
'label' => strval(trans('firefly.earned')),
'label' => (string)trans('firefly.earned'),
'entries' => [],
'type' => 'bar',
],
[
'label' => strval(trans('firefly.sum')),
'label' => (string)trans('firefly.sum'),
'entries' => [],
'type' => 'line',
'fill' => false,
@@ -237,17 +237,17 @@ class CategoryController extends Controller
$periods = app('navigation')->listOfPeriods($start, $end);
$chartData = [
[
'label' => strval(trans('firefly.spent')),
'label' => (string)trans('firefly.spent'),
'entries' => [],
'type' => 'bar',
],
[
'label' => strval(trans('firefly.earned')),
'label' => (string)trans('firefly.earned'),
'entries' => [],
'type' => 'bar',
],
[
'label' => strval(trans('firefly.sum')),
'label' => (string)trans('firefly.sum'),
'entries' => [],
'type' => 'line',
'fill' => false,
@@ -313,17 +313,17 @@ class CategoryController extends Controller
// chart data
$chartData = [
[
'label' => strval(trans('firefly.spent')),
'label' => (string)trans('firefly.spent'),
'entries' => [],
'type' => 'bar',
],
[
'label' => strval(trans('firefly.earned')),
'label' => (string)trans('firefly.earned'),
'entries' => [],
'type' => 'bar',
],
[
'label' => strval(trans('firefly.sum')),
'label' => (string)trans('firefly.sum'),
'entries' => [],
'type' => 'line',
'fill' => false,

View File

@@ -75,7 +75,7 @@ class CategoryReportController extends Controller
{
/** @var MetaPieChartInterface $helper */
$helper = app(MetaPieChartInterface::class);
$helper->setAccounts($accounts)->setCategories($categories)->setStart($start)->setEnd($end)->setCollectOtherObjects(1 === intval($others));
$helper->setAccounts($accounts)->setCategories($categories)->setStart($start)->setEnd($end)->setCollectOtherObjects(1 === (int)$others);
$chartData = $helper->generate('expense', 'account');
$data = $this->generator->pieChart($chartData);
@@ -100,7 +100,7 @@ class CategoryReportController extends Controller
$helper->setCategories($categories);
$helper->setStart($start);
$helper->setEnd($end);
$helper->setCollectOtherObjects(1 === intval($others));
$helper->setCollectOtherObjects(1 === (int)$others);
$chartData = $helper->generate('income', 'account');
$data = $this->generator->pieChart($chartData);
@@ -124,7 +124,7 @@ class CategoryReportController extends Controller
$helper->setCategories($categories);
$helper->setStart($start);
$helper->setEnd($end);
$helper->setCollectOtherObjects(1 === intval($others));
$helper->setCollectOtherObjects(1 === (int)$others);
$chartData = $helper->generate('expense', 'category');
$data = $this->generator->pieChart($chartData);
@@ -148,7 +148,7 @@ class CategoryReportController extends Controller
$helper->setCategories($categories);
$helper->setStart($start);
$helper->setEnd($end);
$helper->setCollectOtherObjects(1 === intval($others));
$helper->setCollectOtherObjects(1 === (int)$others);
$chartData = $helper->generate('income', 'category');
$data = $this->generator->pieChart($chartData);
@@ -183,27 +183,27 @@ class CategoryReportController extends Controller
// prep chart data:
foreach ($categories as $category) {
$chartData[$category->id . '-in'] = [
'label' => $category->name . ' (' . strtolower(strval(trans('firefly.income'))) . ')',
'label' => $category->name . ' (' . strtolower((string)trans('firefly.income')) . ')',
'type' => 'bar',
'yAxisID' => 'y-axis-0',
'entries' => [],
];
$chartData[$category->id . '-out'] = [
'label' => $category->name . ' (' . strtolower(strval(trans('firefly.expenses'))) . ')',
'label' => $category->name . ' (' . strtolower((string)trans('firefly.expenses')) . ')',
'type' => 'bar',
'yAxisID' => 'y-axis-0',
'entries' => [],
];
// total in, total out:
$chartData[$category->id . '-total-in'] = [
'label' => $category->name . ' (' . strtolower(strval(trans('firefly.sum_of_income'))) . ')',
'label' => $category->name . ' (' . strtolower((string)trans('firefly.sum_of_income')) . ')',
'type' => 'line',
'fill' => false,
'yAxisID' => 'y-axis-1',
'entries' => [],
];
$chartData[$category->id . '-total-out'] = [
'label' => $category->name . ' (' . strtolower(strval(trans('firefly.sum_of_expenses'))) . ')',
'label' => $category->name . ' (' . strtolower((string)trans('firefly.sum_of_expenses')) . ')',
'type' => 'line',
'fill' => false,
'yAxisID' => 'y-axis-1',
@@ -251,7 +251,7 @@ class CategoryReportController extends Controller
$newSet[$key] = $chartData[$key];
}
}
if (0 === count($newSet)) {
if (0 === \count($newSet)) {
$newSet = $chartData;
}
$data = $this->generator->multiSet($newSet);
@@ -279,9 +279,7 @@ class CategoryReportController extends Controller
$collector->addFilter(OpposingAccountFilter::class);
$collector->addFilter(PositiveAmountFilter::class);
$transactions = $collector->getJournals();
return $transactions;
return $collector->getJournals();
}
/**
@@ -302,9 +300,7 @@ class CategoryReportController extends Controller
$collector->addFilter(OpposingAccountFilter::class);
$collector->addFilter(NegativeAmountFilter::class);
$transactions = $collector->getJournals();
return $transactions;
return $collector->getJournals();
}
/**
@@ -318,8 +314,8 @@ class CategoryReportController extends Controller
$grouped = [];
/** @var Transaction $transaction */
foreach ($set as $transaction) {
$jrnlCatId = intval($transaction->transaction_journal_category_id);
$transCatId = intval($transaction->transaction_category_id);
$jrnlCatId = (int)$transaction->transaction_journal_category_id;
$transCatId = (int)$transaction->transaction_category_id;
$categoryId = max($jrnlCatId, $transCatId);
$grouped[$categoryId] = $grouped[$categoryId] ?? '0';
$grouped[$categoryId] = bcadd($transaction->transaction_amount, $grouped[$categoryId]);

View File

@@ -100,27 +100,27 @@ class ExpenseReportController extends Controller
/** @var Account $exp */
$exp = $combi->first();
$chartData[$exp->id . '-in'] = [
'label' => $name . ' (' . strtolower(strval(trans('firefly.income'))) . ')',
'label' => $name . ' (' . strtolower((string)trans('firefly.income')) . ')',
'type' => 'bar',
'yAxisID' => 'y-axis-0',
'entries' => [],
];
$chartData[$exp->id . '-out'] = [
'label' => $name . ' (' . strtolower(strval(trans('firefly.expenses'))) . ')',
'label' => $name . ' (' . strtolower((string)trans('firefly.expenses')) . ')',
'type' => 'bar',
'yAxisID' => 'y-axis-0',
'entries' => [],
];
// total in, total out:
$chartData[$exp->id . '-total-in'] = [
'label' => $name . ' (' . strtolower(strval(trans('firefly.sum_of_income'))) . ')',
'label' => $name . ' (' . strtolower((string)trans('firefly.sum_of_income')) . ')',
'type' => 'line',
'fill' => false,
'yAxisID' => 'y-axis-1',
'entries' => [],
];
$chartData[$exp->id . '-total-out'] = [
'label' => $name . ' (' . strtolower(strval(trans('firefly.sum_of_expenses'))) . ')',
'label' => $name . ' (' . strtolower((string)trans('firefly.sum_of_expenses')) . ')',
'type' => 'line',
'fill' => false,
'yAxisID' => 'y-axis-1',
@@ -173,7 +173,7 @@ class ExpenseReportController extends Controller
$newSet[$key] = $chartData[$key];
}
}
if (0 === count($newSet)) {
if (0 === \count($newSet)) {
$newSet = $chartData; // @codeCoverageIgnore
}
$data = $this->generator->multiSet($newSet);
@@ -196,7 +196,7 @@ class ExpenseReportController extends Controller
$collection->push($expenseAccount);
$revenue = $this->accountRepository->findByName($expenseAccount->name, [AccountType::REVENUE]);
if (!is_null($revenue)) {
if (null !== $revenue) {
$collection->push($revenue);
}
$combined[$expenseAccount->name] = $collection;
@@ -219,9 +219,7 @@ class ExpenseReportController extends Controller
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setOpposingAccounts($opposing);
$transactions = $collector->getJournals();
return $transactions;
return $collector->getJournals();
}
/**
@@ -239,9 +237,7 @@ class ExpenseReportController extends Controller
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setOpposingAccounts($opposing);
$transactions = $collector->getJournals();
return $transactions;
return $collector->getJournals();
}
/**

Some files were not shown because too many files have changed in this diff Show More