mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 14:12:15 +00:00
Fix code
This commit is contained in:
@@ -99,7 +99,7 @@ class IndexController extends Controller
|
||||
$activities = app('steam')->getLastActivities($ids);
|
||||
|
||||
$accounts->each(
|
||||
function (Account $account) use ($activities, $startBalances, $endBalances) {
|
||||
function (Account $account) use ($activities, $startBalances, $endBalances): void {
|
||||
$account->lastActivityDate = $this->isInArrayDate($activities, $account->id);
|
||||
$account->startBalance = $this->isInArray($startBalances, $account->id);
|
||||
$account->endBalance = $this->isInArray($endBalances, $account->id);
|
||||
@@ -162,7 +162,7 @@ class IndexController extends Controller
|
||||
$activities = app('steam')->getLastActivities($ids);
|
||||
|
||||
$accounts->each(
|
||||
function (Account $account) use ($activities, $startBalances, $endBalances) {
|
||||
function (Account $account) use ($activities, $startBalances, $endBalances): void {
|
||||
$interest = (string)$this->repository->getMetaValue($account, 'interest');
|
||||
$interest = '' === $interest ? '0' : $interest;
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class LinkController extends Controller
|
||||
|
||||
Log::channel('audit')->info('User on index of link types in admin.');
|
||||
$linkTypes->each(
|
||||
function (LinkType $linkType) {
|
||||
function (LinkType $linkType): void {
|
||||
$linkType->journalCount = $this->repository->countJournals($linkType);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -173,7 +173,7 @@ class UserController extends Controller
|
||||
|
||||
// add meta stuff.
|
||||
$users->each(
|
||||
function (User $user) {
|
||||
function (User $user): void {
|
||||
$user->isAdmin = $this->repository->hasRole($user, 'owner');
|
||||
$user->has2FA = null !== $user->mfa_secret;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class ResetPasswordController extends Controller
|
||||
// database. Otherwise we will parse the error and return the response.
|
||||
$response = $this->broker()->reset(
|
||||
$this->credentials($request),
|
||||
function ($user, $password) {
|
||||
function ($user, $password): void {
|
||||
$this->resetPassword($user, $password);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -77,7 +77,7 @@ class IndexController extends Controller
|
||||
$collection = $collection->slice(($page - 1) * $pageSize, $pageSize);
|
||||
|
||||
$collection->each(
|
||||
function (Category $category) {
|
||||
function (Category $category): void {
|
||||
$category->lastActivity = $this->repository->lastUseDate($category, new Collection());
|
||||
}
|
||||
);
|
||||
|
||||
@@ -74,7 +74,7 @@ class BudgetFormStoreRequest extends FormRequest
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(
|
||||
function (Validator $validator) {
|
||||
function (Validator $validator): void {
|
||||
// validate all account info
|
||||
$this->validateAutoBudgetAmount($validator);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class BudgetFormUpdateRequest extends FormRequest
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(
|
||||
function (Validator $validator) {
|
||||
function (Validator $validator): void {
|
||||
// validate all account info
|
||||
$this->validateAutoBudgetAmount($validator);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ class RecurrenceFormRequest extends FormRequest
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(
|
||||
function (Validator $validator) {
|
||||
function (Validator $validator): void {
|
||||
// validate all account info
|
||||
$this->validateAccountInformation($validator);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,8 @@ class ReportFormRequest extends FormRequest
|
||||
// validate as date
|
||||
// if regex for YYYY-MM-DD:
|
||||
$pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/';
|
||||
if (false !== preg_match($pattern, $string)) {
|
||||
$result = preg_match($pattern, $string);
|
||||
if (false !== $result && 0 !== $result) {
|
||||
try {
|
||||
$date = new Carbon($parts[1]);
|
||||
} catch (\Exception $e) { // intentional generic exception
|
||||
@@ -178,7 +179,8 @@ class ReportFormRequest extends FormRequest
|
||||
// validate as date
|
||||
// if regex for YYYY-MM-DD:
|
||||
$pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/';
|
||||
if (false !== preg_match($pattern, $string)) {
|
||||
$result = preg_match($pattern, $string);
|
||||
if (false !== $result && 0 !== $result) {
|
||||
try {
|
||||
$date = new Carbon($parts[0]);
|
||||
} catch (\Exception $e) { // intentional generic exception
|
||||
|
||||
Reference in New Issue
Block a user