The availableQuantity function of the Ticket class always returns a bool.
Shouldn't the return type be mixed?
public function availableQuantity(): bool
{
// Check if the event overall even has anymore to buy - that's a hard-unavailable
if ($this->event->getAvailableCapacity() < 1) {
return false;
}
// If we've specifically not set a quantity on the ticket, treat it like unlimited
return $this->quantity ?? $this->event->getAvailableCapacity();
}
Steps to reproduce
Use the availableQuantity function of a ticket to output the number of available tickets in the template, for example
Describe the bug
The
availableQuantity
function of theTicket
class always returns a bool.Shouldn't the return type be mixed?
Steps to reproduce
Craft CMS version
Craft Pro 4.6.0
Plugin version
2.0.3
Multi-site?
Yes
Additional context
No response