Update PHP code, code cleanup.

This commit is contained in:
James Cole 2021-08-10 19:31:55 +02:00
parent 8e104a62ae
commit 8328c26df3
29 changed files with 287 additions and 33 deletions

View File

@ -1,4 +1,25 @@
<?php
/*
* AccountController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Data\Bulk;

View File

@ -1,5 +1,27 @@
<?php
/*
* TransactionController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Data\Bulk;
use FireflyIII\Api\V1\Controllers\Controller;
@ -72,4 +94,4 @@ class TransactionController extends Controller
return array_key_exists('source_account_id', $params['where']) && array_key_exists('destination_account_id', $params['update']);
}
}
}

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/*
* AccountController.php
* ExportController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Data\Export;
use FireflyIII\Api\V1\Controllers\Controller;

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/*
* PeriodController.php
* BillController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller;

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/*
* PeriodController.php
* TagController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller;

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/*
* PeriodController.php
* TagController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Income;
use FireflyIII\Api\V1\Controllers\Controller;

View File

@ -1,4 +1,25 @@
<?php
/*
* MoveTransactionsRequest.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\Data\Bulk;

View File

@ -1,5 +1,27 @@
<?php
/*
* TransactionRequest.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\Data\Bulk;
use FireflyIII\Enums\ClauseType;
@ -61,4 +83,4 @@ class TransactionRequest extends FormRequest
}
);
}
}
}

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/*
* PreferenceStoreRequest.php
* PreferenceUpdateRequest.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\User;
use FireflyIII\Support\Request\ChecksLogin;

View File

@ -1,4 +1,25 @@
<?php
/*
* FixPostgresSequences.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Console\Commands\Correction;

View File

@ -1,4 +1,25 @@
<?php
/*
* UpgradeLiabilities.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;

View File

@ -1,4 +1,25 @@
<?php
/*
* VerifySecurityAlerts.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Console\Commands;

View File

@ -1,5 +1,27 @@
<?php
/*
* ClauseType.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Enums;
/**
@ -10,4 +32,4 @@ class ClauseType
public const TRANSACTION = 'transaction';
public const WHERE = 'where';
public const UPDATE = 'update';
}
}

View File

@ -1,5 +1,5 @@
<?php
declare(strict_types=1);
/*
* StoredAccount.php
* Copyright (c) 2021 james@firefly-iii.org
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Events;
use FireflyIII\Models\Account;

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/*
* StoredAccount.php
* UpdatedAccount.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@ -20,6 +20,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Events;
use FireflyIII\Models\Account;

View File

@ -1,8 +1,8 @@
<?php
declare(strict_types=1);
/*
* WebhookMessageGenerator.php
* Copyright (c) 2020 james@firefly-iii.org
* StandardMessageGenerator.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Generator\Webhook;
use FireflyIII\Exceptions\FireflyException;

View File

@ -1,5 +1,5 @@
<?php
declare(strict_types=1);
/*
* LDAPEventHandler.php
* Copyright (c) 2021 james@firefly-iii.org
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Handlers\Events;

View File

@ -1,5 +1,5 @@
<?php
declare(strict_types=1);
/*
* StoredAccountEventHandler.php
* Copyright (c) 2021 james@firefly-iii.org
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\StoredAccount;

View File

@ -1,5 +1,5 @@
<?php
declare(strict_types=1);
/*
* UpdatedAccountEventHandler.php
* Copyright (c) 2021 james@firefly-iii.org
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Handlers\Events;

View File

@ -1,5 +1,5 @@
<?php
declare(strict_types=1);
/*
* AttributeHandler.php
* Copyright (c) 2021 james@firefly-iii.org
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Ldap;
use FireflyIII\User as DatabaseUser;

View File

@ -1,5 +1,27 @@
<?php
/*
* IsValidBulkClause.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Rules;
use Illuminate\Contracts\Validation\Rule;
@ -91,4 +113,4 @@ class IsValidBulkClause implements Rule
return true;
}
}
}

View File

@ -1,5 +1,5 @@
<?php
declare(strict_types=1);
/*
* CreditRecalculateService.php
* Copyright (c) 2021 james@firefly-iii.org
@ -20,6 +20,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Services\Internal\Support;

View File

@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
/*
* StaticConfigKey.php
* EitherConfigKey.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Support\Binder;
use Illuminate\Routing\Route;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

View File

@ -1,5 +1,5 @@
<?php
declare(strict_types=1);
/*
* LiabilityValidation.php
* Copyright (c) 2021 james@firefly-iii.org
@ -20,6 +20,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Validation\Account;

View File

@ -1,5 +1,27 @@
<?php
/*
* ValidatesBulkTransactionQuery.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Validation\Api\Data\Bulk;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
@ -50,4 +72,4 @@ trait ValidatesBulkTransactionQuery
}
}
}
}

View File

@ -35,6 +35,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- You can disable webhooks with an extra field in API submissions.
- There is a static cron token (see `.env.example`) which is useful for Docker.
## 5.5.13 - 2021-07-25
### Security
- This version of Firefly III fixes [CVE-2021-3663](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3663)
## 5.5.12 - 2021-06-03
⚠️ On July 1st 2021 the Docker tag will change to `fireflyiii/core`. You can already start using the new tag.

View File

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
use FireflyIII\Enums\ClauseType;
@ -11,4 +12,4 @@ return [
'destination_account_id' => 'required|numeric|belongsToUser:accounts,id',
],
],
];
];

View File

@ -101,7 +101,7 @@ return [
'webhooks' => true,
'handle_debts' => true,
],
'version' => '5.6.0-alpha.1',
'version' => '5.6.0-alpha.2',
'api_version' => '1.5.3',
'db_version' => 17,
@ -164,7 +164,7 @@ return [
// 'id_ID' => ['name_locale' => 'Bahasa Indonesia', 'name_english' => 'Indonesian'],
// 'is_IS' => ['name_locale' => 'Icelandic', 'name_english' => 'Icelandic'],
'it_IT' => ['name_locale' => 'Italiano', 'name_english' => 'Italian'],
'ja_JA' => ['name_locale' => 'Japanese', 'name_english' => 'Japanese'],
'ja_JP' => ['name_locale' => 'Japanese', 'name_english' => 'Japanese'],
// 'lt_LT' => ['name_locale' => 'Lietuvių', 'name_english' => 'Lithuanian'],
'nb_NO' => ['name_locale' => 'Norsk', 'name_english' => 'Norwegian'],
'nl_NL' => ['name_locale' => 'Nederlands', 'name_english' => 'Dutch'],

View File

@ -1,5 +1,5 @@
sonar.projectKey=firefly-iii
sonar.projectVersion=5.6.0-alpha.1
sonar.projectVersion=5.6.0-alpha.2
sonar.sources=app,bootstrap,database,resources/assets,resources/views,routes,tests,frontend/src/components,frontend/src/pages
sonar.login=2859ca0fb90d8419e211190a8892b3e1721244cb
sonar.sourceEncoding=UTF-8