Skip to content

Firefly III: a personal finances manager

Reformat various code.

James Cole452b6d0e1b0a
diff --git a/app/User.php b/app/User.php
index 649d948122..5c0da04984 100644
--- a/app/User.php
+++ b/app/User.php
@@ -200,7 +200,7 @@ class User extends Authenticatable
public static function routeBinder(string $value): User
{
if (auth()->check()) {
- $userId = (int)$value;
+ $userId = (int) $value;
$user = self::find($userId);
if (null !== $user) {
return $user;
@@ -302,9 +302,9 @@ class User extends Authenticatable
/**
* Get the models LDAP domain.
+ * @return string
* @deprecated
*
- * @return string
*/
public function getLdapDomain()
{
@@ -313,9 +313,9 @@ class User extends Authenticatable
/**
* Get the database column name of the domain.
+ * @return string
* @deprecated
*
- * @return string
*/
public function getLdapDomainColumn()
{
@@ -324,9 +324,9 @@ class User extends Authenticatable
/**
* Get the models LDAP GUID.
+ * @return string
* @deprecated
*
- * @return string
*/
public function getLdapGuid()
{
@@ -335,9 +335,9 @@ class User extends Authenticatable
/**
* Get the models LDAP GUID database column name.
+ * @return string
* @deprecated
*
- * @return string
*/
public function getLdapGuidColumn()
{
@@ -456,11 +456,11 @@ class User extends Authenticatable
/**
* Set the models LDAP domain.
- * @deprecated
- *
* @param string $domain
*
* @return void
+ * @deprecated
+ *
*/
public function setLdapDomain($domain)
{
@@ -469,10 +469,10 @@ class User extends Authenticatable
/**
* Set the models LDAP GUID.
- * @deprecated
* @param string $guid
*
* @return void
+ * @deprecated
*/
public function setLdapGuid($guid)
{
diff --git a/config/app.php b/config/app.php
index b789433432..cd05e2bab3 100644
--- a/config/app.php
+++ b/config/app.php
@@ -144,9 +144,9 @@ return [
'Google2FA' => PragmaRX\Google2FALaravel\Facade::class,
'Twig' => TwigBridge\Facade\Twig::class,
- 'Arr' => Illuminate\Support\Arr::class,
+ 'Arr' => Illuminate\Support\Arr::class,
'Http' => Illuminate\Support\Facades\Http::class,
- 'Str' => Illuminate\Support\Str::class,
+ 'Str' => Illuminate\Support\Str::class,
],
'asset_url' => env('ASSET_URL', null),
diff --git a/config/auth.php b/config/auth.php
index 348e14ab49..92fad546f9 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -21,7 +21,7 @@
declare(strict_types=1);
-if('ldap' === strtolower((string) env('AUTHENTICATION_GUARD'))) {
+if ('ldap' === strtolower((string) env('AUTHENTICATION_GUARD'))) {
die('LDAP is no longer supported by Firefly III v5.7+. Sorry about that. You will have to switch to "remote_user_guard", and use tools like Authelia or Keycloak to use LDAP together with Firefly III.');
}
@@ -95,8 +95,8 @@ return [
'providers' => [
'users' => [
- 'driver' => 'eloquent',
- 'model' => FireflyIII\User::class,
+ 'driver' => 'eloquent',
+ 'model' => FireflyIII\User::class,
],
'remote_user_provider' => [
'driver' => 'remote_user_provider',
diff --git a/config/breadcrumbs.php b/config/breadcrumbs.php
index 73dbe7b8ae..0cfb2b1185 100644
--- a/config/breadcrumbs.php
+++ b/config/breadcrumbs.php
@@ -61,7 +61,7 @@ return [
|
*/
- 'files' => base_path('routes/breadcrumbs.php'),
+ 'files' => base_path('routes/breadcrumbs.php'),
/*
|--------------------------------------------------------------------------
@@ -73,13 +73,13 @@ return [
*/
// When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException)
- 'unnamed-route-exception' => true,
+ 'unnamed-route-exception' => true,
// When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException)
'missing-route-bound-breadcrumb-exception' => true,
// When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException)
- 'invalid-named-breadcrumb-exception' => true,
+ 'invalid-named-breadcrumb-exception' => true,
/*
|--------------------------------------------------------------------------
@@ -91,9 +91,9 @@ return [
*/
// Manager
- 'manager-class' => Diglactic\Breadcrumbs\Manager::class,
+ 'manager-class' => Diglactic\Breadcrumbs\Manager::class,
// Generator
- 'generator-class' => Diglactic\Breadcrumbs\Generator::class,
+ 'generator-class' => Diglactic\Breadcrumbs\Generator::class,
];
diff --git a/config/bulk.php b/config/bulk.php
index cf0458ee2d..8a92da4205 100644
--- a/config/bulk.php
+++ b/config/bulk.php
@@ -26,7 +26,7 @@ use FireflyIII\Enums\ClauseType;
return [
ClauseType::TRANSACTION => [
- ClauseType::WHERE => [
+ ClauseType::WHERE => [
'source_account_id' => 'required|numeric|belongsToUser:accounts,id',
],
ClauseType::UPDATE => [
diff --git a/config/cache.php b/config/cache.php
index 9510722577..69ed690ca4 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -55,7 +55,7 @@ return [
],
'array' => [
- 'driver' => 'array',
+ 'driver' => 'array',
'serialize' => false,
],
@@ -89,16 +89,16 @@ return [
],
],
- 'redis' => [
+ 'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'dynamodb' => [
- 'driver' => 'dynamodb',
- 'key' => env('AWS_ACCESS_KEY_ID'),
- 'secret' => env('AWS_SECRET_ACCESS_KEY'),
- 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
- 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
+ 'driver' => 'dynamodb',
+ 'key' => env('AWS_ACCESS_KEY_ID'),
+ 'secret' => env('AWS_SECRET_ACCESS_KEY'),
+ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
+ 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
],
diff --git a/config/filesystems.php b/config/filesystems.php
index 64e9d52023..8deff7ba8f 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -52,35 +52,35 @@ return [
*/
'disks' => [
- 'local' => [
+ 'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
// local storage configuration for upload and export:
- 'upload' => [
+ 'upload' => [
'driver' => 'local',
'root' => storage_path('upload'),
],
- 'export' => [
+ 'export' => [
'driver' => 'local',
'root' => storage_path('export'),
],
// various other paths:
- 'database' => [
+ 'database' => [
'driver' => 'local',
'root' => storage_path('database'),
],
- 'seeds' => [
+ 'seeds' => [
'driver' => 'local',
'root' => base_path('resources/seeds'),
],
- 'stubs' => [
+ 'stubs' => [
'driver' => 'local',
'root' => base_path('resources/stubs'),
],
- 'resources' => [
+ 'resources' => [
'driver' => 'local',
'root' => base_path('resources'),
],
diff --git a/config/intro.php b/config/intro.php
index 4fd93513e5..b364b9f7b5 100644
--- a/config/intro.php
+++ b/config/intro.php
@@ -45,7 +45,7 @@ return [
'basic_info' => ['element' => '#transaction-info', 'position' => 'right'],
'amount_info' => ['element' => '#amount-info', 'position' => 'bottom'],
'optional_info' => ['element' => '#optional-info', 'position' => 'left'],
- 'split' => ['element' => '.split_add_btn','position' => 'top'],
+ 'split' => ['element' => '.split_add_btn', 'position' => 'top'],
],
'transactions_create_withdrawal' => [
diff --git a/config/logging.php b/config/logging.php
index fe22ffa672..228f6c1de1 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -54,22 +54,22 @@ return [
'channels' => [
// default channels for 'stack' and audit logs:
- 'stack' => [
+ 'stack' => [
'driver' => 'stack',
'channels' => ['daily', 'stdout'],
],
- 'audit' => [
+ 'audit' => [
'driver' => 'stack',
'channels' => ['audit_daily', 'audit_stdout'],
],
- 'scoped' => [
+ 'scoped' => [
'driver' => 'custom',
- 'via' => FireflyIII\Logging\CreateCustomLogger::class,
+ 'via' => FireflyIII\Logging\CreateCustomLogger::class,
],
- 'papertrail' => [
- 'driver' => 'monolog',
- 'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
- 'handler' => SyslogUdpHandler::class,
+ 'papertrail' => [
+ 'driver' => 'monolog',
+ 'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
+ 'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_HOST'),
'port' => env('PAPERTRAIL_PORT'),
@@ -77,21 +77,21 @@ return [
],
// single laravel log file:
- 'single' => [
+ 'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
// stdout, used in stack 'stack' by default:
- 'stdout' => [
+ 'stdout' => [
'driver' => 'single',
'path' => 'php://stdout',
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
// daily, used in stack 'stack' by default:
- 'daily' => [
+ 'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/ff3-' . PHP_SAPI . '.log'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
@@ -99,14 +99,14 @@ return [
],
// the audit log destinations:
- 'audit_daily' => [
+ 'audit_daily' => [
'driver' => 'daily',
'path' => storage_path('logs/ff3-audit.log'),
'tap' => [AuditLogger::class],
'level' => envNonEmpty('AUDIT_LOG_LEVEL', 'info'),
'days' => 90,
],
- 'audit_stdout' => [
+ 'audit_stdout' => [
'driver' => 'single',
'path' => 'php://stdout',
'tap' => [AuditLogger::class],
@@ -114,13 +114,13 @@ return [
],
// syslog destination
- 'syslog' => [
+ 'syslog' => [
'driver' => 'syslog',
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
// errorlog destination
- 'errorlog' => [
+ 'errorlog' => [
'driver' => 'errorlog',
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
diff --git a/config/mail.php b/config/mail.php
index 3f3f50eb10..10afa09e7f 100644
--- a/config/mail.php
+++ b/config/mail.php
@@ -23,23 +23,23 @@ declare(strict_types=1);
return [
-/*
-|--------------------------------------------------------------------------
-| Default Mailer
-|--------------------------------------------------------------------------
-|
-| This option controls the default mailer that is used to send any email
-| messages sent by your application. Alternative mailers may be setup
-| and used as needed; however, this mailer will be used by default.
-|
-*/
+ /*
+ |--------------------------------------------------------------------------
+ | Default Mailer
+ |--------------------------------------------------------------------------
+ |
+ | This option controls the default mailer that is used to send any email
+ | messages sent by your application. Alternative mailers may be setup
+ | and used as needed; however, this mailer will be used by default.
+ |
+ */
'default' => env('MAIL_MAILER', 'smtp'),
'mailers' => [
'smtp' => [
'transport' => 'smtp',
- 'host' => env('MAIL_HOST', 'smtp.mailtrap.io'),
- 'port' => env('MAIL_PORT', 2525),
+ 'host' => env('MAIL_HOST', 'smtp.mailtrap.io'),
+ 'port' => env('MAIL_PORT', 2525),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
@@ -62,7 +62,7 @@ return [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],
- 'log' => [
+ 'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL', 'stack'),
'level' => 'notice',
@@ -73,7 +73,7 @@ return [
],
],
- 'from' => ['address' => envNonEmpty('MAIL_FROM', '[email protected]'), 'name' => 'Firefly III Mailer'],
+ 'from' => ['address' => envNonEmpty('MAIL_FROM', '[email protected]'), 'name' => 'Firefly III Mailer'],
'markdown' => [
'theme' => 'default',
diff --git a/config/sanctum.php b/config/sanctum.php
index 8b1fa3633c..d0b57a048f 100644
--- a/config/sanctum.php
+++ b/config/sanctum.php
@@ -38,7 +38,7 @@ return [
|
*/
- 'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS','')),
+ 'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', '')),
/*
|--------------------------------------------------------------------------
diff --git a/config/session.php b/config/session.php
index f3cb244e20..4de1115cfd 100644
--- a/config/session.php
+++ b/config/session.php
@@ -36,5 +36,5 @@ return [
'domain' => env('COOKIE_DOMAIN', null),
'secure' => env('COOKIE_SECURE', null),
'http_only' => true,
- 'same_site' => env('COOKIE_SAMESITE','lax'),
+ 'same_site' => env('COOKIE_SAMESITE', 'lax'),
];
diff --git a/config/twigbridge.php b/config/twigbridge.php
index df8ec2f6aa..a3f8c7a9d3 100644
--- a/config/twigbridge.php
+++ b/config/twigbridge.php
@@ -51,6 +51,7 @@ declare(strict_types=1);
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
+
use FireflyIII\Support\Twig\AmountFormat;
use FireflyIII\Support\Twig\General;
use FireflyIII\Support\Twig\Rule;
@@ -78,15 +79,15 @@ use TwigBridge\Extension\Loader\Globals;
return [
'twig' => [
- 'extension' => 'twig',
- 'environment' => [
- 'debug' => env('APP_DEBUG', false),
- 'charset' => 'utf-8',
- 'cache' => null,
- 'auto_reload' => true,
+ 'extension' => 'twig',
+ 'environment' => [
+ 'debug' => env('APP_DEBUG', false),
+ 'charset' => 'utf-8',
+ 'cache' => null,
+ 'auto_reload' => true,
'strict_variables' => false,
- 'autoescape' => 'html',
- 'optimizations' => -1,
+ 'autoescape' => 'html',
+ 'optimizations' => -1,
],
/*
|--------------------------------------------------------------------------
@@ -110,7 +111,7 @@ return [
| NOTE: these will be overwritten if you pass data into the view with the same key.
|
*/
- 'globals' => [],
+ 'globals' => [],
],
'extensions' => [
@@ -125,7 +126,7 @@ return [
| `Twig\Extension\DebugExtension` is enabled automatically if twig.debug is TRUE.
|
*/
- 'enabled' => [
+ 'enabled' => [
Facades::class,
Filters::class,
Functions::class,
@@ -175,7 +176,7 @@ return [
| in order to be marked as safe.
|
*/
- 'facades' => [
+ 'facades' => [
'Breadcrumbs' => [
'is_safe' => [
'render',
@@ -194,7 +195,7 @@ return [
'ExpandedForm' => [
'is_safe' => [
'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location', 'file', 'staticText',
- 'password', 'nonSelectableAmount', 'number', 'amountNoCurrency', 'percentage','objectGroup'
+ 'password', 'nonSelectableAmount', 'number', 'amountNoCurrency', 'percentage', 'objectGroup',
],
],
@@ -283,7 +284,7 @@ return [
| </code>
|
*/
- 'filters' => [
+ 'filters' => [
'get' => 'data_get',
],
],
diff --git a/config/upgrade.php b/config/upgrade.php
index c5d244c343..423dbfc272 100644
--- a/config/upgrade.php
+++ b/config/upgrade.php
@@ -34,7 +34,7 @@ return [
'4.7.10' => 'Firefly III no longer encrypts database values. To protect your data, make sure you use TDE or FDE. Read more: https://bit.ly/FF3-encryption',
'4.8.0' => 'This is a huge upgrade for Firefly III. Please expect bugs and errors, and bear with me as I fix them. I tested a lot of things but pretty sure I missed some. Thanks for understanding.',
'4.8.1' => 'This version of Firefly III requires PHP7.3.',
- '5.3.0' => 'This version of Firefly III requires PHP7.4.'
+ '5.3.0' => 'This version of Firefly III requires PHP7.4.',
],
'install' => [
'4.3' => 'Welcome to Firefly! Make sure you follow the installation guide. If you need more help, please check Github or the Firefly III website. The installation guide has a FAQ which you should check out as well.',
@@ -47,7 +47,7 @@ return [
'4.7.10' => 'Firefly III no longer encrypts database values. To protect your data, make sure you use TDE or FDE. Read more: https://bit.ly/FF3-encryption',
'4.8.0' => 'This is a huge upgrade for Firefly III. Please expect bugs and errors, and bear with me as I fix them. I tested a lot of things but pretty sure I missed some. Thanks for understanding.',
'4.8.1' => 'This version of Firefly III requires PHP7.3.',
- '5.3.0' => 'This version of Firefly III requires PHP7.4.'
+ '5.3.0' => 'This version of Firefly III requires PHP7.4.',
],
],
];
diff --git a/database/migrations/2021_08_28_073733_user_groups.php b/database/migrations/2021_08_28_073733_user_groups.php
index e66494b814..70afc7d990 100644
--- a/database/migrations/2021_08_28_073733_user_groups.php
+++ b/database/migrations/2021_08_28_073733_user_groups.php
@@ -47,7 +47,7 @@ class UserGroups extends Migration
foreach ($this->tables as $tableName) {
Schema::table(
$tableName, function (Blueprint $table) use ($tableName) {
-
+
$table->dropForeign(sprintf('%s_to_ugi', $tableName));
if (Schema::hasColumn($tableName, 'user_group_id')) {
$table->dropColumn('user_group_id');
diff --git a/database/migrations/2021_12_27_000001_create_local_personal_access_tokens_table.php b/database/migrations/2021_12_27_000001_create_local_personal_access_tokens_table.php
index 4119b19071..76c4519124 100644
--- a/database/migrations/2021_12_27_000001_create_local_personal_access_tokens_table.php
+++ b/database/migrations/2021_12_27_000001_create_local_personal_access_tokens_table.php
@@ -31,6 +31,16 @@ use Illuminate\Support\Facades\Schema;
*/
class CreateLocalPersonalAccessTokensTable extends Migration
{
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('personal_access_tokens');
+ }
+
/**
* Run the migrations.
*
@@ -50,14 +60,4 @@ class CreateLocalPersonalAccessTokensTable extends Migration
});
}
}
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('personal_access_tokens');
- }
}
diff --git a/database/seeders/AccountTypeSeeder.php b/database/seeders/AccountTypeSeeder.php
index 2356d5aa0c..e917f3ba94 100644
--- a/database/seeders/AccountTypeSeeder.php
+++ b/database/seeders/AccountTypeSeeder.php
@@ -46,7 +46,7 @@ class AccountTypeSeeder extends Seeder
AccountType::RECONCILIATION,
AccountType::DEBT,
AccountType::MORTGAGE,
- AccountType::LIABILITY_CREDIT
+ AccountType::LIABILITY_CREDIT,
];
foreach ($types as $type) {
try {
diff --git a/database/seeders/ConfigSeeder.php b/database/seeders/ConfigSeeder.php
index 7005d71345..d0b100792d 100644
--- a/database/seeders/ConfigSeeder.php
+++ b/database/seeders/ConfigSeeder.php
@@ -49,7 +49,7 @@ class ConfigSeeder extends Seeder
);
}
if (null !== $entry) {
- $version = (int)config('firefly.db_version');
+ $version = (int) config('firefly.db_version');
$entry->data = $version;
$entry->save();
diff --git a/database/seeders/TransactionTypeSeeder.php b/database/seeders/TransactionTypeSeeder.php
index 07aacd5ab0..d3dd66be5d 100644
--- a/database/seeders/TransactionTypeSeeder.php
+++ b/database/seeders/TransactionTypeSeeder.php
@@ -40,7 +40,7 @@ class TransactionTypeSeeder extends Seeder
TransactionType::OPENING_BALANCE,
TransactionType::RECONCILIATION,
TransactionType::INVALID,
- TransactionType::LIABILITY_CREDIT
+ TransactionType::LIABILITY_CREDIT,
];
foreach ($types as $type) {