mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
updates for static analysis
This commit is contained in:
parent
f01fa763c1
commit
b566bf6a7f
@ -61,7 +61,7 @@ class UpdateCalculatedFields
|
|||||||
MultiDB::setDB($db);
|
MultiDB::setDB($db);
|
||||||
|
|
||||||
|
|
||||||
Project::with('tasks')->whereHas('tasks', function ($query){
|
Project::query()->with('tasks')->whereHas('tasks', function ($query){
|
||||||
$query->where('updated_at', '>', now()->subHours(2));
|
$query->where('updated_at', '>', now()->subHours(2));
|
||||||
})
|
})
|
||||||
->cursor()
|
->cursor()
|
||||||
|
@ -83,28 +83,22 @@ class Project extends BaseModel
|
|||||||
|
|
||||||
protected $touches = [];
|
protected $touches = [];
|
||||||
|
|
||||||
/**
|
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
* @return BelongsTo
|
|
||||||
*/
|
|
||||||
public function company()
|
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Company::class);
|
return $this->belongsTo(Company::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function client()
|
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vendor()
|
public function vendor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Vendor::class)->withTrashed();
|
return $this->belongsTo(Vendor::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function project()
|
public function project(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(self::class)->withTrashed();
|
return $this->belongsTo(self::class)->withTrashed();
|
||||||
}
|
}
|
||||||
@ -114,12 +108,12 @@ class Project extends BaseModel
|
|||||||
return $this->morphMany(Document::class, 'documentable');
|
return $this->morphMany(Document::class, 'documentable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tasks()
|
public function tasks(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Task::class);
|
return $this->hasMany(Task::class);
|
||||||
}
|
}
|
||||||
|
@ -302,6 +302,8 @@ class TemplateEngine
|
|||||||
'company_id' => $user->company()->id,
|
'company_id' => $user->company()->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
/** @var \App\Models\ClientContact $contact */
|
||||||
$contact = ClientContact::factory()->create([
|
$contact = ClientContact::factory()->create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'company_id' => $user->company()->id,
|
'company_id' => $user->company()->id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user