mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add void after some methods.
This commit is contained in:
parent
bc50d25468
commit
655d03bec4
@ -58,5 +58,6 @@ return $config->setRules([
|
||||
'type_declaration_spaces' => false,
|
||||
'cast_spaces' => false,
|
||||
'binary_operator_spaces' => false,
|
||||
'void_return' => true,
|
||||
])
|
||||
->setFinder($finder);
|
||||
|
@ -66,7 +66,7 @@ class MoveTransactionsRequest extends FormRequest
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(
|
||||
function (Validator $validator) {
|
||||
function (Validator $validator): void {
|
||||
// validate start before end only if both are there.
|
||||
$data = $validator->getData();
|
||||
if (array_key_exists('original_account', $data) && array_key_exists('destination_account', $data)) {
|
||||
|
@ -67,7 +67,7 @@ class TransactionRequest extends FormRequest
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(
|
||||
function (Validator $validator) {
|
||||
function (Validator $validator): void {
|
||||
// validate transaction query data.
|
||||
$this->validateTransactionQuery($validator);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class Request extends FormRequest
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(
|
||||
static function (Validator $validator) {
|
||||
static function (Validator $validator): void {
|
||||
// validate start before end only if both are there.
|
||||
$data = $validator->getData();
|
||||
if (array_key_exists('start', $data) && array_key_exists('end', $data)) {
|
||||
|
@ -92,7 +92,7 @@ class StoreRequest extends FormRequest
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(
|
||||
static function (Validator $validator) {
|
||||
static function (Validator $validator): void {
|
||||
$data = $validator->getData();
|
||||
$min = (string)($data['amount_min'] ?? '0');
|
||||
$max = (string)($data['amount_max'] ?? '0');
|
||||
|
@ -95,7 +95,7 @@ class UpdateRequest extends FormRequest
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(
|
||||
static function (Validator $validator) {
|
||||
static function (Validator $validator): void {
|
||||
$data = $validator->getData();
|
||||
if (array_key_exists('amount_min', $data) && array_key_exists('amount_max', $data)) {
|
||||
$min = $data['amount_min'] ?? '0';
|
||||
|
@ -51,7 +51,7 @@ class FixAccountTypes extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @throws FireflyException|\JsonException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
@ -373,7 +373,7 @@ class FixAccountTypes extends Command
|
||||
$this->inspectJournal($journal);
|
||||
}
|
||||
|
||||
private function giveNewExpense(TransactionJournal $journal, Transaction $destination)
|
||||
private function giveNewExpense(TransactionJournal $journal, Transaction $destination): void
|
||||
{
|
||||
app('log')->debug(sprintf('An account of type "%s" could be a valid destination.', AccountTypeEnum::EXPENSE->value));
|
||||
$this->factory->setUser($journal->user);
|
||||
|
@ -374,7 +374,7 @@ class ForceDecimalSize extends Command
|
||||
/**
|
||||
* This method fixes all piggy bank repetitions in currency $currency.
|
||||
*/
|
||||
private function correctPiggyRepetitionAmounts(TransactionCurrency $currency, array $fields)
|
||||
private function correctPiggyRepetitionAmounts(TransactionCurrency $currency, array $fields): void
|
||||
{
|
||||
$operator = $this->operator;
|
||||
$cast = $this->cast;
|
||||
|
@ -91,7 +91,7 @@ class UpgradeCurrencyPreferences extends Command
|
||||
}
|
||||
}
|
||||
|
||||
private function upgradeGroupPreferences(UserGroup $group)
|
||||
private function upgradeGroupPreferences(UserGroup $group): void
|
||||
{
|
||||
$currencies = TransactionCurrency::get();
|
||||
$enabled = new Collection();
|
||||
|
@ -180,6 +180,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
|
||||
break;
|
||||
|
||||
case WebhookResponse::TRANSACTIONS->value:
|
||||
/** @var TransactionGroup $model */
|
||||
$transformer = new TransactionGroupTransformer();
|
||||
|
||||
try {
|
||||
@ -196,6 +197,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
|
||||
break;
|
||||
|
||||
case WebhookResponse::ACCOUNTS->value:
|
||||
/** @var TransactionGroup $model */
|
||||
$accounts = $this->collectAccounts($model);
|
||||
foreach ($accounts as $account) {
|
||||
$transformer = new AccountTransformer();
|
||||
|
@ -222,7 +222,7 @@ class LoginController extends Controller
|
||||
*
|
||||
* @throws ValidationException
|
||||
*/
|
||||
protected function sendFailedLoginResponse(Request $request)
|
||||
protected function sendFailedLoginResponse(Request $request): void
|
||||
{
|
||||
$exception = ValidationException::withMessages(
|
||||
[
|
||||
|
@ -83,7 +83,7 @@ class ConvertToDeposit implements ActionInterface
|
||||
|
||||
try {
|
||||
$res = $this->convertWithdrawalArray($object);
|
||||
} catch (FireflyException|\JsonException $e) {
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->debug('Could not convert withdrawal to deposit.');
|
||||
app('log')->error($e->getMessage());
|
||||
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.complex_error')));
|
||||
@ -100,7 +100,7 @@ class ConvertToDeposit implements ActionInterface
|
||||
|
||||
try {
|
||||
$res = $this->convertTransferArray($object);
|
||||
} catch (FireflyException|\JsonException $e) {
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->debug('Could not convert transfer to deposit.');
|
||||
app('log')->error($e->getMessage());
|
||||
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.complex_error')));
|
||||
|
@ -86,7 +86,7 @@ class ConvertToWithdrawal implements ActionInterface
|
||||
|
||||
try {
|
||||
$res = $this->convertDepositArray($object);
|
||||
} catch (FireflyException|\JsonException $e) {
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->debug('Could not convert transfer to deposit.');
|
||||
app('log')->error($e->getMessage());
|
||||
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.complex_error')));
|
||||
@ -102,7 +102,7 @@ class ConvertToWithdrawal implements ActionInterface
|
||||
|
||||
try {
|
||||
$res = $this->convertTransferArray($object);
|
||||
} catch (FireflyException|\JsonException $e) {
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->debug('Could not convert transfer to deposit.');
|
||||
app('log')->error($e->getMessage());
|
||||
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.complex_error')));
|
||||
|
@ -527,7 +527,7 @@ class User extends Authenticatable
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function setLdapDomain($domain)
|
||||
public function setLdapDomain($domain): void
|
||||
{
|
||||
$this->{$this->getLdapDomainColumn()} = $domain;
|
||||
}
|
||||
@ -539,7 +539,7 @@ class User extends Authenticatable
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function setLdapGuid($guid)
|
||||
public function setLdapGuid($guid): void
|
||||
{
|
||||
$this->{$this->getLdapGuidColumn()} = $guid;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user