James Cole 2023-11-07 20:06:56 +01:00
parent 867d932e59
commit 80b8e676d0
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
5 changed files with 22 additions and 12 deletions

View File

@ -226,16 +226,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.37.1",
"version": "v3.38.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "c3fe76976081ab871aa654e872da588077e19679"
"reference": "7e6070026e76aa09d77a47519625c86593fb8e31"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/c3fe76976081ab871aa654e872da588077e19679",
"reference": "c3fe76976081ab871aa654e872da588077e19679",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7e6070026e76aa09d77a47519625c86593fb8e31",
"reference": "7e6070026e76aa09d77a47519625c86593fb8e31",
"shasum": ""
},
"require": {
@ -307,7 +307,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.37.1"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.38.0"
},
"funding": [
{
@ -315,7 +315,7 @@
"type": "github"
}
],
"time": "2023-10-29T20:51:23+00:00"
"time": "2023-11-07T08:44:54+00:00"
},
{
"name": "psr/container",

View File

@ -108,10 +108,10 @@ class Controller extends BaseController
}
if (null !== $date) {
try {
$obj = Carbon::parse($date, config('app.timezone'));
$obj = Carbon::parse((string) $date, config('app.timezone'));
} catch (InvalidDateException | InvalidFormatException $e) {
// don't care
app('log')->warning(sprintf('Ignored invalid date "%s" in API v2 controller parameter check: %s', substr($date, 0, 20), $e->getMessage()));
app('log')->warning(sprintf('Ignored invalid date "%s" in API v2 controller parameter check: %s', substr((string) $date, 0, 20), $e->getMessage()));
}
// out of range? set to null.
if (null !== $obj && ($obj->year <= 1900 || $obj->year > 2099)) {

View File

@ -28,7 +28,9 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use stdClass;
use ValueError;
/**
* Class FixUnevenAmount
@ -69,7 +71,15 @@ class FixUnevenAmount extends Command
$count++;
continue;
}
if (0 !== bccomp((string)$entry->the_sum, '0')) {
$res = -1;
try {
$res = bccomp($sum, '0');
} catch (ValueError $e) {
$this->friendlyError(sprintf('Could not bccomp("%s", "0").', $sum));
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
}
if (0 !== $res) {
$message = sprintf(
'Sum of journal #%d is %s instead of zero.',
$entry->transaction_journal_id,

View File

@ -378,11 +378,11 @@ class Navigation
// then correct for quarterly or half-year
if ('quarterly' === $period) {
Log::debug(sprintf('Q: Corrected %f to %f', $floatDiff, $floatDiff / 3));
$floatDiff = $floatDiff / 3;
$floatDiff /= 3;
}
if ('half-year' === $period) {
Log::debug(sprintf('H: Corrected %f to %f', $floatDiff, $floatDiff / 6));
$floatDiff = $floatDiff / 6;
$floatDiff /= 6;
}
// then do ceil()

View File

@ -356,7 +356,7 @@ class BillTransformer extends AbstractTransformer
$steps = app('navigation')->diffInPeriods($bill->repeat_freq, $bill->skip, $start, $date);
$result = clone $start;
if ($steps > 0) {
$steps = $steps - 1;
$steps -= 1;
app('log')->debug(sprintf('Steps is %d, because addPeriod already adds 1.', $steps));
$result = app('navigation')->addPeriod($start, $bill->repeat_freq, $steps);
}