mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 09:52:20 +00:00
Merge pull request #6860 from firefly-iii/six-alpha1
Update files for 6.0.0-alpha.1
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
|
||||
@@ -146,6 +146,5 @@ class ShowController extends Controller
|
||||
// trigger event to send them:
|
||||
event(new RequestedSendWebhookMessages());
|
||||
return response()->json([], 204);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands\Correction;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
* TriggerController.php
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
* TriggerRecurrenceRequest.php
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user