mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Fix return type in user getters for mainScope and userJob
This commit is contained in:
@@ -262,7 +262,7 @@ class User implements UserInterface, \Stringable
|
||||
return $this->mainLocation;
|
||||
}
|
||||
|
||||
public function getMainScope(?DateTimeImmutable $at = null): ?UserScopeHistory
|
||||
public function getMainScope(?DateTimeImmutable $at = null): ?Scope
|
||||
{
|
||||
$at ??= new DateTimeImmutable('today');
|
||||
$criteria = new Criteria();
|
||||
@@ -281,7 +281,7 @@ class User implements UserInterface, \Stringable
|
||||
$scopes = $this->scopeHistories->matching($criteria);
|
||||
|
||||
if ($scopes->count() > 0) {
|
||||
return $scopes->first();
|
||||
return $scopes->first()->getScope();
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -305,7 +305,7 @@ class User implements UserInterface, \Stringable
|
||||
return $this->salt;
|
||||
}
|
||||
|
||||
public function getUserJob(?DateTimeImmutable $at = null): ?UserJobHistory
|
||||
public function getUserJob(?DateTimeImmutable $at = null): ?UserJob
|
||||
{
|
||||
$at ??= new DateTimeImmutable('today');
|
||||
$criteria = new Criteria();
|
||||
@@ -317,13 +317,13 @@ class User implements UserInterface, \Stringable
|
||||
$expr->isNull('endDate'),
|
||||
$expr->gt('endDate', $at)
|
||||
),
|
||||
$expr->lte('startDate')
|
||||
$expr->lte('startDate', $at)
|
||||
)
|
||||
);
|
||||
|
||||
$jobs = $this->jobHistories->matching($criteria);
|
||||
if ($jobs->count() > 0) {
|
||||
return $jobs->first();
|
||||
return $jobs->first()->getJob();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user