Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fre5h committed Apr 12, 2024
1 parent c641ffc commit 4e155ba
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 37 deletions.
5 changes: 3 additions & 2 deletions Asset/DatetimeVersionStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class DatetimeVersionStrategy implements VersionStrategyInterface
/**
* @param DateTimeHelper $dateTimeHelper
*/
public function __construct(DateTimeHelper $dateTimeHelper)
{
public function __construct(
private readonly DateTimeHelper $dateTimeHelper,

Check failure on line 31 in Asset/DatetimeVersionStrategy.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Property StfalconStudio\ApiBundle\Asset\DatetimeVersionStrategy::$dateTimeHelper is never read, only written.
) {
$this->version = $dateTimeHelper->getCurrentDatetimeImmutable()->format('YmdHis');
}

Expand Down
5 changes: 3 additions & 2 deletions Event/User/AbstractUserEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ abstract class AbstractUserEvent extends Event
/**
* @param UserInterface $user
*/
public function __construct(private readonly UserInterface $user)
{
public function __construct(
private readonly UserInterface $user,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions EventListener/JWT/JwtSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ final class JwtSubscriber implements EventSubscriberInterface
/**
* @param TranslatorInterface $translator
*/
public function __construct(private readonly TranslatorInterface $translator)
{
public function __construct(
private readonly TranslatorInterface $translator,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions EventListener/JWT/TokenBlackListSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ final class TokenBlackListSubscriber implements EventSubscriberInterface
/**
* @param JwtBlackListService $tokenBlackListService
*/
public function __construct(private readonly JwtBlackListService $tokenBlackListService)
{
public function __construct(
private readonly JwtBlackListService $tokenBlackListService,
) {
}

/**
Expand Down
8 changes: 6 additions & 2 deletions EventListener/Kernel/ApiExceptionFormatterListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ final class ApiExceptionFormatterListener implements EventSubscriberInterface
* @param ExceptionResponseProcessorInterface $exceptionResponseProcessor
* @param ExceptionResponseFactory $exceptionResponseFactory
*/
public function __construct(private readonly string $apiHost, private readonly string $environment, private readonly ExceptionResponseProcessorInterface $exceptionResponseProcessor, private readonly ExceptionResponseFactory $exceptionResponseFactory)
{
public function __construct(
private readonly string $apiHost,
private readonly string $environment,
private readonly ExceptionResponseProcessorInterface $exceptionResponseProcessor,
private readonly ExceptionResponseFactory $exceptionResponseFactory,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions EventListener/ODM/Aggregate/AggregatePartListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ final class AggregatePartListener
/**
* @param DateTimeHelper $dateTimeHelper
*/
public function __construct(private readonly DateTimeHelper $dateTimeHelper)
{
public function __construct(
private readonly DateTimeHelper $dateTimeHelper,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions EventListener/ORM/Aggregate/AggregatePartListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ final class AggregatePartListener
/**
* @param DateTimeHelper $dateTimeHelper
*/
public function __construct(private readonly DateTimeHelper $dateTimeHelper)
{
public function __construct(
private readonly DateTimeHelper $dateTimeHelper,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions EventListener/Security/CheckVerifiedUserSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ final class CheckVerifiedUserSubscriber implements EventSubscriberInterface
/**
* @param JwtBlackListService $tokenBlackListService
*/
public function __construct(private readonly JwtBlackListService $tokenBlackListService)
{
public function __construct(
private readonly JwtBlackListService $tokenBlackListService,
) {
}

/**
Expand Down
6 changes: 4 additions & 2 deletions Request/DtoExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class DtoExtractor
* @param DtoAttributeProcessor $dtoAttributeProcessor
* @param SerializerInterface $serializer
*/
public function __construct(private readonly DtoAttributeProcessor $dtoAttributeProcessor, private readonly SerializerInterface $serializer)
{
public function __construct(
private readonly DtoAttributeProcessor $dtoAttributeProcessor,
private readonly SerializerInterface $serializer,
) {
}

/**
Expand Down
8 changes: 6 additions & 2 deletions Security/JwtBlackListService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ class JwtBlackListService
* @param JwtCacheHelper $jwtCacheHelper
* @param DateTimeHelper $dateTimeHelper
*/
public function __construct(private readonly JWSProviderInterface $jwsProvider, private readonly JwtTokenHelper $jwtTokenHelper, private readonly JwtCacheHelper $jwtCacheHelper, private readonly DateTimeHelper $dateTimeHelper)
{
public function __construct(
private readonly JWSProviderInterface $jwsProvider,
private readonly JwtTokenHelper $jwtTokenHelper,
private readonly JwtCacheHelper $jwtCacheHelper,
private readonly DateTimeHelper $dateTimeHelper,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions Security/JwtTokenHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class JwtTokenHelper
/**
* @param TokenStorageInterface $tokenStorage
*/
public function __construct(private readonly TokenStorageInterface $tokenStorage)
{
public function __construct(
private readonly TokenStorageInterface $tokenStorage,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions Serializer/Normalizer/ConstraintViolationListNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class ConstraintViolationListNormalizer implements NormalizerInterface
/**
* @param NormalizerInterface $symfonyConstraintViolationListNormalizer
*/
public function __construct(private readonly NormalizerInterface $symfonyConstraintViolationListNormalizer)
{
public function __construct(
private readonly NormalizerInterface $symfonyConstraintViolationListNormalizer,
) {
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Serializer/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function serialize(object|array $object, string $serializationGroup, arra
$context,
[
'group' => $serializationGroup,
'json_encode_options' => \JSON_UNESCAPED_SLASHES | \JSON_THROW_ON_ERROR | \JSON_UNESCAPED_UNICODE,
'json_encode_options' => \JSON_UNESCAPED_SLASHES | \JSON_THROW_ON_ERROR | \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES,
]
);

Expand Down
7 changes: 5 additions & 2 deletions Service/AttributeProcessor/JsonSchemaAttributeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ class JsonSchemaAttributeProcessor
* @param FileReader $fileReader
* @param string $jsonSchemaDir
*/
public function __construct(private readonly DtoAttributeProcessor $dtoAttributeProcessor, private readonly FileReader $fileReader, private readonly string $jsonSchemaDir)
{
public function __construct(
private readonly DtoAttributeProcessor $dtoAttributeProcessor,
private readonly FileReader $fileReader,
private readonly string $jsonSchemaDir,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions Service/DependentEntity/DependentEntityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ class DependentEntityService
/**
* @param RepositoryService $repositoryService
*/
public function __construct(private readonly RepositoryService $repositoryService)
{
public function __construct(
private readonly RepositoryService $repositoryService,
) {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ class ExceptionResponseProcessor implements ExceptionResponseProcessorInterface
/**
* @param iterable|CustomAppExceptionResponseProcessorInterface[] $errorResponseProcessors
*/
public function __construct(private readonly iterable $errorResponseProcessors)
{
public function __construct(
private readonly iterable $errorResponseProcessors,
) {
}

/**
Expand Down
5 changes: 3 additions & 2 deletions Validator/Constraints/Entity/EntityExistsValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class EntityExistsValidator extends ConstraintValidator
/**
* @param RepositoryService $repositoryService
*/
public function __construct(private readonly RepositoryService $repositoryService)
{
public function __construct(
private readonly RepositoryService $repositoryService,
) {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class PasswordMeetSpecialRequirementsValidator extends ConstraintValidator
/**
* @param PasswordRequirementsValidator $passwordRequirementsValidator
*/
public function __construct(private readonly PasswordRequirementsValidator $passwordRequirementsValidator)
{
public function __construct(
private readonly PasswordRequirementsValidator $passwordRequirementsValidator,
) {
}

/**
Expand Down
6 changes: 4 additions & 2 deletions Validator/JsonSchemaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ class JsonSchemaValidator
* @param Validator $validator
* @param JsonSchemaAttributeProcessor $jsonSchemaAttributeProcessor
*/
public function __construct(private readonly Validator $validator, private readonly JsonSchemaAttributeProcessor $jsonSchemaAttributeProcessor)
{
public function __construct(
private readonly Validator $validator,
private readonly JsonSchemaAttributeProcessor $jsonSchemaAttributeProcessor,
) {
}

/**
Expand Down

0 comments on commit 4e155ba

Please sign in to comment.