new cs rule: single_line_empty_body

Rule is added to the last version of php-cs-fixer
This commit is contained in:
2023-09-12 15:58:59 +02:00
parent b9231a91a3
commit d2323e91ca
606 changed files with 639 additions and 1804 deletions

View File

@@ -24,6 +24,4 @@ use const E_USER_DEPRECATED;
*
* This abstract Voter provide generic methods to handle object specific to Chill
*/
abstract class AbstractChillVoter extends Voter implements ChillVoterInterface
{
}
abstract class AbstractChillVoter extends Voter implements ChillVoterInterface {}

View File

@@ -33,9 +33,7 @@ use function get_class;
*/
class AuthorizationHelper implements AuthorizationHelperInterface
{
public function __construct(private readonly CenterResolverManagerInterface $centerResolverManager, private readonly LoggerInterface $logger, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly UserACLAwareRepositoryInterface $userACLAwareRepository, private readonly ParentRoleHelper $parentRoleHelper)
{
}
public function __construct(private readonly CenterResolverManagerInterface $centerResolverManager, private readonly LoggerInterface $logger, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly UserACLAwareRepositoryInterface $userACLAwareRepository, private readonly ParentRoleHelper $parentRoleHelper) {}
/**
* Filter an array of centers, return only center which are reachable.

View File

@@ -17,9 +17,7 @@ use Symfony\Component\Security\Core\Security;
class AuthorizationHelperForCurrentUser implements AuthorizationHelperForCurrentUserInterface
{
public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security)
{
}
public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security) {}
public function getReachableCenters(string $role, ?Scope $scope = null): array
{

View File

@@ -14,6 +14,4 @@ namespace Chill\MainBundle\Security\Authorization;
/**
* Provides methods for compiling voter and build admin role fields.
*/
interface ChillVoterInterface
{
}
interface ChillVoterInterface {}

View File

@@ -18,9 +18,7 @@ use function in_array;
final readonly class DefaultVoterHelper implements VoterHelperInterface
{
public function __construct(private AuthorizationHelper $authorizationHelper, private CenterResolverDispatcherInterface $centerResolverDispatcher, private array $configuration)
{
}
public function __construct(private AuthorizationHelper $authorizationHelper, private CenterResolverDispatcherInterface $centerResolverDispatcher, private array $configuration) {}
public function supports($attribute, $subject): bool
{

View File

@@ -15,9 +15,7 @@ use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
class DefaultVoterHelperFactory implements VoterHelperFactoryInterface
{
public function __construct(protected AuthorizationHelper $authorizationHelper, protected CenterResolverDispatcherInterface $centerResolverDispatcher)
{
}
public function __construct(protected AuthorizationHelper $authorizationHelper, protected CenterResolverDispatcherInterface $centerResolverDispatcher) {}
public function generate($context): VoterGeneratorInterface
{

View File

@@ -17,9 +17,7 @@ final class DefaultVoterHelperGenerator implements VoterGeneratorInterface
{
private array $configuration = [];
public function __construct(private readonly AuthorizationHelper $authorizationHelper, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher)
{
}
public function __construct(private readonly AuthorizationHelper $authorizationHelper, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher) {}
public function addCheckFor(?string $subject, array $attributes): self
{

View File

@@ -29,9 +29,7 @@ class EntityWorkflowVoter extends Voter
final public const SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW';
public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security)
{
}
public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security) {}
protected function supports($attribute, $subject)
{

View File

@@ -24,9 +24,7 @@ class WorkflowEntityDeletionVoter extends Voter
/**
* @param \Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface[] $handlers
*/
public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository)
{
}
public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository) {}
protected function supports($attribute, $subject)
{

View File

@@ -31,8 +31,7 @@ class PasswordRecoverEvent extends \Symfony\Contracts\EventDispatcher\Event
private readonly ?User $user = null,
private $ip = null,
private readonly bool $safelyGenerated = false,
) {
}
) {}
public function getIp()
{

View File

@@ -24,9 +24,7 @@ class RecoverPasswordHelper
{
final public const RECOVER_PASSWORD_ROUTE = 'password_recover';
public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer)
{
}
public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer) {}
/**
* @param bool $absolute

View File

@@ -16,9 +16,7 @@ final readonly class CenterResolverDispatcher implements CenterResolverDispatche
/**
* @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers
*/
public function __construct(private iterable $resolvers = [])
{
}
public function __construct(private iterable $resolvers = []) {}
public function resolveCenter($entity, ?array $options = [])
{

View File

@@ -22,9 +22,7 @@ final readonly class CenterResolverManager implements CenterResolverManagerInter
/**
* @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers
*/
public function __construct(private iterable $resolvers = [])
{
}
public function __construct(private iterable $resolvers = []) {}
public function resolveCenters($entity, ?array $options = []): array
{

View File

@@ -15,9 +15,7 @@ use Twig\TwigFilter;
final class ResolverTwigExtension extends \Twig\Extension\AbstractExtension
{
public function __construct(private readonly CenterResolverManagerInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher)
{
}
public function __construct(private readonly CenterResolverManagerInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) {}
public function getFilters()
{

View File

@@ -19,9 +19,7 @@ final readonly class ScopeResolverDispatcher
/**
* @param \Chill\MainBundle\Security\Resolver\ScopeResolverInterface[] $resolvers
*/
public function __construct(private iterable $resolvers)
{
}
public function __construct(private iterable $resolvers) {}
public function isConcerned($entity, ?array $options = []): bool
{

View File

@@ -21,9 +21,7 @@ use Symfony\Component\Security\Core\User\UserProviderInterface;
class UserProvider implements UserProviderInterface
{
public function __construct(protected EntityManagerInterface $em)
{
}
public function __construct(protected EntityManagerInterface $em) {}
public function loadUserByUsername($username): UserInterface
{