Static analysis and cleanup for tests
This commit is contained in:
parent
d5a7cab86c
commit
a89e51ebdc
|
|
@ -39,7 +39,8 @@ class ProtectedDownloadController extends BaseController
|
|||
return response()->streamDownload(function () use ($hashed_path) {
|
||||
$stream = Storage::readStream($hashed_path);
|
||||
|
||||
if ($stream === false) {
|
||||
// if($stream ===false){
|
||||
if ($stream === null) {
|
||||
throw new SystemError('Unable to read file', 500);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class ConnectNordigenBankIntegrationRequest extends Request
|
|||
/**
|
||||
* @return array{
|
||||
* user_id: int,
|
||||
* bank_account_id?: string,
|
||||
* company_key: string,
|
||||
* context: string,
|
||||
* is_react: bool,
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ class PaymentScheduleRequest extends Request
|
|||
RecurringInvoice::FREQUENCY_ANNUALLY => $date->startOfDay()->addYear(),
|
||||
RecurringInvoice::FREQUENCY_TWO_YEARS => $date->startOfDay()->addYears(2),
|
||||
RecurringInvoice::FREQUENCY_THREE_YEARS => $date->startOfDay()->addYears(3),
|
||||
default => $date->startOfDay()->addMonthNoOverflow(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class InvoiceTransactionEventEntry
|
|||
return new TransactionEventMetadata([
|
||||
'tax_report' => [
|
||||
'tax_details' => $details,
|
||||
'payment_history' => $this->payments->toArray() ?? [],
|
||||
'payment_history' => $this->payments->toArray() ?? [], //@phpstan-ignore-line
|
||||
'tax_summary' => [
|
||||
'total_taxes' => $invoice->total_taxes,
|
||||
'total_paid' => $this->getTotalTaxPaid($invoice),
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ use Laracasts\Presenter\PresentableTrait;
|
|||
* @property bool $is_trial
|
||||
* @property int $e_invoice_quota
|
||||
* @property int $docuninja_num_users
|
||||
* @property string|null $e_invoicing_token
|
||||
* @property-read int|null $bank_integrations_count
|
||||
* @property-read int|null $companies_count
|
||||
* @property-read int|null $company_users_count
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ use Illuminate\Contracts\Translation\HasLocalePreference;
|
|||
* @property-read \App\Models\User $user
|
||||
* @property-read \App\Models\Company $company
|
||||
* @property-read \App\Models\Country|null $country
|
||||
* @property-read \App\Models\Industry|null $industry
|
||||
* @property-read \App\Models\Country|null $shipping_country
|
||||
* @property-read \App\Models\Size|null $size
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientContact> $contacts
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ use Laracasts\Presenter\PresentableTrait;
|
|||
* @property string|null $inbound_mailbox_blacklist
|
||||
* @property string|null $e_invoice_certificate_passphrase
|
||||
* @property string|null $e_invoice_certificate
|
||||
* @property object|null $origin_tax_data
|
||||
* @property int $deleted_at
|
||||
* @property string|null $smtp_username
|
||||
* @property string|null $smtp_password
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @property int|null $created_at
|
||||
* @property int|null $updated_at
|
||||
* @property int|null $deleted_at
|
||||
* @property string|null $entities
|
||||
* @property-read \App\Models\Company|null $company
|
||||
* @property-read string $hashed_id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
||||
|
|
|
|||
|
|
@ -66,19 +66,20 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @property float $tax_amount3
|
||||
* @property bool $uses_inclusive_taxes
|
||||
* @property bool $calculate_tax_by_amount
|
||||
* @property-read int|null $documents_count
|
||||
* @property-read mixed $hashed_id
|
||||
* @property-read \App\Models\User|null $assigned_user
|
||||
* @property-read \App\Models\ExpenseCategory|null $category
|
||||
* @property-read \App\Models\Client|null $client
|
||||
* @property-read \App\Models\Company $company
|
||||
* @property-read \App\Models\Currency|null $currency
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
||||
* @property-read int|null $documents_count
|
||||
* @property-read mixed $hashed_id
|
||||
* @property-read \App\Models\PaymentType|null $payment_type
|
||||
* @property-read \App\Models\Project|null $project
|
||||
* @property-read \App\Models\PurchaseOrder|null $purchase_order
|
||||
* @property-read \App\Models\User $user
|
||||
* @property-read \App\Models\Vendor|null $vendor
|
||||
* @property-read \App\Models\Currency|null $invoice_currency
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
||||
* @method static \Database\Factories\ExpenseFactory factory($count = null, $state = [])
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||
* @property bool $is_deleted
|
||||
* @property string|null $number
|
||||
* @property string $color
|
||||
* @property int|null $current_hours
|
||||
* @property-read \App\Models\Client|null $client
|
||||
* @property-read \App\Models\Company $company
|
||||
* @property-read int|null $documents_count
|
||||
|
|
|
|||
|
|
@ -101,6 +101,8 @@ use App\Events\PurchaseOrder\PurchaseOrderWasEmailed;
|
|||
* @property \App\Models\User $user
|
||||
* @property \App\Models\Vendor $vendor
|
||||
* @property \App\Models\PurchaseOrderInvitation $invitation
|
||||
* @property \App\Models\Currency|null $currency
|
||||
* @property \App\Models\Location|null $location
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder exclude($columns)
|
||||
* @method static \Database\Factories\PurchaseOrderFactory factory($count = null, $state = [])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|PurchaseOrder filter(\App\Filters\QueryFilters $filters)
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @property float $promo_price
|
||||
* @property int $registration_required
|
||||
* @property int $use_inventory_management
|
||||
* @property string|null $steps
|
||||
* @property string|null $optional_product_ids
|
||||
* @property string|null $optional_recurring_product_ids
|
||||
* @property-read \App\Models\Company $company
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @property int|null $language_id
|
||||
* @property int|null $last_login
|
||||
* @property bool $is_tax_exempt
|
||||
* @property string|null $classification
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
|
||||
* @property-read int|null $activities_count
|
||||
* @property-read \App\Models\Language|null $language
|
||||
|
|
|
|||
|
|
@ -650,6 +650,21 @@ $this->account->forceDelete();
|
|||
'public_notes' => 'Public5',
|
||||
'private_notes' => 'Private5',
|
||||
'terms' => 'Terms5',
|
||||
'tax_rate1' => 0,
|
||||
'tax_rate2' => 0,
|
||||
'tax_rate3' => 0,
|
||||
'discount' => 0,
|
||||
'line_items' => [
|
||||
[
|
||||
'quantity' => 1,
|
||||
'product_key' => 'product_key',
|
||||
'notes' => 'notes',
|
||||
'cost' => 1000,
|
||||
'custom_value1' => 'Custom 1',
|
||||
'custom_value2' => 'Custom 2',
|
||||
'custom_value3' => 'Custom 3',
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,7 @@ class UpdateExchangeRatesTest extends TestCase
|
|||
|
||||
UpdateExchangeRates::dispatchSync();
|
||||
|
||||
$gbp_currency = app('currencies')->first(function ($item) {
|
||||
return $item->id == 2;
|
||||
});
|
||||
$gbp_currency = \App\Models\Currency::find(2);
|
||||
|
||||
$this->assertEquals($currency_api->rates->GBP, $gbp_currency->exchange_rate);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue