mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'master' into user_filter_tasks
This commit is contained in:
@@ -195,10 +195,6 @@ class AuthorizationHelper implements AuthorizationHelperInterface
|
||||
|
||||
/**
|
||||
* Return all reachable scope for a given user, center and role.
|
||||
*
|
||||
* @param Center|Center[] $center
|
||||
*
|
||||
* @return array|Scope[]
|
||||
*/
|
||||
public function getReachableScopes(UserInterface $user, string $role, Center|array $center): array
|
||||
{
|
||||
|
@@ -25,7 +25,8 @@ interface AuthorizationHelperForCurrentUserInterface
|
||||
public function getReachableCenters(string $role, ?Scope $scope = null): array;
|
||||
|
||||
/**
|
||||
* @param array|Center|Center[] $center
|
||||
* @param list<Center>|Center $center
|
||||
* @return list<Scope>
|
||||
*/
|
||||
public function getReachableScopes(string $role, $center): array;
|
||||
public function getReachableScopes(string $role, array|Center $center): array;
|
||||
}
|
||||
|
@@ -26,7 +26,8 @@ interface AuthorizationHelperInterface
|
||||
public function getReachableCenters(UserInterface $user, string $role, ?Scope $scope = null): array;
|
||||
|
||||
/**
|
||||
* @param Center|list<Center> $center
|
||||
* @param Center|array<Center> $center
|
||||
* @return list<Scope>
|
||||
*/
|
||||
public function getReachableScopes(UserInterface $user, string $role, Center|array $center): array;
|
||||
}
|
||||
|
@@ -18,8 +18,12 @@ use UnexpectedValueException;
|
||||
|
||||
class RollingDateConverter implements RollingDateConverterInterface
|
||||
{
|
||||
public function convert(RollingDate $rollingDate): DateTimeImmutable
|
||||
public function convert(?RollingDate $rollingDate): ?DateTimeImmutable
|
||||
{
|
||||
if (null === $rollingDate) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch ($rollingDate->getRoll()) {
|
||||
case RollingDate::T_MONTH_CURRENT_START:
|
||||
return $this->toBeginOfMonth($rollingDate->getPivotDate());
|
||||
|
@@ -15,5 +15,9 @@ use DateTimeImmutable;
|
||||
|
||||
interface RollingDateConverterInterface
|
||||
{
|
||||
public function convert(RollingDate $rollingDate): DateTimeImmutable;
|
||||
/**
|
||||
* @param RollingDate|null $rollingDate
|
||||
* @return ($rollingDate is null ? null : DateTimeImmutable)
|
||||
*/
|
||||
public function convert(?RollingDate $rollingDate): ?DateTimeImmutable;
|
||||
}
|
||||
|
Reference in New Issue
Block a user