1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Static Analysis

This commit is contained in:
David Bomba 2024-10-14 08:37:30 +11:00
parent 78eeccea62
commit 7b49438a96

View File

@ -1311,19 +1311,21 @@ class TemplateService
*/
private function resolveEntity(): string
{
$entity_string = '';
//@phpstan-ignore-next-line
match($this->entity) {
($this->entity instanceof Invoice) => $entity_string = 'invoice',
($this->entity instanceof Quote) => $entity_string = 'quote',
($this->entity instanceof Credit) => $entity_string = 'credit',
($this->entity instanceof RecurringInvoice) => $entity_string = 'invoice',
($this->entity instanceof PurchaseOrder) => $entity_string = 'purchase_order',
default => $entity_string = 'invoice',
};
return $entity_string;
switch ($this->entity) {
case ($this->entity instanceof Invoice):
return 'invoice';
case ($this->entity instanceof Quote):
return 'quote';
case ($this->entity instanceof Credit):
return 'credit';
case ($this->entity instanceof RecurringInvoice):
return 'invoice';
case ($this->entity instanceof PurchaseOrder):
return 'purchase_order';
default:
return 'invoice';
}
}