Autoformat lol

This commit is contained in:
James Cole
2026-01-23 15:09:50 +01:00
parent ae1347c550
commit 8f15a32bd6
1071 changed files with 21111 additions and 21687 deletions

View File

@@ -24,12 +24,12 @@ declare(strict_types=1);
namespace FireflyIII\Support\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Exceptions\ValidationException;
use FireflyIII\Http\Requests\RuleFormRequest;
use FireflyIII\Http\Requests\TestRuleFormRequest;
use FireflyIII\Support\Binder\AccountList;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\User;
use Illuminate\Contracts\Validation\Validator as ValidatorContract;
use Illuminate\Routing\Route;
@@ -80,13 +80,13 @@ trait RequestInformation
$data = $request->get('triggers');
if (is_array($data)) {
foreach ($data as $triggerInfo) {
$current = [
$current = [
'type' => $triggerInfo['type'] ?? '',
'value' => $triggerInfo['value'] ?? '',
'prohibited' => $triggerInfo['prohibited'] ?? false,
'stop_processing' => 1 === (int)($triggerInfo['stop_processing'] ?? '0'),
'stop_processing' => 1 === (int) ($triggerInfo['stop_processing'] ?? '0')
];
$current = RuleFormRequest::replaceAmountTrigger($current);
$current = RuleFormRequest::replaceAmountTrigger($current);
$triggers[] = $current;
}
}
@@ -102,13 +102,13 @@ trait RequestInformation
$page = $this->getPageName();
$specificPage = $this->getSpecificPageName();
// indicator if user has seen the help for this page ( + special page):
$key = sprintf('shown_demo_%s%s', $page, $specificPage);
$key = sprintf('shown_demo_%s%s', $page, $specificPage);
// is there an intro for this route?
$intro = config(sprintf('intro.%s', $page)) ?? [];
$specialIntro = config(sprintf('intro.%s%s', $page, $specificPage)) ?? [];
// some routes have a "what" parameter, which indicates a special page:
$shownDemo = true;
$shownDemo = true;
// both must be array and either must be > 0
if (count($intro) > 0 || count($specialIntro) > 0) {
$shownDemo = Preferences::get($key, false)->data;
@@ -129,7 +129,7 @@ trait RequestInformation
$start = session('start', today(config('app.timezone'))->startOfMonth());
/** @var Carbon $end */
$end = session('end', today(config('app.timezone'))->endOfMonth());
$end = session('end', today(config('app.timezone'))->endOfMonth());
if ($start->greaterThanOrEqualTo($date) && $end->greaterThanOrEqualTo($date)) {
return true;
}
@@ -144,20 +144,20 @@ trait RequestInformation
final protected function parseAttributes(array $attributes): array // parse input + return result
{
$attributes['location'] ??= '';
$attributes['accounts'] = AccountList::routeBinder($attributes['accounts'] ?? '', new Route('get', '', []));
$date = Carbon::createFromFormat('Ymd', $attributes['startDate']);
$attributes['accounts'] = AccountList::routeBinder($attributes['accounts'] ?? '', new Route('get', '', []));
$date = Carbon::createFromFormat('Ymd', $attributes['startDate']);
if (!$date instanceof Carbon) {
$date = today(config('app.timezone'));
}
$date->startOfMonth();
$attributes['startDate'] = $date;
$date2 = Carbon::createFromFormat('Ymd', $attributes['endDate']);
$date2 = Carbon::createFromFormat('Ymd', $attributes['endDate']);
if (!$date2 instanceof Carbon) {
$date2 = today(config('app.timezone'));
}
$date2->endOfDay();
$attributes['endDate'] = $date2;
$attributes['endDate'] = $date2;
return $attributes;
}
@@ -167,14 +167,14 @@ trait RequestInformation
*
* @throws ValidationException
*/
final protected function validatePassword(User $user, string $current, string $new): bool // get request info
{
final protected function validatePassword(User $user, string $current, string $new): bool
{ // get request info
if (!Hash::check($current, $user->password)) {
throw new ValidationException((string)trans('firefly.invalid_current_password'));
throw new ValidationException((string) trans('firefly.invalid_current_password'));
}
if ($current === $new) {
throw new ValidationException((string)trans('firefly.should_change'));
throw new ValidationException((string) trans('firefly.should_change'));
}
return true;
@@ -185,12 +185,9 @@ trait RequestInformation
*/
final protected function validator(array $data): ValidatorContract
{
return Validator::make(
$data,
[
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:16|secure_password|confirmed',
]
);
return Validator::make($data, [
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:16|secure_password|confirmed'
]);
}
}