From 224e5d99f89f061a81abf4fdaf01ca536cc0ee4f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 1 Aug 2023 23:53:10 +1000 Subject: [PATCH] Static analysis cleanup --- app/Console/Commands/CreateSingleAccount.php | 4 +- app/Models/Credit.php | 76 +------------- app/Models/Expense.php | 23 +++-- app/Models/Invoice.php | 4 +- app/Models/Product.php | 53 ---------- app/Models/PurchaseOrder.php | 78 ++------------- app/Models/Quote.php | 98 +++---------------- app/Models/StaticModel.php | 2 +- .../PayPalRestPaymentDriver.php | 20 ++-- tests/MockAccountData.php | 1 + 10 files changed, 50 insertions(+), 309 deletions(-) diff --git a/app/Console/Commands/CreateSingleAccount.php b/app/Console/Commands/CreateSingleAccount.php index 9d83e6b8f0..a28eb64e23 100644 --- a/app/Console/Commands/CreateSingleAccount.php +++ b/app/Console/Commands/CreateSingleAccount.php @@ -723,10 +723,10 @@ class CreateSingleAccount extends Command $cg->config = encrypt(config('ninja.testvars.paypal_rest')); $cg->save(); - $gateway_types = $cg->driver()->gatewayTypes(); + // $gateway_types = $cg->driver()->gatewayTypes(); $fees_and_limits = new stdClass; - $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits; + $fees_and_limits->{3} = new FeesAndLimits; $cg->fees_and_limits = $fees_and_limits; $cg->save(); diff --git a/app/Models/Credit.php b/app/Models/Credit.php index e4dfe6e5f7..380c9e3cb9 100644 --- a/app/Models/Credit.php +++ b/app/Models/Credit.php @@ -22,6 +22,7 @@ use App\Utils\Traits\MakesDates; use App\Utils\Traits\MakesHash; use App\Utils\Traits\MakesInvoiceValues; use App\Utils\Traits\MakesReminders; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Storage; @@ -112,79 +113,8 @@ use Laracasts\Presenter\PresentableTrait; * @property-read int|null $payments_count * @property-read \App\Models\Project|null $project * @property-read \App\Models\User $user + * @property-read \App\Models\Client $client * @property-read \App\Models\Vendor|null $vendor - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) - * @method static \Database\Factories\CreditFactory factory($count = null, $state = []) - * @method static \Illuminate\Database\Eloquent\Builder|Credit filter(\App\Filters\QueryFilters $filters) - * @method static \Illuminate\Database\Eloquent\Builder|Credit newModelQuery() - * @method static \Illuminate\Database\Eloquent\Builder|Credit newQuery() - * @method static \Illuminate\Database\Eloquent\Builder|Credit onlyTrashed() - * @method static \Illuminate\Database\Eloquent\Builder|Credit query() - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereAmount($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereAssignedUserId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereBackup($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereBalance($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereClientId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCompanyId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCreatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurcharge1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurcharge2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurcharge3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurcharge4($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurchargeTax1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurchargeTax2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurchargeTax3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomSurchargeTax4($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomValue1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomValue2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomValue3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereCustomValue4($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereDeletedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereDesignId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereDiscount($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereDueDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereExchangeRate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereFooter($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereInvoiceId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereIsAmountDiscount($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereIsDeleted($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereLastSentDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereLastViewed($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereLineItems($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereNextSendDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereNumber($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit wherePaidToDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit wherePartial($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit wherePartialDueDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit wherePoNumber($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit wherePrivateNotes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereProjectId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit wherePublicNotes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereRecurringId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereReminder1Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereReminder2Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereReminder3Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereReminderLastSent($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereStatusId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereSubscriptionId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxName1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxName2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxName3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxRate1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxRate2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereTaxRate3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereTerms($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereTotalTaxes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereUpdatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereUserId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereUsesInclusiveTaxes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit whereVendorId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Credit withTrashed() - * @method static \Illuminate\Database\Eloquent\Builder|Credit withoutTrashed() * @property-read \Illuminate\Database\Eloquent\Collection $activities * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger * @property-read \Illuminate\Database\Eloquent\Collection $documents @@ -390,7 +320,7 @@ class Credit extends BaseModel return $this->belongsTo(User::class)->withTrashed(); } - public function client() + public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Client::class)->withTrashed(); } diff --git a/app/Models/Expense.php b/app/Models/Expense.php index fd2cea88c6..d60802bc23 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -86,8 +86,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Eloquent\Builder|Expense withTrashed() * @method static \Illuminate\Database\Eloquent\Builder|Expense withoutTrashed() * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $client - * @property-read \Illuminate\Database\Eloquent\Collection $invoice + * @property-read \App\Models\Invoice|null $invoice * @property-read \App\Models\BankTransaction|null $transaction * @mixin \Eloquent */ @@ -156,12 +155,12 @@ class Expense extends BaseModel return $this->morphMany(Document::class, 'documentable'); } - public function user() + public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class)->withTrashed(); } - public function assigned_user() + public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed(); } @@ -171,17 +170,17 @@ class Expense extends BaseModel return $this->belongsTo(Company::class); } - public function invoice() + public function invoice(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Invoice::class); } - public function vendor() + public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Vendor::class); } - public function client() + public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Client::class); } @@ -196,27 +195,27 @@ class Expense extends BaseModel return ctrans('texts.expense'); } - public function currency() + public function currency(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Currency::class); } - public function category() + public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(ExpenseCategory::class)->withTrashed(); } - public function payment_type() + public function payment_type(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(PaymentType::class); } - public function project() + public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Project::class); } - public function transaction() + public function transaction(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(BankTransaction::class); } diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 812539485d..b7f127ee0c 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -100,7 +100,7 @@ use App\Events\Invoice\InvoiceReminderWasEmailed; * @property bool $is_proforma * @property-read int|null $activities_count * @property-read \App\Models\User|null $assigned_user - * @property-read \App\Models\Client $client + * @property \App\Models\Client $client * @property-read \App\Models\Company $company * @property-read int|null $company_ledger_count * @property-read int|null $credits_count @@ -292,7 +292,7 @@ class Invoice extends BaseModel return $this->hasMany(InvoiceInvitation::class); } - public function client() + public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Client::class)->withTrashed(); } diff --git a/app/Models/Product.php b/app/Models/Product.php index c3e8724ebc..d07445e7f1 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -50,66 +50,13 @@ use League\CommonMark\CommonMarkConverter; * @property string|null $product_image * @property-read \App\Models\User|null $assigned_user * @property-read \App\Models\Company $company - * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read int|null $documents_count * @property-read mixed $hashed_id * @property-read \App\Models\User $user * @property-read \App\Models\Vendor|null $vendor - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) - * @method static \Database\Factories\ProductFactory factory($count = null, $state = []) - * @method static \Illuminate\Database\Eloquent\Builder|Product filter(\App\Filters\QueryFilters $filters) - * @method static \Illuminate\Database\Eloquent\Builder|Product newModelQuery() - * @method static \Illuminate\Database\Eloquent\Builder|Product newQuery() - * @method static \Illuminate\Database\Eloquent\Builder|Product onlyTrashed() - * @method static \Illuminate\Database\Eloquent\Builder|Product query() - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() - * @method static \Illuminate\Database\Eloquent\Builder|Product whereAssignedUserId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereCompanyId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereCost($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereCreatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereCustomValue1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereCustomValue2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereCustomValue3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereCustomValue4($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereDeletedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereInStockQuantity($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereIsDeleted($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereMaxQuantity($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereNotes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product wherePrice($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereProductImage($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereProductKey($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereProjectId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereQuantity($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereStockNotification($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereStockNotificationThreshold($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxName1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxName2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxName3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxRate1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxRate2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxRate3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereUpdatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereUserId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product whereVendorId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Product withTrashed() - * @method static \Illuminate\Database\Eloquent\Builder|Product withoutTrashed() - * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property int|null $tax_id * @property-read \Illuminate\Database\Eloquent\Collection $documents * @method static \Illuminate\Database\Eloquent\Builder|Product whereTaxId($value) - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents - * @property-read \Illuminate\Database\Eloquent\Collection $documents * @mixin \Eloquent */ class Product extends BaseModel diff --git a/app/Models/PurchaseOrder.php b/app/Models/PurchaseOrder.php index ec5b257fa4..e4355f6f82 100644 --- a/app/Models/PurchaseOrder.php +++ b/app/Models/PurchaseOrder.php @@ -116,70 +116,6 @@ use Illuminate\Support\Facades\Storage; * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder query() * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereAmount($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereAssignedUserId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereBackup($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereBalance($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereClientId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCompanyId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCreatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCurrencyId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurcharge1($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurcharge2($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurcharge3($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurcharge4($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurchargeTax1($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurchargeTax2($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurchargeTax3($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomSurchargeTax4($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomValue1($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomValue2($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomValue3($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereCustomValue4($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDeletedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDesignId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDiscount($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereDueDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereExchangeRate($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereExpenseId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereFooter($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereInvoiceId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereIsAmountDiscount($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereIsDeleted($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereLastSentDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereLastViewed($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereLineItems($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereNextSendDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereNumber($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePaidToDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePartial($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePartialDueDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePoNumber($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePrivateNotes($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereProjectId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder wherePublicNotes($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereRecurringId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereReminder1Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereReminder2Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereReminder3Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereReminderLastSent($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereStatusId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxName1($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxName2($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxName3($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxRate1($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxRate2($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTaxRate3($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTerms($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereTotalTaxes($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereUpdatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereUserId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereUsesInclusiveTaxes($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder whereVendorId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder withTrashed() - * @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder withoutTrashed() * @property-read \Illuminate\Database\Eloquent\Collection $activities * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $history @@ -303,12 +239,12 @@ class PurchaseOrder extends BaseModel return self::class; } - public function assigned_user() + public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed(); } - public function vendor() + public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Vendor::class)->withTrashed(); } @@ -323,22 +259,22 @@ class PurchaseOrder extends BaseModel return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50); } - public function company() + public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Company::class); } - public function expense() + public function expense(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Expense::class); } - public function user() + public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class)->withTrashed(); } - public function client() + public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Client::class)->withTrashed(); } @@ -384,7 +320,7 @@ class PurchaseOrder extends BaseModel return Storage::disk('public')->{$type}($file_path); } - public function invitations() + public function invitations(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(PurchaseOrderInvitation::class); } diff --git a/app/Models/Quote.php b/app/Models/Quote.php index 04c3cee2cd..5333fd49d3 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -109,78 +109,6 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \App\Models\Project|null $project * @property-read \App\Models\User $user * @property-read \App\Models\Vendor|null $vendor - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns) - * @method static \Database\Factories\QuoteFactory factory($count = null, $state = []) - * @method static \Illuminate\Database\Eloquent\Builder|Quote filter(\App\Filters\QueryFilters $filters) - * @method static \Illuminate\Database\Eloquent\Builder|Quote newModelQuery() - * @method static \Illuminate\Database\Eloquent\Builder|Quote newQuery() - * @method static \Illuminate\Database\Eloquent\Builder|Quote onlyTrashed() - * @method static \Illuminate\Database\Eloquent\Builder|Quote query() - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope() - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereAmount($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereAssignedUserId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereBackup($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereBalance($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereClientId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCompanyId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCreatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurcharge1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurcharge2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurcharge3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurcharge4($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurchargeTax1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurchargeTax2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurchargeTax3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomSurchargeTax4($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomValue1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomValue2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomValue3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereCustomValue4($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereDeletedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereDesignId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereDiscount($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereDueDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereExchangeRate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereFooter($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereInvoiceId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereIsAmountDiscount($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereIsDeleted($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereLastSentDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereLastViewed($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereLineItems($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereNextSendDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereNumber($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote wherePaidToDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote wherePartial($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote wherePartialDueDate($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote wherePoNumber($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote wherePrivateNotes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereProjectId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote wherePublicNotes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereRecurringId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereReminder1Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereReminder2Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereReminder3Sent($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereReminderLastSent($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereStatusId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereSubscriptionId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxName1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxName2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxName3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxRate1($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxRate2($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereTaxRate3($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereTerms($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereTotalTaxes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereUpdatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereUserId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereUsesInclusiveTaxes($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote whereVendorId($value) - * @method static \Illuminate\Database\Eloquent\Builder|Quote withTrashed() - * @method static \Illuminate\Database\Eloquent\Builder|Quote withoutTrashed() * @property-read \Illuminate\Database\Eloquent\Collection $activities * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $history @@ -291,57 +219,57 @@ class Quote extends BaseModel return $value; } - public function company() + public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Company::class); } - public function vendor() + public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Vendor::class); } - public function history() + public function history(): \Illuminate\Database\Eloquent\Relations\HasManyThrough { return $this->hasManyThrough(Backup::class, Activity::class); } - public function activities() + public function activities(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50); } - public function user() + public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class)->withTrashed(); } - public function client() + public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Client::class)->withTrashed(); } - public function invoice() + public function invoice(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Invoice::class)->withTrashed(); } - public function assigned_user() + public function assigned_user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed(); } - public function project() + public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Project::class)->withTrashed(); } - public function invitations() + public function invitations(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(QuoteInvitation::class); } - public function documents() + public function documents(): \Illuminate\Database\Eloquent\Relations\MorphMany { return $this->morphMany(Document::class, 'documentable'); } @@ -473,7 +401,7 @@ class Quote extends BaseModel * * @return bool */ - public function isApproved() + public function isApproved(): bool { if ($this->status_id === $this::STATUS_APPROVED) { return true; @@ -497,7 +425,7 @@ class Quote extends BaseModel return $this->calc()->getTotal(); } - public function translate_entity() + public function translate_entity(): string { return ctrans('texts.quote'); } diff --git a/app/Models/StaticModel.php b/app/Models/StaticModel.php index f5be46c525..f6b3a5747f 100644 --- a/app/Models/StaticModel.php +++ b/app/Models/StaticModel.php @@ -24,7 +24,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundExceptio * @method static \Illuminate\Database\Eloquent\Builder|StaticModel exclude($columns) * @method static \Illuminate\Database\Eloquent\Builder|StaticModel newModelQuery($value) * @method static \Illuminate\Database\Eloquent\Builder|StaticModel newQuery($value) - * @method static \Illuminate\Database\Eloquent\Builder|StaticModel query($value) + * @method static \Illuminate\Database\Eloquent\Builder|StaticModel query(?$value) * @method static \Illuminate\Database\Eloquent\Builder|StaticModel find($value) * @method static \Illuminate\Database\Eloquent\Builder|StaticModel with($value) * @method static \Illuminate\Database\Eloquent\Builder|StaticModel withTrashed($value) diff --git a/app/PaymentDrivers/PayPalRestPaymentDriver.php b/app/PaymentDrivers/PayPalRestPaymentDriver.php index 6e257c8e71..f60c4e3b17 100644 --- a/app/PaymentDrivers/PayPalRestPaymentDriver.php +++ b/app/PaymentDrivers/PayPalRestPaymentDriver.php @@ -44,16 +44,16 @@ class PayPalRestPaymentDriver extends BaseDriver 3 => 'paypal', 1 => 'card', 25 => 'venmo', - 9 => 'sepa', - 12 => 'bancontact', - 17 => 'eps', - 15 => 'giropay', - 13 => 'ideal', - 26 => 'mercadopago', - 27 => 'mybank', - 28 => 'paylater', - 16 => 'p24', - 7 => 'sofort' + // 9 => 'sepa', + // 12 => 'bancontact', + // 17 => 'eps', + // 15 => 'giropay', + // 13 => 'ideal', + // 26 => 'mercadopago', + // 27 => 'mybank', + // 28 => 'paylater', + // 16 => 'p24', + // 7 => 'sofort' ]; diff --git a/tests/MockAccountData.php b/tests/MockAccountData.php index c81a97c6a9..86b039bfcd 100644 --- a/tests/MockAccountData.php +++ b/tests/MockAccountData.php @@ -808,6 +808,7 @@ trait MockAccountData $cg->fees_and_limits = $data; $cg->save(); + $cg = new CompanyGateway; $cg->company_id = $this->company->id; $cg->user_id = $user_id;