mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 02:04:46 -04:00
Updates for static analysis
This commit is contained in:
parent
87b2be8572
commit
b332e637b5
@ -177,27 +177,27 @@ class Helpers
|
|||||||
'literal' => [
|
'literal' => [
|
||||||
':MONTH_BEFORE' => \sprintf(
|
':MONTH_BEFORE' => \sprintf(
|
||||||
'%s %s %s',
|
'%s %s %s',
|
||||||
$currentDateTime->copy()->subMonth(1)->translatedFormat($entity->date_format()),
|
$currentDateTime->copy()->subMonth()->translatedFormat($entity->date_format()),
|
||||||
ctrans('texts.to'),
|
ctrans('texts.to'),
|
||||||
$currentDateTime->copy()->subDay(1)->translatedFormat($entity->date_format()),
|
$currentDateTime->copy()->subDay()->translatedFormat($entity->date_format()),
|
||||||
),
|
),
|
||||||
':YEAR_BEFORE' => \sprintf(
|
':YEAR_BEFORE' => \sprintf(
|
||||||
'%s %s %s',
|
'%s %s %s',
|
||||||
$currentDateTime->copy()->subYear(1)->translatedFormat($entity->date_format()),
|
$currentDateTime->copy()->subYear()->translatedFormat($entity->date_format()),
|
||||||
ctrans('texts.to'),
|
ctrans('texts.to'),
|
||||||
$currentDateTime->copy()->subDay(1)->translatedFormat($entity->date_format()),
|
$currentDateTime->copy()->subDay()->translatedFormat($entity->date_format()),
|
||||||
),
|
),
|
||||||
':MONTH_AFTER' => \sprintf(
|
':MONTH_AFTER' => \sprintf(
|
||||||
'%s %s %s',
|
'%s %s %s',
|
||||||
$currentDateTime->translatedFormat($entity->date_format()),
|
$currentDateTime->translatedFormat($entity->date_format()),
|
||||||
ctrans('texts.to'),
|
ctrans('texts.to'),
|
||||||
$currentDateTime->copy()->addMonth(1)->subDay(1)->translatedFormat($entity->date_format()),
|
$currentDateTime->copy()->addMonth()->subDay()->translatedFormat($entity->date_format()),
|
||||||
),
|
),
|
||||||
':YEAR_AFTER' => \sprintf(
|
':YEAR_AFTER' => \sprintf(
|
||||||
'%s %s %s',
|
'%s %s %s',
|
||||||
$currentDateTime->translatedFormat($entity->date_format()),
|
$currentDateTime->translatedFormat($entity->date_format()),
|
||||||
ctrans('texts.to'),
|
ctrans('texts.to'),
|
||||||
$currentDateTime->copy()->addYear(1)->subDay(1)->translatedFormat($entity->date_format()),
|
$currentDateTime->copy()->addYear()->subDay()->translatedFormat($entity->date_format()),
|
||||||
),
|
),
|
||||||
':MONTHYEAR' => \sprintf(
|
':MONTHYEAR' => \sprintf(
|
||||||
'%s %s',
|
'%s %s',
|
||||||
|
@ -12,27 +12,29 @@
|
|||||||
|
|
||||||
namespace App\Utils;
|
namespace App\Utils;
|
||||||
|
|
||||||
use App\DataMapper\EmailTemplateDefaults;
|
|
||||||
use App\Mail\Engine\PaymentEmailEngine;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\ClientContact;
|
|
||||||
use App\Models\Invoice;
|
|
||||||
use App\Models\InvoiceInvitation;
|
|
||||||
use App\Models\Payment;
|
|
||||||
use App\Models\PurchaseOrder;
|
|
||||||
use App\Models\PurchaseOrderInvitation;
|
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Models\QuoteInvitation;
|
|
||||||
use App\Models\Vendor;
|
|
||||||
use App\Models\VendorContact;
|
|
||||||
use App\Services\PdfMaker\Designs\Utilities\DesignHelpers;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Utils\Traits\MakesInvoiceHtml;
|
|
||||||
use App\Utils\Traits\MakesTemplateData;
|
|
||||||
use DB;
|
use DB;
|
||||||
use Illuminate\Support\Facades\App;
|
use App\Models\Quote;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\Credit;
|
||||||
|
use App\Models\Vendor;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Models\Payment;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
use App\Models\ClientContact;
|
||||||
|
use App\Models\PurchaseOrder;
|
||||||
|
use App\Models\VendorContact;
|
||||||
|
use App\Models\QuoteInvitation;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Models\RecurringInvoice;
|
||||||
|
use App\Models\InvoiceInvitation;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use App\Utils\Traits\MakesInvoiceHtml;
|
||||||
|
use App\Mail\Engine\PaymentEmailEngine;
|
||||||
|
use App\Models\PurchaseOrderInvitation;
|
||||||
|
use App\Utils\Traits\MakesTemplateData;
|
||||||
|
use App\DataMapper\EmailTemplateDefaults;
|
||||||
use League\CommonMark\CommonMarkConverter;
|
use League\CommonMark\CommonMarkConverter;
|
||||||
|
use App\Services\PdfMaker\Designs\Utilities\DesignHelpers;
|
||||||
|
|
||||||
class TemplateEngine
|
class TemplateEngine
|
||||||
{
|
{
|
||||||
@ -50,7 +52,7 @@ class TemplateEngine
|
|||||||
|
|
||||||
public $template;
|
public $template;
|
||||||
|
|
||||||
/** @var \App\Models\Invoice | \App\Models\Quote | \App\Models\Credit | \App\Models\PurchaseOrder | null $entity_obj **/
|
/** @var Invoice | Quote | Credit | PurchaseOrder | RecurringInvoice | null $entity_obj **/
|
||||||
private $entity_obj;
|
private $entity_obj;
|
||||||
|
|
||||||
/** @var \App\Models\Company | \App\Models\Client | null $settings_entity **/
|
/** @var \App\Models\Company | \App\Models\Client | null $settings_entity **/
|
||||||
@ -340,6 +342,7 @@ class TemplateEngine
|
|||||||
'client_contact_id' => $contact->id,
|
'client_contact_id' => $contact->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** @var \App\Models\Invoice $invoice */
|
||||||
$this->entity_obj->invoices()->attach($invoice->id, [
|
$this->entity_obj->invoices()->attach($invoice->id, [
|
||||||
'amount' => 10,
|
'amount' => 10,
|
||||||
]);
|
]);
|
||||||
@ -378,11 +381,13 @@ class TemplateEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->entity == 'purchaseOrder') {
|
if ($this->entity == 'purchaseOrder') {
|
||||||
|
/** @var \App\Models\Vendor $vendor **/
|
||||||
$vendor = Vendor::factory()->create([
|
$vendor = Vendor::factory()->create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'company_id' => $user->company()->id,
|
'company_id' => $user->company()->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** @var \App\Models\VendorContact $contact **/
|
||||||
$contact = VendorContact::factory()->create([
|
$contact = VendorContact::factory()->create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'company_id' => $user->company()->id,
|
'company_id' => $user->company()->id,
|
||||||
@ -391,13 +396,13 @@ class TemplateEngine
|
|||||||
'send_email' => true,
|
'send_email' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
$this->entity_obj = PurchaseOrder::factory()->create([
|
$this->entity_obj = PurchaseOrder::factory()->create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'company_id' => $user->company()->id,
|
'company_id' => $user->company()->id,
|
||||||
'vendor_id' => $vendor->id,
|
'vendor_id' => $vendor->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** @var \App\Models\PurchaseOrderInvitation $invitation **/
|
||||||
$invitation = PurchaseOrderInvitation::factory()->create([
|
$invitation = PurchaseOrderInvitation::factory()->create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'company_id' => $user->company()->id,
|
'company_id' => $user->company()->id,
|
||||||
|
@ -21,4 +21,5 @@ parameters:
|
|||||||
- '#Call to an undefined method [a-zA-Z0-9\\_]+::exclude\(\)#'
|
- '#Call to an undefined method [a-zA-Z0-9\\_]+::exclude\(\)#'
|
||||||
- '#Array has 2 duplicate keys with value#'
|
- '#Array has 2 duplicate keys with value#'
|
||||||
- '#Undefined method#'
|
- '#Undefined method#'
|
||||||
- '#makeHidden#'
|
- '#makeHidden#'
|
||||||
|
- '#Socialite#'
|
Loading…
x
Reference in New Issue
Block a user