Merge branch 'release/4.6.11'

This commit is contained in:
James Cole 2017-11-30 20:16:28 +01:00
commit f7eb78364d
770 changed files with 13812 additions and 13028 deletions

View File

@ -5,6 +5,7 @@ APP_KEY=${FF_APP_KEY}
APP_LOG=daily APP_LOG=daily
APP_LOG_LEVEL=warning APP_LOG_LEVEL=warning
APP_URL=http://localhost APP_URL=http://localhost
TRUSTED_PROXIES=
DB_CONNECTION=mysql DB_CONNECTION=mysql
DB_HOST=${FF_DB_HOST} DB_HOST=${FF_DB_HOST}
@ -55,3 +56,5 @@ PUSHER_ID=
DEMO_USERNAME= DEMO_USERNAME=
DEMO_PASSWORD= DEMO_PASSWORD=
IS_DOCKER=true
IS_SANDSTORM=false

View File

@ -56,3 +56,5 @@ PUSHER_ID=
DEMO_USERNAME= DEMO_USERNAME=
DEMO_PASSWORD= DEMO_PASSWORD=
IS_DOCKER=false
IS_SANDSTORM=false

55
.env.heroku Normal file
View File

@ -0,0 +1,55 @@
APP_ENV=heroku
APP_DEBUG=true
APP_NAME=FireflyIII
APP_KEY=7ahyYVPVsmxjdhsweWCauGeJfwc92NP2
APP_LOG=errorlog
APP_LOG_LEVEL=debug
APP_URL=http://localhost
TRUSTED_PROXIES=*
DB_CONNECTION=pgsql
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
COOKIE_PATH="/"
COOKIE_DOMAIN=
COOKIE_SECURE=false
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_FROM=changeme@example.com
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
SEND_REGISTRATION_MAIL=true
SEND_ERROR_MESSAGE=true
SHOW_INCOMPLETE_TRANSLATIONS=false
CACHE_PREFIX=firefly
SEARCH_RESULT_LIMIT=50
EXCHANGE_RATE_SERVICE=fixerio
MAPBOX_API_KEY=
ANALYTICS_ID=
SITE_OWNER=heroku@example.com
USE_ENCRYPTION=true
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_ID=
DEMO_USERNAME=
DEMO_PASSWORD=
IS_DOCKER=false
IS_SANDSTORM=false

View File

@ -5,6 +5,7 @@ APP_KEY=SomeRandomStringOf32CharsExactly
APP_LOG=syslog APP_LOG=syslog
APP_LOG_LEVEL=info APP_LOG_LEVEL=info
APP_URL=http://localhost APP_URL=http://localhost
TRUSTED_PROXIES=
DB_CONNECTION=mysql DB_CONNECTION=mysql
DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
@ -54,3 +55,6 @@ PUSHER_ID=
DEMO_USERNAME= DEMO_USERNAME=
DEMO_PASSWORD= DEMO_PASSWORD=
IS_DOCKER=false
IS_SANDSTORM=true

View File

@ -5,10 +5,12 @@ APP_KEY=TestTestTestTestTestTestTestTest
APP_LOG=daily APP_LOG=daily
APP_LOG_LEVEL=debug APP_LOG_LEVEL=debug
APP_URL=http://localhost APP_URL=http://localhost
TRUSTED_PROXIES=
DB_CONNECTION=sqlite DB_CONNECTION=sqlite
DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
DB_PORT=3306 DB_PORT=3306
#DB_DATABASE=firefly
DB_USERNAME=homestead DB_USERNAME=homestead
DB_PASSWORD= DB_PASSWORD=
@ -39,9 +41,10 @@ SHOW_INCOMPLETE_TRANSLATIONS=false
CACHE_PREFIX=firefly CACHE_PREFIX=firefly
SEARCH_RESULT_LIMIT=50
EXCHANGE_RATE_SERVICE=fixerio EXCHANGE_RATE_SERVICE=fixerio
GOOGLE_MAPS_API_KEY= MAPBOX_API_KEY=
ANALYTICS_ID= ANALYTICS_ID=
SITE_OWNER=mail@example.com SITE_OWNER=mail@example.com
USE_ENCRYPTION=true USE_ENCRYPTION=true
@ -53,3 +56,5 @@ PUSHER_ID=
DEMO_USERNAME= DEMO_USERNAME=
DEMO_PASSWORD= DEMO_PASSWORD=
IS_DOCKER=false
IS_SANDSTORM=false

View File

@ -7,3 +7,5 @@ I am running Firefly III version x.x.x
(please include if this problem also exists on the demo site) (please include if this problem also exists on the demo site)
#### Other important details (log files, system info): #### Other important details (log files, system info):
Please visit the /debug page to get extra debug information.

View File

