Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Jan 31, 2022
1 parent b21b626 commit 8b42dbd
Show file tree
Hide file tree
Showing 51 changed files with 115 additions and 173 deletions.
4 changes: 0 additions & 4 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?php

use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\CodingStandard\Fixer\Spacing\StandaloneLinePromotedPropertyFixer;
use Symplify\EasyCodingStandard\ValueObject\Option;

return static function (ContainerConfigurator $containerConfigurator): void {
Expand All @@ -21,8 +19,6 @@
//file that was distributed with this source code.',
// ]);

$containerConfigurator->services()->set(StandaloneLinePromotedPropertyFixer::class);

$containerConfigurator->parameters()->set(Option::SKIP, [
InlineDocCommentDeclarationSniff::class . '.MissingVariable',
InlineDocCommentDeclarationSniff::class . '.NoAssignment',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ public function __construct(
public function create(string $resourceClass): ResourceMetadata
{
$parentResourceMetadata = null;
if ($this->decorated) {
try {
$parentResourceMetadata = $this->decorated->create($resourceClass);
} catch (ResourceClassNotFoundException) {
// Ignore not found exception from decorated factories
}
try {
$parentResourceMetadata = $this->decorated->create($resourceClass);
} catch (ResourceClassNotFoundException) {
// Ignore not found exception from decorated factories
}

if (!(class_exists($resourceClass) || interface_exists($resourceClass)) || !$resource = $this->extractor->getResources()[$resourceClass] ?? false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
/** @experimental */
final class VerifyCustomerAccountHandler implements MessageHandlerInterface
{
public function __construct(
private RepositoryInterface $shopUserRepository
) {
public function __construct(private RepositoryInterface $shopUserRepository)
{
}

public function __invoke(VerifyCustomerAccount $command): JsonResponse
Expand Down
5 changes: 2 additions & 3 deletions src/Sylius/Bundle/ApiBundle/Context/TokenBasedUserContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
/** @experimental */
final class TokenBasedUserContext implements UserContextInterface
{
public function __construct(
private TokenStorageInterface $tokenStorage
) {
public function __construct(private TokenStorageInterface $tokenStorage)
{
}

public function getUser(): ?UserInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@

final class DeleteOrderItemAction
{
public function __construct(
private MessageBusInterface $commandBus
) {
public function __construct(private MessageBusInterface $commandBus)
{
}

public function __invoke(Request $request): Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
/** @experimental */
final class ShippingMethodDataPersister implements ContextAwareDataPersisterInterface
{
public function __construct(
private ContextAwareDataPersisterInterface $decoratedDataPersister
) {
public function __construct(private ContextAwareDataPersisterInterface $decoratedDataPersister)
{
}

public function supports($data, array $context = []): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
/** @experimental */
final class OrderAdjustmentsSubresourceDataProvider implements RestrictedDataProviderInterface, SubresourceDataProviderInterface
{
public function __construct(
private OrderRepositoryInterface $orderRepository
) {
public function __construct(private OrderRepositoryInterface $orderRepository)
{
}

public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
/** @experimental */
final class OrderItemAdjustmentsSubresourceDataProvider implements RestrictedDataProviderInterface, SubresourceDataProviderInterface
{
public function __construct(
private OrderItemRepositoryInterface $orderItemRepository
) {
public function __construct(private OrderItemRepositoryInterface $orderItemRepository)
{
}

public function supports(string $resourceClass, string $operationName = null, array $context = []): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
/** @experimental */
final class ChannelCodeAwareInputCommandDataTransformer implements CommandDataTransformerInterface
{
public function __construct(
private ChannelContextInterface $channelContext
) {
public function __construct(private ChannelContextInterface $channelContext)
{
}

public function transform($object, string $to, array $context = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
/** @experimental */
final class LocaleCodeAwareInputCommandDataTransformer implements CommandDataTransformerInterface
{
public function __construct(
private LocaleContextInterface $localeContext
) {
public function __construct(private LocaleContextInterface $localeContext)
{
}

public function transform($object, string $to, array $context = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
/** @experimental */
final class LoggedInCustomerEmailAwareCommandDataTransformer implements CommandDataTransformerInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function transform($object, string $to, array $context = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
/** @experimental */
final class LoggedInShopUserIdAwareCommandDataTransformer implements CommandDataTransformerInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
/** @experimental */
final class SubresourceIdAwareCommandDataTransformer implements CommandDataTransformerInterface
{
public function __construct(
private RequestStack $requestStack
) {
public function __construct(private RequestStack $requestStack)
{
}

public function transform($object, string $to, array $context = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
/** @experimental */
final class AcceptedProductReviewsExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private string $productReviewClass
) {
public function __construct(private string $productReviewClass)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
/** @experimental */
final class AddressesExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
/** @experimental */
final class CountryCollectionExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
/** @experimental */
final class CurrencyCollectionExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
/** @experimental */
final class HideArchivedShippingMethodExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private string $shippingMethodClass
) {
public function __construct(private string $shippingMethodClass)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
/** @experimental */
final class LocaleCollectionExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
/** @experimental */
final class OrdersByLoggedInUserExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
/** @experimental */
final class ProductsByChannelAndLocaleCodeExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
/** @experimental */
final class ProductsWithEnableFlagExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
/** @experimental */
final class TaxonCollectionExtension implements ContextAwareQueryCollectionExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
/** @experimental */
final class AddressItemExtension implements QueryItemExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
/** @experimental */
final class OrderGetMethodItemExtension implements QueryItemExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
/** @experimental */
final class OrderMethodsItemExtension implements QueryItemExtensionInterface
{
public function __construct(
private UserContextInterface $userContext
) {
public function __construct(private UserContextInterface $userContext)
{
}

public function applyToItem(
Expand Down
9 changes: 6 additions & 3 deletions src/Sylius/Bundle/ApiBundle/Event/OrderCompleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@

class OrderCompleted
{
public function __construct(
public string $orderToken
) {
/** @var string */
public $orderToken;

public function __construct(string $orderToken)
{
$this->orderToken = $orderToken;
}

public function orderToken(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
/** @experimental */
final class OrderCompletedHandler
{
public function __construct(
private MessageBusInterface $commandBus
) {
public function __construct(private MessageBusInterface $commandBus)
{
}

public function __invoke(OrderCompleted $orderCompleted): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@

final class AuthenticationSuccessListener
{
public function __construct(
private IriConverterInterface $iriConverter
) {
public function __construct(private IriConverterInterface $iriConverter)
{
}

public function onAuthenticationSuccessResponse(AuthenticationSuccessEvent $event): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@

final class CatalogPromotionEventSubscriber implements EventSubscriberInterface
{
public function __construct(
private CatalogPromotionAnnouncerInterface $catalogPromotionAnnouncer
) {
public function __construct(private CatalogPromotionAnnouncerInterface $catalogPromotionAnnouncer)
{
}

public static function getSubscribedEvents(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
/** @experimental */
final class ProductSlugEventSubscriber implements EventSubscriberInterface
{
public function __construct(
private SlugGeneratorInterface $slugGenerator
) {
public function __construct(private SlugGeneratorInterface $slugGenerator)
{
}

public static function getSubscribedEvents(): array
Expand Down
Loading

0 comments on commit 8b42dbd

Please sign in to comment.