for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Coyote\Services\Invoice;
use Coyote\Country;
class VatRateCalculator
{
private float $defaultVatRate;
public function __construct()
$this->defaultVatRate = config('vendor.default_vat_rate');
}
public function vatRate(?Country $country, ?string $vatId): float
if (!$vatId || !$country) {
return $this->defaultVatRate;
return $country->vat_rate ?? $this->defaultVatRate;