1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-19 16:01:34 +02:00

Static analysis

This commit is contained in:
David Bomba 2024-07-15 13:35:21 +10:00
parent 7b0b5216a8
commit 745c594f3b
12 changed files with 15 additions and 16 deletions

View File

@ -1545,7 +1545,6 @@ class Import implements ShouldQueue
$file_path,
$file_name,
$file_info,
filesize($file_path),
0,
false
);

View File

@ -46,7 +46,7 @@ class MailSentListener implements ShouldQueue
try {
$message_id = $event->sent->getMessageId();
$message = MessageConverter::toEmail($event->sent->getOriginalMessage());
$message = MessageConverter::toEmail($event->sent->getOriginalMessage()); //@phpstan-ignore-line
if (!$message->getHeaders()->get('x-invitation')) {
return;

View File

@ -39,7 +39,7 @@ class StripeConnectFailed extends Mailable
return new Envelope(
subject: "Stripe Connect not configured, please login and connect.",
from: config('ninja.contact.email'),
to: $this->user->email,
to: $this->user->email, //@phpstan-ignore-line
);
}

View File

@ -245,9 +245,9 @@ class Document extends BaseModel
try {
$file = base64_encode($image);
$img = new \Imagick();
$img = new \Imagick(); //@phpstan-ignore-line
$img->readImageBlob($file);
$img->setImageCompression(true);
$img->setImageCompression(true); //@phpstan-ignore-line
$img->setImageCompressionQuality(40);
return $img->getImageBlob();

View File

@ -297,7 +297,7 @@ class PayPalWebhook implements ShouldQueue
$gateway = CompanyGateway::query()
->where('company_id', $company->id)
->where('gateway_key', $this->gateway_key)
->first(function ($cg) use ($merchant_id) {
->first(function ($cg) use ($merchant_id) { //@phpstan-ignore-line
$config = $cg->getConfig();
if($config->merchantId == $merchant_id) {

View File

@ -188,7 +188,7 @@ class RoEInvoice extends AbstractService
$ubl_invoice->setCustomizationID("urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1");
// invoice
$ubl_invoice->setId($invoice->number);
$ubl_invoice->setId($invoice->number); //@phpstan-ignore-line
$ubl_invoice->setIssueDate(date_create($invoice->date));
$ubl_invoice->setDueDate(date_create($invoice->due_date));
$ubl_invoice->setInvoiceTypeCode("380");

View File

@ -410,7 +410,7 @@ class PdfConfiguration
$precision = 0;
}
$value = number_format($v, $precision, $decimal, $thousand);
$value = number_format($v, $precision, $decimal, $thousand); //@phpstan-ignore-line
$symbol = $this->currency->symbol;
if ($this->settings->show_currency_code === true && $this->currency->code == 'CHF') {
@ -427,7 +427,7 @@ class PdfConfiguration
return "{$symbol}{$value}";
} else {
return $this->formatValue($value);
return $this->formatValue($value); // @phpstan-ignore-line
}
}

View File

@ -174,7 +174,7 @@ trait DesignHelpers
// evaluating the variable.
if (in_array(sprintf('%s%s.tax', '$', $type), (array) $this->context['pdf_variables']["{$column_type}_columns"])) {
$line_items = collect($this->entity->line_items)->filter(function ($item) use ($type_id) {
$line_items = collect($this->entity->line_items)->filter(function ($item) use ($type_id) { //@phpstan-ignore-line
return $item->type_id = $type_id;
});

View File

@ -428,7 +428,7 @@ class SubscriptionService
/**
* We refund unused days left.
*
* @param Invoice $invoice
* @param \App\Models\Invoice | \App\Models\Credit $invoice
* @return float
*/
private function calculateProRataRefund($invoice, $subscription = null): float

View File

@ -654,7 +654,7 @@ class TemplateService
'updated_at' => $this->translateDate($invoice->pivot->updated_at, $payment->client->date_format(), $payment->client->locale()),
'timestamp' => $invoice->pivot->created_at->timestamp,
];
})->merge($credits)->sortBy('timestamp')->toArray();
})->concat($credits)->sortBy('timestamp')->toArray();
return [
'status' => $payment->stringStatus($payment->status_id),

View File

@ -277,7 +277,7 @@ class Number
return "{$symbol}{$value}";
} else {
return self::formatValue($value, $currency);
return self::formatValue($value, $currency); //@phpstan-ignore-line
}
}
@ -339,7 +339,7 @@ class Number
$precision = 0;
}
$value = number_format($v, $precision, $decimal, $thousand);
$value = number_format($v, $precision, $decimal, $thousand);//@phpstan-ignore-line
$symbol = $currency->symbol;
if ($entity->getSetting('show_currency_code') === true && $currency->code == 'CHF') {
@ -356,7 +356,7 @@ class Number
return "{$symbol}{$value}";
} else {
return self::formatValue($value, $currency);
return self::formatValue($value, $currency); //@phpstan-ignore-line
}
}
}

View File

@ -17,7 +17,7 @@ class TempFile
{
public static function path($url): string
{
$temp_path = @tempnam(sys_get_temp_dir().'/'.sha1(time()), basename($url));
$temp_path = @tempnam(sys_get_temp_dir().'/'.sha1((string)time()), basename($url));
copy($url, $temp_path);
return $temp_path;