1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for static analysis

This commit is contained in:
David Bomba 2023-06-08 17:16:24 +10:00
parent 897f170307
commit 11de4b241d
5 changed files with 14 additions and 7 deletions

View File

@ -100,10 +100,7 @@ class Import implements ShouldQueue
use Uploadable;
use SavesDocuments;
/**
* @var array
*/
private $file_path; //the file path - using a different JSON parser here.
private string $file_path; //the file path - using a different JSON parser here.
/**
* @var Company
@ -202,7 +199,11 @@ class Import implements ShouldQueue
nlog($this->company->id);
auth()->login($this->user, false);
auth()->user()->setCompany($this->company);
/** @var \App\Models\User $user */
$user = auth()->user();
$user->setCompany($this->company);
$array = json_decode(file_get_contents($this->file_path), 1);
$data = $array['data'];

View File

@ -40,7 +40,10 @@ use Illuminate\Support\Str;
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scopeExclude()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel find()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel whereIn()
* @method static \Illuminate\Database\Eloquent\Builder|BankIntegration where()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel where()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel count()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel create()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel insert()
* @method \App\Models\Company company()
* @method int companyId()
* @method Builder|static exclude($columns)

View File

@ -168,6 +168,7 @@ use Laracasts\Presenter\PresentableTrait;
* @method static \Illuminate\Database\Eloquent\Builder|Client withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|Client withoutTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|Client with()
* @method static \Illuminate\Database\Eloquent\Builder|Client where()
* @property string $payment_balance
* @method static \Illuminate\Database\Eloquent\Builder|Client wherePaymentBalance($value)
* @property mixed $tax_data

View File

@ -37,6 +37,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Eloquent\Builder|TaskStatus onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|TaskStatus query()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel insert()
* @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereColor($value)
* @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereCompanyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TaskStatus whereCreatedAt($value)

View File

@ -708,7 +708,8 @@ trait GeneratesCounter
$replace[] = str_pad(($user_id), 2, '0', STR_PAD_LEFT);
}
$matches = false;
$matches = [];
preg_match('/{\$date:(.*?)}/', $pattern, $matches);
if (count($matches) > 1) {
$format = $matches[1];