Skip to content

Commit

Permalink
Upgrade Symfony 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaky212 committed Dec 9, 2022
1 parent b5573d9 commit 53845dc
Show file tree
Hide file tree
Showing 45 changed files with 271 additions and 1,033 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,10 @@

class LoadMetadataCommand implements Command
{
/**
* @var SaveSamlEntityCommand
*/
private $saveEntityCommand;

private $requestData;

public function __construct(SaveSamlEntityCommand $command, array $requestData)
{
$this->saveEntityCommand = $command;
$this->requestData = $requestData;
public function __construct(
private readonly SaveSamlEntityCommand $saveEntityCommand,
private readonly array $requestData
) {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,11 @@

class DeleteServiceCommand implements Command
{
/**
* @var int
*/
private $id;

/**
* The Contact that initiated the service deletion.
* @var Contact
*/
private $contact;

/**
* @var int
*/
private $teamId;

public function __construct(int $id, Contact $contact, ?int $teamId)
{
$this->id = $id;
$this->contact = $contact;
$this->teamId = $teamId;
public function __construct(
private readonly int $id,
private readonly Contact $contact,
private readonly ?int $teamId
) {
}

public function getId(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DeletePublishedProductionEntityCommandHandler implements CommandHandler
{
public function __construct(
private readonly DeleteManageEntityRepository $deleteEntityRepository,
private readonly LoggerInterface $logger
private readonly LoggerInterface $logger
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DeletePublishedTestEntityCommandHandler implements CommandHandler
{
public function __construct(
private readonly DeleteManageEntityRepository $deleteEntityRepository,
private readonly LoggerInterface $logger
private readonly LoggerInterface $logger
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
*/
class RequestDeletePublishedEntityCommandHandler implements CommandHandler
{
/**
* @var QueryManageRepository
*/
private $queryClient;

/**
* @var string
*/
Expand All @@ -49,14 +44,13 @@ class RequestDeletePublishedEntityCommandHandler implements CommandHandler
private $descriptionTranslationKey;

public function __construct(
private QueryManageRepository $manageProductionQueryClient,
private readonly string $issueType,
private readonly TicketService $ticketService,
private readonly FlashBagInterface $flashBag,
private readonly LoggerInterface $logger
private readonly QueryManageRepository $queryClient,
private readonly string $issueType,
private readonly TicketService $ticketService,
private readonly FlashBagInterface $flashBag,
private readonly LoggerInterface $logger
) {
Assert::stringNotEmpty($issueType, 'Please set "jira_issue_type" in .env');
$this->queryClient = $manageProductionQueryClient;
$this->summaryTranslationKey = 'entity.delete.request.ticket.summary';
$this->descriptionTranslationKey = 'entity.delete.request.ticket.description';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,10 @@

class PrivacyQuestionsCommandHandler implements CommandHandler
{
/**
* @var PrivacyQuestionsRepository
*/
private $repository;

/**
* @var LoggerInterface
*/
private $logger;

public function __construct(PrivacyQuestionsRepository $repository, LoggerInterface $logger)
{
$this->repository = $repository;
$this->logger = $logger;
public function __construct(
private readonly PrivacyQuestionsRepository $repository,
private readonly LoggerInterface $logger
) {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,43 +28,13 @@

class CreateServiceCommandHandler implements CommandHandler
{
/**
* @var ServiceRepository
*/
private $serviceRepository;

/**
* @var PublishTeamsRepository
*/
private $publishEntityClient;

/**
* @var TranslatorInterface
*/
private $translator;

/**
* @var string
*/
private $prefixPart1;

/**
* @var string
*/
private $prefixPart2;

public function __construct(
ServiceRepository $serviceRepository,
PublishTeamsRepository $publishEntityClient,
TranslatorInterface $translator,
string $prefixPart1,
string $prefixPart2
private readonly ServiceRepository $serviceRepository,
private readonly PublishTeamsRepository $publishEntityClient,
private readonly TranslatorInterface $translator,
private readonly string $prefixPart1,
private readonly string $prefixPart2
) {
$this->serviceRepository = $serviceRepository;
$this->publishEntityClient = $publishEntityClient;
$this->translator = $translator;
$this->prefixPart1 = $prefixPart1;
$this->prefixPart2 = $prefixPart2;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,50 +32,14 @@

class DeleteServiceCommandHandler implements CommandHandler
{
/**
* @var ServiceRepository
*/
private $serviceRepository;

/**
* @var EntityServiceInterface
*/
private $entityService;

/**
* @var DeleteCommandFactory
*/
private $deleteCommandFactory;

/**
* @var CommandBus
*/
private $commandBus;

/**
* @var LoggerInterface
*/
private $logger;

/**
* @var DeleteEntityClient
*/
private $deleteTeamClient;

public function __construct(
ServiceRepository $serviceRepository,
EntityServiceInterface $entityService,
DeleteCommandFactory $deleteCommandFactory,
CommandBus $commandBus,
DeleteEntityClient $deleteTeamClient,
LoggerInterface $logger
private readonly ServiceRepository $serviceRepository,
private readonly EntityServiceInterface $entityService,
private readonly DeleteCommandFactory $deleteCommandFactory,
private readonly CommandBus $commandBus,
private readonly DeleteEntityClient $deleteTeamClient,
private readonly LoggerInterface $logger
) {
$this->serviceRepository = $serviceRepository;
$this->entityService = $entityService;
$this->deleteCommandFactory = $deleteCommandFactory;
$this->commandBus = $commandBus;
$this->logger = $logger;
$this->deleteTeamClient = $deleteTeamClient;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,10 @@

class EntityQueryRepositoryProvider
{
/**
* @var QueryManageRepository
*/
private $manageTestQueryClient;

/**
* @var QueryManageRepository
*/
private $manageProductionQueryClient;


public function __construct(
QueryManageRepository $manageTestQueryClient,
QueryManageRepository $manageProductionQueryClient
private readonly QueryManageRepository $manageTestQueryClient,
private readonly QueryManageRepository $manageProductionQueryClient
) {
$this->manageTestQueryClient = $manageTestQueryClient;
$this->manageProductionQueryClient = $manageProductionQueryClient;
}

public function fromEnvironment(string $environment): QueryManageRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,12 @@

class AttributeService implements AttributeServiceInterface
{
/**
* @var AttributeRepository
*/
private $attributeRepository;

private $attributes = [];

/**
* @var string
*/
private $language;

public function __construct(AttributeRepositoryInterface $attributeRepository, $language)
{
$this->attributeRepository = $attributeRepository;
$this->language = $language;
public function __construct(
private readonly AttributeRepositoryInterface $attributeRepository,
private readonly string $language
) {
}

public function getAttributeTypeAttributes(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,9 @@

class ChangeRequestService implements ChangeRequestServiceInterface
{
/**
* @var EntityChangeRequestRepository
*/
private $repository;

public function __construct(
EntityChangeRequestRepository $repository
private readonly EntityChangeRequestRepository $repository
) {
$this->repository = $repository;
}

public function findByIdAndProtocol(string $id, Protocol $protocol): ChangeRequestDtoCollection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,14 @@

class EntityAclService
{
/**
* @var IdentityProviderRepository
*/
private $identityProviderRepository;

/**
* @var IdentityProvider[]|null
*/
public $availableProviders = null;

public function __construct(
IdentityProviderRepository $identityProviderRepository
private readonly IdentityProviderRepository $identityProviderRepository
) {
$this->identityProviderRepository = $identityProviderRepository;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,11 @@
*/
class EntityMergeService
{
/**
* @var AttributeServiceInterface
*/
private $attributeService;

/**
* @var string
*/
private $playGroundUriTest;

/**
* @var string
*/
private $playGroundUriProd;

public function __construct(
AttributeServiceInterface $attributeService,
string $oidcPlaygroundUriTest,
string $oidcPlaygroundUriProd
private readonly AttributeServiceInterface $attributeService,
private readonly string $playGroundUriTest,
private readonly string $playGroundUriProd
) {
$this->attributeService = $attributeService;
$this->playGroundUriTest = $oidcPlaygroundUriTest;
$this->playGroundUriProd = $oidcPlaygroundUriProd;
}

/**
Expand Down
Loading

0 comments on commit 53845dc

Please sign in to comment.