Better error handling and remove some warnings.

This commit is contained in:
James Cole
2024-08-05 19:45:04 +02:00
parent d2e9b64bf5
commit e26f78bf50
13 changed files with 316 additions and 46 deletions

View File

@@ -44,7 +44,7 @@ class Steam
*/
public function balanceIgnoreVirtual(Account $account, Carbon $date): string
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
//Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class);
$repository->setUser($account->user);
@@ -93,7 +93,7 @@ class Steam
*/
public function balanceInRange(Account $account, Carbon $start, Carbon $end, ?TransactionCurrency $currency = null): array
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
$cache = new CacheProperties();
$cache->addProperty($account->id);
$cache->addProperty('balance-in-range');
@@ -214,7 +214,7 @@ class Steam
*/
public function balance(Account $account, Carbon $date, ?TransactionCurrency $currency = null): string
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// abuse chart properties:
$cache = new CacheProperties();
$cache->addProperty($account->id);
@@ -261,7 +261,7 @@ class Steam
*/
public function balanceInRangeConverted(Account $account, Carbon $start, Carbon $end, TransactionCurrency $native): array
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
$cache = new CacheProperties();
$cache->addProperty($account->id);
$cache->addProperty('balance-in-range-converted');
@@ -386,7 +386,7 @@ class Steam
*/
public function balanceConverted(Account $account, Carbon $date, TransactionCurrency $native): string
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
Log::debug(sprintf('Now in balanceConverted (%s) for account #%d, converting to %s', $date->format('Y-m-d'), $account->id, $native->code));
$cache = new CacheProperties();
$cache->addProperty($account->id);
@@ -526,7 +526,7 @@ class Steam
*/
public function balancesByAccounts(Collection $accounts, Carbon $date): array
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
$ids = $accounts->pluck('id')->toArray();
// cache this property.
$cache = new CacheProperties();
@@ -557,7 +557,7 @@ class Steam
*/
public function balancesByAccountsConverted(Collection $accounts, Carbon $date): array
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
$ids = $accounts->pluck('id')->toArray();
// cache this property.
$cache = new CacheProperties();
@@ -591,7 +591,7 @@ class Steam
*/
public function balancesPerCurrencyByAccounts(Collection $accounts, Carbon $date): array
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
$ids = $accounts->pluck('id')->toArray();
// cache this property.
$cache = new CacheProperties();
@@ -617,7 +617,7 @@ class Steam
public function balancePerCurrency(Account $account, Carbon $date): array
{
Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// Log::warning(sprintf('Deprecated method %s, do not use.', __METHOD__));
// abuse chart properties:
$cache = new CacheProperties();
$cache->addProperty($account->id);