. */ declare(strict_types=1); namespace FireflyIII\Services\Internal\Destroy; use Exception; use FireflyIII\Models\Bill; use Log; /** * @codeCoverageIgnore * Class BillDestroyService */ class BillDestroyService { /** * 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 Bill $bill */ public function destroy(Bill $bill): void { try { $bill->delete(); } catch (Exception $e) { // @codeCoverageIgnore Log::error(sprintf('Could not delete bill: %s', $e->getMessage())); // @codeCoverageIgnore } } }