TaxNotFoundException example



    /** * Get the tax rules depend on the customer billing address * respectively the shippingLocation if there is no customer */
    public function buildTaxRules(string $taxId): TaxRuleCollection
    {
        $tax = $this->taxRules->get($taxId);

        if ($tax === null || $tax->getRules() === null) {
            throw new TaxNotFoundException($taxId);
        }

        if ($tax->getRules()->first() !== null) {
            // NEXT-21735 - This is covered randomly             // @codeCoverageIgnoreStart             return new TaxRuleCollection([
                new TaxRule($tax->getRules()->first()->getTaxRate(), 100),
            ]);
            // @codeCoverageIgnoreEnd         }

        
Home | Imprint | This part of the site doesn't use cookies.