. */ declare(strict_types=1); namespace FireflyIII\Services\Internal\Destroy; use Exception; use FireflyIII\Models\TransactionCurrency; use Log; /** * Class CurrencyDestroyService */ class CurrencyDestroyService { /** * Constructor. */ public function __construct() { if ('testing' === config('app.env')) { Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this))); } } /** * @param TransactionCurrency $currency */ public function destroy(TransactionCurrency $currency): void { try { $currency->forceDelete(); } catch (Exception $e) { // @codeCoverageIgnore Log::error(sprintf('Could not delete transaction currency: %s', $e->getMessage())); // @codeCoverageIgnore } } }