Skip to content

Reference

phil/tax

Every type of the library, with its role.

TypeKindRole
Phil\Tax\TaxRatefinal readonly classA code and a share in parts per million; percentages; the tax on a base
Phil\Tax\TaxLinefinal readonly classA rate, its base, its amount; computed or reported
Phil\Tax\TaxBreakdownfinal readonly classLines on one base; line by code; totals; reversal
Phil\Tax\MultiRateTaxCalculatorfinal readonly classEvery rate on the same base, one line each (calculate()); the taxes included in a price, and the base they leave (extract())
Phil\Tax\Exception\TaxExceptioninterface, extends ThrowableEvery exception of the library
Phil\Tax\Exception\InvalidTaxRatefinal class, InvalidArgumentExceptionA code, share or percentage refused
Phil\Tax\Exception\InvalidBreakdownfinal class, DomainExceptionA line on another base, or a code twice
Phil\Tax\Exception\UntaxableBasefinal class, DomainExceptionA base too large to tax in a native integer

See rates.md, breakdowns.md, choosing-rates.md and exceptions.md.