Merge pull request #6860 from firefly-iii/six-alpha1

Update files for 6.0.0-alpha.1
This commit is contained in:
James Cole
2023-01-15 15:55:31 +01:00
committed by GitHub
508 changed files with 2186 additions and 1904 deletions

View File

@@ -194,7 +194,7 @@ class UserController extends Controller
$data = $request->getAll();
// can only update 'blocked' when user is admin.
if(!$this->repository->hasRole(auth()->user(), 'owner')) {
if (!$this->repository->hasRole(auth()->user(), 'owner')) {
Log::debug('Quietly drop fields "blocked" and "blocked_code" from request.');
unset($data['blocked'], $data['blocked_code']);
}

View File

@@ -146,6 +146,5 @@ class ShowController extends Controller
// trigger event to send them:
event(new RequestedSendWebhookMessages());
return response()->json([], 204);
}
}

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace FireflyIII\Console\Commands\Correction;
use FireflyIII\Models\Account;

View File

@@ -44,19 +44,19 @@ use Psr\Container\NotFoundExceptionInterface;
*/
class UpgradeLiabilitiesEight extends Command
{
public const CONFIG_NAME = '580_upgrade_liabilities';
public const CONFIG_NAME = '600_upgrade_liabilities';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Upgrade liabilities to new 5.8.0 structure.';
protected $description = 'Upgrade liabilities to new 6.0.0 structure.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:liabilities-580 {--F|force : Force the execution of this command.}';
protected $signature = 'firefly-iii:liabilities-600 {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
@@ -76,7 +76,7 @@ class UpgradeLiabilitiesEight extends Command
$this->markAsExecuted();
$end = round(microtime(true) - $start, 2);
$this->info(sprintf('Upgraded liabilities for 5.8.0 in %s seconds.', $end));
$this->info(sprintf('Upgraded liabilities for 6.0.0 in %s seconds.', $end));
return 0;
}

View File

@@ -39,7 +39,7 @@ class WebhookEventHandler
{
Log::debug(sprintf('Now in %s', __METHOD__));
// kick off the job!
$messages = WebhookMessage::where('webhook_messages.sent',false)
$messages = WebhookMessage::where('webhook_messages.sent', false)
->get(['webhook_messages.*'])
->filter(
function (WebhookMessage $message) {

View File

@@ -32,7 +32,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
*/
trait CollectorProperties
{
const TEST = 'Test';
public const TEST = 'Test';
private array $fields;
private bool $hasAccountInfo;
private bool $hasBillInformation;

View File

@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* TriggerController.php

View File

@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* TriggerRecurrenceRequest.php

View File

@@ -299,7 +299,7 @@ class AccountUpdateService
$openingBalanceDate = $data['opening_balance_date'];
// if liability, make sure the amount is positive for a credit, and negative for a debit.
if($this->isLiability($account)) {
if ($this->isLiability($account)) {
$openingBalance = 'credit' === $data['liability_direction'] ? app('steam')->positive($openingBalance) : app('steam')->negative($openingBalance);
}
@@ -311,7 +311,7 @@ class AccountUpdateService
}
}
// if cannot have an opening balance, delete it.
if(!in_array($type->type, $this->canHaveOpeningBalance, true)) {
if (!in_array($type->type, $this->canHaveOpeningBalance, true)) {
$this->deleteOBGroup($account);
}
}

View File

@@ -244,10 +244,10 @@ class TransactionGroupTransformer extends AbstractTransformer
return null;
}
if (array_key_exists($key, $array) && null !== $array[$key]) {
if(0 === $array[$key]) {
if (0 === $array[$key]) {
return $default;
}
if('0' === $array[$key]) {
if ('0' === $array[$key]) {
return $default;
}
return (string)$array[$key];

View File

@@ -243,10 +243,10 @@ class TransactionGroupTransformer extends AbstractTransformer
if (null === $array[$key] && null === $default) {
return null;
}
if(0 === $array[$key]) {
if (0 === $array[$key]) {
return $default;
}
if('0' === $array[$key]) {
if ('0' === $array[$key]) {
return $default;
}
if (null !== $array[$key]) {
@@ -270,7 +270,7 @@ class TransactionGroupTransformer extends AbstractTransformer
return null;
}
Log::debug(sprintf('Now in date("%s")', $string));
if(10 === strlen($string)) {
if (10 === strlen($string)) {
return Carbon::createFromFormat('Y-m-d', $string, config('app.timezone'));
}
return Carbon::createFromFormat('Y-m-d H:i:s', $string, config('app.timezone'));

View File

@@ -34,7 +34,7 @@ use Log;
*/
trait CurrencyValidation
{
const TEST = 'Test';
public const TEST = 'Test';
/**
* If the transactions contain foreign amounts, there must also be foreign currency information.
*