Static Analysis

This commit is contained in:
David Bomba 2024-06-18 09:41:22 +10:00
parent 957ddb2a81
commit f68d1d3053
8 changed files with 14 additions and 6 deletions

View File

@ -89,6 +89,7 @@ class PreviewInvoiceRequest extends Request
{
$invitation = false;
/** @phpstan-ignore-next-line */
if(! $this->entity_id ?? false) {
return $this->stubInvitation();
}
@ -98,6 +99,7 @@ class PreviewInvoiceRequest extends Request
'quote' => $invitation = QuoteInvitation::withTrashed()->where('quote_id', $this->entity_id)->first(),
'credit' => $invitation = CreditInvitation::withTrashed()->where('credit_id', $this->entity_id)->first(),
'recurring_invoice' => $invitation = RecurringInvoiceInvitation::withTrashed()->where('recurring_invoice_id', $this->entity_id)->first(),
default => $invitation = false,
};
if($invitation) {

View File

@ -56,6 +56,7 @@ class CheckoutWebhook implements ShouldQueue
nlog("Checkout Webhook type not set");
}
/** @phpstan-ignore-next-line */
match($this->webhook_array['type']) {
'payment_approved' => $this->paymentApproved(),
};

View File

@ -103,6 +103,7 @@ class PayPalBasePaymentDriver extends BaseDriver
"25" => $method = PaymentType::VENMO,
"28" => $method = PaymentType::PAY_LATER,
"29" => $method = PaymentType::CREDIT_CARD_OTHER,
default => $method = PaymentType::PAYPAL,
};
return $method;

View File

@ -63,7 +63,7 @@ class PayPalWebhook implements ShouldQueue
if($this->verifyWebhook()) {
nlog('verified');
match($this->webhook_request['event_type']) {
match($this->webhook_request['event_type']) {//@phpstan-ignore-line
'CHECKOUT.ORDER.COMPLETED' => $this->checkoutOrderCompleted(),
};

View File

@ -80,7 +80,7 @@ class BankTransfer
*/
private function resolveBankType()
{
return match ($this->stripe->client->currency()->code) {
return match ($this->stripe->client->currency()->code) { //@phpstan-ignore-line
'GBP' => ['type' => 'gb_bank_transfer'],
'EUR' => ['type' => 'eu_bank_transfer', 'eu_bank_transfer' => ['country' => $this->stripe->client->country->iso_3166_2]],
'JPY' => ['type' => 'jp_bank_transfer'],
@ -128,8 +128,8 @@ class BankTransfer
}
/* Create a pending payment */
if ($pi->status == 'requires_action' && $pi->next_action->type == 'display_bank_transfer_instructions') {
match ($pi->next_action->display_bank_transfer_instructions->currency) {
if ($pi->status == 'requires_action' && $pi->next_action->type == 'display_bank_transfer_instructions') { //@phpstan-ignore-line
match ($pi->next_action->display_bank_transfer_instructions->currency) { //@phpstan-ignore-line
'mxn' => $data['bank_details'] = $this->formatDataforMx($pi),
'gbp' => $data['bank_details'] = $this->formatDataforUk($pi),
'eur' => $data['bank_details'] = $this->formatDataforEur($pi),

View File

@ -993,6 +993,7 @@ class PdfBuilder
PdfService::DELIVERY_NOTE => $this->getDeliveryNoteSections(),
PdfService::STATEMENT => $this->getStatementSections(),
PdfService::PURCHASE_ORDER => $this->getPurchaseOrderSections(),
default => $this->getProductSections(),
};
}

View File

@ -174,7 +174,8 @@ class PdfMock
match ($this->request['settings_type']) {
'group' => $settings = ClientSettings::buildClientSettings($this->company->settings, $this->request['settings']),
'client' => $settings = ClientSettings::buildClientSettings($this->company->settings, $this->request['settings']),
'company' => $settings = (object)$this->request['settings']
'company' => $settings = (object)$this->request['settings'],
default => $settings = (object)$this->request['settings'],
};
$settings = CompanySettings::setProperties($settings);

View File

@ -102,6 +102,7 @@ class TemplateAction implements ShouldQueue
Expense::class => $resource->with('client'),
Payment::class => $resource->with('invoices', 'client'),
Client::class => $resource,
default => $resource,
};
$result = $resource->withTrashed()
@ -219,6 +220,7 @@ class TemplateAction implements ShouldQueue
Project::class => 'projects',
Client::class => 'clients',
Vendor::class => 'vendors',
default =>'invoices',
};
}