mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
Fix cs with new cs rules (php-cs-fixer version 3.35)
This commit is contained in:
@@ -96,7 +96,7 @@ class LoadPostalCodesCommand extends Command
|
||||
try {
|
||||
$this->addPostalCode($row, $output);
|
||||
++$num;
|
||||
} catch (ExistingPostalCodeException|CountryCodeNotFoundException|PostalCodeNotValidException $ex) {
|
||||
} catch (CountryCodeNotFoundException|ExistingPostalCodeException|PostalCodeNotValidException $ex) {
|
||||
$output->writeln('<warning> on line ' . $line . ' : ' . $ex->getMessage() . '</warning>');
|
||||
}
|
||||
++$line;
|
||||
|
@@ -99,7 +99,7 @@ class PasswordController extends AbstractController
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
* @\Symfony\Component\Routing\Annotation\Route(path="/public/{_locale}/password/recover", name="password_recover")
|
||||
*/
|
||||
public function recoverAction(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
public function recoverAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
if (false === $this->isGranted(PasswordRecoverVoter::ASK_TOKEN)) {
|
||||
return new Response($this->translator->trans('You are not allowed '
|
||||
@@ -168,7 +168,7 @@ class PasswordController extends AbstractController
|
||||
* @return Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
* @\Symfony\Component\Routing\Annotation\Route(path="/public/{_locale}/password/request-recover", name="password_request_recover")
|
||||
*/
|
||||
public function requestRecoverAction(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
public function requestRecoverAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
if (false === $this->isGranted(PasswordRecoverVoter::ASK_TOKEN)) {
|
||||
return new Response($this->translator->trans('You are not allowed '
|
||||
|
@@ -29,7 +29,7 @@ class Extract extends FunctionNode
|
||||
{
|
||||
private string $field;
|
||||
|
||||
private \Doctrine\ORM\Query\AST\Node|string|null $value = null;
|
||||
private null|\Doctrine\ORM\Query\AST\Node|string $value = null;
|
||||
//private PathExpression $value;
|
||||
//private FunctionNode $value;
|
||||
//private DateDiffFunction $value;
|
||||
|
@@ -18,7 +18,7 @@ use Doctrine\ORM\Query\SqlWalker;
|
||||
|
||||
class JsonExtract extends FunctionNode
|
||||
{
|
||||
private \Doctrine\ORM\Query\AST\Node|string|null $element = null;
|
||||
private null|\Doctrine\ORM\Query\AST\Node|string $element = null;
|
||||
|
||||
private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $keyToExtract = null;
|
||||
|
||||
|
@@ -23,7 +23,7 @@ class ToChar extends FunctionNode
|
||||
{
|
||||
private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $datetime = null;
|
||||
|
||||
private \Doctrine\ORM\Query\AST\Node|string|null $fmt = null;
|
||||
private null|\Doctrine\ORM\Query\AST\Node|string $fmt = null;
|
||||
|
||||
public function getSql(SqlWalker $sqlWalker)
|
||||
{
|
||||
|
@@ -28,7 +28,7 @@ final readonly class ExportFormHelper
|
||||
private FormFactoryInterface $formFactory,
|
||||
) {}
|
||||
|
||||
public function getDefaultData(string $step, ExportInterface|DirectExportInterface $export, array $options = []): array
|
||||
public function getDefaultData(string $step, DirectExportInterface|ExportInterface $export, array $options = []): array
|
||||
{
|
||||
return match ($step) {
|
||||
'centers', 'generate_centers' => ['centers' => $this->authorizationHelper->getReachableCenters($export->requiredRole())],
|
||||
@@ -45,7 +45,7 @@ final readonly class ExportFormHelper
|
||||
return $formatter->getFormDefaultData($options['aggregator_aliases']);
|
||||
}
|
||||
|
||||
private function getDefaultDataStepExport(ExportInterface|DirectExportInterface $export, array $options): array
|
||||
private function getDefaultDataStepExport(DirectExportInterface|ExportInterface $export, array $options): array
|
||||
{
|
||||
$data = [
|
||||
ExportType::EXPORT_KEY => $export->getFormDefaultData(),
|
||||
|
@@ -101,7 +101,7 @@ class ExportManager
|
||||
*
|
||||
* @return FilterInterface[] a \Generator that contains filters. The key is the filter's alias
|
||||
*/
|
||||
public function &getFiltersApplyingOn(ExportInterface|DirectExportInterface $export, ?array $centers = null): iterable
|
||||
public function &getFiltersApplyingOn(DirectExportInterface|ExportInterface $export, ?array $centers = null): iterable
|
||||
{
|
||||
if ($export instanceof DirectExportInterface) {
|
||||
return;
|
||||
@@ -124,7 +124,7 @@ class ExportManager
|
||||
*
|
||||
* @return null|iterable<string, AggregatorInterface> a \Generator that contains aggretagors. The key is the filter's alias
|
||||
*/
|
||||
public function &getAggregatorsApplyingOn(ExportInterface|DirectExportInterface $export, ?array $centers = null): ?iterable
|
||||
public function &getAggregatorsApplyingOn(DirectExportInterface|ExportInterface $export, ?array $centers = null): ?iterable
|
||||
{
|
||||
if ($export instanceof ListInterface || $export instanceof DirectExportInterface) {
|
||||
return;
|
||||
@@ -307,7 +307,7 @@ class ExportManager
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function getExport($alias): ExportInterface|DirectExportInterface
|
||||
public function getExport($alias): DirectExportInterface|ExportInterface
|
||||
{
|
||||
if (!array_key_exists($alias, $this->exports)) {
|
||||
throw new RuntimeException("The export with alias {$alias} is not known.");
|
||||
@@ -453,7 +453,7 @@ class ExportManager
|
||||
*
|
||||
*/
|
||||
public function isGrantedForElement(
|
||||
ExportInterface|DirectExportInterface|ModifierInterface $element,
|
||||
DirectExportInterface|ExportInterface|ModifierInterface $element,
|
||||
\Chill\MainBundle\Export\DirectExportInterface|\Chill\MainBundle\Export\ExportInterface $export = null,
|
||||
?array $centers = null
|
||||
): bool {
|
||||
|
@@ -66,7 +66,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface
|
||||
*
|
||||
* @return User[]
|
||||
*/
|
||||
public function findUsersReaching(string $role, array|\Chill\MainBundle\Entity\Center $center, array|\Chill\MainBundle\Entity\Scope|null $scope = null, bool $onlyEnabled = true): array
|
||||
public function findUsersReaching(string $role, array|\Chill\MainBundle\Entity\Center $center, null|array|\Chill\MainBundle\Entity\Scope $scope = null, bool $onlyEnabled = true): array
|
||||
{
|
||||
return $this->userACLAwareRepository
|
||||
->findUsersByReachedACL($role, $center, $scope, $onlyEnabled);
|
||||
@@ -130,7 +130,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface
|
||||
* @param Center|Center[] $center
|
||||
* @return Scope[]
|
||||
*/
|
||||
public function getReachableCircles(UserInterface $user, string $role, \Chill\MainBundle\Entity\Center|array $center)
|
||||
public function getReachableCircles(UserInterface $user, string $role, array|\Chill\MainBundle\Entity\Center $center)
|
||||
{
|
||||
$scopes = [];
|
||||
|
||||
@@ -162,7 +162,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface
|
||||
/**
|
||||
* Return all reachable scope for a given user, center and role.
|
||||
*/
|
||||
public function getReachableScopes(UserInterface $user, string $role, Center|array $center): array
|
||||
public function getReachableScopes(UserInterface $user, string $role, array|Center $center): array
|
||||
{
|
||||
return $this->getReachableCircles($user, $role, $center);
|
||||
}
|
||||
@@ -172,7 +172,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface
|
||||
*
|
||||
* @param Center|Center[] $center May be an array of center
|
||||
*/
|
||||
public function userCanReachCenter(User $user, \Chill\MainBundle\Entity\Center|array $center): bool
|
||||
public function userCanReachCenter(User $user, array|\Chill\MainBundle\Entity\Center $center): bool
|
||||
{
|
||||
if ($center instanceof Traversable) {
|
||||
foreach ($center as $c) {
|
||||
|
@@ -29,5 +29,5 @@ interface AuthorizationHelperInterface
|
||||
* @param Center|array<Center> $center
|
||||
* @return list<Scope>
|
||||
*/
|
||||
public function getReachableScopes(UserInterface $user, string $role, Center|array $center): array;
|
||||
public function getReachableScopes(UserInterface $user, string $role, array|Center $center): array;
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ final readonly class ScopeResolverDispatcher
|
||||
return false;
|
||||
}
|
||||
|
||||
public function resolveScope(mixed $entity, ?array $options = []): iterable|\Chill\MainBundle\Entity\Scope|null
|
||||
public function resolveScope(mixed $entity, ?array $options = []): null|\Chill\MainBundle\Entity\Scope|iterable
|
||||
{
|
||||
foreach ($this->resolvers as $resolver) {
|
||||
if ($resolver->supports($entity, $options)) {
|
||||
|
@@ -45,7 +45,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
|
||||
if ($this->denormalizer->supportsDenormalization($data, $localType, $format)) {
|
||||
try {
|
||||
return $this->denormalizer->denormalize($data, $localType, $format, $context);
|
||||
} catch (RuntimeException|NotNormalizableValueException $e) {
|
||||
} catch (NotNormalizableValueException|RuntimeException $e) {
|
||||
$lastException = $e;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user