mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Remove some logs.
This commit is contained in:
@@ -19,26 +19,24 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
|
|
||||||
|
|
||||||
$current = __DIR__;
|
$current = __DIR__;
|
||||||
|
|
||||||
$paths = [
|
$paths = [
|
||||||
$current . '/../../app',
|
$current . '/../../app',
|
||||||
$current . '/../../config',
|
$current . '/../../config',
|
||||||
$current . '/../../database',
|
|
||||||
$current . '/../../routes',
|
$current . '/../../routes',
|
||||||
$current . '/../../tests',
|
$current . '/../../tests',
|
||||||
$current . '/../../resources/lang/en_US',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$finder = PhpCsFixer\Finder::create()
|
$finder = PhpCsFixer\Finder::create()
|
||||||
->in($paths);
|
->in($paths);
|
||||||
|
|
||||||
|
|
||||||
$config = new PhpCsFixer\Config();
|
$config = (new PhpCsFixer\Config())
|
||||||
$config->setParallelConfig(ParallelConfigFactory::detect());
|
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
|
||||||
|
;
|
||||||
return $config->setRules(
|
return $config->setRules(
|
||||||
|
|
||||||
[
|
[
|
||||||
// rule sets
|
// rule sets
|
||||||
'@PHP83Migration' => true,
|
'@PHP83Migration' => true,
|
||||||
@@ -53,9 +51,6 @@ return $config->setRules(
|
|||||||
'statement_indentation' => true,
|
'statement_indentation' => true,
|
||||||
'void_return' => true,
|
'void_return' => true,
|
||||||
|
|
||||||
// about importing statements
|
|
||||||
'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
|
|
||||||
|
|
||||||
// disabled rules
|
// disabled rules
|
||||||
'native_function_invocation' => false, // annoying
|
'native_function_invocation' => false, // annoying
|
||||||
'php_unit_data_provider_name' => false, // bloody annoying long test names
|
'php_unit_data_provider_name' => false, // bloody annoying long test names
|
||||||
@@ -64,9 +59,14 @@ return $config->setRules(
|
|||||||
'comment_to_phpdoc' => false, // breaks phpstan lines in combination with PHPStorm.
|
'comment_to_phpdoc' => false, // breaks phpstan lines in combination with PHPStorm.
|
||||||
'type_declaration_spaces' => false,
|
'type_declaration_spaces' => false,
|
||||||
'cast_spaces' => false,
|
'cast_spaces' => false,
|
||||||
'phpdoc_to_comment' => false, // do not overrule single line comment style, breaks phpstan.
|
|
||||||
|
// enabled rules
|
||||||
|
'global_namespace_import' => true, // matches with rector.
|
||||||
|
|
||||||
// complex rules
|
// complex rules
|
||||||
|
'php_unit_test_case_static_method_calls' => [
|
||||||
|
'call_type' => 'this',
|
||||||
|
],
|
||||||
'array_syntax' => ['syntax' => 'short'],
|
'array_syntax' => ['syntax' => 'short'],
|
||||||
'binary_operator_spaces' => [
|
'binary_operator_spaces' => [
|
||||||
'default' => 'at_least_single_space',
|
'default' => 'at_least_single_space',
|
||||||
@@ -76,5 +76,7 @@ return $config->setRules(
|
|||||||
'??=' => 'align_single_space_minimal_by_scope',
|
'??=' => 'align_single_space_minimal_by_scope',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
])
|
]
|
||||||
|
|
||||||
|
)
|
||||||
->setFinder($finder);
|
->setFinder($finder);
|
||||||
|
@@ -82,7 +82,7 @@ class NetWorth implements NetWorthInterface
|
|||||||
|
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
Log::debug(sprintf('Now at account #%d ("%s")', $account->id, $account->name));
|
// Log::debug(sprintf('Now at account #%d ("%s")', $account->id, $account->name));
|
||||||
$currency = $this->accountRepository->getAccountCurrency($account) ?? $default;
|
$currency = $this->accountRepository->getAccountCurrency($account) ?? $default;
|
||||||
$useNative = $convertToNative && $default->id !== $currency->id;
|
$useNative = $convertToNative && $default->id !== $currency->id;
|
||||||
$currency = $useNative ? $default : $currency;
|
$currency = $useNative ? $default : $currency;
|
||||||
@@ -93,12 +93,12 @@ class NetWorth implements NetWorthInterface
|
|||||||
$balance = $balances[$account->id]['balance'] ?? '0';
|
$balance = $balances[$account->id]['balance'] ?? '0';
|
||||||
$nativeBalance = $balances[$account->id]['native_balance'] ?? '0';
|
$nativeBalance = $balances[$account->id]['native_balance'] ?? '0';
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Balance is %s, native balance is %s', $balance, $nativeBalance));
|
// Log::debug(sprintf('Balance is %s, native balance is %s', $balance, $nativeBalance));
|
||||||
// always subtract virtual balance again.
|
// always subtract virtual balance again.
|
||||||
$balance = '' !== (string) $account->virtual_balance ? bcsub($balance, (string) $account->virtual_balance) : $balance;
|
$balance = '' !== (string) $account->virtual_balance ? bcsub($balance, (string) $account->virtual_balance) : $balance;
|
||||||
$nativeBalance = '' !== (string) $account->native_virtual_balance ? bcsub($nativeBalance, (string) $account->native_virtual_balance) : $nativeBalance;
|
$nativeBalance = '' !== (string) $account->native_virtual_balance ? bcsub($nativeBalance, (string) $account->native_virtual_balance) : $nativeBalance;
|
||||||
$amountToUse = $useNative ? $nativeBalance : $balance;
|
$amountToUse = $useNative ? $nativeBalance : $balance;
|
||||||
Log::debug(sprintf('Will use %s %s', $currencyCode, $amountToUse));
|
// Log::debug(sprintf('Will use %s %s', $currencyCode, $amountToUse));
|
||||||
|
|
||||||
$netWorth[$currencyCode] ??= [
|
$netWorth[$currencyCode] ??= [
|
||||||
'balance' => '0',
|
'balance' => '0',
|
||||||
|
@@ -71,12 +71,12 @@ class TransactionSummarizer
|
|||||||
$foreignCurrencyDecimalPlaces = null;
|
$foreignCurrencyDecimalPlaces = null;
|
||||||
|
|
||||||
if ($this->convertToNative) {
|
if ($this->convertToNative) {
|
||||||
Log::debug('convertToNative is true.');
|
// Log::debug('convertToNative is true.');
|
||||||
// if convert to native, use the native amount yes or no?
|
// if convert to native, use the native amount yes or no?
|
||||||
$useNative = $this->default->id !== (int) $journal['currency_id'];
|
$useNative = $this->default->id !== (int) $journal['currency_id'];
|
||||||
$useForeign = $this->default->id === (int) $journal['foreign_currency_id'];
|
$useForeign = $this->default->id === (int) $journal['foreign_currency_id'];
|
||||||
if ($useNative) {
|
if ($useNative) {
|
||||||
Log::debug(sprintf('Journal #%d switches to native amount (original is %s)', $journal['transaction_journal_id'], $journal['currency_code']));
|
// Log::debug(sprintf('Journal #%d switches to native amount (original is %s)', $journal['transaction_journal_id'], $journal['currency_code']));
|
||||||
$field = 'native_amount';
|
$field = 'native_amount';
|
||||||
$currencyId = $this->default->id;
|
$currencyId = $this->default->id;
|
||||||
$currencyName = $this->default->name;
|
$currencyName = $this->default->name;
|
||||||
@@ -85,7 +85,7 @@ class TransactionSummarizer
|
|||||||
$currencyDecimalPlaces = $this->default->decimal_places;
|
$currencyDecimalPlaces = $this->default->decimal_places;
|
||||||
}
|
}
|
||||||
if ($useForeign) {
|
if ($useForeign) {
|
||||||
Log::debug(sprintf('Journal #%d switches to foreign amount (foreign is %s)', $journal['transaction_journal_id'], $journal['foreign_currency_code']));
|
// Log::debug(sprintf('Journal #%d switches to foreign amount (foreign is %s)', $journal['transaction_journal_id'], $journal['foreign_currency_code']));
|
||||||
$field = 'foreign_amount';
|
$field = 'foreign_amount';
|
||||||
$currencyId = (int) $journal['foreign_currency_id'];
|
$currencyId = (int) $journal['foreign_currency_id'];
|
||||||
$currencyName = $journal['foreign_currency_name'];
|
$currencyName = $journal['foreign_currency_name'];
|
||||||
@@ -95,7 +95,7 @@ class TransactionSummarizer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$this->convertToNative) {
|
if (!$this->convertToNative) {
|
||||||
Log::debug('convertToNative is false.');
|
// Log::debug('convertToNative is false.');
|
||||||
// use foreign amount?
|
// use foreign amount?
|
||||||
$foreignCurrencyId = (int) $journal['foreign_currency_id'];
|
$foreignCurrencyId = (int) $journal['foreign_currency_id'];
|
||||||
if (0 !== $foreignCurrencyId) {
|
if (0 !== $foreignCurrencyId) {
|
||||||
|
Reference in New Issue
Block a user