@ -1,3 +1,28 @@
# 4.6.11
- A debug page at `/debug` for easier debug.
- Strings translatable (see [issue 976](https://github.com/firefly-iii/firefly-iii/issues/976)), thanks to [Findus23](https://github.com/Findus23)
- Even more strings are translatable (and translated), thanks to [pkoziol](https://github.com/pkoziol) (see [issue 979](https://github.com/firefly-iii/firefly-iii/issues/979))
- Reconciliation of accounts ([issue 736](https://github.com/firefly-iii/firefly-iii/issues/736)), as requested by [kristophr](https://github.com/kristophr) and several others
- Extended currency list, as suggested by @emuhendis in [issue 994](https://github.com/firefly-iii/firefly-iii/issues/994)
- [Issue 996](https://github.com/firefly-iii/firefly-iii/issues/996) as suggested by [dp87](https://github.com/dp87)
- Disabled Heroku support until I get it working again.
- [Issue 980](https://github.com/firefly-iii/firefly-iii/issues/980), reported by [Tim-Frensch](https://github.com/Tim-Frensch)
- [Issue 987](https://github.com/firefly-iii/firefly-iii/issues/987), reported by [gavu](https://github.com/gavu)
- [Issue 988](https://github.com/firefly-iii/firefly-iii/issues/988), reported by [gavu](https://github.com/gavu)
- [Issue 992](https://github.com/firefly-iii/firefly-iii/issues/992), reported by [ncicovic](https://github.com/ncicovic)
- [Issue 993](https://github.com/firefly-iii/firefly-iii/issues/993), reported by [gavu](https://github.com/gavu)
- [Issue 997](https://github.com/firefly-iii/firefly-iii/issues/997), reported by [gavu](https://github.com/gavu)
- [Issue 1000](https://github.com/firefly-iii/firefly-iii/issues/1000), reported by [xpfgsyb](https://github.com/xpfgsyb)
- [Issue 1001](https://github.com/firefly-iii/firefly-iii/issues/1001), reported by [gavu](https://github.com/gavu)
- [Issue 1002](https://github.com/firefly-iii/firefly-iii/issues/1002), reported by [ursweiss](https://github.com/ursweiss)
- [Issue 1003](https://github.com/firefly-iii/firefly-iii/issues/1003), reported by [ursweiss](https://github.com/ursweiss)
- [Issue 1004](https://github.com/firefly-iii/firefly-iii/issues/1004), reported by [Aquariu](https://github.com/Aquariu)
- [Issue 1010](https://github.com/firefly-iii/firefly-iii/issues/1010)
- [Issue 1014](https://github.com/firefly-iii/firefly-iii/issues/1014), reported by [ursweiss](https://github.com/ursweiss)
- [Issue 1016](https://github.com/firefly-iii/firefly-iii/issues/1016)
- [Issue 1024](https://github.com/firefly-iii/firefly-iii/issues/1024), reported by [gavu](https://github.com/gavu)
- [Issue 1025](https://github.com/firefly-iii/firefly-iii/issues/1025), reported by [gavu](https://github.com/gavu)
# 4.6.10 # 4.6.10
- Greatly expanded Docker support thanks to [alazare619](https://github.com/alazare619) - Greatly expanded Docker support thanks to [alazare619](https://github.com/alazare619)
- [Issue 967](https://github.com/firefly-iii/firefly-iii/issues/967), thanks to [Aquariu](https://github.com/Aquariu) - [Issue 967](https://github.com/firefly-iii/firefly-iii/issues/967), thanks to [Aquariu](https://github.com/Aquariu)

View File

@ -204,8 +204,39 @@ opt/app/.dockerignore
opt/app/.env opt/app/.env
opt/app/.env.docker opt/app/.env.docker
opt/app/.env.example opt/app/.env.example
opt/app/.env.heroku
opt/app/.env.sandstorm opt/app/.env.sandstorm
opt/app/.gitattributes opt/app/.gitattributes
opt/app/.sandstorm/.gitattributes
opt/app/.sandstorm/.vagrant/machines/default/virtualbox/action_provision
opt/app/.sandstorm/.vagrant/machines/default/virtualbox/action_set_name
opt/app/.sandstorm/.vagrant/machines/default/virtualbox/creator_uid
opt/app/.sandstorm/.vagrant/machines/default/virtualbox/id
opt/app/.sandstorm/.vagrant/machines/default/virtualbox/index_uuid
opt/app/.sandstorm/.vagrant/machines/default/virtualbox/private_key
opt/app/.sandstorm/.vagrant/machines/default/virtualbox/synced_folders
opt/app/.sandstorm/.vagrant/machines/default/virtualbox/vagrant_cwd
opt/app/.sandstorm/Vagrantfile
opt/app/.sandstorm/app-graphics/firefly-iii-128.png
opt/app/.sandstorm/app-graphics/firefly-iii-150.png
opt/app/.sandstorm/app-graphics/firefly-iii-24.png
opt/app/.sandstorm/app-graphics/firefly-iii-48.png
opt/app/.sandstorm/build.sh
opt/app/.sandstorm/changelog.md
opt/app/.sandstorm/description.md
opt/app/.sandstorm/global-setup.sh
opt/app/.sandstorm/launcher.sh
opt/app/.sandstorm/pgp-keyring
opt/app/.sandstorm/pgp-signature
opt/app/.sandstorm/sandstorm-files.list
opt/app/.sandstorm/sandstorm-pkgdef.capnp
opt/app/.sandstorm/screenshots/screenshot-1.png
opt/app/.sandstorm/screenshots/screenshot-2.png
opt/app/.sandstorm/screenshots/screenshot-3.png
opt/app/.sandstorm/service-config/mime.types
opt/app/.sandstorm/service-config/nginx.conf
opt/app/.sandstorm/setup.sh
opt/app/.sandstorm/stack
opt/app/CHANGELOG.md opt/app/CHANGELOG.md
opt/app/CODE_OF_CONDUCT.md opt/app/CODE_OF_CONDUCT.md
opt/app/Dockerfile opt/app/Dockerfile
@ -303,6 +334,7 @@ opt/app/app/Helpers/Report/PopupReport.php
opt/app/app/Helpers/Report/PopupReportInterface.php opt/app/app/Helpers/Report/PopupReportInterface.php
opt/app/app/Helpers/Report/ReportHelper.php opt/app/app/Helpers/Report/ReportHelper.php
opt/app/app/Helpers/Report/ReportHelperInterface.php opt/app/app/Helpers/Report/ReportHelperInterface.php
opt/app/app/Http/Controllers/Account/ReconcileController.php
opt/app/app/Http/Controllers/AccountController.php opt/app/app/Http/Controllers/AccountController.php
opt/app/app/Http/Controllers/Admin/ConfigurationController.php opt/app/app/Http/Controllers/Admin/ConfigurationController.php
opt/app/app/Http/Controllers/Admin/HomeController.php opt/app/app/Http/Controllers/Admin/HomeController.php
@ -397,6 +429,7 @@ opt/app/app/Http/Requests/MassEditJournalRequest.php
opt/app/app/Http/Requests/NewUserFormRequest.php opt/app/app/Http/Requests/NewUserFormRequest.php
opt/app/app/Http/Requests/PiggyBankFormRequest.php opt/app/app/Http/Requests/PiggyBankFormRequest.php
opt/app/app/Http/Requests/ProfileFormRequest.php opt/app/app/Http/Requests/ProfileFormRequest.php
opt/app/app/Http/Requests/ReconciliationFormRequest.php
opt/app/app/Http/Requests/ReportFormRequest.php opt/app/app/Http/Requests/ReportFormRequest.php
opt/app/app/Http/Requests/Request.php opt/app/app/Http/Requests/Request.php
opt/app/app/Http/Requests/RuleFormRequest.php opt/app/app/Http/Requests/RuleFormRequest.php
@ -412,6 +445,8 @@ opt/app/app/Http/breadcrumbs.php
opt/app/app/Import/Configurator/ConfiguratorInterface.php opt/app/app/Import/Configurator/ConfiguratorInterface.php
opt/app/app/Import/Configurator/CsvConfigurator.php opt/app/app/Import/Configurator/CsvConfigurator.php
opt/app/app/Import/Converter/Amount.php opt/app/app/Import/Converter/Amount.php
opt/app/app/Import/Converter/AmountCredit.php
opt/app/app/Import/Converter/AmountDebet.php
opt/app/app/Import/Converter/ConverterInterface.php opt/app/app/Import/Converter/ConverterInterface.php
opt/app/app/Import/Converter/INGDebetCredit.php opt/app/app/Import/Converter/INGDebetCredit.php
opt/app/app/Import/Converter/RabobankDebetCredit.php opt/app/app/Import/Converter/RabobankDebetCredit.php
@ -468,7 +503,6 @@ opt/app/app/Models/Configuration.php
opt/app/app/Models/CurrencyExchangeRate.php opt/app/app/Models/CurrencyExchangeRate.php
opt/app/app/Models/ExportJob.php opt/app/app/Models/ExportJob.php
opt/app/app/Models/ImportJob.php opt/app/app/Models/ImportJob.php
opt/app/app/Models/LimitRepetition.php
opt/app/app/Models/LinkType.php opt/app/app/Models/LinkType.php
opt/app/app/Models/Note.php opt/app/app/Models/Note.php
opt/app/app/Models/PiggyBank.php opt/app/app/Models/PiggyBank.php
@ -616,10 +650,15 @@ opt/app/app/Support/Preferences.php
opt/app/app/Support/Search/Modifier.php opt/app/app/Support/Search/Modifier.php
opt/app/app/Support/Search/Search.php opt/app/app/Support/Search/Search.php
opt/app/app/Support/Search/SearchInterface.php opt/app/app/Support/Search/SearchInterface.php
opt/app/app/Support/SingleCacheProperties.php
opt/app/app/Support/Steam.php opt/app/app/Support/Steam.php
opt/app/app/Support/Twig/AmountFormat.php opt/app/app/Support/Twig/AmountFormat.php
opt/app/app/Support/Twig/Extension/Transaction.php
opt/app/app/Support/Twig/Extension/TransactionJournal.php
opt/app/app/Support/Twig/General.php opt/app/app/Support/Twig/General.php
opt/app/app/Support/Twig/Journal.php opt/app/app/Support/Twig/Journal.php
opt/app/app/Support/Twig/Loader/TransactionJournalLoader.php
opt/app/app/Support/Twig/Loader/TransactionLoader.php
opt/app/app/Support/Twig/PiggyBank.php opt/app/app/Support/Twig/PiggyBank.php
opt/app/app/Support/Twig/Rule.php opt/app/app/Support/Twig/Rule.php
opt/app/app/Support/Twig/Transaction.php opt/app/app/Support/Twig/Transaction.php
@ -688,7 +727,6 @@ opt/app/bootstrap/cache/packages.php
opt/app/bootstrap/cache/services.php opt/app/bootstrap/cache/services.php
opt/app/composer.json opt/app/composer.json
opt/app/composer.lock opt/app/composer.lock
opt/app/composer.phar
opt/app/config/app.php opt/app/config/app.php
opt/app/config/auth.php opt/app/config/auth.php
opt/app/config/broadcasting.php opt/app/config/broadcasting.php
@ -705,6 +743,7 @@ opt/app/config/session.php
opt/app/config/twigbridge.php opt/app/config/twigbridge.php
opt/app/config/upgrade.php opt/app/config/upgrade.php
opt/app/config/view.php opt/app/config/view.php
opt/app/crowdin.yml
opt/app/database/factories/ModelFactory.php opt/app/database/factories/ModelFactory.php
opt/app/database/migrations/2016_06_16_000000_create_support_tables.php 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_000001_create_users_table.php
@ -719,6 +758,7 @@ opt/app/database/migrations/2016_12_28_203205_changes_for_v431.php
opt/app/database/migrations/2017_04_13_163623_changes_for_v440.php opt/app/database/migrations/2017_04_13_163623_changes_for_v440.php
opt/app/database/migrations/2017_06_02_105232_changes_for_v450.php opt/app/database/migrations/2017_06_02_105232_changes_for_v450.php
opt/app/database/migrations/2017_08_20_062014_changes_for_v470.php opt/app/database/migrations/2017_08_20_062014_changes_for_v470.php
opt/app/database/migrations/2017_11_04_170844_changes_for_v470a.php
opt/app/database/seeds/AccountTypeSeeder.php opt/app/database/seeds/AccountTypeSeeder.php
opt/app/database/seeds/DatabaseSeeder.php opt/app/database/seeds/DatabaseSeeder.php
opt/app/database/seeds/LinkTypeSeeder.php opt/app/database/seeds/LinkTypeSeeder.php
@ -813,7 +853,9 @@ opt/app/public/images/page_green.png
opt/app/public/images/page_white_acrobat.png opt/app/public/images/page_white_acrobat.png
opt/app/public/index.php opt/app/public/index.php
opt/app/public/js/ff/accounts/create.js opt/app/public/js/ff/accounts/create.js
opt/app/public/js/ff/accounts/edit-reconciliation.js
opt/app/public/js/ff/accounts/edit.js opt/app/public/js/ff/accounts/edit.js
opt/app/public/js/ff/accounts/reconcile.js
opt/app/public/js/ff/accounts/show.js opt/app/public/js/ff/accounts/show.js
opt/app/public/js/ff/bills/create.js opt/app/public/js/ff/bills/create.js
opt/app/public/js/ff/bills/edit.js opt/app/public/js/ff/bills/edit.js
@ -1061,6 +1103,7 @@ opt/app/resources/lang/sl_SI/list.php
opt/app/resources/lang/sl_SI/pagination.php opt/app/resources/lang/sl_SI/pagination.php
opt/app/resources/lang/sl_SI/passwords.php opt/app/resources/lang/sl_SI/passwords.php
opt/app/resources/lang/sl_SI/validation.php opt/app/resources/lang/sl_SI/validation.php
opt/app/resources/stubs/binary.bin
opt/app/resources/stubs/csv.csv opt/app/resources/stubs/csv.csv
opt/app/resources/stubs/demo-configuration.json opt/app/resources/stubs/demo-configuration.json
opt/app/resources/stubs/demo-import.csv opt/app/resources/stubs/demo-import.csv
@ -1069,6 +1112,11 @@ opt/app/resources/views/accounts/create.twig
opt/app/resources/views/accounts/delete.twig opt/app/resources/views/accounts/delete.twig
opt/app/resources/views/accounts/edit.twig opt/app/resources/views/accounts/edit.twig
opt/app/resources/views/accounts/index.twig opt/app/resources/views/accounts/index.twig
opt/app/resources/views/accounts/reconcile/edit.twig
opt/app/resources/views/accounts/reconcile/index.twig
opt/app/resources/views/accounts/reconcile/overview.twig
opt/app/resources/views/accounts/reconcile/show.twig
opt/app/resources/views/accounts/reconcile/transactions.twig
opt/app/resources/views/accounts/show.twig opt/app/resources/views/accounts/show.twig
opt/app/resources/views/admin/configuration/index.twig opt/app/resources/views/admin/configuration/index.twig
opt/app/resources/views/admin/index.twig opt/app/resources/views/admin/index.twig
@ -1202,6 +1250,7 @@ opt/app/resources/views/partials/flashes.twig
opt/app/resources/views/partials/menu-sidebar.twig opt/app/resources/views/partials/menu-sidebar.twig
opt/app/resources/views/partials/page-header.twig opt/app/resources/views/partials/page-header.twig
opt/app/resources/views/partials/password-modal.twig opt/app/resources/views/partials/password-modal.twig
opt/app/resources/views/partials/transaction-row.twig
opt/app/resources/views/piggy-banks/add-mobile.twig opt/app/resources/views/piggy-banks/add-mobile.twig
opt/app/resources/views/piggy-banks/add.twig opt/app/resources/views/piggy-banks/add.twig
opt/app/resources/views/piggy-banks/create.twig opt/app/resources/views/piggy-banks/create.twig
@ -2352,6 +2401,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/Inte
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithRedis.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php 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/Concerns/MocksApplicationServices.php
@ -3821,6 +3871,9 @@ opt/app/vendor/symfony/console/Command/Command.php
opt/app/vendor/symfony/console/Command/HelpCommand.php opt/app/vendor/symfony/console/Command/HelpCommand.php
opt/app/vendor/symfony/console/Command/ListCommand.php opt/app/vendor/symfony/console/Command/ListCommand.php
opt/app/vendor/symfony/console/Command/LockableTrait.php opt/app/vendor/symfony/console/Command/LockableTrait.php
opt/app/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php
opt/app/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php
opt/app/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php
opt/app/vendor/symfony/console/ConsoleEvents.php opt/app/vendor/symfony/console/ConsoleEvents.php
opt/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php opt/app/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php
opt/app/vendor/symfony/console/Descriptor/ApplicationDescription.php opt/app/vendor/symfony/console/Descriptor/ApplicationDescription.php
@ -3898,6 +3951,8 @@ opt/app/vendor/symfony/console/Tests/Command/CommandTest.php
opt/app/vendor/symfony/console/Tests/Command/HelpCommandTest.php opt/app/vendor/symfony/console/Tests/Command/HelpCommandTest.php
opt/app/vendor/symfony/console/Tests/Command/ListCommandTest.php opt/app/vendor/symfony/console/Tests/Command/ListCommandTest.php
opt/app/vendor/symfony/console/Tests/Command/LockableTraitTest.php opt/app/vendor/symfony/console/Tests/Command/LockableTraitTest.php
opt/app/vendor/symfony/console/Tests/CommandLoader/ContainerCommandLoaderTest.php
opt/app/vendor/symfony/console/Tests/CommandLoader/FactoryCommandLoaderTest.php
opt/app/vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php opt/app/vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php
opt/app/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php opt/app/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php
opt/app/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php opt/app/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php
@ -3926,6 +3981,8 @@ opt/app/vendor/symfony/console/Tests/Fixtures/FooCommand.php
opt/app/vendor/symfony/console/Tests/Fixtures/FooLock2Command.php opt/app/vendor/symfony/console/Tests/Fixtures/FooLock2Command.php
opt/app/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php opt/app/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php
opt/app/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php opt/app/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php
opt/app/vendor/symfony/console/Tests/Fixtures/FooSameCaseLowercaseCommand.php
opt/app/vendor/symfony/console/Tests/Fixtures/FooSameCaseUppercaseCommand.php
opt/app/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php opt/app/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php
opt/app/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php opt/app/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php
opt/app/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php opt/app/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php
@ -4232,12 +4289,17 @@ opt/app/vendor/symfony/debug/Tests/ExceptionHandlerTest.php
opt/app/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php opt/app/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
opt/app/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php opt/app/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php
opt/app/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php opt/app/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
opt/app/vendor/symfony/debug/Tests/Fixtures/AnnotatedClass.php
opt/app/vendor/symfony/debug/Tests/Fixtures/ClassAlias.php opt/app/vendor/symfony/debug/Tests/Fixtures/ClassAlias.php
opt/app/vendor/symfony/debug/Tests/Fixtures/DeprecatedClass.php opt/app/vendor/symfony/debug/Tests/Fixtures/DeprecatedClass.php
opt/app/vendor/symfony/debug/Tests/Fixtures/DeprecatedInterface.php opt/app/vendor/symfony/debug/Tests/Fixtures/DeprecatedInterface.php
opt/app/vendor/symfony/debug/Tests/Fixtures/ExtendedFinalMethod.php opt/app/vendor/symfony/debug/Tests/Fixtures/ExtendedFinalMethod.php
opt/app/vendor/symfony/debug/Tests/Fixtures/FinalClass.php opt/app/vendor/symfony/debug/Tests/Fixtures/FinalClass.php
opt/app/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php opt/app/vendor/symfony/debug/Tests/Fixtures/FinalMethod.php
opt/app/vendor/symfony/debug/Tests/Fixtures/InternalClass.php
opt/app/vendor/symfony/debug/Tests/Fixtures/InternalInterface.php
opt/app/vendor/symfony/debug/Tests/Fixtures/InternalTrait.php
opt/app/vendor/symfony/debug/Tests/Fixtures/InternalTrait2.php
opt/app/vendor/symfony/debug/Tests/Fixtures/NonDeprecatedInterface.php opt/app/vendor/symfony/debug/Tests/Fixtures/NonDeprecatedInterface.php
opt/app/vendor/symfony/debug/Tests/Fixtures/PEARClass.php opt/app/vendor/symfony/debug/Tests/Fixtures/PEARClass.php
opt/app/vendor/symfony/debug/Tests/Fixtures/Throwing.php opt/app/vendor/symfony/debug/Tests/Fixtures/Throwing.php
@ -4390,7 +4452,9 @@ opt/app/vendor/symfony/http-foundation/Session/Flash/FlashBag.php
opt/app/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php opt/app/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php
opt/app/vendor/symfony/http-foundation/Session/Session.php opt/app/vendor/symfony/http-foundation/Session/Session.php
opt/app/vendor/symfony/http-foundation/Session/SessionBagInterface.php 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/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/MemcacheSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.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/MongoDbSessionHandler.php
@ -4398,6 +4462,7 @@ opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSession
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/NativeSessionHandler.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/NullSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.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/Handler/WriteCheckSessionHandler.php
opt/app/vendor/symfony/http-foundation/Session/Storage/MetadataBag.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/MockArraySessionStorage.php
@ -4442,6 +4507,18 @@ opt/app/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttribu
opt/app/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php opt/app/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php opt/app/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/SessionTest.php opt/app/vendor/symfony/http-foundation/Tests/Session/SessionTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/common.inc
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/empty_destroys.expected
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/empty_destroys.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/read_only.expected
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/read_only.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/regenerate.expected
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/regenerate.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/storage.expected
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/storage.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.expected
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.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/MemcachedSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
@ -4449,6 +4526,7 @@ opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileS
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.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/NullSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.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/Handler/WriteCheckSessionHandlerTest.php
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.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/MockArraySessionStorageTest.php
@ -4724,6 +4802,18 @@ opt/app/vendor/symfony/polyfill-php56/Php56.php
opt/app/vendor/symfony/polyfill-php56/README.md opt/app/vendor/symfony/polyfill-php56/README.md
opt/app/vendor/symfony/polyfill-php56/bootstrap.php opt/app/vendor/symfony/polyfill-php56/bootstrap.php
opt/app/vendor/symfony/polyfill-php56/composer.json 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-util/Binary.php opt/app/vendor/symfony/polyfill-util/Binary.php
opt/app/vendor/symfony/polyfill-util/BinaryNoFuncOverload.php opt/app/vendor/symfony/polyfill-util/BinaryNoFuncOverload.php
opt/app/vendor/symfony/polyfill-util/BinaryOnFuncOverload.php opt/app/vendor/symfony/polyfill-util/BinaryOnFuncOverload.php
@ -4771,6 +4861,7 @@ opt/app/vendor/symfony/routing/Exception/ExceptionInterface.php
opt/app/vendor/symfony/routing/Exception/InvalidParameterException.php opt/app/vendor/symfony/routing/Exception/InvalidParameterException.php
opt/app/vendor/symfony/routing/Exception/MethodNotAllowedException.php opt/app/vendor/symfony/routing/Exception/MethodNotAllowedException.php
opt/app/vendor/symfony/routing/Exception/MissingMandatoryParametersException.php opt/app/vendor/symfony/routing/Exception/MissingMandatoryParametersException.php
opt/app/vendor/symfony/routing/Exception/NoConfigurationException.php
opt/app/vendor/symfony/routing/Exception/ResourceNotFoundException.php opt/app/vendor/symfony/routing/Exception/ResourceNotFoundException.php
opt/app/vendor/symfony/routing/Exception/RouteNotFoundException.php opt/app/vendor/symfony/routing/Exception/RouteNotFoundException.php
opt/app/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php opt/app/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php
@ -4784,6 +4875,12 @@ opt/app/vendor/symfony/routing/Loader/AnnotationClassLoader.php
opt/app/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php opt/app/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php
opt/app/vendor/symfony/routing/Loader/AnnotationFileLoader.php opt/app/vendor/symfony/routing/Loader/AnnotationFileLoader.php
opt/app/vendor/symfony/routing/Loader/ClosureLoader.php opt/app/vendor/symfony/routing/Loader/ClosureLoader.php
opt/app/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php
opt/app/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php
opt/app/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php
opt/app/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php
opt/app/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php
opt/app/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php
opt/app/vendor/symfony/routing/Loader/DependencyInjection/ServiceRouterLoader.php opt/app/vendor/symfony/routing/Loader/DependencyInjection/ServiceRouterLoader.php
opt/app/vendor/symfony/routing/Loader/DirectoryLoader.php opt/app/vendor/symfony/routing/Loader/DirectoryLoader.php
opt/app/vendor/symfony/routing/Loader/ObjectRouteLoader.php opt/app/vendor/symfony/routing/Loader/ObjectRouteLoader.php
@ -4830,10 +4927,21 @@ opt/app/vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php
opt/app/vendor/symfony/routing/Tests/Fixtures/annotated.php opt/app/vendor/symfony/routing/Tests/Fixtures/annotated.php
opt/app/vendor/symfony/routing/Tests/Fixtures/bad_format.yml opt/app/vendor/symfony/routing/Tests/Fixtures/bad_format.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/bar.xml opt/app/vendor/symfony/routing/Tests/Fixtures/bar.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/import__controller.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/import__controller.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/import_controller.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/import_controller.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/routing.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/controller/routing.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/directory/recurse/routes1.yml opt/app/vendor/symfony/routing/Tests/Fixtures/directory/recurse/routes1.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/directory/recurse/routes2.yml opt/app/vendor/symfony/routing/Tests/Fixtures/directory/recurse/routes2.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/directory/routes3.yml opt/app/vendor/symfony/routing/Tests/Fixtures/directory/routes3.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/directory_import/import.yml opt/app/vendor/symfony/routing/Tests/Fixtures/directory_import/import.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php
opt/app/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php opt/app/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php
opt/app/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php opt/app/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php
opt/app/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php opt/app/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php
@ -4866,6 +4974,8 @@ opt/app/vendor/symfony/routing/Tests/Fixtures/nonvalidkeys.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/nonvalidnode.xml opt/app/vendor/symfony/routing/Tests/Fixtures/nonvalidnode.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/nonvalidroute.xml opt/app/vendor/symfony/routing/Tests/Fixtures/nonvalidroute.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/null_values.xml opt/app/vendor/symfony/routing/Tests/Fixtures/null_values.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/php_dsl.php
opt/app/vendor/symfony/routing/Tests/Fixtures/php_dsl_sub.php
opt/app/vendor/symfony/routing/Tests/Fixtures/scalar_defaults.xml opt/app/vendor/symfony/routing/Tests/Fixtures/scalar_defaults.xml
opt/app/vendor/symfony/routing/Tests/Fixtures/special_route_name.yml opt/app/vendor/symfony/routing/Tests/Fixtures/special_route_name.yml
opt/app/vendor/symfony/routing/Tests/Fixtures/validpattern.php opt/app/vendor/symfony/routing/Tests/Fixtures/validpattern.php
@ -4910,6 +5020,9 @@ opt/app/vendor/symfony/translation/Catalogue/TargetOperation.php
opt/app/vendor/symfony/translation/Command/XliffLintCommand.php opt/app/vendor/symfony/translation/Command/XliffLintCommand.php
opt/app/vendor/symfony/translation/DataCollector/TranslationDataCollector.php opt/app/vendor/symfony/translation/DataCollector/TranslationDataCollector.php
opt/app/vendor/symfony/translation/DataCollectorTranslator.php opt/app/vendor/symfony/translation/DataCollectorTranslator.php
opt/app/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php
opt/app/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php
opt/app/vendor/symfony/translation/DependencyInjection/TranslatorPass.php
opt/app/vendor/symfony/translation/Dumper/CsvFileDumper.php opt/app/vendor/symfony/translation/Dumper/CsvFileDumper.php
opt/app/vendor/symfony/translation/Dumper/DumperInterface.php opt/app/vendor/symfony/translation/Dumper/DumperInterface.php
opt/app/vendor/symfony/translation/Dumper/FileDumper.php opt/app/vendor/symfony/translation/Dumper/FileDumper.php
@ -4931,6 +5044,11 @@ opt/app/vendor/symfony/translation/Exception/RuntimeException.php
opt/app/vendor/symfony/translation/Extractor/AbstractFileExtractor.php opt/app/vendor/symfony/translation/Extractor/AbstractFileExtractor.php
opt/app/vendor/symfony/translation/Extractor/ChainExtractor.php opt/app/vendor/symfony/translation/Extractor/ChainExtractor.php
opt/app/vendor/symfony/translation/Extractor/ExtractorInterface.php opt/app/vendor/symfony/translation/Extractor/ExtractorInterface.php
opt/app/vendor/symfony/translation/Extractor/PhpExtractor.php
opt/app/vendor/symfony/translation/Extractor/PhpStringTokenParser.php
opt/app/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php
opt/app/vendor/symfony/translation/Formatter/MessageFormatter.php
opt/app/vendor/symfony/translation/Formatter/MessageFormatterInterface.php
opt/app/vendor/symfony/translation/IdentityTranslator.php opt/app/vendor/symfony/translation/IdentityTranslator.php
opt/app/vendor/symfony/translation/Interval.php opt/app/vendor/symfony/translation/Interval.php
opt/app/vendor/symfony/translation/LICENSE opt/app/vendor/symfony/translation/LICENSE
@ -4958,12 +5076,17 @@ opt/app/vendor/symfony/translation/MessageSelector.php
opt/app/vendor/symfony/translation/MetadataAwareInterface.php opt/app/vendor/symfony/translation/MetadataAwareInterface.php
opt/app/vendor/symfony/translation/PluralizationRules.php opt/app/vendor/symfony/translation/PluralizationRules.php
opt/app/vendor/symfony/translation/README.md opt/app/vendor/symfony/translation/README.md
opt/app/vendor/symfony/translation/Reader/TranslationReader.php
opt/app/vendor/symfony/translation/Reader/TranslationReaderInterface.php
opt/app/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd opt/app/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd
opt/app/vendor/symfony/translation/Tests/Catalogue/AbstractOperationTest.php opt/app/vendor/symfony/translation/Tests/Catalogue/AbstractOperationTest.php
opt/app/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php opt/app/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php
opt/app/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php opt/app/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php
opt/app/vendor/symfony/translation/Tests/DataCollector/TranslationDataCollectorTest.php opt/app/vendor/symfony/translation/Tests/DataCollector/TranslationDataCollectorTest.php
opt/app/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php opt/app/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php
opt/app/vendor/symfony/translation/Tests/DependencyInjection/TranslationDumperPassTest.php
opt/app/vendor/symfony/translation/Tests/DependencyInjection/TranslationExtractorPassTest.php
opt/app/vendor/symfony/translation/Tests/DependencyInjection/TranslationPassTest.php
opt/app/vendor/symfony/translation/Tests/Dumper/CsvFileDumperTest.php opt/app/vendor/symfony/translation/Tests/Dumper/CsvFileDumperTest.php
opt/app/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php opt/app/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php
opt/app/vendor/symfony/translation/Tests/Dumper/IcuResFileDumperTest.php opt/app/vendor/symfony/translation/Tests/Dumper/IcuResFileDumperTest.php
@ -4975,6 +5098,8 @@ opt/app/vendor/symfony/translation/Tests/Dumper/PoFileDumperTest.php
opt/app/vendor/symfony/translation/Tests/Dumper/QtFileDumperTest.php opt/app/vendor/symfony/translation/Tests/Dumper/QtFileDumperTest.php
opt/app/vendor/symfony/translation/Tests/Dumper/XliffFileDumperTest.php opt/app/vendor/symfony/translation/Tests/Dumper/XliffFileDumperTest.php
opt/app/vendor/symfony/translation/Tests/Dumper/YamlFileDumperTest.php opt/app/vendor/symfony/translation/Tests/Dumper/YamlFileDumperTest.php
opt/app/vendor/symfony/translation/Tests/Extractor/PhpExtractorTest.php
opt/app/vendor/symfony/translation/Tests/Formatter/MessageFormatterTest.php
opt/app/vendor/symfony/translation/Tests/IdentityTranslatorTest.php opt/app/vendor/symfony/translation/Tests/IdentityTranslatorTest.php
opt/app/vendor/symfony/translation/Tests/IntervalTest.php opt/app/vendor/symfony/translation/Tests/IntervalTest.php
opt/app/vendor/symfony/translation/Tests/Loader/CsvFileLoaderTest.php opt/app/vendor/symfony/translation/Tests/Loader/CsvFileLoaderTest.php
@ -5009,6 +5134,9 @@ opt/app/vendor/symfony/translation/Tests/fixtures/empty.yml
opt/app/vendor/symfony/translation/Tests/fixtures/encoding.xlf opt/app/vendor/symfony/translation/Tests/fixtures/encoding.xlf
opt/app/vendor/symfony/translation/Tests/fixtures/escaped-id-plurals.po opt/app/vendor/symfony/translation/Tests/fixtures/escaped-id-plurals.po
opt/app/vendor/symfony/translation/Tests/fixtures/escaped-id.po opt/app/vendor/symfony/translation/Tests/fixtures/escaped-id.po
opt/app/vendor/symfony/translation/Tests/fixtures/extractor/resource.format.engine
opt/app/vendor/symfony/translation/Tests/fixtures/extractor/this.is.a.template.format.engine
opt/app/vendor/symfony/translation/Tests/fixtures/extractor/translation.html.php
opt/app/vendor/symfony/translation/Tests/fixtures/fuzzy-translations.po opt/app/vendor/symfony/translation/Tests/fixtures/fuzzy-translations.po
opt/app/vendor/symfony/translation/Tests/fixtures/invalid-xml-resources.xlf opt/app/vendor/symfony/translation/Tests/fixtures/invalid-xml-resources.xlf
opt/app/vendor/symfony/translation/Tests/fixtures/malformed.json opt/app/vendor/symfony/translation/Tests/fixtures/malformed.json
@ -5030,6 +5158,7 @@ opt/app/vendor/symfony/translation/Tests/fixtures/resourcebundle/res/en.res
opt/app/vendor/symfony/translation/Tests/fixtures/resources-2.0-clean.xlf opt/app/vendor/symfony/translation/Tests/fixtures/resources-2.0-clean.xlf
opt/app/vendor/symfony/translation/Tests/fixtures/resources-2.0.xlf opt/app/vendor/symfony/translation/Tests/fixtures/resources-2.0.xlf
opt/app/vendor/symfony/translation/Tests/fixtures/resources-clean.xlf opt/app/vendor/symfony/translation/Tests/fixtures/resources-clean.xlf
opt/app/vendor/symfony/translation/Tests/fixtures/resources-notes-meta.xlf
opt/app/vendor/symfony/translation/Tests/fixtures/resources-target-attributes.xlf opt/app/vendor/symfony/translation/Tests/fixtures/resources-target-attributes.xlf
opt/app/vendor/symfony/translation/Tests/fixtures/resources-tool-info.xlf opt/app/vendor/symfony/translation/Tests/fixtures/resources-tool-info.xlf
opt/app/vendor/symfony/translation/Tests/fixtures/resources.csv opt/app/vendor/symfony/translation/Tests/fixtures/resources.csv
@ -5051,6 +5180,7 @@ opt/app/vendor/symfony/translation/TranslatorBagInterface.php
opt/app/vendor/symfony/translation/TranslatorInterface.php opt/app/vendor/symfony/translation/TranslatorInterface.php
opt/app/vendor/symfony/translation/Util/ArrayConverter.php opt/app/vendor/symfony/translation/Util/ArrayConverter.php
opt/app/vendor/symfony/translation/Writer/TranslationWriter.php opt/app/vendor/symfony/translation/Writer/TranslationWriter.php
opt/app/vendor/symfony/translation/Writer/TranslationWriterInterface.php
opt/app/vendor/symfony/translation/composer.json opt/app/vendor/symfony/translation/composer.json
opt/app/vendor/symfony/translation/phpunit.xml.dist opt/app/vendor/symfony/translation/phpunit.xml.dist
opt/app/vendor/symfony/var-dumper/CHANGELOG.md opt/app/vendor/symfony/var-dumper/CHANGELOG.md
@ -5062,6 +5192,7 @@ opt/app/vendor/symfony/var-dumper/Caster/ConstStub.php
opt/app/vendor/symfony/var-dumper/Caster/CutArrayStub.php opt/app/vendor/symfony/var-dumper/Caster/CutArrayStub.php
opt/app/vendor/symfony/var-dumper/Caster/CutStub.php opt/app/vendor/symfony/var-dumper/Caster/CutStub.php
opt/app/vendor/symfony/var-dumper/Caster/DOMCaster.php opt/app/vendor/symfony/var-dumper/Caster/DOMCaster.php
opt/app/vendor/symfony/var-dumper/Caster/DateCaster.php
opt/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php opt/app/vendor/symfony/var-dumper/Caster/DoctrineCaster.php
opt/app/vendor/symfony/var-dumper/Caster/EnumStub.php 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/ExceptionCaster.php
@ -5096,6 +5227,7 @@ opt/app/vendor/symfony/var-dumper/README.md
opt/app/vendor/symfony/var-dumper/Resources/functions/dump.php opt/app/vendor/symfony/var-dumper/Resources/functions/dump.php
opt/app/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php opt/app/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php
opt/app/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php opt/app/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php
opt/app/vendor/symfony/var-dumper/Tests/Caster/DateCasterTest.php
opt/app/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php opt/app/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php
opt/app/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php opt/app/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php
opt/app/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php opt/app/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php

View File

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

View File

@ -2,6 +2,39 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).
## [4.6.11] - 2017-11-30
### Added
- A debug page at `/debug` for easier debug.
- Strings translatable (see [issue 976](https://github.com/firefly-iii/firefly-iii/issues/976)), thanks to [Findus23](https://github.com/Findus23)
- Even more strings are translatable (and translated), thanks to [pkoziol](https://github.com/pkoziol) (see [issue 979](https://github.com/firefly-iii/firefly-iii/issues/979))
- Reconciliation of accounts ([issue 736](https://github.com/firefly-iii/firefly-iii/issues/736)), as requested by [kristophr](https://github.com/kristophr) and several others
### Changed
- Extended currency list, as suggested by @emuhendis in [issue 994](https://github.com/firefly-iii/firefly-iii/issues/994)
- [Issue 996](https://github.com/firefly-iii/firefly-iii/issues/996) as suggested by [dp87](https://github.com/dp87)
### Removed
- Disabled Heroku support until I get it working again.
### Fixed
- [Issue 980](https://github.com/firefly-iii/firefly-iii/issues/980), reported by [Tim-Frensch](https://github.com/Tim-Frensch)
- [Issue 987](https://github.com/firefly-iii/firefly-iii/issues/987), reported by [gavu](https://github.com/gavu)
- [Issue 988](https://github.com/firefly-iii/firefly-iii/issues/988), reported by [gavu](https://github.com/gavu)
- [Issue 992](https://github.com/firefly-iii/firefly-iii/issues/992), reported by [ncicovic](https://github.com/ncicovic)
- [Issue 993](https://github.com/firefly-iii/firefly-iii/issues/993), reported by [gavu](https://github.com/gavu)
- [Issue 997](https://github.com/firefly-iii/firefly-iii/issues/997), reported by [gavu](https://github.com/gavu)
- [Issue 1000](https://github.com/firefly-iii/firefly-iii/issues/1000), reported by [xpfgsyb](https://github.com/xpfgsyb)
- [Issue 1001](https://github.com/firefly-iii/firefly-iii/issues/1001), reported by [gavu](https://github.com/gavu)
- [Issue 1002](https://github.com/firefly-iii/firefly-iii/issues/1002), reported by [ursweiss](https://github.com/ursweiss)
- [Issue 1003](https://github.com/firefly-iii/firefly-iii/issues/1003), reported by [ursweiss](https://github.com/ursweiss)
- [Issue 1004](https://github.com/firefly-iii/firefly-iii/issues/1004), reported by [Aquariu](https://github.com/Aquariu)
- [Issue 1010](https://github.com/firefly-iii/firefly-iii/issues/1010)
- [Issue 1014](https://github.com/firefly-iii/firefly-iii/issues/1014), reported by [ursweiss](https://github.com/ursweiss)
- [Issue 1016](https://github.com/firefly-iii/firefly-iii/issues/1016)
- [Issue 1024](https://github.com/firefly-iii/firefly-iii/issues/1024), reported by [gavu](https://github.com/gavu)
- [Issue 1025](https://github.com/firefly-iii/firefly-iii/issues/1025), reported by [gavu](https://github.com/gavu)
## [4.6.10] - 2017-11-xx ## [4.6.10] - 2017-11-xx
### Added ### Added
- Greatly expanded Docker support thanks to [alazare619](https://github.com/alazare619) - Greatly expanded Docker support thanks to [alazare619](https://github.com/alazare619)
@ -277,8 +310,8 @@ This will be the last release to support PHP 7.0.
- Can now make rules for attachments, see [issue 608](https://github.com/firefly-iii/firefly-iii/issues/608), as suggested by [dzaikos](https://github.com/dzaikos). - Can now make rules for attachments, see [issue 608](https://github.com/firefly-iii/firefly-iii/issues/608), as suggested by [dzaikos](https://github.com/dzaikos).
### Fixed ### Fixed
- Fixed [issue 629](https://github.com/firefly-iii/firefly-iii/issues/629), reported by forcaeluz - Fixed [issue 629](https://github.com/firefly-iii/firefly-iii/issues/629), reported by @forcaeluz
- Fixed [issue 630](https://github.com/firefly-iii/firefly-iii/issues/630), reported by welbert - Fixed [issue 630](https://github.com/firefly-iii/firefly-iii/issues/630), reported by @welbert
- And more various bug fixes. - And more various bug fixes.
## [4.3.8] - 2017-04-08 ## [4.3.8] - 2017-04-08

View File

@ -31,6 +31,8 @@ You can install Firefly III on any Linux or Windows machine. You'll need a web s
Register for a free Heroku account and instantly run Firefly III on your very own cloud instance. Register for a free Heroku account and instantly run Firefly III on your very own cloud instance.
_My Heroku configuration is currently broken, but I'm trying to fix it._
### Using Sandstorm.io ### Using Sandstorm.io
You can find Firefly III in [the Sandstorm.io marketplace](https://apps.sandstorm.io/app/uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70). You can run it on your own installation or on Oasis. You can find Firefly III in [the Sandstorm.io marketplace](https://apps.sandstorm.io/app/uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70). You can run it on your own installation or on Oasis.

View File

@ -2,6 +2,7 @@
"name": "Firefly III", "name": "Firefly III",
"description": "A free and open source personal finances manager", "description": "A free and open source personal finances manager",
"repository": "https://github.com/firefly-iii/firefly-iii", "repository": "https://github.com/firefly-iii/firefly-iii",
"website": "https://firefly-iii.github.io/",
"logo": "https://raw.githubusercontent.com/firefly-iii/firefly-iii/master/public/mstile-150x150.png", "logo": "https://raw.githubusercontent.com/firefly-iii/firefly-iii/master/public/mstile-150x150.png",
"keywords": [ "keywords": [
"finance", "finance",
@ -36,14 +37,16 @@
"transfers", "transfers",
"management" "management"
], ],
"website": "https://firefly-iii.github.io/",
"addons": [ "addons": [
{ {
"plan": "heroku-postgresql" "plan": "heroku-postgresql",
"options": {
"version": "9.5"
}
} }
], ],
"scripts": { "scripts": {
"postdeploy": "export APP_KEY=$(php artisan --no-ansi key:generate --show)" "postdeploy": "php artisan migrate:refresh --seed;php artisan firefly:instructions install"
}, },
"buildpacks": [ "buildpacks": [
{ {

View File

@ -18,10 +18,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
use Carbon\Carbon; use Carbon\Carbon;
@ -34,13 +32,10 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Storage; use Storage;
/** /**
* Class CreateExport * Class CreateExport.
* *
* Generates export from the command line. * Generates export from the command line.
*
* @package FireflyIII\Console\Commands
*/ */
class CreateExport extends Command class CreateExport extends Command
{ {
@ -66,7 +61,6 @@ class CreateExport extends Command
/** /**
* Create a new command instance. * Create a new command instance.
*
*/ */
public function __construct() public function __construct()
{ {
@ -74,7 +68,6 @@ class CreateExport extends Command
} }
/** /**
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine.
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* *
@ -109,7 +102,7 @@ class CreateExport extends Command
// first date // first date
$firstJournal = $journalRepository->first(); $firstJournal = $journalRepository->first();
$first = new Carbon; $first = new Carbon;
if (!is_null($firstJournal->id)) { if (null !== $firstJournal->id) {
$first = $firstJournal->date; $first = $firstJournal->date;
} }
@ -125,7 +118,6 @@ class CreateExport extends Command
'job' => $job, 'job' => $job,
]; ];
/** @var ProcessorInterface $processor */ /** @var ProcessorInterface $processor */
$processor = app(ProcessorInterface::class); $processor = app(ProcessorInterface::class);
$processor->setSettings($settings); $processor->setSettings($settings);

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
@ -35,9 +34,7 @@ use Monolog\Formatter\LineFormatter;
use Preferences; use Preferences;
/** /**
* Class CreateImport * Class CreateImport.
*
* @package FireflyIII\Console\Commands
*/ */
class CreateImport extends Command class CreateImport extends Command
{ {
@ -65,7 +62,6 @@ class CreateImport extends Command
/** /**
* Create a new command instance. * Create a new command instance.
*
*/ */
public function __construct() public function __construct()
{ {
@ -98,7 +94,7 @@ class CreateImport extends Command
} }
$configurationData = json_decode(file_get_contents($configuration)); $configurationData = json_decode(file_get_contents($configuration));
if (is_null($configurationData)) { if (null === $configurationData) {
$this->error(sprintf('Firefly III cannot read the contents of configuration file "%s" (working directory: "%s").', $configuration, $cwd)); $this->error(sprintf('Firefly III cannot read the contents of configuration file "%s" (working directory: "%s").', $configuration, $cwd));
return; return;
@ -109,25 +105,21 @@ class CreateImport extends Command
$this->line(sprintf('Import into user: #%d (%s)', $user->id, $user->email)); $this->line(sprintf('Import into user: #%d (%s)', $user->id, $user->email));
$this->line(sprintf('Type of import: %s', $type)); $this->line(sprintf('Type of import: %s', $type));
/** @var ImportJobRepositoryInterface $jobRepository */ /** @var ImportJobRepositoryInterface $jobRepository */
$jobRepository = app(ImportJobRepositoryInterface::class); $jobRepository = app(ImportJobRepositoryInterface::class);
$jobRepository->setUser($user); $jobRepository->setUser($user);
$job = $jobRepository->create($type); $job = $jobRepository->create($type);
$this->line(sprintf('Created job "%s"', $job->key)); $this->line(sprintf('Created job "%s"', $job->key));
Artisan::call('firefly:encrypt-file', ['file' => $file, 'key' => $job->key]); Artisan::call('firefly:encrypt-file', ['file' => $file, 'key' => $job->key]);
$this->line('Stored import data...'); $this->line('Stored import data...');
$job->configuration = $configurationData; $job->configuration = $configurationData;
$job->status = 'configured'; $job->status = 'configured';
$job->save(); $job->save();
$this->line('Stored configuration...'); $this->line('Stored configuration...');
if (true === $this->option('start')) {
if ($this->option('start') === true) {
$this->line('The import will start in a moment. This process is not visible...'); $this->line('The import will start in a moment. This process is not visible...');
Log::debug('Go for import!'); Log::debug('Go for import!');
@ -138,7 +130,6 @@ class CreateImport extends Command
$handler->setFormatter($formatter); $handler->setFormatter($formatter);
$monolog->pushHandler($handler); $monolog->pushHandler($handler);
// start the actual routine: // start the actual routine:
/** @var ImportRoutine $routine */ /** @var ImportRoutine $routine */
$routine = app(ImportRoutine::class); $routine = app(ImportRoutine::class);
@ -177,7 +168,7 @@ class CreateImport extends Command
$cwd = getcwd(); $cwd = getcwd();
$validTypes = array_keys(config('firefly.import_formats')); $validTypes = array_keys(config('firefly.import_formats'));
$type = strtolower($this->option('type')); $type = strtolower($this->option('type'));
if (is_null($user->id)) { if (null === $user->id) {
$this->error(sprintf('There is no user with ID %d.', $this->option('user'))); $this->error(sprintf('There is no user with ID %d.', $this->option('user')));
return false; return false;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
@ -28,9 +27,7 @@ use Illuminate\Console\Command;
use Log; use Log;
/** /**
* Class DecryptAttachment * Class DecryptAttachment.
*
* @package FireflyIII\Console\Commands
*/ */
class DecryptAttachment extends Command class DecryptAttachment extends Command
{ {
@ -50,15 +47,12 @@ class DecryptAttachment extends Command
= 'firefly:decrypt-attachment {id:The ID of the attachment.} {name:The file name of the attachment.} = 'firefly:decrypt-attachment {id:The ID of the attachment.} {name:The file name of the attachment.}
{directory:Where the file must be stored.}'; {directory:Where the file must be stored.}';
/** /**
* Create a new command instance. * Create a new command instance.
*
*/ */
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
} }
/** /**
@ -66,7 +60,6 @@ class DecryptAttachment extends Command
* *
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine.
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
*/ */
public function handle() public function handle()
{ {
@ -76,7 +69,7 @@ class DecryptAttachment extends Command
$attachment = $repository->findWithoutUser($attachmentId); $attachment = $repository->findWithoutUser($attachmentId);
$attachmentName = trim($this->argument('name')); $attachmentName = trim($this->argument('name'));
$storagePath = realpath(trim($this->argument('directory'))); $storagePath = realpath(trim($this->argument('directory')));
if (is_null($attachment->id)) { if (null === $attachment->id) {
$this->error(sprintf('No attachment with id #%d', $attachmentId)); $this->error(sprintf('No attachment with id #%d', $attachmentId));
Log::error(sprintf('DecryptAttachment: No attachment with id #%d', $attachmentId)); Log::error(sprintf('DecryptAttachment: No attachment with id #%d', $attachmentId));
@ -108,7 +101,7 @@ class DecryptAttachment extends Command
$content = $repository->getContent($attachment); $content = $repository->getContent($attachment);
$this->line(sprintf('Going to write content for attachment #%d into file "%s"', $attachment->id, $fullPath)); $this->line(sprintf('Going to write content for attachment #%d into file "%s"', $attachment->id, $fullPath));
$result = file_put_contents($fullPath, $content); $result = file_put_contents($fullPath, $content);
if ($result === false) { if (false === $result) {
$this->error('Could not write to file.'); $this->error('Could not write to file.');
return; return;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
@ -27,9 +26,7 @@ use Crypt;
use Illuminate\Console\Command; use Illuminate\Console\Command;
/** /**
* Class EncryptFile * Class EncryptFile.
*
* @package FireflyIII\Console\Commands
*/ */
class EncryptFile extends Command class EncryptFile extends Command
{ {
@ -49,7 +46,6 @@ class EncryptFile extends Command
/** /**
* Create a new command instance. * Create a new command instance.
*
*/ */
public function __construct() public function __construct()
{ {

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
@ -31,9 +30,7 @@ use Illuminate\Support\MessageBag;
use Log; use Log;
/** /**
* Class Import * Class Import.
*
* @package FireflyIII\Console\Commands
*/ */
class Import extends Command class Import extends Command
{ {
@ -53,7 +50,6 @@ class Import extends Command
/** /**
* Create a new command instance. * Create a new command instance.
*
*/ */
public function __construct() public function __construct()
{ {
@ -68,7 +64,7 @@ class Import extends Command
Log::debug('Start start-import command'); Log::debug('Start start-import command');
$jobKey = $this->argument('key'); $jobKey = $this->argument('key');
$job = ImportJob::where('key', $jobKey)->first(); $job = ImportJob::where('key', $jobKey)->first();
if (is_null($job)) { if (null === $job) {
$this->error(sprintf('No job found with key "%s"', $jobKey)); $this->error(sprintf('No job found with key "%s"', $jobKey));
return; return;
@ -109,14 +105,14 @@ class Import extends Command
*/ */
private function isValid(ImportJob $job): bool private function isValid(ImportJob $job): bool
{ {
if (is_null($job)) { if (null === $job) {
Log::error('This job does not seem to exist.'); Log::error('This job does not seem to exist.');
$this->error('This job does not seem to exist.'); $this->error('This job does not seem to exist.');
return false; return false;
} }
if ($job->status !== 'configured') { if ('configured' !== $job->status) {
Log::error(sprintf('This job is not ready to be imported (status is %s).', $job->status)); Log::error(sprintf('This job is not ready to be imported (status is %s).', $job->status));
$this->error('This job is not ready to be imported.'); $this->error('This job is not ready to be imported.');

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
@ -31,9 +30,7 @@ use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Storage; use Storage;
/** /**
* Class ScanAttachments * Class ScanAttachments.
*
* @package FireflyIII\Console\Commands
*/ */
class ScanAttachments extends Command class ScanAttachments extends Command
{ {
@ -53,7 +50,6 @@ class ScanAttachments extends Command
/** /**
* Create a new command instance. * Create a new command instance.
*
*/ */
public function __construct() public function __construct()
{ {

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
use DB; use DB;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\AccountMeta; use FireflyIII\Models\AccountMeta;
@ -45,17 +43,15 @@ use Preferences;
use Schema; use Schema;
/** /**
* Class UpgradeDatabase * Class UpgradeDatabase.
* *
* Upgrade user database. * Upgrade user database.
* *
* *
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) // it just touches a lot of things. * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // it just touches a lot of things.
* @package FireflyIII\Console\Commands
*/ */
class UpgradeDatabase extends Command class UpgradeDatabase extends Command
{ {
/** /**
* The console command description. * The console command description.
* *
@ -85,6 +81,7 @@ class UpgradeDatabase extends Command
$this->setTransactionIdentifier(); $this->setTransactionIdentifier();
$this->migrateRepetitions(); $this->migrateRepetitions();
$this->updateAccountCurrencies(); $this->updateAccountCurrencies();
$this->createNewTypes();
$this->line('Updating currency information..'); $this->line('Updating currency information..');
$this->updateTransferCurrencies(); $this->updateTransferCurrencies();
$this->updateOtherCurrencies(); $this->updateOtherCurrencies();
@ -93,8 +90,6 @@ class UpgradeDatabase extends Command
$this->info('Firefly III database is up to date.'); $this->info('Firefly III database is up to date.');
return; return;
} }
/** /**
@ -108,7 +103,7 @@ class UpgradeDatabase extends Command
foreach ($set as $budgetLimit) { foreach ($set as $budgetLimit) {
/** @var LimitRepetition $repetition */ /** @var LimitRepetition $repetition */
$repetition = $budgetLimit->limitrepetitions()->first(); $repetition = $budgetLimit->limitrepetitions()->first();
if (!is_null($repetition)) { if (null !== $repetition) {
$budgetLimit->end_date = $repetition->enddate; $budgetLimit->end_date = $repetition->enddate;
$budgetLimit->save(); $budgetLimit->save();
$this->line(sprintf('Updated budget limit #%d', $budgetLimit->id)); $this->line(sprintf('Updated budget limit #%d', $budgetLimit->id));
@ -173,7 +168,7 @@ class UpgradeDatabase extends Command
$obCurrency = intval($openingBalance->transaction_currency_id); $obCurrency = intval($openingBalance->transaction_currency_id);
// both 0? set to default currency: // both 0? set to default currency:
if ($accountCurrency === 0 && $obCurrency === 0) { if (0 === $accountCurrency && 0 === $obCurrency) {
AccountMeta::create(['account_id' => $account->id, 'name' => 'currency_id', 'data' => $defaultCurrency->id]); AccountMeta::create(['account_id' => $account->id, 'name' => 'currency_id', 'data' => $defaultCurrency->id]);
$this->line(sprintf('Account #%d ("%s") now has a currency setting (%s).', $account->id, $account->name, $defaultCurrencyCode)); $this->line(sprintf('Account #%d ("%s") now has a currency setting (%s).', $account->id, $account->name, $defaultCurrencyCode));
@ -181,7 +176,7 @@ class UpgradeDatabase extends Command
} }
// account is set to 0, opening balance is not? // account is set to 0, opening balance is not?
if ($accountCurrency === 0 && $obCurrency > 0) { if (0 === $accountCurrency && $obCurrency > 0) {
AccountMeta::create(['account_id' => $account->id, 'name' => 'currency_id', 'data' => $obCurrency]); AccountMeta::create(['account_id' => $account->id, 'name' => 'currency_id', 'data' => $obCurrency]);
$this->line(sprintf('Account #%d ("%s") now has a currency setting (%s).', $account->id, $account->name, $defaultCurrencyCode)); $this->line(sprintf('Account #%d ("%s") now has a currency setting (%s).', $account->id, $account->name, $defaultCurrencyCode));
@ -231,7 +226,7 @@ class UpgradeDatabase extends Command
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->first(['transactions.*']); ->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->first(['transactions.*']);
if (is_null($transaction)) { if (null === $transaction) {
return; return;
} }
/** @var Account $account */ /** @var Account $account */
@ -240,7 +235,7 @@ class UpgradeDatabase extends Command
$transactions = $journal->transactions()->get(); $transactions = $journal->transactions()->get();
$transactions->each( $transactions->each(
function (Transaction $transaction) use ($currency) { function (Transaction $transaction) use ($currency) {
if (is_null($transaction->transaction_currency_id)) { if (null === $transaction->transaction_currency_id) {
$transaction->transaction_currency_id = $currency->id; $transaction->transaction_currency_id = $currency->id;
$transaction->save(); $transaction->save();
} }
@ -295,6 +290,19 @@ class UpgradeDatabase extends Command
); );
} }
private function createNewTypes(): void
{
// create transaction type "Reconciliation".
$type = TransactionType::where('type', TransactionType::RECONCILIATION)->first();
if (is_null($type)) {
TransactionType::create(['type' => TransactionType::RECONCILIATION]);
}
$account = AccountType::where('type', AccountType::RECONCILIATION)->first();
if (is_null($account)) {
AccountType::create(['type' => AccountType::RECONCILIATION]);
}
}
/** /**
* Move all the journal_meta notes to their note object counter parts. * Move all the journal_meta notes to their note object counter parts.
*/ */
@ -305,8 +313,8 @@ class UpgradeDatabase extends Command
foreach ($set as $meta) { foreach ($set as $meta) {
$journal = $meta->transactionJournal; $journal = $meta->transactionJournal;
$note = $journal->notes()->first(); $note = $journal->notes()->first();
if (is_null($note)) { if (null === $note) {
$note = new Note; $note = new Note();
$note->noteable()->associate($journal); $note->noteable()->associate($journal);
} }
@ -314,11 +322,9 @@ class UpgradeDatabase extends Command
$note->save(); $note->save();
Log::debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id)); Log::debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id));
$meta->delete(); $meta->delete();
} }
} }
/** /**
* This method makes sure that the transaction journal uses the currency given in the transaction. * This method makes sure that the transaction journal uses the currency given in the transaction.
* *
@ -334,7 +340,10 @@ class UpgradeDatabase extends Command
if (!(intval($currency->id) === intval($journal->transaction_currency_id))) { if (!(intval($currency->id) === intval($journal->transaction_currency_id))) {
$this->line( $this->line(
sprintf( sprintf(
'Transfer #%d ("%s") has been updated to use %s instead of %s.', $journal->id, $journal->description, $currency->code, 'Transfer #%d ("%s") has been updated to use %s instead of %s.',
$journal->id,
$journal->description,
$currency->code,
$journal->transactionCurrency->code $journal->transactionCurrency->code
) )
); );
@ -376,7 +385,7 @@ class UpgradeDatabase extends Command
return; return;
} }
if (!is_null($opposing)) { if (null !== $opposing) {
// give both a new identifier: // give both a new identifier:
$transaction->identifier = $identifier; $transaction->identifier = $identifier;
$opposing->identifier = $identifier; $opposing->identifier = $identifier;
@ -385,7 +394,7 @@ class UpgradeDatabase extends Command
$processed[] = $transaction->id; $processed[] = $transaction->id;
$processed[] = $opposing->id; $processed[] = $opposing->id;
} }
$identifier++; ++$identifier;
} }
return; return;
@ -412,7 +421,7 @@ class UpgradeDatabase extends Command
$currency = $repository->find(intval($transaction->account->getMeta('currency_id'))); $currency = $repository->find(intval($transaction->account->getMeta('currency_id')));
// has no currency ID? Must have, so fill in using account preference: // has no currency ID? Must have, so fill in using account preference:
if (is_null($transaction->transaction_currency_id)) { if (null === $transaction->transaction_currency_id) {
$transaction->transaction_currency_id = $currency->id; $transaction->transaction_currency_id = $currency->id;
Log::debug(sprintf('Transaction #%d has no currency setting, now set to %s', $transaction->id, $currency->code)); Log::debug(sprintf('Transaction #%d has no currency setting, now set to %s', $transaction->id, $currency->code));
$transaction->save(); $transaction->save();
@ -420,11 +429,14 @@ class UpgradeDatabase extends Command
// does not match the source account (see above)? Can be fixed // does not match the source account (see above)? Can be fixed
// when mismatch in transaction and NO foreign amount is set: // when mismatch in transaction and NO foreign amount is set:
if ($transaction->transaction_currency_id !== $currency->id && is_null($transaction->foreign_amount)) { if ($transaction->transaction_currency_id !== $currency->id && null === $transaction->foreign_amount) {
Log::debug( Log::debug(
sprintf( sprintf(
'Transaction #%d has a currency setting (#%d) that should be #%d. Amount remains %s, currency is changed.', $transaction->id, 'Transaction #%d has a currency setting (#%d) that should be #%d. Amount remains %s, currency is changed.',
$transaction->transaction_currency_id, $currency->id, $transaction->amount $transaction->id,
$transaction->transaction_currency_id,
$currency->id,
$transaction->amount
) )
); );
$transaction->transaction_currency_id = $currency->id; $transaction->transaction_currency_id = $currency->id;
@ -438,7 +450,7 @@ class UpgradeDatabase extends Command
$opposing = $journal->transactions()->where('amount', '>', 0)->where('identifier', $transaction->identifier)->first(); $opposing = $journal->transactions()->where('amount', '>', 0)->where('identifier', $transaction->identifier)->first();
$opposingCurrency = $repository->find(intval($opposing->account->getMeta('currency_id'))); $opposingCurrency = $repository->find(intval($opposing->account->getMeta('currency_id')));
if (is_null($opposingCurrency->id)) { if (null === $opposingCurrency->id) {
Log::error(sprintf('Account #%d ("%s") must have currency preference but has none.', $opposing->account->id, $opposing->account->name)); Log::error(sprintf('Account #%d ("%s") must have currency preference but has none.', $opposing->account->id, $opposing->account->name));
return; return;
@ -468,24 +480,23 @@ class UpgradeDatabase extends Command
} }
// if foreign amount of one is null and the other is not, use this to restore: // if foreign amount of one is null and the other is not, use this to restore:
if (is_null($transaction->foreign_amount) && !is_null($opposing->foreign_amount)) { if (null === $transaction->foreign_amount && null !== $opposing->foreign_amount) {
$transaction->foreign_amount = bcmul(strval($opposing->foreign_amount), '-1'); $transaction->foreign_amount = bcmul(strval($opposing->foreign_amount), '-1');
$transaction->save(); $transaction->save();
Log::debug(sprintf('Restored foreign amount of transaction (1) #%d to %s', $transaction->id, $transaction->foreign_amount)); 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 foreign amount of one is null and the other is not, use this to restore (other way around)
if (is_null($opposing->foreign_amount) && !is_null($transaction->foreign_amount)) { if (null === $opposing->foreign_amount && null !== $transaction->foreign_amount) {
$opposing->foreign_amount = bcmul(strval($transaction->foreign_amount), '-1'); $opposing->foreign_amount = bcmul(strval($transaction->foreign_amount), '-1');
$opposing->save(); $opposing->save();
Log::debug(sprintf('Restored foreign amount of transaction (2) #%d to %s', $opposing->id, $opposing->foreign_amount)); Log::debug(sprintf('Restored foreign amount of transaction (2) #%d to %s', $opposing->id, $opposing->foreign_amount));
} }
// when both are zero, try to grab it from journal: // when both are zero, try to grab it from journal:
if (is_null($opposing->foreign_amount) && is_null($transaction->foreign_amount)) { if (null === $opposing->foreign_amount && null === $transaction->foreign_amount) {
$foreignAmount = $journal->getMeta('foreign_amount'); $foreignAmount = $journal->getMeta('foreign_amount');
if (is_null($foreignAmount)) { if (null === $foreignAmount) {
Log::debug(sprintf('Journal #%d has missing foreign currency data, forced to do 1:1 conversion :(.', $transaction->transaction_journal_id)); 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'); $transaction->foreign_amount = bcmul(strval($transaction->amount), '-1');
$opposing->foreign_amount = bcmul(strval($opposing->amount), '-1'); $opposing->foreign_amount = bcmul(strval($opposing->amount), '-1');
@ -497,7 +508,9 @@ class UpgradeDatabase extends Command
$foreignPositive = app('steam')->positive(strval($foreignAmount)); $foreignPositive = app('steam')->positive(strval($foreignAmount));
Log::debug( Log::debug(
sprintf( sprintf(
'Journal #%d has missing foreign currency info, try to restore from meta-data ("%s").', $transaction->transaction_journal_id, $foreignAmount 'Journal #%d has missing foreign currency info, try to restore from meta-data ("%s").',
$transaction->transaction_journal_id,
$foreignAmount
) )
); );
$transaction->foreign_amount = bcmul($foreignPositive, '-1'); $transaction->foreign_amount = bcmul($foreignPositive, '-1');
@ -506,7 +519,6 @@ class UpgradeDatabase extends Command
$opposing->save(); $opposing->save();
} }
return; return;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
@ -26,9 +25,7 @@ namespace FireflyIII\Console\Commands;
use Illuminate\Console\Command; use Illuminate\Console\Command;
/** /**
* Class UpgradeFireflyInstructions * Class UpgradeFireflyInstructions.
*
* @package FireflyIII\Console\Commands
*/ */
class UpgradeFireflyInstructions extends Command class UpgradeFireflyInstructions extends Command
{ {
@ -47,7 +44,6 @@ class UpgradeFireflyInstructions extends Command
/** /**
* Create a new command instance. * Create a new command instance.
*
*/ */
public function __construct() public function __construct()
{ {
@ -59,17 +55,16 @@ class UpgradeFireflyInstructions extends Command
*/ */
public function handle() public function handle()
{ {
if ('update' === $this->argument('task')) {
if ($this->argument('task') === 'update') {
$this->updateInstructions(); $this->updateInstructions();
} }
if ($this->argument('task') === 'install') { if ('install' === $this->argument('task')) {
$this->installInstructions(); $this->installInstructions();
} }
} }
/** /**
* Show a nice box * Show a nice box.
* *
* @param string $text * @param string $text
*/ */
@ -82,7 +77,7 @@ class UpgradeFireflyInstructions extends Command
} }
/** /**
* Show a nice info box * Show a nice info box.
* *
* @param string $text * @param string $text
*/ */
@ -109,12 +104,10 @@ class UpgradeFireflyInstructions extends Command
if (substr($version, 0, $len) === $compare) { if (substr($version, 0, $len) === $compare) {
$text = $config[$compare]; $text = $config[$compare];
} }
} }
$this->showLine(); $this->showLine();
$this->boxed(''); $this->boxed('');
if (is_null($text)) { if (null === $text) {
$this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version)); $this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version));
$this->boxedInfo('There are no extra installation instructions.'); $this->boxedInfo('There are no extra installation instructions.');
$this->boxed('Firefly III should be ready for use.'); $this->boxed('Firefly III should be ready for use.');
@ -131,17 +124,16 @@ class UpgradeFireflyInstructions extends Command
} }
/** /**
* Show a line * Show a line.
*/ */
private function showLine() private function showLine()
{ {
$line = '+'; $line = '+';
for ($i = 0; $i < 78; $i++) { for ($i = 0; $i < 78; ++$i) {
$line .= '-'; $line .= '-';
} }
$line .= '+'; $line .= '+';
$this->line($line); $this->line($line);
} }
/** /**
@ -159,12 +151,10 @@ class UpgradeFireflyInstructions extends Command
if (substr($version, 0, $len) === $compare) { if (substr($version, 0, $len) === $compare) {
$text = $config[$compare]; $text = $config[$compare];
} }
} }
$this->showLine(); $this->showLine();
$this->boxed(''); $this->boxed('');
if (is_null($text)) { if (null === $text) {
$this->boxed(sprintf('Thank you for updating to Firefly III, v%s', $version)); $this->boxed(sprintf('Thank you for updating to Firefly III, v%s', $version));
$this->boxedInfo('There are no extra upgrade instructions.'); $this->boxedInfo('There are no extra upgrade instructions.');
$this->boxed('Firefly III should be ready for use.'); $this->boxed('Firefly III should be ready for use.');

View File

@ -19,7 +19,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
/** /**
@ -36,9 +35,7 @@ use Illuminate\Console\Command;
use Illuminate\Support\Str; use Illuminate\Support\Str;
/** /**
* Class UseEncryption * Class UseEncryption.
*
* @package FireflyIII\Console\Commands
*/ */
class UseEncryption extends Command class UseEncryption extends Command
{ {
@ -57,7 +54,6 @@ class UseEncryption extends Command
/** /**
* Create a new command instance. * Create a new command instance.
*
*/ */
public function __construct() public function __construct()
{ {

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
@ -28,11 +27,9 @@ use Log;
use Preferences; use Preferences;
/** /**
* Trait VerifiesAccessToken * Trait VerifiesAccessToken.
* *
* Verifies user access token for sensitive commands. * Verifies user access token for sensitive commands.
*
* @package FireflyIII\Console\Commands
*/ */
trait VerifiesAccessToken trait VerifiesAccessToken
{ {
@ -58,13 +55,13 @@ trait VerifiesAccessToken
$repository = app(UserRepositoryInterface::class); $repository = app(UserRepositoryInterface::class);
$user = $repository->find($userId); $user = $repository->find($userId);
if (is_null($user->id)) { if (null === $user->id) {
Log::error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId)); Log::error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId));
return false; return false;
} }
$accessToken = Preferences::getForUser($user, 'access_token', null); $accessToken = Preferences::getForUser($user, 'access_token', null);
if (is_null($accessToken)) { if (null === $accessToken) {
Log::error(sprintf('User #%d has no access token, so cannot access command line options.', $userId)); Log::error(sprintf('User #%d has no access token, so cannot access command line options.', $userId));
return false; return false;
@ -77,5 +74,4 @@ trait VerifiesAccessToken
return true; return true;
} }
}
}

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands; namespace FireflyIII\Console\Commands;
@ -42,11 +41,9 @@ use Schema;
use stdClass; use stdClass;
/** /**
* Class VerifyDatabase * Class VerifyDatabase.
* *
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*
* @package FireflyIII\Console\Commands
*/ */
class VerifyDatabase extends Command class VerifyDatabase extends Command
{ {
@ -96,7 +93,6 @@ class VerifyDatabase extends Command
$this->repairPiggyBanks(); $this->repairPiggyBanks();
$this->createLinkTypes(); $this->createLinkTypes();
$this->createAccessTokens(); $this->createAccessTokens();
} }
/** /**
@ -108,7 +104,7 @@ class VerifyDatabase extends Command
/** @var User $user */ /** @var User $user */
foreach ($users as $user) { foreach ($users as $user) {
$pref = Preferences::getForUser($user, 'access_token', null); $pref = Preferences::getForUser($user, 'access_token', null);
if (is_null($pref)) { if (null === $pref) {
$token = $user->generateAccessToken(); $token = $user->generateAccessToken();
Preferences::setForUser($user, 'access_token', $token); Preferences::setForUser($user, 'access_token', $token);
$this->line(sprintf('Generated access token for user %s', $user->email)); $this->line(sprintf('Generated access token for user %s', $user->email));
@ -129,7 +125,7 @@ class VerifyDatabase extends Command
]; ];
foreach ($set as $name => $values) { foreach ($set as $name => $values) {
$link = LinkType::where('name', $name)->where('outward', $values[0])->where('inward', $values[1])->first(); $link = LinkType::where('name', $name)->where('outward', $values[0])->where('inward', $values[1])->first();
if (is_null($link)) { if (null === $link) {
$link = new LinkType; $link = new LinkType;
$link->name = $name; $link->name = $name;
$link->outward = $values[0]; $link->outward = $values[0];
@ -148,17 +144,17 @@ class VerifyDatabase extends Command
$set = PiggyBankEvent::with(['PiggyBank', 'TransactionJournal', 'TransactionJournal.TransactionType'])->get(); $set = PiggyBankEvent::with(['PiggyBank', 'TransactionJournal', 'TransactionJournal.TransactionType'])->get();
$set->each( $set->each(
function (PiggyBankEvent $event) { function (PiggyBankEvent $event) {
if (is_null($event->transaction_journal_id)) { if (null === $event->transaction_journal_id) {
return true; return true;
} }
/** @var TransactionJournal $journal */ /** @var TransactionJournal $journal */
$journal = $event->transactionJournal()->first(); $journal = $event->transactionJournal()->first();
if (is_null($journal)) { if (null === $journal) {
return true; return true;
} }
$type = $journal->transactionType->type; $type = $journal->transactionType->type;
if ($type !== TransactionType::TRANSFER) { if (TransactionType::TRANSFER !== $type) {
$event->transaction_journal_id = null; $event->transaction_journal_id = null;
$event->save(); $event->save();
$this->line(sprintf('Piggy bank #%d was referenced by an invalid event. This has been fixed.', $event->piggy_bank_id)); $this->line(sprintf('Piggy bank #%d was referenced by an invalid event. This has been fixed.', $event->piggy_bank_id));
@ -208,7 +204,10 @@ class VerifyDatabase extends Command
foreach ($set as $entry) { foreach ($set as $entry) {
$line = sprintf( $line = sprintf(
'User #%d (%s) has budget #%d ("%s") which has no budget limits.', 'User #%d (%s) has budget #%d ("%s") which has no budget limits.',
$entry->user_id, $entry->email, $entry->id, $entry->name $entry->user_id,
$entry->email,
$entry->id,
$entry->name
); );
$this->line($line); $this->line($line);
} }
@ -232,11 +231,11 @@ class VerifyDatabase extends Command
->get( ->get(
['accounts.id as account_id', 'accounts.deleted_at as account_deleted_at', 'transactions.id as transaction_id', ['accounts.id as account_id', 'accounts.deleted_at as account_deleted_at', 'transactions.id as transaction_id',
'transactions.deleted_at as transaction_deleted_at', 'transaction_journals.id as journal_id', 'transactions.deleted_at as transaction_deleted_at', 'transaction_journals.id as journal_id',
'transaction_journals.deleted_at as journal_deleted_at'] 'transaction_journals.deleted_at as journal_deleted_at',]
); );
/** @var stdClass $entry */ /** @var stdClass $entry */
foreach ($set as $entry) { foreach ($set as $entry) {
$date = is_null($entry->transaction_deleted_at) ? $entry->journal_deleted_at : $entry->transaction_deleted_at; $date = null === $entry->transaction_deleted_at ? $entry->journal_deleted_at : $entry->transaction_deleted_at;
$this->error( $this->error(
'Error: Account #' . $entry->account_id . ' should have been deleted, but has not.' . '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 . '"' ' Find it in the table called "accounts" and change the "deleted_at" field to: "' . $date . '"'
@ -268,7 +267,7 @@ class VerifyDatabase extends Command
->whereNull('transaction_journals.deleted_at') ->whereNull('transaction_journals.deleted_at')
->get( ->get(
['transaction_journals.id', 'transaction_journals.user_id', 'users.email', 'account_types.type as a_type', ['transaction_journals.id', 'transaction_journals.user_id', 'users.email', 'account_types.type as a_type',
'transaction_types.type'] 'transaction_types.type',]
); );
foreach ($set as $entry) { foreach ($set as $entry) {
$this->error( $this->error(
@ -287,7 +286,7 @@ class VerifyDatabase extends Command
} }
/** /**
* Any deleted transaction journals that have transactions that are NOT deleted: * Any deleted transaction journals that have transactions that are NOT deleted:.
*/ */
private function reportJournals() private function reportJournals()
{ {
@ -301,7 +300,7 @@ class VerifyDatabase extends Command
'transaction_journals.description', 'transaction_journals.description',
'transaction_journals.deleted_at as journal_deleted', 'transaction_journals.deleted_at as journal_deleted',
'transactions.id as transaction_id', 'transactions.id as transaction_id',
'transactions.deleted_at as transaction_deleted_at'] 'transactions.deleted_at as transaction_deleted_at',]
); );
/** @var stdClass $entry */ /** @var stdClass $entry */
foreach ($set as $entry) { foreach ($set as $entry) {
@ -327,7 +326,6 @@ class VerifyDatabase extends Command
'Error: Journal #' . $entry->id . ' has zero transactions. Open table "transaction_journals" and delete the entry with id #' . $entry->id 'Error: Journal #' . $entry->id . ' has zero transactions. Open table "transaction_journals" and delete the entry with id #' . $entry->id
); );
} }
} }
/** /**
@ -339,7 +337,7 @@ class VerifyDatabase extends Command
{ {
$plural = str_plural($name); $plural = str_plural($name);
$class = sprintf('FireflyIII\Models\%s', ucfirst($name)); $class = sprintf('FireflyIII\Models\%s', ucfirst($name));
$field = $name === 'tag' ? 'tag' : 'name'; $field = 'tag' === $name ? 'tag' : 'name';
$set = $class::leftJoin($name . '_transaction_journal', $plural . '.id', '=', $name . '_transaction_journal.' . $name . '_id') $set = $class::leftJoin($name . '_transaction_journal', $plural . '.id', '=', $name . '_transaction_journal.' . $name . '_id')
->leftJoin('users', $plural . '.user_id', '=', 'users.id') ->leftJoin('users', $plural . '.user_id', '=', 'users.id')
->distinct() ->distinct()
@ -349,7 +347,6 @@ class VerifyDatabase extends Command
/** @var stdClass $entry */ /** @var stdClass $entry */
foreach ($set as $entry) { foreach ($set as $entry) {
$objName = $entry->name; $objName = $entry->name;
try { try {
$objName = Crypt::decrypt($objName); $objName = Crypt::decrypt($objName);
@ -359,7 +356,11 @@ class VerifyDatabase extends Command
$line = sprintf( $line = sprintf(
'User #%d (%s) has %s #%d ("%s") which has no transactions.', 'User #%d (%s) has %s #%d ("%s") which has no transactions.',
$entry->user_id, $entry->email, $name, $entry->id, $objName $entry->user_id,
$entry->email,
$name,
$entry->id,
$objName
); );
$this->line($line); $this->line($line);
} }
@ -376,7 +377,7 @@ class VerifyDatabase extends Command
/** @var User $user */ /** @var User $user */
foreach ($userRepository->all() as $user) { foreach ($userRepository->all() as $user) {
$sum = strval($user->transactions()->sum('amount')); $sum = strval($user->transactions()->sum('amount'));
if (bccomp($sum, '0') !== 0) { if (0 !== bccomp($sum, '0')) {
$this->error('Error: Transactions for user #' . $user->id . ' (' . $user->email . ') are off by ' . $sum . '!'); $this->error('Error: Transactions for user #' . $user->id . ' (' . $user->email . ') are off by ' . $sum . '!');
} }
} }
@ -392,7 +393,7 @@ class VerifyDatabase extends Command
->whereNull('transaction_journals.deleted_at') ->whereNull('transaction_journals.deleted_at')
->get( ->get(
['transactions.id as transaction_id', 'transactions.deleted_at as transaction_deleted', 'transaction_journals.id as journal_id', ['transactions.id as transaction_id', 'transactions.deleted_at as transaction_deleted', 'transaction_journals.id as journal_id',
'transaction_journals.deleted_at'] 'transaction_journals.deleted_at',]
); );
/** @var stdClass $entry */ /** @var stdClass $entry */
foreach ($set as $entry) { foreach ($set as $entry) {
@ -419,11 +420,10 @@ class VerifyDatabase extends Command
$this->error( $this->error(
sprintf( sprintf(
'Error: Transaction journal #%d is a %s, but has a budget. Edit it without changing anything, so the budget will be removed.', 'Error: Transaction journal #%d is a %s, but has a budget. Edit it without changing anything, so the budget will be removed.',
$entry->id, $entry->transactionType->type $entry->id,
$entry->transactionType->type
) )
); );
} }
} }
} }

View File

@ -18,10 +18,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
/** /**
* Kernel.php * Kernel.php
* Copyright (c) 2017 thegrumpydictator@gmail.com * Copyright (c) 2017 thegrumpydictator@gmail.com
@ -48,13 +46,10 @@ class Kernel extends ConsoleKernel
*/ */
protected $commands protected $commands
= [ = [
//
]; ];
/** /**
* Register the commands for the application. * Register the commands for the application.
*
* @return void
*/ */
protected function commands() protected function commands()
{ {
@ -66,9 +61,8 @@ class Kernel extends ConsoleKernel
/** /**
* Define the application's command schedule. * Define the application's command schedule.
* *
* @param \Illuminate\Console\Scheduling\Schedule $schedule * @param \Illuminate\Console\Scheduling\Schedule $schedule
* *
* @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
protected function schedule(Schedule $schedule) protected function schedule(Schedule $schedule)

View File

@ -18,20 +18,16 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Events; namespace FireflyIII\Events;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Log; use Log;
/** /**
* Class AdminRequestedTestMessage * Class AdminRequestedTestMessage.
*
* @package FireflyIII\Events
*/ */
class AdminRequestedTestMessage extends Event class AdminRequestedTestMessage extends Event
{ {
@ -43,7 +39,7 @@ class AdminRequestedTestMessage extends Event
/** /**
* Create a new event instance. * Create a new event instance.
* *
* @param User $user * @param User $user
* @param string $ipAddress * @param string $ipAddress
*/ */
public function __construct(User $user, string $ipAddress) public function __construct(User $user, string $ipAddress)

View File

@ -18,17 +18,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Events; namespace FireflyIII\Events;
/** /**
* Class Event * Class Event.
*
* @package FireflyIII\Events
*/ */
abstract class Event abstract class Event
{ {
//
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Events; namespace FireflyIII\Events;
@ -27,9 +26,7 @@ use FireflyIII\User;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/** /**
* Class RegisteredUser * Class RegisteredUser.
*
* @package FireflyIII\Events
*/ */
class RegisteredUser extends Event class RegisteredUser extends Event
{ {
@ -41,7 +38,7 @@ class RegisteredUser extends Event
/** /**
* Create a new event instance. This event is triggered when a new user registers. * Create a new event instance. This event is triggered when a new user registers.
* *
* @param User $user * @param User $user
* @param string $ipAddress * @param string $ipAddress
*/ */
public function __construct(User $user, string $ipAddress) public function __construct(User $user, string $ipAddress)

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Events; namespace FireflyIII\Events;
@ -27,9 +26,7 @@ use FireflyIII\User;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/** /**
* Class RequestedNewPassword * Class RequestedNewPassword.
*
* @package FireflyIII\Events
*/ */
class RequestedNewPassword extends Event class RequestedNewPassword extends Event
{ {
@ -42,7 +39,7 @@ class RequestedNewPassword extends Event
/** /**
* Create a new event instance. This event is triggered when a users tries to reset his or her password. * Create a new event instance. This event is triggered when a users tries to reset his or her password.
* *
* @param User $user * @param User $user
* @param string $token * @param string $token
* @param string $ipAddress * @param string $ipAddress
*/ */
@ -52,5 +49,4 @@ class RequestedNewPassword extends Event
$this->token = $token; $this->token = $token;
$this->ipAddress = $ipAddress; $this->ipAddress = $ipAddress;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Events; namespace FireflyIII\Events;
@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/** /**
* Class StoredTransactionJournal * Class StoredTransactionJournal.
*
* @package FireflyIII\Events
*/ */
class StoredTransactionJournal extends Event class StoredTransactionJournal extends Event
{ {
use SerializesModels; use SerializesModels;
/** @var TransactionJournal */ /** @var TransactionJournal */
@ -49,10 +45,7 @@ class StoredTransactionJournal extends Event
*/ */
public function __construct(TransactionJournal $journal, int $piggyBankId) public function __construct(TransactionJournal $journal, int $piggyBankId)
{ {
//
$this->journal = $journal; $this->journal = $journal;
$this->piggyBankId = $piggyBankId; $this->piggyBankId = $piggyBankId;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Events; namespace FireflyIII\Events;
@ -27,13 +26,10 @@ use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/** /**
* Class UpdatedTransactionJournal * Class UpdatedTransactionJournal.
*
* @package FireflyIII\Events
*/ */
class UpdatedTransactionJournal extends Event class UpdatedTransactionJournal extends Event
{ {
use SerializesModels; use SerializesModels;
/** @var TransactionJournal */ /** @var TransactionJournal */
@ -46,8 +42,6 @@ class UpdatedTransactionJournal extends Event
*/ */
public function __construct(TransactionJournal $journal) public function __construct(TransactionJournal $journal)
{ {
//
$this->journal = $journal; $this->journal = $journal;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Events; namespace FireflyIII\Events;
@ -27,19 +26,17 @@ use FireflyIII\User;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/** /**
* Class UserChangedEmail * Class UserChangedEmail.
*
* @package FireflyIII\Events
*/ */
class UserChangedEmail extends Event class UserChangedEmail extends Event
{ {
use SerializesModels; use SerializesModels;
/** @var string */ /** @var string */
public $ipAddress; public $ipAddress;
/** @var string */ /** @var string */
public $newEmail; public $newEmail;
/** @var string */ /** @var string */
public $oldEmail; public $oldEmail;
/** @var User */ /** @var User */
public $user; public $user;
@ -59,4 +56,4 @@ class UserChangedEmail extends Event
$this->oldEmail = $oldEmail; $this->oldEmail = $oldEmail;
$this->newEmail = $newEmail; $this->newEmail = $newEmail;
} }
} }

View File

@ -18,18 +18,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Exceptions; namespace FireflyIII\Exceptions;
/** /**
* Class FireflyException * Class FireflyException.
*
* @package FireflyIII\Exceptions
*/ */
class FireflyException extends \Exception class FireflyException extends \Exception
{ {
}
}

View File

@ -18,10 +18,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
/** /**
* Handler.php * Handler.php
* Copyright (c) 2017 thegrumpydictator@gmail.com * Copyright (c) 2017 thegrumpydictator@gmail.com
@ -39,7 +37,6 @@ use FireflyIII\Jobs\MailError;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Request; use Request;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
/** /**
@ -59,21 +56,19 @@ class Handler extends ExceptionHandler
*/ */
protected $dontReport protected $dontReport
= [ = [
//
]; ];
/** /**
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Exception $exception * @param \Exception $exception
* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function render($request, Exception $exception) public function render($request, Exception $exception)
{ {
if ($exception instanceof FireflyException || $exception instanceof ErrorException) { if ($exception instanceof FireflyException || $exception instanceof ErrorException) {
$isDebug = env('APP_DEBUG', false); $isDebug = env('APP_DEBUG', false);
return response()->view('errors.FireflyException', ['exception' => $exception, 'debug' => $isDebug], 500); return response()->view('errors.FireflyException', ['exception' => $exception, 'debug' => $isDebug], 500);
@ -88,9 +83,10 @@ class Handler extends ExceptionHandler
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* *
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine.
* @param \Exception $exception
* *
* @return void * @param \Exception $exception
*
* @return mixed|void
*/ */
public function report(Exception $exception) public function report(Exception $exception)
{ {
@ -121,7 +117,6 @@ class Handler extends ExceptionHandler
dispatch($job); dispatch($job);
} }
parent::report($exception); parent::report($exception);
} }
} }

View File

@ -18,18 +18,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Exceptions; namespace FireflyIII\Exceptions;
/** /**
* Class NotImplementedException * Class NotImplementedException.
*
* @package FireflyIII\Exceptions
*/ */
class NotImplementedException extends \Exception class NotImplementedException extends \Exception
{ {
}
}

View File

@ -18,17 +18,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Exceptions; namespace FireflyIII\Exceptions;
/** /**
* Class ValidationExceptions * Class ValidationExceptions.
*
* @package FireflyIII\Exception
*/ */
class ValidationException extends \Exception class ValidationException extends \Exception
{ {
}
}

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export\Collector; namespace FireflyIII\Export\Collector;
@ -33,19 +32,17 @@ use Log;
use Storage; use Storage;
/** /**
* Class AttachmentCollector * Class AttachmentCollector.
*
* @package FireflyIII\Export\Collector
*/ */
class AttachmentCollector extends BasicCollector implements CollectorInterface class AttachmentCollector extends BasicCollector implements CollectorInterface
{ {
/** @var Carbon */ /** @var Carbon */
private $end; private $end;
/** @var \Illuminate\Contracts\Filesystem\Filesystem */ /** @var \Illuminate\Contracts\Filesystem\Filesystem */
private $exportDisk; private $exportDisk;
/** @var AttachmentRepositoryInterface */ /** @var AttachmentRepositoryInterface */
private $repository; private $repository;
/** @var Carbon */ /** @var Carbon */
private $start; private $start;
/** @var \Illuminate\Contracts\Filesystem\Filesystem */ /** @var \Illuminate\Contracts\Filesystem\Filesystem */
private $uploadDisk; private $uploadDisk;
@ -55,7 +52,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
*/ */
public function __construct() public function __construct()
{ {
/** @var AttachmentRepositoryInterface repository */ // @var AttachmentRepositoryInterface repository
$this->repository = app(AttachmentRepositoryInterface::class); $this->repository = app(AttachmentRepositoryInterface::class);
// make storage: // make storage:
$this->uploadDisk = Storage::disk('upload'); $this->uploadDisk = Storage::disk('upload');
@ -104,11 +101,9 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
$exportFile = $this->exportFileName($attachment); $exportFile = $this->exportFileName($attachment);
$this->exportDisk->put($exportFile, $decrypted); $this->exportDisk->put($exportFile, $decrypted);
$this->getEntries()->push($exportFile); $this->getEntries()->push($exportFile);
} catch (DecryptException $e) { } catch (DecryptException $e) {
Log::error('Catchable error: could not decrypt attachment #' . $attachment->id . ' because: ' . $e->getMessage()); Log::error('Catchable error: could not decrypt attachment #' . $attachment->id . ' because: ' . $e->getMessage());
} }
} }
return true; return true;
@ -123,7 +118,6 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
*/ */
private function exportFileName($attachment): string 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, strval($attachment->id), $attachment->filename);
} }

View File

@ -18,26 +18,22 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export\Collector; namespace FireflyIII\Export\Collector;
use FireflyIII\Models\ExportJob; use FireflyIII\Models\ExportJob;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class BasicCollector * Class BasicCollector.
*
* @package FireflyIII\Export\Collector
*/ */
class BasicCollector class BasicCollector
{ {
/** @var ExportJob */ /** @var ExportJob */
protected $job; protected $job;
/** @var User */ /** @var User */
protected $user; protected $user;
/** @var Collection */ /** @var Collection */
private $entries; private $entries;
@ -82,6 +78,4 @@ class BasicCollector
{ {
$this->user = $user; $this->user = $user;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export\Collector; namespace FireflyIII\Export\Collector;
@ -27,9 +26,7 @@ use FireflyIII\Models\ExportJob;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface CollectorInterface * Interface CollectorInterface.
*
* @package FireflyIII\Export\Collector
*/ */
interface CollectorInterface interface CollectorInterface
{ {
@ -45,9 +42,6 @@ interface CollectorInterface
/** /**
* @param Collection $entries * @param Collection $entries
*
* @return void
*
*/ */
public function setEntries(Collection $entries); public function setEntries(Collection $entries);
@ -57,5 +51,4 @@ interface CollectorInterface
* @return mixed * @return mixed
*/ */
public function setJob(ExportJob $job); public function setJob(ExportJob $job);
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export\Collector; namespace FireflyIII\Export\Collector;
@ -30,9 +29,7 @@ use Log;
use Storage; use Storage;
/** /**
* Class UploadCollector * Class UploadCollector.
*
* @package FireflyIII\Export\Collector
*/ */
class UploadCollector extends BasicCollector implements CollectorInterface class UploadCollector extends BasicCollector implements CollectorInterface
{ {
@ -94,7 +91,7 @@ class UploadCollector extends BasicCollector implements CollectorInterface
{ {
// find job associated with import file: // find job associated with import file:
$job = $this->job->user->importJobs()->where('key', $key)->first(); $job = $this->job->user->importJobs()->where('key', $key)->first();
if (is_null($job)) { if (null === $job) {
return false; return false;
} }
@ -116,5 +113,4 @@ class UploadCollector extends BasicCollector implements CollectorInterface
return true; return true;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export\Entry; namespace FireflyIII\Export\Entry;
@ -27,7 +26,7 @@ use FireflyIII\Models\Transaction;
/** /**
* To extend the exported object, in case of new features in Firefly III for example, * To extend the exported object, in case of new features in Firefly III for example,
* do the following: * do the following:.
* *
* - Add the field(s) to this class. If you add more than one related field, add a new object. * - Add the field(s) to this class. If you add more than one related field, add a new object.
* - Make sure the "fromJournal"-routine fills these fields. * - Make sure the "fromJournal"-routine fills these fields.
@ -39,10 +38,9 @@ use FireflyIII\Models\Transaction;
* *
* *
* Class Entry * Class Entry
*
* @SuppressWarnings(PHPMD.LongVariable) * @SuppressWarnings(PHPMD.LongVariable)
* @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.TooManyFields)
*
* @package FireflyIII\Export\Entry
*/ */
final class Entry final class Entry
{ {
@ -84,7 +82,10 @@ final class Entry
public $bill_name; public $bill_name;
public $notes; public $notes;
public $tags; public $tags;
// @formatter:on // @formatter:on
/** /**
@ -106,7 +107,7 @@ final class Entry
*/ */
public static function fromTransaction(Transaction $transaction): Entry public static function fromTransaction(Transaction $transaction): Entry
{ {
$entry = new self; $entry = new self();
$entry->journal_id = $transaction->journal_id; $entry->journal_id = $transaction->journal_id;
$entry->transaction_id = $transaction->id; $entry->transaction_id = $transaction->id;
$entry->date = $transaction->date->format('Ymd'); $entry->date = $transaction->date->format('Ymd');
@ -117,12 +118,13 @@ final class Entry
$entry->currency_code = $transaction->transactionCurrency->code; $entry->currency_code = $transaction->transactionCurrency->code;
$entry->amount = round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places); $entry->amount = round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places);
$entry->foreign_currency_code = is_null($transaction->foreign_currency_id) ? null : $transaction->foreignCurrency->code; $entry->foreign_currency_code = null === $transaction->foreign_currency_id ? null : $transaction->foreignCurrency->code;
$entry->foreign_amount = is_null($transaction->foreign_currency_id) $entry->foreign_amount = null === $transaction->foreign_currency_id
? null ? null
: strval( : strval(
round( round(
$transaction->transaction_foreign_amount, $transaction->foreignCurrency->decimal_places $transaction->transaction_foreign_amount,
$transaction->foreignCurrency->decimal_places
) )
); );
@ -141,23 +143,23 @@ final class Entry
$entry->opposing_account_bic = $transaction->opposing_account_bic; $entry->opposing_account_bic = $transaction->opposing_account_bic;
$entry->opposing_currency_code = $transaction->opposing_currency_code; $entry->opposing_currency_code = $transaction->opposing_currency_code;
/** budget */ // budget
$entry->budget_id = $transaction->transaction_budget_id; $entry->budget_id = $transaction->transaction_budget_id;
$entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_budget_name); $entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_budget_name);
if (is_null($transaction->transaction_budget_id)) { if (null === $transaction->transaction_budget_id) {
$entry->budget_id = $transaction->transaction_journal_budget_id; $entry->budget_id = $transaction->transaction_journal_budget_id;
$entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_journal_budget_name); $entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_journal_budget_name);
} }
/** category */ // category
$entry->category_id = $transaction->transaction_category_id; $entry->category_id = $transaction->transaction_category_id;
$entry->category_name = app('steam')->tryDecrypt($transaction->transaction_category_name); $entry->category_name = app('steam')->tryDecrypt($transaction->transaction_category_name);
if (is_null($transaction->transaction_category_id)) { if (null === $transaction->transaction_category_id) {
$entry->category_id = $transaction->transaction_journal_category_id; $entry->category_id = $transaction->transaction_journal_category_id;
$entry->category_name = app('steam')->tryDecrypt($transaction->transaction_journal_category_name); $entry->category_name = app('steam')->tryDecrypt($transaction->transaction_journal_category_name);
} }
/** budget */ // budget
$entry->bill_id = $transaction->bill_id; $entry->bill_id = $transaction->bill_id;
$entry->bill_name = app('steam')->tryDecrypt($transaction->bill_name); $entry->bill_name = app('steam')->tryDecrypt($transaction->bill_name);
@ -166,6 +168,4 @@ final class Entry
return $entry; return $entry;
} }
} }

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export; namespace FireflyIII\Export;
use Crypt; use Crypt;
use DB; use DB;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@ -43,32 +41,29 @@ use Storage;
use ZipArchive; use ZipArchive;
/** /**
* Class ExpandedProcessor * Class ExpandedProcessor.
* *
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) // its doing a lot. * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // its doing a lot.
*
* @package FireflyIII\Export
*/ */
class ExpandedProcessor implements ProcessorInterface class ExpandedProcessor implements ProcessorInterface
{ {
/** @var Collection */ /** @var Collection */
public $accounts; public $accounts;
/** @var string */ /** @var string */
public $exportFormat; public $exportFormat;
/** @var bool */ /** @var bool */
public $includeAttachments; public $includeAttachments;
/** @var bool */ /** @var bool */
public $includeOldUploads; public $includeOldUploads;
/** @var ExportJob */ /** @var ExportJob */
public $job; public $job;
/** @var array */ /** @var array */
public $settings; public $settings;
/** @var Collection */ /** @var Collection */
private $exportEntries; private $exportEntries;
/** @var Collection */ /** @var Collection */
private $files; private $files;
/** @var Collection */ /** @var Collection */
private $journals; private $journals;
/** /**
@ -136,7 +131,6 @@ class ExpandedProcessor implements ProcessorInterface
$transaction->opposing_account_number = $ibans[$opposingId]['accountNumber'] ?? ''; $transaction->opposing_account_number = $ibans[$opposingId]['accountNumber'] ?? '';
$transaction->opposing_account_bic = $ibans[$opposingId]['BIC'] ?? ''; $transaction->opposing_account_bic = $ibans[$opposingId]['BIC'] ?? '';
$transaction->opposing_currency_code = $currencies[$opposingCurrencyId] ?? ''; $transaction->opposing_currency_code = $currencies[$opposingCurrencyId] ?? '';
} }
); );
@ -177,6 +171,7 @@ class ExpandedProcessor implements ProcessorInterface
/** /**
* @return bool * @return bool
*
* @throws FireflyException * @throws FireflyException
*/ */
public function createZipFile(): bool public function createZipFile(): bool
@ -185,7 +180,7 @@ class ExpandedProcessor implements ProcessorInterface
$file = $this->job->key . '.zip'; $file = $this->job->key . '.zip';
$fullPath = storage_path('export') . '/' . $file; $fullPath = storage_path('export') . '/' . $file;
if ($zip->open($fullPath, ZipArchive::CREATE) !== true) { if (true !== $zip->open($fullPath, ZipArchive::CREATE)) {
throw new FireflyException('Cannot store zip file.'); throw new FireflyException('Cannot store zip file.');
} }
// for each file in the collection, add it to the zip file. // for each file in the collection, add it to the zip file.
@ -280,7 +275,7 @@ class ExpandedProcessor implements ProcessorInterface
} }
/** /**
* Get all IBAN / SWIFT / account numbers * Get all IBAN / SWIFT / account numbers.
* *
* @param array $array * @param array $array
* *

View File

@ -18,23 +18,19 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export\Exporter; namespace FireflyIII\Export\Exporter;
use FireflyIII\Models\ExportJob; use FireflyIII\Models\ExportJob;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class BasicExporter * Class BasicExporter.
*
* @package FireflyIII\Export\Exporter
*/ */
class BasicExporter class BasicExporter
{ {
/** @var ExportJob */ /** @var ExportJob */
protected $job; protected $job;
/** @var Collection */ /** @var Collection */
private $entries; private $entries;
@ -70,6 +66,4 @@ class BasicExporter
{ {
$this->job = $job; $this->job = $job;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export\Exporter; namespace FireflyIII\Export\Exporter;
@ -28,13 +27,11 @@ use League\Csv\Writer;
use SplFileObject; use SplFileObject;
/** /**
* Class CsvExporter * Class CsvExporter.
*
* @package FireflyIII\Export\Exporter
*/ */
class CsvExporter extends BasicExporter implements ExporterInterface class CsvExporter extends BasicExporter implements ExporterInterface
{ {
/** @var string */ /** @var string */
private $fileName; private $fileName;
/** /**
@ -69,7 +66,7 @@ class CsvExporter extends BasicExporter implements ExporterInterface
// get field names for header row: // get field names for header row:
$first = $this->getEntries()->first(); $first = $this->getEntries()->first();
$headers = []; $headers = [];
if (!is_null($first)) { if (null !== $first) {
$headers = array_keys(get_object_vars($first)); $headers = array_keys(get_object_vars($first));
} }
@ -88,7 +85,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface
return true; return true;
} }
private function tempFile() private function tempFile()
{ {
$this->fileName = $this->job->key . '-records.csv'; $this->fileName = $this->job->key . '-records.csv';

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export\Exporter; namespace FireflyIII\Export\Exporter;
@ -27,9 +26,7 @@ use FireflyIII\Models\ExportJob;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface ExporterInterface * Interface ExporterInterface.
*
* @package FireflyIII\Export\Exporter
*/ */
interface ExporterInterface interface ExporterInterface
{ {
@ -50,9 +47,6 @@ interface ExporterInterface
/** /**
* @param Collection $entries * @param Collection $entries
*
* @return void
*
*/ */
public function setEntries(Collection $entries); public function setEntries(Collection $entries);
@ -60,5 +54,4 @@ interface ExporterInterface
* @param ExportJob $job * @param ExportJob $job
*/ */
public function setJob(ExportJob $job); public function setJob(ExportJob $job);
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Export; namespace FireflyIII\Export;
@ -26,13 +25,10 @@ namespace FireflyIII\Export;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface ProcessorInterface * Interface ProcessorInterface.
*
* @package FireflyIII\Export
*/ */
interface ProcessorInterface interface ProcessorInterface
{ {
/** /**
* Processor constructor. * Processor constructor.
*/ */

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Chart\Basic; namespace FireflyIII\Generator\Chart\Basic;
@ -27,15 +26,12 @@ use FireflyIII\Support\ChartColour;
use Steam; use Steam;
/** /**
* Class ChartJsGenerator * Class ChartJsGenerator.
*
* @package FireflyIII\Generator\Chart\Basic
*/ */
class ChartJsGenerator implements GeneratorInterface class ChartJsGenerator implements GeneratorInterface
{ {
/** /**
* Will generate a Chart JS compatible array from the given input. Expects this format * Will generate a Chart JS compatible array from the given input. Expects this format.
* *
* Will take labels for all from first set. * Will take labels for all from first set.
* *
@ -102,7 +98,7 @@ class ChartJsGenerator implements GeneratorInterface
} }
/** /**
* Expects data as: * Expects data as:.
* *
* key => value * key => value
* *
@ -123,7 +119,7 @@ class ChartJsGenerator implements GeneratorInterface
// different sort when values are positive and when they're negative. // different sort when values are positive and when they're negative.
asort($data); asort($data);
$next = next($data); $next = next($data);
if (!is_bool($next) && bccomp($next, '0') === 1) { if (!is_bool($next) && 1 === bccomp($next, '0')) {
// next is positive, sort other way around. // next is positive, sort other way around.
arsort($data); arsort($data);
} }
@ -131,19 +127,18 @@ class ChartJsGenerator implements GeneratorInterface
$index = 0; $index = 0;
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
// make larger than 0 // make larger than 0
$chartData['datasets'][0]['data'][] = floatval(Steam::positive($value)); $chartData['datasets'][0]['data'][] = floatval(Steam::positive($value));
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index); $chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
$chartData['labels'][] = $key; $chartData['labels'][] = $key;
$index++; ++$index;
} }
return $chartData; return $chartData;
} }
/** /**
* Will generate a (ChartJS) compatible array from the given input. Expects this format: * Will generate a (ChartJS) compatible array from the given input. Expects this format:.
* *
* 'label-of-entry' => value * 'label-of-entry' => value
* 'label-of-entry' => value * 'label-of-entry' => value

View File

@ -18,21 +18,17 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Chart\Basic; namespace FireflyIII\Generator\Chart\Basic;
/** /**
* Interface GeneratorInterface * Interface GeneratorInterface.
*
* @package FireflyIII\Generator\Chart\Basic
*/ */
interface GeneratorInterface interface GeneratorInterface
{ {
/** /**
* Will generate a Chart JS compatible array from the given input. Expects this format * Will generate a Chart JS compatible array from the given input. Expects this format.
* *
* Will take labels for all from first set. * Will take labels for all from first set.
* *
@ -66,7 +62,7 @@ interface GeneratorInterface
public function multiSet(array $data): array; public function multiSet(array $data): array;
/** /**
* Expects data as: * Expects data as:.
* *
* key => value * key => value
* *
@ -77,7 +73,7 @@ interface GeneratorInterface
public function pieChart(array $data): array; public function pieChart(array $data): array;
/** /**
* Will generate a (ChartJS) compatible array from the given input. Expects this format: * Will generate a (ChartJS) compatible array from the given input. Expects this format:.
* *
* 'label-of-entry' => value * 'label-of-entry' => value
* 'label-of-entry' => value * 'label-of-entry' => value
@ -88,5 +84,4 @@ interface GeneratorInterface
* @return array * @return array
*/ */
public function singleSet(string $setLabel, array $data): array; public function singleSet(string $setLabel, array $data): array;
} }

View File

@ -18,33 +18,28 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Audit; namespace FireflyIII\Generator\Report\Audit;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\Transaction;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Steam; use Steam;
/** /**
* Class MonthReportGenerator * Class MonthReportGenerator.
*
* @package FireflyIII\Generator\Report\Audit
*/ */
class MonthReportGenerator implements ReportGeneratorInterface class MonthReportGenerator implements ReportGeneratorInterface
{ {
/** @var Collection */ /** @var Collection */
private $accounts; private $accounts;
/** @var Carbon */ /** @var Carbon */
private $end; private $end;
/** @var Carbon */ /** @var Carbon */
private $start; private $start;
/** /**
@ -52,8 +47,6 @@ class MonthReportGenerator implements ReportGeneratorInterface
*/ */
public function generate(): string public function generate(): string
{ {
$auditData = []; $auditData = [];
$dayBefore = clone $this->start; $dayBefore = clone $this->start;
$dayBefore->subDay(); $dayBefore->subDay();
@ -77,11 +70,9 @@ class MonthReportGenerator implements ReportGeneratorInterface
'create_date', 'update_date', 'create_date', 'update_date',
]; ];
return view('reports.audit.report', compact('reportType', 'accountIds', 'auditData', 'hideable', 'defaultShow')) return view('reports.audit.report', compact('reportType', 'accountIds', 'auditData', 'hideable', 'defaultShow'))
->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts) ->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts)
->render(); ->render();
} }
/** /**
@ -157,7 +148,6 @@ class MonthReportGenerator implements ReportGeneratorInterface
* @return array * @return array
* *
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // not that long * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // not that long
*
*/ */
private function getAuditReport(Account $account, Carbon $date): array private function getAuditReport(Account $account, Carbon $date): array
{ {
@ -173,7 +163,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
$startBalance = $dayBeforeBalance; $startBalance = $dayBeforeBalance;
$currency = $currencyRepos->find(intval($account->getMeta('currency_id'))); $currency = $currencyRepos->find(intval($account->getMeta('currency_id')));
/** @var Transaction $journal */ // @var Transaction $journal
foreach ($journals as $transaction) { foreach ($journals as $transaction) {
$transaction->before = $startBalance; $transaction->before = $startBalance;
$transactionAmount = $transaction->transaction_amount; $transactionAmount = $transaction->transaction_amount;

View File

@ -18,20 +18,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Audit; namespace FireflyIII\Generator\Report\Audit;
/** /**
* Class MultiYearReportGenerator * Class MultiYearReportGenerator.
*
* @package FireflyIII\Generator\Report\Audit
*/ */
class MultiYearReportGenerator extends MonthReportGenerator class MultiYearReportGenerator extends MonthReportGenerator
{ {
/** // Doesn't do anything different.
* Doesn't do anything different.
*/
} }

View File

@ -18,21 +18,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Audit; namespace FireflyIII\Generator\Report\Audit;
/** /**
* Class YearReportGenerator * Class YearReportGenerator.
*
* @package FireflyIII\Generator\Report\Audit
*/ */
class YearReportGenerator extends MonthReportGenerator class YearReportGenerator extends MonthReportGenerator
{ {
// Doesn't do anything different.
/**
* Doesn't do anything different.
*/
} }

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Budget; namespace FireflyIII\Generator\Report\Budget;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Generator\Report\Support; use FireflyIII\Generator\Report\Support;
@ -37,23 +35,21 @@ use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class MonthReportGenerator * Class MonthReportGenerator.
*
* @package FireflyIII\Generator\Report\Budget
*/ */
class MonthReportGenerator extends Support implements ReportGeneratorInterface class MonthReportGenerator extends Support implements ReportGeneratorInterface
{ {
/** @var Collection */ /** @var Collection */
private $accounts; private $accounts;
/** @var Collection */ /** @var Collection */
private $budgets; private $budgets;
/** @var Carbon */ /** @var Carbon */
private $end; private $end;
/** @var Collection */ /** @var Collection */
private $expenses; private $expenses;
/** @var Collection */ /** @var Collection */
private $income; private $income;
/** @var Carbon */ /** @var Carbon */
private $start; private $start;
/** /**

View File

@ -18,20 +18,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Budget; namespace FireflyIII\Generator\Report\Budget;
/** /**
* Class MultiYearReportGenerator * Class MultiYearReportGenerator.
*
* @package FireflyIII\Generator\Report\Budget
*/ */
class MultiYearReportGenerator extends MonthReportGenerator class MultiYearReportGenerator extends MonthReportGenerator
{ {
/** // Doesn't do anything different.
* Doesn't do anything different.
*/
} }

View File

@ -18,21 +18,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Budget; namespace FireflyIII\Generator\Report\Budget;
/** /**
* Class YearReportGenerator * Class YearReportGenerator.
*
* @package FireflyIII\Generator\Report\Budget
*/ */
class YearReportGenerator extends MonthReportGenerator class YearReportGenerator extends MonthReportGenerator
{ {
// Doesn't do anything different.
/**
* Doesn't do anything different.
*/
} }

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Category; namespace FireflyIII\Generator\Report\Category;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Generator\Report\Support; use FireflyIII\Generator\Report\Support;
@ -38,23 +36,21 @@ use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class MonthReportGenerator * Class MonthReportGenerator.
*
* @package FireflyIII\Generator\Report\Category
*/ */
class MonthReportGenerator extends Support implements ReportGeneratorInterface class MonthReportGenerator extends Support implements ReportGeneratorInterface
{ {
/** @var Collection */ /** @var Collection */
private $accounts; private $accounts;
/** @var Collection */ /** @var Collection */
private $categories; private $categories;
/** @var Carbon */ /** @var Carbon */
private $end; private $end;
/** @var Collection */ /** @var Collection */
private $expenses; private $expenses;
/** @var Collection */ /** @var Collection */
private $income; private $income;
/** @var Carbon */ /** @var Carbon */
private $start; private $start;
/** /**
@ -83,12 +79,19 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
$topExpenses = $this->getTopExpenses(); $topExpenses = $this->getTopExpenses();
$topIncome = $this->getTopIncome(); $topIncome = $this->getTopIncome();
// render! // render!
return view( return view(
'reports.category.month', 'reports.category.month',
compact( compact(
'accountIds', 'categoryIds', 'topIncome', 'reportType', 'accountSummary', 'categorySummary', 'averageExpenses', 'averageIncome', 'topExpenses' 'accountIds',
'categoryIds',
'topIncome',
'reportType',
'accountSummary',
'categorySummary',
'averageExpenses',
'averageIncome',
'topExpenses'
) )
) )
->with('start', $this->start)->with('end', $this->end) ->with('start', $this->start)->with('end', $this->end)

View File

@ -18,20 +18,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Category; namespace FireflyIII\Generator\Report\Category;
/** /**
* Class MultiYearReportGenerator * Class MultiYearReportGenerator.
*
* @package FireflyIII\Generator\Report\Category
*/ */
class MultiYearReportGenerator extends MonthReportGenerator class MultiYearReportGenerator extends MonthReportGenerator
{ {
/** // Doesn't do anything different.
* Doesn't do anything different.
*/
} }

View File

@ -18,21 +18,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Category; namespace FireflyIII\Generator\Report\Category;
/** /**
* Class YearReportGenerator * Class YearReportGenerator.
*
* @package FireflyIII\Generator\Report\Category
*/ */
class YearReportGenerator extends MonthReportGenerator class YearReportGenerator extends MonthReportGenerator
{ {
// Doesn't do anything different.
/**
* Doesn't do anything different.
*/
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report; namespace FireflyIII\Generator\Report;
@ -27,19 +26,17 @@ use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
/** /**
* Class ReportGeneratorFactory * Class ReportGeneratorFactory.
*
* @package FireflyIII\Generator\Report
*/ */
class ReportGeneratorFactory class ReportGeneratorFactory
{ {
/** /**
* @param string $type * @param string $type
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* *
* @return ReportGeneratorInterface * @return ReportGeneratorInterface
*
* @throws FireflyException * @throws FireflyException
*/ */
public static function reportGenerator(string $type, Carbon $start, Carbon $end): ReportGeneratorInterface public static function reportGenerator(string $type, Carbon $start, Carbon $end): ReportGeneratorInterface
@ -55,7 +52,6 @@ class ReportGeneratorFactory
$period = 'MultiYear'; $period = 'MultiYear';
} }
$class = sprintf('FireflyIII\Generator\Report\%s\%sReportGenerator', $type, $period); $class = sprintf('FireflyIII\Generator\Report\%s\%sReportGenerator', $type, $period);
if (class_exists($class)) { if (class_exists($class)) {
/** @var ReportGeneratorInterface $obj */ /** @var ReportGeneratorInterface $obj */

View File

@ -18,19 +18,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report; namespace FireflyIII\Generator\Report;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface ReportGeneratorInterface * Interface ReportGeneratorInterface.
*
* @package FireflyIII\Generator\Report
*/ */
interface ReportGeneratorInterface interface ReportGeneratorInterface
{ {
@ -80,5 +76,4 @@ interface ReportGeneratorInterface
* @return ReportGeneratorInterface * @return ReportGeneratorInterface
*/ */
public function setTags(Collection $tags): ReportGeneratorInterface; public function setTags(Collection $tags): ReportGeneratorInterface;
} }

View File

@ -18,29 +18,25 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Standard; namespace FireflyIII\Generator\Report\Standard;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Helpers\Report\ReportHelperInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class MonthReportGenerator * Class MonthReportGenerator.
*
* @package FireflyIII\Generator\Report\Standard
*/ */
class MonthReportGenerator implements ReportGeneratorInterface class MonthReportGenerator implements ReportGeneratorInterface
{ {
/** @var Collection */ /** @var Collection */
private $accounts; private $accounts;
/** @var Carbon */ /** @var Carbon */
private $end; private $end;
/** @var Carbon */ /** @var Carbon */
private $start; private $start;
/** /**

View File

@ -18,28 +18,24 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Standard; namespace FireflyIII\Generator\Report\Standard;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class MonthReportGenerator * Class MonthReportGenerator.
*
* @package FireflyIII\Generator\Report\Standard
*/ */
class MultiYearReportGenerator implements ReportGeneratorInterface class MultiYearReportGenerator implements ReportGeneratorInterface
{ {
/** @var Collection */ /** @var Collection */
private $accounts; private $accounts;
/** @var Carbon */ /** @var Carbon */
private $end; private $end;
/** @var Carbon */ /** @var Carbon */
private $start; private $start;
/** /**

View File

@ -18,28 +18,24 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Standard; namespace FireflyIII\Generator\Report\Standard;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class MonthReportGenerator * Class MonthReportGenerator.
*
* @package FireflyIII\Generator\Report\Standard
*/ */
class YearReportGenerator implements ReportGeneratorInterface class YearReportGenerator implements ReportGeneratorInterface
{ {
/** @var Collection */ /** @var Collection */
private $accounts; private $accounts;
/** @var Carbon */ /** @var Carbon */
private $end; private $end;
/** @var Carbon */ /** @var Carbon */
private $start; private $start;
/** /**

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report; namespace FireflyIII\Generator\Report;
@ -26,11 +25,8 @@ namespace FireflyIII\Generator\Report;
use FireflyIII\Models\Transaction; use FireflyIII\Models\Transaction;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class Support * Class Support.
*
* @package FireflyIII\Generator\Report\Category
*/ */
class Support class Support
{ {
@ -80,7 +76,7 @@ class Support
]; ];
continue; continue;
} }
$result[$opposingId]['count']++; ++$result[$opposingId]['count'];
$result[$opposingId]['sum'] = bcadd($result[$opposingId]['sum'], $transaction->transaction_amount); $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'], strval($result[$opposingId]['count']));
} }
@ -98,6 +94,7 @@ class Support
/** /**
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five.
*
* @param array $spent * @param array $spent
* @param array $earned * @param array $earned
* *
@ -108,7 +105,7 @@ class Support
$return = []; $return = [];
/** /**
* @var int $accountId * @var int
* @var string $entry * @var string $entry
*/ */
foreach ($spent as $objectId => $entry) { foreach ($spent as $objectId => $entry) {
@ -121,7 +118,7 @@ class Support
unset($entry); unset($entry);
/** /**
* @var int $accountId * @var int
* @var string $entry * @var string $entry
*/ */
foreach ($earned as $objectId => $entry) { foreach ($earned as $objectId => $entry) {
@ -132,7 +129,6 @@ class Support
$return[$objectId]['earned'] = $entry; $return[$objectId]['earned'] = $entry;
} }
return $return; return $return;
} }
@ -153,5 +149,4 @@ class Support
return $result; return $result;
} }
} }

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Tag; namespace FireflyIII\Generator\Report\Tag;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Generator\Report\Support; use FireflyIII\Generator\Report\Support;
@ -39,22 +37,19 @@ use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class MonthReportGenerator * Class MonthReportGenerator.
*
* @package FireflyIII\Generator\Report\Tag
*/ */
class MonthReportGenerator extends Support implements ReportGeneratorInterface class MonthReportGenerator extends Support implements ReportGeneratorInterface
{ {
/** @var Collection */ /** @var Collection */
private $accounts; private $accounts;
/** @var Carbon */ /** @var Carbon */
private $end; private $end;
/** @var Collection */ /** @var Collection */
private $expenses; private $expenses;
/** @var Collection */ /** @var Collection */
private $income; private $income;
/** @var Carbon */ /** @var Carbon */
private $start; private $start;
/** @var Collection */ /** @var Collection */
private $tags; private $tags;
@ -85,13 +80,20 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
$topExpenses = $this->getTopExpenses(); $topExpenses = $this->getTopExpenses();
$topIncome = $this->getTopIncome(); $topIncome = $this->getTopIncome();
// render! // render!
return view( return view(
'reports.tag.month', compact( 'reports.tag.month',
'accountIds', 'tagTags', 'reportType', 'accountSummary', 'tagSummary', 'averageExpenses', 'averageIncome', 'topIncome', compact(
'topExpenses' 'accountIds',
) 'tagTags',
'reportType',
'accountSummary',
'tagSummary',
'averageExpenses',
'averageIncome',
'topIncome',
'topExpenses'
)
)->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render(); )->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render();
} }

View File

@ -18,20 +18,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Tag; namespace FireflyIII\Generator\Report\Tag;
/** /**
* Class MultiYearReportGenerator * Class MultiYearReportGenerator.
*
* @package FireflyIII\Generator\Report\Tag
*/ */
class MultiYearReportGenerator extends MonthReportGenerator class MultiYearReportGenerator extends MonthReportGenerator
{ {
/** // Doesn't do anything different.
* Doesn't do anything different.
*/
} }

View File

@ -18,21 +18,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Generator\Report\Tag; namespace FireflyIII\Generator\Report\Tag;
/** /**
* Class YearReportGenerator * Class YearReportGenerator.
*
* @package FireflyIII\Generator\Report\Tag
*/ */
class YearReportGenerator extends MonthReportGenerator class YearReportGenerator extends MonthReportGenerator
{ {
// Doesn't do anything different.
/**
* Doesn't do anything different.
*/
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
@ -31,20 +30,19 @@ use Session;
use Swift_TransportException; use Swift_TransportException;
/** /**
* Class AdminEventHandler * Class AdminEventHandler.
*
* @package FireflyIII\Handlers\Events
*/ */
class AdminEventHandler class AdminEventHandler
{ {
/** /**
* Sends a test message to an administrator.
*
* @param AdminRequestedTestMessage $event * @param AdminRequestedTestMessage $event
* *
* @return bool * @return bool
*/ */
public function sendTestMessage(AdminRequestedTestMessage $event): bool public function sendTestMessage(AdminRequestedTestMessage $event): bool
{ {
$email = $event->user->email; $email = $event->user->email;
$ipAddress = $event->ipAddress; $ipAddress = $event->ipAddress;
@ -64,4 +62,4 @@ class AdminEventHandler
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
return true; return true;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
@ -37,17 +36,15 @@ use Log;
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* Class StoredJournalEventHandler * Class StoredJournalEventHandler
*
* @package FireflyIII\Handlers\Events
*/ */
class StoredJournalEventHandler class StoredJournalEventHandler
{ {
/** @var JRI */ /** @var JRI */
public $journalRepository; public $journalRepository;
/** @var PRI */ /** @var PRI */
public $repository; public $repository;
/** @var RGRI */ /** @var RGRI */
public $ruleGroupRepository; public $ruleGroupRepository;
/** /**
@ -88,7 +85,7 @@ class StoredJournalEventHandler
} }
// piggy exists? // piggy exists?
if (is_null($piggyBank->id)) { if (null === $piggyBank->id) {
Log::error(sprintf('There is no piggy bank with ID #%d', $piggyBankId)); Log::error(sprintf('There is no piggy bank with ID #%d', $piggyBankId));
return true; return true;
@ -96,7 +93,7 @@ class StoredJournalEventHandler
// repetition exists? // repetition exists?
$repetition = $this->repository->getRepetition($piggyBank, $journal->date); $repetition = $this->repository->getRepetition($piggyBank, $journal->date);
if (is_null($repetition->id)) { if (null === $repetition->id) {
Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d'))); Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d')));
return true; return true;
@ -104,7 +101,7 @@ class StoredJournalEventHandler
// get the amount // get the amount
$amount = $this->repository->getExactAmount($piggyBank, $repetition, $journal); $amount = $this->repository->getExactAmount($piggyBank, $repetition, $journal);
if (bccomp($amount, '0') === 0) { if (0 === bccomp($amount, '0')) {
Log::debug('Amount is zero, will not create event.'); Log::debug('Amount is zero, will not create event.');
return true; return true;
@ -137,7 +134,6 @@ class StoredJournalEventHandler
$rules = $this->ruleGroupRepository->getActiveStoreRules($group); $rules = $this->ruleGroupRepository->getActiveStoreRules($group);
/** @var Rule $rule */ /** @var Rule $rule */
foreach ($rules as $rule) { foreach ($rules as $rule) {
$processor = Processor::make($rule); $processor = Processor::make($rule);
$processor->handleTransactionJournal($journal); $processor->handleTransactionJournal($journal);

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\UpdatedTransactionJournal; use FireflyIII\Events\UpdatedTransactionJournal;
use FireflyIII\Models\Rule; use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleGroup; use FireflyIII\Models\RuleGroup;
@ -35,12 +33,10 @@ use FireflyIII\TransactionRules\Processor;
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* Class UpdatedJournalEventHandler * Class UpdatedJournalEventHandler
*
* @package FireflyIII\Handlers\Events
*/ */
class UpdatedJournalEventHandler class UpdatedJournalEventHandler
{ {
/** @var RuleGroupRepositoryInterface */ /** @var RuleGroupRepositoryInterface */
public $repository; public $repository;
/** /**
@ -77,7 +73,6 @@ class UpdatedJournalEventHandler
if ($rule->stop_processing) { if ($rule->stop_processing) {
break; break;
} }
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Handlers\Events; namespace FireflyIII\Handlers\Events;
@ -37,17 +36,14 @@ use Preferences;
use Swift_TransportException; use Swift_TransportException;
/** /**
* Class UserEventHandler * Class UserEventHandler.
* *
* This class responds to any events that have anything to do with the User object. * This class responds to any events that have anything to do with the User object.
* *
* The method name reflects what is being done. This is in the present tense. * The method name reflects what is being done. This is in the present tense.
*
* @package FireflyIII\Handlers\Events
*/ */
class UserEventHandler class UserEventHandler
{ {
/** /**
* This method will bestow upon a user the "owner" role if he is the first user in the system. * This method will bestow upon a user the "owner" role if he is the first user in the system.
* *
@ -61,7 +57,7 @@ class UserEventHandler
$repository = app(UserRepositoryInterface::class); $repository = app(UserRepositoryInterface::class);
// first user ever? // first user ever?
if ($repository->count() === 1) { if (1 === $repository->count()) {
$repository->attachRole($event->user, 'owner'); $repository->attachRole($event->user, 'owner');
} }
@ -152,7 +148,6 @@ class UserEventHandler
*/ */
public function sendRegistrationMail(RegisteredUser $event) public function sendRegistrationMail(RegisteredUser $event)
{ {
$sendMail = env('SEND_REGISTRATION_MAIL', true); $sendMail = env('SEND_REGISTRATION_MAIL', true);
if (!$sendMail) { if (!$sendMail) {
return true; // @codeCoverageIgnore return true; // @codeCoverageIgnore

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Attachments; namespace FireflyIII\Helpers\Attachments;
@ -33,14 +32,11 @@ use Storage;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
/** /**
* Class AttachmentHelper * Class AttachmentHelper.
*
* @package FireflyIII\Helpers\Attachments
*/ */
class AttachmentHelper implements AttachmentHelperInterface class AttachmentHelper implements AttachmentHelperInterface
{ {
/** @var Collection */
/** @var Collection */
public $attachments; public $attachments;
/** @var MessageBag */ /** @var MessageBag */
public $errors; public $errors;
@ -111,10 +107,12 @@ class AttachmentHelper implements AttachmentHelperInterface
*/ */
public function saveAttachmentsForModel(Model $model, ?array $files): bool public function saveAttachmentsForModel(Model $model, ?array $files): bool
{ {
Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', get_class($model)));
if (is_array($files)) { if (is_array($files)) {
Log::debug('$files is an array.');
/** @var UploadedFile $entry */ /** @var UploadedFile $entry */
foreach ($files as $entry) { foreach ($files as $entry) {
if (!is_null($entry)) { if (null !== $entry) {
$this->processFile($entry, $model); $this->processFile($entry, $model);
} }
} }
@ -152,7 +150,6 @@ class AttachmentHelper implements AttachmentHelperInterface
} }
/** /**
*
* @param UploadedFile $file * @param UploadedFile $file
* @param Model $model * @param Model $model
* *
@ -160,8 +157,9 @@ class AttachmentHelper implements AttachmentHelperInterface
*/ */
protected function processFile(UploadedFile $file, Model $model): Attachment protected function processFile(UploadedFile $file, Model $model): Attachment
{ {
Log::debug('Now in processFile()');
$validation = $this->validateUpload($file, $model); $validation = $this->validateUpload($file, $model);
if ($validation === false) { if (false === $validation) {
return new Attachment; return new Attachment;
} }
@ -204,8 +202,11 @@ class AttachmentHelper implements AttachmentHelperInterface
*/ */
protected function validMime(UploadedFile $file): bool protected function validMime(UploadedFile $file): bool
{ {
Log::debug('Now in validMime()');
$mime = e($file->getMimeType()); $mime = e($file->getMimeType());
$name = e($file->getClientOriginalName()); $name = e($file->getClientOriginalName());
Log::debug(sprintf('Name is %, 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]); $msg = (string)trans('validation.file_invalid_mime', ['name' => $name, 'mime' => $mime]);
@ -248,6 +249,7 @@ class AttachmentHelper implements AttachmentHelperInterface
*/ */
protected function validateUpload(UploadedFile $file, Model $model): bool protected function validateUpload(UploadedFile $file, Model $model): bool
{ {
Log::debug('Now in validateUpload()');
if (!$this->validMime($file)) { if (!$this->validMime($file)) {
return false; return false;
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Attachments; namespace FireflyIII\Helpers\Attachments;
@ -29,13 +28,10 @@ use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag; use Illuminate\Support\MessageBag;
/** /**
* Interface AttachmentHelperInterface * Interface AttachmentHelperInterface.
*
* @package FireflyIII\Helpers\Attachments
*/ */
interface AttachmentHelperInterface interface AttachmentHelperInterface
{ {
/** /**
* @param Attachment $attachment * @param Attachment $attachment
* *
@ -60,11 +56,9 @@ interface AttachmentHelperInterface
/** /**
* @param Model $model * @param Model $model
*
* @param null|array $files * @param null|array $files
* *
* @return bool * @return bool
*/ */
public function saveAttachmentsForModel(Model $model, ?array $files): bool; public function saveAttachmentsForModel(Model $model, ?array $files): bool;
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Chart; namespace FireflyIII\Helpers\Chart;
@ -41,23 +40,19 @@ use Illuminate\Support\Collection;
use Steam; use Steam;
/** /**
* Class MetaPieChart * Class MetaPieChart.
*
* @package FireflyIII\Helpers\Chart
*
*
*/ */
class MetaPieChart implements MetaPieChartInterface class MetaPieChart implements MetaPieChartInterface
{ {
/** @var Collection */ /** @var Collection */
protected $accounts; protected $accounts;
/** @var Collection */ /** @var Collection */
protected $budgets; protected $budgets;
/** @var Collection */ /** @var Collection */
protected $categories; protected $categories;
/** @var bool */ /** @var bool */
protected $collectOtherObjects = false; protected $collectOtherObjects = false;
/** @var Carbon */ /** @var Carbon */
protected $end; protected $end;
/** @var array */ /** @var array */
protected $grouping protected $grouping
@ -75,13 +70,13 @@ class MetaPieChart implements MetaPieChartInterface
'category' => CategoryRepositoryInterface::class, 'category' => CategoryRepositoryInterface::class,
'tag' => TagRepositoryInterface::class, 'tag' => TagRepositoryInterface::class,
]; ];
/** @var Carbon */ /** @var Carbon */
protected $start; protected $start;
/** @var Collection */ /** @var Collection */
protected $tags; protected $tags;
/** @var string */ /** @var string */
protected $total = '0'; protected $total = '0';
/** @var User */ /** @var User */
protected $user; protected $user;
public function __construct() public function __construct()
@ -108,7 +103,7 @@ class MetaPieChart implements MetaPieChartInterface
$key = strval(trans('firefly.everything_else')); $key = strval(trans('firefly.everything_else'));
// also collect all other transactions // also collect all other transactions
if ($this->collectOtherObjects && $direction === 'expense') { if ($this->collectOtherObjects && 'expense' === $direction) {
/** @var JournalCollectorInterface $collector */ /** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class); $collector = app(JournalCollectorInterface::class);
$collector->setUser($this->user); $collector->setUser($this->user);
@ -121,7 +116,7 @@ class MetaPieChart implements MetaPieChartInterface
$chartData[$key] = $sum; $chartData[$key] = $sum;
} }
if ($this->collectOtherObjects && $direction === 'income') { if ($this->collectOtherObjects && 'income' === $direction) {
/** @var JournalCollectorInterface $collector */ /** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class); $collector = app(JournalCollectorInterface::class);
$collector->setUser($this->user); $collector->setUser($this->user);
@ -133,7 +128,6 @@ class MetaPieChart implements MetaPieChartInterface
} }
return $chartData; return $chartData;
} }
/** /**
@ -259,7 +253,7 @@ class MetaPieChart implements MetaPieChartInterface
$collector = app(JournalCollectorInterface::class); $collector = app(JournalCollectorInterface::class);
$types = [TransactionType::DEPOSIT, TransactionType::TRANSFER]; $types = [TransactionType::DEPOSIT, TransactionType::TRANSFER];
$collector->addFilter(NegativeAmountFilter::class); $collector->addFilter(NegativeAmountFilter::class);
if ($direction === 'expense') { if ('expense' === $direction) {
$types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER]; $types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
$collector->addFilter(PositiveAmountFilter::class); $collector->addFilter(PositiveAmountFilter::class);
$collector->removeFilter(NegativeAmountFilter::class); $collector->removeFilter(NegativeAmountFilter::class);
@ -272,7 +266,7 @@ class MetaPieChart implements MetaPieChartInterface
$collector->withOpposingAccount(); $collector->withOpposingAccount();
$collector->addFilter(OpposingAccountFilter::class); $collector->addFilter(OpposingAccountFilter::class);
if ($direction === 'income') { if ('income' === $direction) {
$collector->removeFilter(TransferFilter::class); $collector->removeFilter(TransferFilter::class);
} }
@ -295,11 +289,10 @@ class MetaPieChart implements MetaPieChartInterface
* @return array * @return array
* *
* @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/ */
protected function groupByFields(Collection $set, array $fields): array protected function groupByFields(Collection $set, array $fields): array
{ {
if (count($fields) === 0 && $this->tags->count() > 0) { if (0 === count($fields) && $this->tags->count() > 0) {
// do a special group on tags: // do a special group on tags:
return $this->groupByTag($set); return $this->groupByTag($set);
} }
@ -342,7 +335,6 @@ class MetaPieChart implements MetaPieChartInterface
} }
return $chartData; return $chartData;
} }
/** /**

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Chart; namespace FireflyIII\Helpers\Chart;
@ -28,9 +27,7 @@ use FireflyIII\User;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface MetaPieChartInterface * Interface MetaPieChartInterface.
*
* @package FireflyIII\Helpers\Chart
*/ */
interface MetaPieChartInterface interface MetaPieChartInterface
{ {
@ -97,5 +94,4 @@ interface MetaPieChartInterface
* @return MetaPieChartInterface * @return MetaPieChartInterface
*/ */
public function setUser(User $user): MetaPieChartInterface; public function setUser(User $user): MetaPieChartInterface;
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
@ -26,18 +25,14 @@ namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* * Class Balance.
* Class Balance
*
* @package FireflyIII\Helpers\Collection
*/ */
class Balance class Balance
{ {
/** @var BalanceHeader */
/** @var BalanceHeader */
protected $balanceHeader; protected $balanceHeader;
/** @var Collection */ /** @var Collection */
protected $balanceLines; protected $balanceLines;
/** /**
@ -87,6 +82,4 @@ class Balance
{ {
$this->balanceLines = $balanceLines; $this->balanceLines = $balanceLines;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
@ -26,16 +25,11 @@ namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Account as AccountModel; use FireflyIII\Models\Account as AccountModel;
/** /**
* * Class BalanceEntry.
* Class BalanceEntry
*
* @package FireflyIII\Helpers\Collection
*/ */
class BalanceEntry class BalanceEntry
{ {
/** @var AccountModel */
/** @var AccountModel */
protected $account; protected $account;
/** @var string */ /** @var string */
protected $left = '0'; protected $left = '0';
@ -89,6 +83,4 @@ class BalanceEntry
{ {
$this->spent = $spent; $this->spent = $spent;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
@ -27,15 +26,11 @@ use FireflyIII\Models\Account as AccountModel;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* * Class BalanceHeader.
* Class BalanceHeader
*
* @package FireflyIII\Helpers\Collection
*/ */
class BalanceHeader class BalanceHeader
{ {
/** @var Collection */
/** @var Collection */
protected $accounts; protected $accounts;
/** /**
@ -61,6 +56,4 @@ class BalanceHeader
{ {
return $this->accounts; return $this->accounts;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
@ -29,24 +28,20 @@ use FireflyIII\Models\BudgetLimit;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* * Class BalanceLine.
* Class BalanceLine
*
* @package FireflyIII\Helpers\Collection
*/ */
class BalanceLine class BalanceLine
{ {
const ROLE_DEFAULTROLE = 1; const ROLE_DEFAULTROLE = 1;
const ROLE_TAGROLE = 2; const ROLE_TAGROLE = 2;
const ROLE_DIFFROLE = 3; const ROLE_DIFFROLE = 3;
/** @var Collection */ /** @var Collection */
protected $balanceEntries; protected $balanceEntries;
/** @var BudgetModel */ /** @var BudgetModel */
protected $budget; protected $budget;
/** @var BudgetLimit */ /** @var BudgetLimit */
protected $budgetLimit; protected $budgetLimit;
/** @var int */ /** @var int */
protected $role = self::ROLE_DEFAULTROLE; protected $role = self::ROLE_DEFAULTROLE;
@ -57,7 +52,6 @@ class BalanceLine
public function __construct() public function __construct()
{ {
$this->balanceEntries = new Collection; $this->balanceEntries = new Collection;
} }
/** /**
@ -150,20 +144,21 @@ class BalanceLine
/** /**
* @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
* @return string * @return string
*/ */
public function getTitle(): string public function getTitle(): string
{ {
if ($this->getBudget() instanceof BudgetModel && !is_null($this->getBudget()->id)) { if ($this->getBudget() instanceof BudgetModel && null !== $this->getBudget()->id) {
return $this->getBudget()->name; return $this->getBudget()->name;
} }
if ($this->getRole() === self::ROLE_DEFAULTROLE) { if (self::ROLE_DEFAULTROLE === $this->getRole()) {
return strval(trans('firefly.no_budget')); return strval(trans('firefly.no_budget'));
} }
if ($this->getRole() === self::ROLE_TAGROLE) { if (self::ROLE_TAGROLE === $this->getRole()) {
return strval(trans('firefly.coveredWithTags')); return strval(trans('firefly.coveredWithTags'));
} }
if ($this->getRole() === self::ROLE_DIFFROLE) { if (self::ROLE_DIFFROLE === $this->getRole()) {
return strval(trans('firefly.leftUnbalanced')); return strval(trans('firefly.leftUnbalanced'));
} }
@ -174,7 +169,7 @@ class BalanceLine
* If a BalanceLine has a budget/repetition, each BalanceEntry in this BalanceLine * If a BalanceLine has a budget/repetition, each BalanceEntry in this BalanceLine
* should have a "spent" value, which is the amount of money that has been spent * should have a "spent" value, which is the amount of money that has been spent
* on the given budget/repetition. If you subtract all those amounts from the budget/repetition's * on the given budget/repetition. If you subtract all those amounts from the budget/repetition's
* total amount, this is returned: * total amount, this is returned:.
* *
* @return string * @return string
*/ */

View File

@ -18,32 +18,27 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class Bill * Class Bill.
*
* @package FireflyIII\Helpers\Collection
*/ */
class Bill class Bill
{ {
/** /**
* @var Collection * @var Collection
*/ */
private $bills; private $bills;
/** @var Carbon */ /** @var Carbon */
private $endDate; private $endDate;
/** @var Carbon */ /** @var Carbon */
private $startDate; private $startDate;
/** /**
@ -106,14 +101,13 @@ class Bill
{ {
$set = $this->bills->sortBy( $set = $this->bills->sortBy(
function (BillLine $bill) { function (BillLine $bill) {
$active = intval($bill->getBill()->active) === 0 ? 1 : 0; $active = 0 === intval($bill->getBill()->active) ? 1 : 0;
$name = $bill->getBill()->name; $name = $bill->getBill()->name;
return $active . $name; return $active . $name;
} }
); );
return $set; return $set;
} }
@ -132,5 +126,4 @@ class Bill
{ {
$this->startDate = $startDate; $this->startDate = $startDate;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
@ -27,27 +26,23 @@ use Carbon\Carbon;
use FireflyIII\Models\Bill as BillModel; use FireflyIII\Models\Bill as BillModel;
/** /**
* * Class BillLine.
* Class BillLine
*
* @package FireflyIII\Helpers\Collection
*/ */
class BillLine class BillLine
{ {
/** @var string */
/** @var string */
protected $amount; protected $amount;
/** @var BillModel */ /** @var BillModel */
protected $bill; protected $bill;
/** @var bool */ /** @var bool */
protected $hit; protected $hit;
/** @var string */ /** @var string */
protected $max; protected $max;
/** @var string */ /** @var string */
protected $min; protected $min;
/** @var Carbon */ /** @var Carbon */
private $lastHitDate; private $lastHitDate;
/** @var int */ /** @var int */
private $transactionJournalId; private $transactionJournalId;
/** /**
@ -159,7 +154,7 @@ class BillLine
*/ */
public function isActive(): bool public function isActive(): bool
{ {
return intval($this->bill->active) === 1; return 1 === intval($this->bill->active);
} }
/** /**
@ -177,6 +172,4 @@ class BillLine
{ {
$this->hit = $hit; $this->hit = $hit;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
@ -26,17 +25,12 @@ namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Category as CategoryModel; use FireflyIII\Models\Category as CategoryModel;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* * Class Category.
* Class Category
*
* @package FireflyIII\Helpers\Collection
*/ */
class Category class Category
{ {
/** @var Collection */
/** @var Collection */
protected $categories; protected $categories;
/** @var string */ /** @var string */
protected $total = '0'; protected $total = '0';
@ -80,7 +74,6 @@ class Category
} }
); );
return $set; return $set;
} }
@ -91,6 +84,4 @@ class Category
{ {
return $this->total; return $this->total;
} }
} }

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collector; namespace FireflyIII\Helpers\Collector;
use Carbon\Carbon; use Carbon\Carbon;
use DB; use DB;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@ -52,17 +50,16 @@ use Steam;
* *
* Class JournalCollector * Class JournalCollector
* *
* @package FireflyIII\Helpers\Collector
* *
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
*/ */
class JournalCollector implements JournalCollectorInterface class JournalCollector implements JournalCollectorInterface
{ {
/** @var array */ /** @var array */
private $accountIds = []; private $accountIds = [];
/** @var int */ /** @var int */
private $count = 0; private $count = 0;
/** @var array */ /** @var array */
private $fields private $fields
@ -73,12 +70,14 @@ class JournalCollector implements JournalCollectorInterface
'transaction_journals.encrypted', 'transaction_journals.encrypted',
'transaction_types.type as transaction_type_type', 'transaction_types.type as transaction_type_type',
'transaction_journals.bill_id', 'transaction_journals.bill_id',
'transaction_journals.updated_at',
'bills.name as bill_name', 'bills.name as bill_name',
'bills.name_encrypted as bill_name_encrypted', 'bills.name_encrypted as bill_name_encrypted',
'transactions.id as id', 'transactions.id as id',
'transactions.description as transaction_description', 'transactions.description as transaction_description',
'transactions.account_id', 'transactions.account_id',
'transactions.reconciled',
'transactions.identifier', 'transactions.identifier',
'transactions.transaction_journal_id', 'transactions.transaction_journal_id',
'transactions.amount as transaction_amount', 'transactions.amount as transaction_amount',
@ -99,22 +98,21 @@ class JournalCollector implements JournalCollectorInterface
'accounts.encrypted as account_encrypted', 'accounts.encrypted as account_encrypted',
'accounts.iban as account_iban', 'accounts.iban as account_iban',
'account_types.type as account_type', 'account_types.type as account_type',
]; ];
/** @var array */ /** @var array */
private $filters = [InternalTransferFilter::class]; private $filters = [InternalTransferFilter::class];
/** @var bool */ /** @var bool */
private $joinedBudget = false; private $joinedBudget = false;
/** @var bool */ /** @var bool */
private $joinedCategory = false; private $joinedCategory = false;
/** @var bool */ /** @var bool */
private $joinedOpposing = false; private $joinedOpposing = false;
/** @var bool */ /** @var bool */
private $joinedTag = false; private $joinedTag = false;
/** @var int */ /** @var int */
private $limit; private $limit;
/** @var int */ /** @var int */
private $offset; private $offset;
/** @var int */ /** @var int */
private $page = 1; private $page = 1;
@ -170,8 +168,8 @@ class JournalCollector implements JournalCollectorInterface
$q1->where( $q1->where(
function (EloquentBuilder $q2) use ($amount) { function (EloquentBuilder $q2) use ($amount) {
// amount < 0 and .amount > -$amount // amount < 0 and .amount > -$amount
$amount = bcmul($amount,'-1'); $invertedAmount = bcmul($amount, '-1');
$q2->where('transactions.amount', '<', 0)->where('transactions.amount', '>', $amount); $q2->where('transactions.amount', '<', 0)->where('transactions.amount', '>', $invertedAmount);
} }
) )
->orWhere( ->orWhere(
@ -198,8 +196,8 @@ class JournalCollector implements JournalCollectorInterface
$q1->where( $q1->where(
function (EloquentBuilder $q2) use ($amount) { function (EloquentBuilder $q2) use ($amount) {
// amount < 0 and .amount < -$amount // amount < 0 and .amount < -$amount
$amount = bcmul($amount,'-1'); $invertedAmount = bcmul($amount, '-1');
$q2->where('transactions.amount', '<', 0)->where('transactions.amount', '<', $amount); $q2->where('transactions.amount', '<', 0)->where('transactions.amount', '<', $invertedAmount);
} }
) )
->orWhere( ->orWhere(
@ -210,16 +208,18 @@ class JournalCollector implements JournalCollectorInterface
); );
} }
); );
return $this; return $this;
} }
/** /**
* @return int * @return int
*
* @throws FireflyException * @throws FireflyException
*/ */
public function count(): int public function count(): int
{ {
if ($this->run === true) { if (true === $this->run) {
throw new FireflyException('Cannot count after run in JournalCollector.'); throw new FireflyException('Cannot count after run in JournalCollector.');
} }
@ -255,14 +255,12 @@ class JournalCollector implements JournalCollectorInterface
$transaction->date = new Carbon($transaction->date); $transaction->date = new Carbon($transaction->date);
$transaction->description = Steam::decrypt(intval($transaction->encrypted), $transaction->description); $transaction->description = Steam::decrypt(intval($transaction->encrypted), $transaction->description);
if (!is_null($transaction->bill_name)) { if (null !== $transaction->bill_name) {
$transaction->bill_name = Steam::decrypt(intval($transaction->bill_name_encrypted), $transaction->bill_name); $transaction->bill_name = Steam::decrypt(intval($transaction->bill_name_encrypted), $transaction->bill_name);
} }
$transaction->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name); $transaction->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name);
$transaction->account_iban = app('steam')->tryDecrypt($transaction->account_iban); $transaction->account_iban = app('steam')->tryDecrypt($transaction->account_iban);
$transaction->opposing_account_iban = app('steam')->tryDecrypt($transaction->opposing_account_iban); $transaction->opposing_account_iban = app('steam')->tryDecrypt($transaction->opposing_account_iban);
} }
); );
@ -271,11 +269,12 @@ class JournalCollector implements JournalCollectorInterface
/** /**
* @return LengthAwarePaginator * @return LengthAwarePaginator
*
* @throws FireflyException * @throws FireflyException
*/ */
public function getPaginatedJournals(): LengthAwarePaginator public function getPaginatedJournals(): LengthAwarePaginator
{ {
if ($this->run === true) { if (true === $this->run) {
throw new FireflyException('Cannot getPaginatedJournals after run in JournalCollector.'); throw new FireflyException('Cannot getPaginatedJournals after run in JournalCollector.');
} }
$this->count(); $this->count();
@ -293,7 +292,7 @@ class JournalCollector implements JournalCollectorInterface
public function removeFilter(string $filter): JournalCollectorInterface public function removeFilter(string $filter): JournalCollectorInterface
{ {
$key = array_search($filter, $this->filters, true); $key = array_search($filter, $this->filters, true);
if (!($key === false)) { if (!(false === $key)) {
Log::debug(sprintf('Removed filter %s', $filter)); Log::debug(sprintf('Removed filter %s', $filter));
unset($this->filters[$key]); unset($this->filters[$key]);
} }
@ -319,7 +318,6 @@ class JournalCollector implements JournalCollectorInterface
$this->addFilter(TransferFilter::class); $this->addFilter(TransferFilter::class);
} }
return $this; return $this;
} }
@ -386,7 +384,6 @@ class JournalCollector implements JournalCollectorInterface
} }
return $this; return $this;
} }
/** /**
@ -416,7 +413,7 @@ class JournalCollector implements JournalCollectorInterface
public function setBudgets(Collection $budgets): JournalCollectorInterface public function setBudgets(Collection $budgets): JournalCollectorInterface
{ {
$budgetIds = $budgets->pluck('id')->toArray(); $budgetIds = $budgets->pluck('id')->toArray();
if (count($budgetIds) === 0) { if (0 === count($budgetIds)) {
return $this; return $this;
} }
$this->joinBudgetTables(); $this->joinBudgetTables();
@ -440,7 +437,7 @@ class JournalCollector implements JournalCollectorInterface
public function setCategories(Collection $categories): JournalCollectorInterface public function setCategories(Collection $categories): JournalCollectorInterface
{ {
$categoryIds = $categories->pluck('id')->toArray(); $categoryIds = $categories->pluck('id')->toArray();
if (count($categoryIds) === 0) { if (0 === count($categoryIds)) {
return $this; return $this;
} }
$this->joinCategoryTables(); $this->joinCategoryTables();
@ -514,11 +511,11 @@ class JournalCollector implements JournalCollectorInterface
$this->page = $page; $this->page = $page;
if ($page > 0) { if ($page > 0) {
$page--; --$page;
} }
Log::debug(sprintf('Page is %d', $page)); Log::debug(sprintf('Page is %d', $page));
if (!is_null($this->limit)) { if (null !== $this->limit) {
$offset = ($this->limit * $page); $offset = ($this->limit * $page);
$this->offset = $offset; $this->offset = $offset;
$this->query->skip($offset); $this->query->skip($offset);
@ -626,7 +623,6 @@ class JournalCollector implements JournalCollectorInterface
->orderBy('transactions.amount', 'DESC'); ->orderBy('transactions.amount', 'DESC');
$this->query = $query; $this->query = $query;
} }
/** /**
@ -644,7 +640,6 @@ class JournalCollector implements JournalCollectorInterface
*/ */
public function withCategoryInformation(): JournalCollectorInterface public function withCategoryInformation(): JournalCollectorInterface
{ {
$this->joinCategoryTables(); $this->joinCategoryTables();
return $this; return $this;
@ -756,7 +751,10 @@ class JournalCollector implements JournalCollectorInterface
$this->joinedCategory = true; $this->joinedCategory = true;
$this->query->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id'); $this->query->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id');
$this->query->leftJoin( $this->query->leftJoin(
'categories as transaction_journal_categories', 'transaction_journal_categories.id', '=', 'category_transaction_journal.category_id' 'categories as transaction_journal_categories',
'transaction_journal_categories.id',
'=',
'category_transaction_journal.category_id'
); );
$this->query->leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id'); $this->query->leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id');
@ -781,11 +779,12 @@ class JournalCollector implements JournalCollectorInterface
Log::debug('joinedOpposing is false'); Log::debug('joinedOpposing is false');
// join opposing transaction (hard): // join opposing transaction (hard):
$this->query->leftJoin( $this->query->leftJoin(
'transactions as opposing', function (JoinClause $join) { 'transactions as opposing',
$join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id') function (JoinClause $join) {
->where('opposing.identifier', '=', DB::raw('transactions.identifier')) $join->on('opposing.transaction_journal_id', '=', 'transactions.transaction_journal_id')
->where('opposing.amount', '=', DB::raw('transactions.amount * -1')); ->where('opposing.identifier', '=', DB::raw('transactions.identifier'))
} ->where('opposing.amount', '=', DB::raw('transactions.amount * -1'));
}
); );
$this->query->leftJoin('accounts as opposing_accounts', 'opposing.account_id', '=', 'opposing_accounts.id'); $this->query->leftJoin('accounts as opposing_accounts', 'opposing.account_id', '=', 'opposing_accounts.id');
$this->query->leftJoin('account_types as opposing_account_types', 'opposing_accounts.account_type_id', '=', 'opposing_account_types.id'); $this->query->leftJoin('account_types as opposing_account_types', 'opposing_accounts.account_type_id', '=', 'opposing_account_types.id');

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Collector; namespace FireflyIII\Helpers\Collector;
@ -32,9 +31,7 @@ use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface JournalCollectorInterface * Interface JournalCollectorInterface.
*
* @package FireflyIII\Helpers\Collector
*/ */
interface JournalCollectorInterface interface JournalCollectorInterface
{ {
@ -50,7 +47,7 @@ interface JournalCollectorInterface
* *
* @return JournalCollectorInterface * @return JournalCollectorInterface
*/ */
public function amountMore(string $amount): JournalCollectorInterface; public function amountIs(string $amount): JournalCollectorInterface;
/** /**
* @param string $amount * @param string $amount
@ -64,7 +61,7 @@ interface JournalCollectorInterface
* *
* @return JournalCollectorInterface * @return JournalCollectorInterface
*/ */
public function amountIs(string $amount): JournalCollectorInterface; public function amountMore(string $amount): JournalCollectorInterface;
/** /**
* @return int * @return int

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Filter; namespace FireflyIII\Helpers\Filter;
@ -28,12 +27,10 @@ use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class AmountFilter * Class AmountFilter.
* *
* This filter removes transactions with either a positive amount ($parameters = 1) or a negative amount * This filter removes transactions with either a positive amount ($parameters = 1) or a negative amount
* ($parameter = -1). This is helpful when a Collection has you with both transactions in a journal. * ($parameter = -1). This is helpful when a Collection has you with both transactions in a journal.
*
* @package FireflyIII\Helpers\Filter
*/ */
class AmountFilter implements FilterInterface class AmountFilter implements FilterInterface
{ {

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Filter; namespace FireflyIII\Helpers\Filter;
@ -26,14 +25,10 @@ namespace FireflyIII\Helpers\Filter;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class EmptyFilter * Class EmptyFilter.
*
* @package FireflyIII\Helpers\Filter
*/ */
class EmptyFilter implements FilterInterface class EmptyFilter implements FilterInterface
{ {
/** /**
* @param Collection $set * @param Collection $set
* *

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Filter; namespace FireflyIII\Helpers\Filter;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
interface FilterInterface interface FilterInterface
@ -34,5 +32,4 @@ interface FilterInterface
* @return Collection * @return Collection
*/ */
public function filter(Collection $set): Collection; public function filter(Collection $set): Collection;
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Filter; namespace FireflyIII\Helpers\Filter;
@ -28,13 +27,11 @@ use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class InternalTransferFilter * Class InternalTransferFilter.
* *
* This filter removes any filters that are from A to B or from B to A given a set of * This filter removes any filters that are from A to B or from B to A given a set of
* account id's (in $parameters) where A and B are mentioned. So transfers between the mentioned * account id's (in $parameters) where A and B are mentioned. So transfers between the mentioned
* accounts will be removed. * accounts will be removed.
*
* @package FireflyIII\Helpers\Filter
*/ */
class InternalTransferFilter implements FilterInterface class InternalTransferFilter implements FilterInterface
{ {
@ -60,7 +57,7 @@ class InternalTransferFilter implements FilterInterface
{ {
return $set->filter( return $set->filter(
function (Transaction $transaction) { function (Transaction $transaction) {
if (is_null($transaction->opposing_account_id)) { if (null === $transaction->opposing_account_id) {
return $transaction; return $transaction;
} }
// both id's in $parameters? // both id's in $parameters?
@ -68,18 +65,18 @@ class InternalTransferFilter implements FilterInterface
Log::debug( Log::debug(
sprintf( sprintf(
'Transaction #%d has #%d and #%d in set, so removed', 'Transaction #%d has #%d and #%d in set, so removed',
$transaction->id, $transaction->account_id, $transaction->opposing_account_id $transaction->id,
), $this->accounts $transaction->account_id,
$transaction->opposing_account_id
),
$this->accounts
); );
return false; return false;
} }
return $transaction; return $transaction;
} }
); );
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Filter; namespace FireflyIII\Helpers\Filter;
@ -28,11 +27,9 @@ use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class NegativeAmountFilter * Class NegativeAmountFilter.
* *
* This filter removes entries with a negative amount (the original modifier is -1). * This filter removes entries with a negative amount (the original modifier is -1).
*
* @package FireflyIII\Helpers\Filter
*/ */
class NegativeAmountFilter implements FilterInterface class NegativeAmountFilter implements FilterInterface
{ {

View File

@ -18,23 +18,19 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Filter; namespace FireflyIII\Helpers\Filter;
use FireflyIII\Models\Transaction; use FireflyIII\Models\Transaction;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class OpposingAccountFilter * Class OpposingAccountFilter.
* *
* This filter is similar to the internal transfer filter but only removes transactions when the opposing account is * This filter is similar to the internal transfer filter but only removes transactions when the opposing account is
* amongst $parameters (list of account ID's). * amongst $parameters (list of account ID's).
*
* @package FireflyIII\Helpers\Filter
*/ */
class OpposingAccountFilter implements FilterInterface class OpposingAccountFilter implements FilterInterface
{ {

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Filter; namespace FireflyIII\Helpers\Filter;
@ -28,14 +27,12 @@ use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class PositiveAmountFilter * Class PositiveAmountFilter.
* *
* This filter removes entries with a negative amount (the original modifier is -1). * This filter removes entries with a negative amount (the original modifier is -1).
* *
* This filter removes transactions with either a positive amount ($parameters = 1) or a negative amount * This filter removes transactions with either a positive amount ($parameters = 1) or a negative amount
* ($parameter = -1). This is helpful when a Collection has you with both transactions in a journal. * ($parameter = -1). This is helpful when a Collection has you with both transactions in a journal.
*
* @package FireflyIII\Helpers\Filter
*/ */
class PositiveAmountFilter implements FilterInterface class PositiveAmountFilter implements FilterInterface
{ {
@ -49,7 +46,7 @@ class PositiveAmountFilter implements FilterInterface
return $set->filter( return $set->filter(
function (Transaction $transaction) { function (Transaction $transaction) {
// remove by amount // remove by amount
if (bccomp($transaction->transaction_amount, '0') === 1) { if (1 === bccomp($transaction->transaction_amount, '0')) {
Log::debug(sprintf('Filtered #%d because amount is %f.', $transaction->id, $transaction->transaction_amount)); Log::debug(sprintf('Filtered #%d because amount is %f.', $transaction->id, $transaction->transaction_amount));
return null; return null;

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Filter; namespace FireflyIII\Helpers\Filter;
@ -29,11 +28,9 @@ use Illuminate\Support\Collection;
use Steam; use Steam;
/** /**
* Class TransferFilter * Class TransferFilter.
* *
* This filter removes any transfers that are in the collection twice (from A to B and from B to A). * This filter removes any transfers that are in the collection twice (from A to B and from B to A).
*
* @package FireflyIII\Helpers\Filter
*/ */
class TransferFilter implements FilterInterface class TransferFilter implements FilterInterface
{ {
@ -48,7 +45,7 @@ class TransferFilter implements FilterInterface
$new = new Collection; $new = new Collection;
/** @var Transaction $transaction */ /** @var Transaction $transaction */
foreach ($set as $transaction) { foreach ($set as $transaction) {
if ($transaction->transaction_type_type !== TransactionType::TRANSFER) { if (TransactionType::TRANSFER !== $transaction->transaction_type_type) {
$new->push($transaction); $new->push($transaction);
continue; continue;
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers; namespace FireflyIII\Helpers;
@ -27,20 +26,15 @@ use Carbon\Carbon;
use Preferences; use Preferences;
/** /**
* Class FiscalHelper * Class FiscalHelper.
*
* @package FireflyIII\Helpers
*/ */
class FiscalHelper implements FiscalHelperInterface class FiscalHelper implements FiscalHelperInterface
{ {
/** @var bool */ /** @var bool */
protected $useCustomFiscalYear; protected $useCustomFiscalYear;
/** /**
* FiscalHelper constructor. * FiscalHelper constructor.
*
*
*/ */
public function __construct() public function __construct()
{ {
@ -56,7 +50,7 @@ class FiscalHelper implements FiscalHelperInterface
{ {
// get start of fiscal year for passed date // get start of fiscal year for passed date
$endDate = $this->startOfFiscalYear($date); $endDate = $this->startOfFiscalYear($date);
if ($this->useCustomFiscalYear === true) { if (true === $this->useCustomFiscalYear) {
// add 1 year and sub 1 day // add 1 year and sub 1 day
$endDate->addYear(); $endDate->addYear();
$endDate->subDay(); $endDate->subDay();
@ -65,7 +59,6 @@ class FiscalHelper implements FiscalHelperInterface
} }
$endDate->endOfYear(); $endDate->endOfYear();
return $endDate; return $endDate;
} }
@ -78,7 +71,7 @@ class FiscalHelper implements FiscalHelperInterface
{ {
// get start mm-dd. Then create a start date in the year passed. // get start mm-dd. Then create a start date in the year passed.
$startDate = clone $date; $startDate = clone $date;
if ($this->useCustomFiscalYear === true) { if (true === $this->useCustomFiscalYear) {
$prefStartStr = Preferences::get('fiscalYearStart', '01-01')->data; $prefStartStr = Preferences::get('fiscalYearStart', '01-01')->data;
list($mth, $day) = explode('-', $prefStartStr); list($mth, $day) = explode('-', $prefStartStr);
$startDate->month(intval($mth))->day(intval($day)); $startDate->month(intval($mth))->day(intval($day));

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers; namespace FireflyIII\Helpers;
@ -26,13 +25,10 @@ namespace FireflyIII\Helpers;
use Carbon\Carbon; use Carbon\Carbon;
/** /**
* Interface FiscalHelperInterface * Interface FiscalHelperInterface.
*
* @package FireflyIII\Helpers
*/ */
interface FiscalHelperInterface interface FiscalHelperInterface
{ {
/** /**
* This method produces a clone of the Carbon date object passed, checks preferences * This method produces a clone of the Carbon date object passed, checks preferences
* and calculates the last day of the fiscal year. * and calculates the last day of the fiscal year.
@ -52,5 +48,4 @@ interface FiscalHelperInterface
* @return Carbon date object * @return Carbon date object
*/ */
public function startOfFiscalYear(Carbon $date): Carbon; public function startOfFiscalYear(Carbon $date): Carbon;
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Help; namespace FireflyIII\Helpers\Help;
@ -31,9 +30,7 @@ use Requests_Exception;
use Route; use Route;
/** /**
* Class Help * Class Help.
*
* @package FireflyIII\Helpers\Help
*/ */
class Help implements HelpInterface class Help implements HelpInterface
{ {
@ -62,7 +59,6 @@ class Help implements HelpInterface
*/ */
public function getFromGithub(string $route, string $language): string public function getFromGithub(string $route, string $language): string
{ {
$uri = sprintf('https://raw.githubusercontent.com/firefly-iii/help/master/%s/%s.md', $language, $route); $uri = sprintf('https://raw.githubusercontent.com/firefly-iii/help/master/%s/%s.md', $language, $route);
Log::debug(sprintf('Trying to get %s...', $uri)); Log::debug(sprintf('Trying to get %s...', $uri));
$opt = ['useragent' => $this->userAgent]; $opt = ['useragent' => $this->userAgent];
@ -77,7 +73,7 @@ class Help implements HelpInterface
Log::debug(sprintf('Status code is %d', $result->status_code)); Log::debug(sprintf('Status code is %d', $result->status_code));
if ($result->status_code === 200) { if (200 === $result->status_code) {
$content = trim($result->body); $content = trim($result->body);
} }
@ -91,7 +87,6 @@ class Help implements HelpInterface
} }
/** /**
*
* @param string $route * @param string $route
* *
* @return bool * @return bool
@ -119,15 +114,12 @@ class Help implements HelpInterface
} }
return $result; return $result;
} }
/** /**
*
* @param string $route * @param string $route
* @param string $language * @param string $language
* @param string $content * @param string $content
*
*/ */
public function putInCache(string $route, string $language, string $content) public function putInCache(string $route, string $language, string $content)
{ {

View File

@ -18,19 +18,15 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Help; namespace FireflyIII\Helpers\Help;
/** /**
* Interface HelpInterface * Interface HelpInterface.
*
* @package FireflyIII\Helpers\Help
*/ */
interface HelpInterface interface HelpInterface
{ {
/** /**
* @param string $route * @param string $route
* @param string $language * @param string $language

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Report; namespace FireflyIII\Helpers\Report;
@ -34,15 +33,13 @@ use Illuminate\Support\Collection;
use Log; use Log;
/** /**
* Class BalanceReportHelper * Class BalanceReportHelper.
* *
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) // I can't really help it. * @SuppressWarnings(PHPMD.CouplingBetweenObjects) // I can't really help it.
* @package FireflyIII\Helpers\Report
*/ */
class BalanceReportHelper implements BalanceReportHelperInterface class BalanceReportHelper implements BalanceReportHelperInterface
{ {
/** @var BudgetRepositoryInterface */
/** @var BudgetRepositoryInterface */
protected $budgetRepository; protected $budgetRepository;
/** /**
@ -56,7 +53,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface
$this->budgetRepository = $budgetRepository; $this->budgetRepository = $budgetRepository;
} }
/** /**
* @param Collection $accounts * @param Collection $accounts
* @param Carbon $start * @param Carbon $start
@ -77,7 +73,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface
/** @var BudgetLimit $budgetLimit */ /** @var BudgetLimit $budgetLimit */
foreach ($budgetLimits as $budgetLimit) { foreach ($budgetLimits as $budgetLimit) {
if (!is_null($budgetLimit->budget)) { if (null !== $budgetLimit->budget) {
$line = $this->createBalanceLine($budgetLimit, $accounts); $line = $this->createBalanceLine($budgetLimit, $accounts);
$balance->addBalanceLine($line); $balance->addBalanceLine($line);
} }
@ -96,7 +92,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface
return $balance; return $balance;
} }
/** /**
* @param BudgetLimit $budgetLimit * @param BudgetLimit $budgetLimit
* @param Collection $accounts * @param Collection $accounts
@ -114,7 +109,10 @@ class BalanceReportHelper implements BalanceReportHelperInterface
$balanceEntry = new BalanceEntry; $balanceEntry = new BalanceEntry;
$balanceEntry->setAccount($account); $balanceEntry->setAccount($account);
$spent = $this->budgetRepository->spentInPeriod( $spent = $this->budgetRepository->spentInPeriod(
new Collection([$budgetLimit->budget]), new Collection([$account]), $budgetLimit->start_date, $budgetLimit->end_date new Collection([$budgetLimit->budget]),
new Collection([$account]),
$budgetLimit->start_date,
$budgetLimit->end_date
); );
$balanceEntry->setSpent($spent); $balanceEntry->setSpent($spent);
$line->addBalanceEntry($balanceEntry); $line->addBalanceEntry($balanceEntry);
@ -123,7 +121,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface
return $line; return $line;
} }
/** /**
* @param Collection $accounts * @param Collection $accounts
* @param Carbon $start * @param Carbon $start
@ -142,13 +139,11 @@ class BalanceReportHelper implements BalanceReportHelperInterface
$budgetEntry->setAccount($account); $budgetEntry->setAccount($account);
$budgetEntry->setSpent($spent); $budgetEntry->setSpent($spent);
$empty->addBalanceEntry($budgetEntry); $empty->addBalanceEntry($budgetEntry);
} }
return $empty; return $empty;
} }
/** /**
* @param Balance $balance * @param Balance $balance
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5.
@ -160,7 +155,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface
$set = $balance->getBalanceLines(); $set = $balance->getBalanceLines();
$newSet = new Collection; $newSet = new Collection;
foreach ($set as $entry) { foreach ($set as $entry) {
if (!is_null($entry->getBudget()->id)) { if (null !== $entry->getBudget()->id) {
$sum = '0'; $sum = '0';
foreach ($entry->getBalanceEntries() as $balanceEntry) { foreach ($entry->getBalanceEntries() as $balanceEntry) {
$sum = bcadd($sum, $balanceEntry->getSpent()); $sum = bcadd($sum, $balanceEntry->getSpent());
@ -176,7 +171,5 @@ class BalanceReportHelper implements BalanceReportHelperInterface
$balance->setBalanceLines($newSet); $balance->setBalanceLines($newSet);
return $balance; return $balance;
} }
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Report; namespace FireflyIII\Helpers\Report;
@ -27,11 +26,8 @@ use Carbon\Carbon;
use FireflyIII\Helpers\Collection\Balance; use FireflyIII\Helpers\Collection\Balance;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface BalanceReportHelperInterface * Interface BalanceReportHelperInterface.
*
* @package FireflyIII\Helpers\Report
*/ */
interface BalanceReportHelperInterface interface BalanceReportHelperInterface
{ {

View File

@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Report; namespace FireflyIII\Helpers\Report;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\BudgetLimit;
@ -31,9 +29,7 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class BudgetReportHelper * Class BudgetReportHelper.
*
* @package FireflyIII\Helpers\Report
*/ */
class BudgetReportHelper implements BudgetReportHelperInterface class BudgetReportHelper implements BudgetReportHelperInterface
{ {
@ -53,6 +49,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface
/** /**
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5. * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5.
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // all the arrays make it long. * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // all the arrays make it long.
*
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
@ -67,9 +64,8 @@ class BudgetReportHelper implements BudgetReportHelperInterface
/** @var Budget $budget */ /** @var Budget $budget */
foreach ($set as $budget) { foreach ($set as $budget) {
$budgetLimits = $this->repository->getBudgetLimits($budget, $start, $end); $budgetLimits = $this->repository->getBudgetLimits($budget, $start, $end);
if ($budgetLimits->count() === 0) { // no budget limit(s) for this budget if (0 === $budgetLimits->count()) { // no budget limit(s) for this budget
$spent = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end); // spent for budget in time range
$spent = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end);// spent for budget in time range
if (bccomp($spent, '0') === -1) { if (bccomp($spent, '0') === -1) {
$line = [ $line = [
'type' => 'budget', 'type' => 'budget',
@ -157,12 +153,11 @@ class BudgetReportHelper implements BudgetReportHelperInterface
{ {
$array = []; $array = [];
$expenses = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $budgetLimit->start_date, $budgetLimit->end_date); $expenses = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $budgetLimit->start_date, $budgetLimit->end_date);
$array['left'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? bcadd($budgetLimit->amount, $expenses) : '0'; $array['left'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? bcadd($budgetLimit->amount, $expenses) : '0';
$array['spent'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? $expenses : '0'; $array['spent'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? $expenses : '0';
$array['overspent'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? '0' : bcadd($expenses, $budgetLimit->amount); $array['overspent'] = 1 === bccomp(bcadd($budgetLimit->amount, $expenses), '0') ? '0' : bcadd($expenses, $budgetLimit->amount);
$array['expenses'] = $expenses; $array['expenses'] = $expenses;
return $array; return $array;
} }
} }

View File

@ -18,23 +18,18 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Report; namespace FireflyIII\Helpers\Report;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface BudgetReportHelperInterface * Interface BudgetReportHelperInterface.
*
* @package FireflyIII\Helpers\Report
*/ */
interface BudgetReportHelperInterface interface BudgetReportHelperInterface
{ {
/** /**
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
@ -52,5 +47,4 @@ interface BudgetReportHelperInterface
* @return Collection * @return Collection
*/ */
public function getBudgetsWithExpenses(Carbon $start, Carbon $end, Collection $accounts): Collection; public function getBudgetsWithExpenses(Carbon $start, Carbon $end, Collection $accounts): Collection;
} }

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Report; namespace FireflyIII\Helpers\Report;
@ -32,14 +31,10 @@ use FireflyIII\Models\TransactionType;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class PopupReport * Class PopupReport.
*
* @package FireflyIII\Helpers\Report
*/ */
class PopupReport implements PopupReportInterface class PopupReport implements PopupReportInterface
{ {
/** /**
* @param $account * @param $account
* @param $attributes * @param $attributes
@ -58,11 +53,10 @@ class PopupReport implements PopupReportInterface
->withoutBudget(); ->withoutBudget();
$journals = $collector->getJournals(); $journals = $collector->getJournals();
return $journals->filter( return $journals->filter(
function (Transaction $transaction) { function (Transaction $transaction) {
$tags = $transaction->transactionJournal->tags()->where('tagMode', 'balancingAct')->count(); $tags = $transaction->transactionJournal->tags()->where('tagMode', 'balancingAct')->count();
if ($tags === 0) { if (0 === $tags) {
return true; return true;
} }
@ -120,10 +114,10 @@ class PopupReport implements PopupReportInterface
$collector->setAccounts($attributes['accounts'])->setRange($attributes['startDate'], $attributes['endDate']); $collector->setAccounts($attributes['accounts'])->setRange($attributes['startDate'], $attributes['endDate']);
if (is_null($budget->id)) { if (null === $budget->id) {
$collector->setTypes([TransactionType::WITHDRAWAL])->withoutBudget(); $collector->setTypes([TransactionType::WITHDRAWAL])->withoutBudget();
} }
if (!is_null($budget->id)) { if (null !== $budget->id) {
$collector->setBudget($budget); $collector->setBudget($budget);
} }
$journals = $collector->getJournals(); $journals = $collector->getJournals();

View File

@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Helpers\Report; namespace FireflyIII\Helpers\Report;
@ -29,13 +28,10 @@ use FireflyIII\Models\Category;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Interface PopupReportInterface * Interface PopupReportInterface.
*
* @package FireflyIII\Helpers\Report
*/ */
interface PopupReportInterface interface PopupReportInterface
{ {
/** /**
* @param $account * @param $account
* @param $attributes * @param $attributes

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