diff --git a/app/Helpers/Invoice/InvoiceItemSumInclusive.php b/app/Helpers/Invoice/InvoiceItemSumInclusive.php index 238f48636530..b2a4b40337e6 100644 --- a/app/Helpers/Invoice/InvoiceItemSumInclusive.php +++ b/app/Helpers/Invoice/InvoiceItemSumInclusive.php @@ -94,7 +94,7 @@ class InvoiceItemSumInclusive protected RecurringInvoice | Invoice | Quote | Credit | PurchaseOrder | RecurringQuote $invoice; - private $currency; + private \App\Models\Currency $currency; private $total_taxes; diff --git a/app/Helpers/Mail/GmailTransport.php b/app/Helpers/Mail/GmailTransport.php index 1538edcfde13..1a787113af54 100644 --- a/app/Helpers/Mail/GmailTransport.php +++ b/app/Helpers/Mail/GmailTransport.php @@ -33,7 +33,6 @@ class GmailTransport extends AbstractTransport nlog("In Do Send"); $message = MessageConverter::toEmail($message->getOriginalMessage()); - /** @phpstan-ignore-next-line **/ $token = $message->getHeaders()->get('gmailtoken')->getValue(); $message->getHeaders()->remove('gmailtoken'); diff --git a/app/Helpers/Mail/Office365MailTransport.php b/app/Helpers/Mail/Office365MailTransport.php index 246ebb025069..6a94139a76cb 100644 --- a/app/Helpers/Mail/Office365MailTransport.php +++ b/app/Helpers/Mail/Office365MailTransport.php @@ -28,6 +28,8 @@ class Office365MailTransport extends AbstractTransport $symfony_message = MessageConverter::toEmail($message->getOriginalMessage()); $graph = new Graph(); + + /** @phpstan-ignore-next-line **/ $token = $symfony_message->getHeaders()->get('gmailtoken')->getValue(); $symfony_message->getHeaders()->remove('gmailtoken'); @@ -38,6 +40,8 @@ class Office365MailTransport extends AbstractTransport $bcc_list = ''; if ($bccs) { + + /** @phpstan-ignore-next-line **/ foreach ($bccs->getAddresses() as $address) { $bcc_list .= 'Bcc: "'.$address->getAddress().'" <'.$address->getAddress().'>\r\n'; } diff --git a/app/Jobs/Bank/MatchBankTransactions.php b/app/Jobs/Bank/MatchBankTransactions.php index 278c5f583847..164dede3a0b3 100644 --- a/app/Jobs/Bank/MatchBankTransactions.php +++ b/app/Jobs/Bank/MatchBankTransactions.php @@ -52,6 +52,7 @@ class MatchBankTransactions implements ShouldQueue public Invoice $invoice; + /** @var \App\Models\BankTransaction $bt */ private ?BankTransaction $bt; private $categories; @@ -194,7 +195,7 @@ class MatchBankTransactions implements ShouldQueue private function linkPayment($input) { - $this->bt = BankTransaction::find($input['id']); + $this->bt = BankTransaction::query()->withTrashed()->find($input['id']); if (!$this->bt || $this->bt->status_id == BankTransaction::STATUS_CONVERTED) { return $this; @@ -244,7 +245,7 @@ class MatchBankTransactions implements ShouldQueue private function matchExpense($input) :self { //if there is a category id, pull it from Yodlee and insert - or just reuse!! - $this->bt = BankTransaction::find($input['id']); + $this->bt = BankTransaction::query()->withTrashed()->find($input['id']); if (!$this->bt || $this->bt->status_id == BankTransaction::STATUS_CONVERTED) { return $this; diff --git a/app/Jobs/Company/CompanyExport.php b/app/Jobs/Company/CompanyExport.php index 0a496b4c9f2c..1a3bfc43b22b 100644 --- a/app/Jobs/Company/CompanyExport.php +++ b/app/Jobs/Company/CompanyExport.php @@ -65,7 +65,7 @@ class CompanyExport implements ShouldQueue { MultiDB::setDb($this->company->db); - $this->company = Company::where('company_key', $this->company->company_key)->first(); + $this->company = Company::query()->where('company_key', $this->company->company_key)->first(); set_time_limit(0); diff --git a/app/Utils/Traits/NumberFormatter.php b/app/Utils/Traits/NumberFormatter.php index 96684e03650f..e2ea72649e10 100644 --- a/app/Utils/Traits/NumberFormatter.php +++ b/app/Utils/Traits/NumberFormatter.php @@ -16,7 +16,14 @@ namespace App\Utils\Traits; */ trait NumberFormatter { - private function formatValue($value, $precision) : string + /** + * Undocumented function + * + * @param float $value + * @param int $precision + * @return string|float + */ + private function formatValue($value, $precision) { /* 08-01-2022 allow increased precision means we need to transform from scientific notation to a regular string */ @@ -27,7 +34,6 @@ trait NumberFormatter * Parse a float value that may be delimited with either a comma or decimal point. * * @param string $value The value - * * @return float Consumable float value */ private function parseFloat($value) : float diff --git a/phpstan.neon b/phpstan.neon index 476dbfada6ef..670c37f46795 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -20,4 +20,5 @@ parameters: - '#Call to an undefined method [a-zA-Z0-9\\_]+::entityFilter\(\)#' - '#Call to an undefined method [a-zA-Z0-9\\_]+::exclude\(\)#' - '#Array has 2 duplicate keys with value#' - - '#Undefined method#' \ No newline at end of file + - '#Undefined method#' + - '#makeHidden#' \ No newline at end of file