Skip to content

Commit

Permalink
NEXT-37426 - Fix ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
mstegmeyer committed Jul 25, 2024
1 parent c30162a commit 6b71407
Show file tree
Hide file tree
Showing 493 changed files with 1,286 additions and 1,286 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$fs->remove($publicPath);

$io->success(sprintf('Removed public assets for bundle "%s"', $bundle->getName()));
$io->success(\sprintf('Removed public assets for bundle "%s"', $bundle->getName()));
}

return self::SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/Snippet/SnippetFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private function findSnippetFiles(string $locale): array
->ignoreDotFiles(true)
->ignoreVCS(true)
->ignoreUnreadableDirs()
->name(sprintf('%s.json', $locale))
->name(\sprintf('%s.json', $locale))
->in($this->getBundlePaths());

$iterator = $finder->getIterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(
private readonly bool $isBillingAddress,
private readonly ConstraintViolationList $violations
) {
$this->message = sprintf(
$this->message = \sprintf(
'Please check your %s address for missing or invalid values.',
$isBillingAddress ? 'billing' : 'shipping'
);
Expand All @@ -35,7 +35,7 @@ public function getId(): string

public function getMessageKey(): string
{
return sprintf('%s-%s', $this->isBillingAddress ? 'billing' : 'shipping', self::KEY);
return \sprintf('%s-%s', $this->isBillingAddress ? 'billing' : 'shipping', self::KEY);
}

public function getLevel(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BillingAddressBlockedError extends Error

public function __construct(private readonly string $name)
{
$this->message = sprintf(
$this->message = \sprintf(
'Billings to billing address %s are not possible.',
$name
);
Expand All @@ -32,7 +32,7 @@ public function blockOrder(): bool

public function getKey(): string
{
return sprintf('%s-%s', self::KEY, $this->name);
return \sprintf('%s-%s', self::KEY, $this->name);
}

public function getLevel(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BillingAddressCountryRegionMissingError extends CountryRegionMissingError

public function __construct(CustomerAddressEntity $address)
{
$this->message = sprintf(
$this->message = \sprintf(
'A country region needs to be defined for the billing address "%s %s, %s %s".',
$address->getFirstName(),
$address->getLastName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BillingAddressSalutationMissingError extends SalutationMissingError

public function __construct(CustomerAddressEntity $address)
{
$this->message = sprintf(
$this->message = \sprintf(
'A salutation needs to be defined for the billing address "%s %s, %s %s".',
$address->getFirstName(),
$address->getLastName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ShippingAddressBlockedError extends Error

public function __construct(private readonly string $name)
{
$this->message = sprintf(
$this->message = \sprintf(
'Shippings to shipping address %s are not possible.',
$name
);
Expand All @@ -32,7 +32,7 @@ public function blockOrder(): bool

public function getKey(): string
{
return sprintf('%s-%s', self::KEY, $this->name);
return \sprintf('%s-%s', self::KEY, $this->name);
}

public function getLevel(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ShippingAddressCountryRegionMissingError extends CountryRegionMissingError

public function __construct(CustomerAddressEntity $address)
{
$this->message = sprintf(
$this->message = \sprintf(
'A country region needs to be defined for the billing address "%s %s %s %s".',
$address->getFirstName(),
$address->getLastName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ShippingAddressSalutationMissingError extends SalutationMissingError

public function __construct(CustomerAddressEntity $address)
{
$this->message = sprintf(
$this->message = \sprintf(
'A salutation needs to be defined for the shipping address "%s %s, %s %s".',
$address->getFirstName(),
$address->getLastName(),
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Checkout/Cart/CartPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function replace(string $oldToken, string $newToken, SalesChannelContext
public function prune(int $days): void
{
$time = new \DateTime();
$time->modify(sprintf('-%d day', $days));
$time->modify(\sprintf('-%d day', $days));

$stmt = $this->connection->prepare(<<<'SQL'
DELETE FROM cart
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Checkout/Cart/CartRuleLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private function load(SalesChannelContext $context, Cart $cart, CartBehavior $be
foreach ($rules as $rule) {
++$index;
$this->logger->info(
sprintf('#%d Rule detection: %s with priority %d (id: %s)', $index, $rule->getName(), $rule->getPriority(), $rule->getId())
\sprintf('#%d Rule detection: %s with priority %d (id: %s)', $index, $rule->getName(), $rule->getPriority(), $rule->getId())
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Checkout/Cart/Delivery/Struct/DeliveryDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static function createFromDeliveryTime(DeliveryTime $deliveryTime): self
self::create('P' . $deliveryTime->getMin() . 'Y'),
self::create('P' . $deliveryTime->getMax() . 'Y')
),
default => throw new \RuntimeException(sprintf('Not supported unit %s', $deliveryTime->getUnit())),
default => throw new \RuntimeException(\sprintf('Not supported unit %s', $deliveryTime->getUnit())),
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Checkout/Cart/Error/IncompleteLineItemError.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct(
private string $key,
private readonly string $property
) {
$this->message = sprintf('Line item "%s" incomplete. Property "%s" missing.', $key, $property);
$this->message = \sprintf('Line item "%s" incomplete. Property "%s" missing.', $key, $property);

parent::__construct($this->message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Checkout/Customer/Rule/EmailRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private function matchPartially(CustomerEntity $customer): bool
}

$email = str_replace('\*', '(.*?)', preg_quote($this->email, '/'));
$regex = sprintf('/^%s$/i', $email);
$regex = \sprintf('/^%s$/i', $email);

return match ($this->operator) {
Rule::OPERATOR_EQ => preg_match($regex, $customer->getEmail()) === 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private function getBirthday(DataBag $data): ?\DateTimeInterface
\assert(\is_numeric($birthdayMonth));
\assert(\is_numeric($birthdayYear));

return new \DateTime(sprintf(
return new \DateTime(\sprintf(
'%s-%s-%s',
$birthdayYear,
$birthdayMonth,
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Checkout/Customer/SalesChannel/RegisterRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private function getBirthday(DataBag $data): ?\DateTimeInterface
\assert(\is_numeric($birthdayMonth));
\assert(\is_numeric($birthdayYear));

return new \DateTime(sprintf(
return new \DateTime(\sprintf(
'%d-%d-%d',
$birthdayYear,
$birthdayMonth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class CustomerEmailUnique extends Constraint
public function __construct(array $options)
{
if (!($options['context'] ?? null) instanceof Context) {
throw new MissingOptionsException(sprintf('Option "context" must be given for constraint %s', self::class), ['context']);
throw new MissingOptionsException(\sprintf('Option "context" must be given for constraint %s', self::class), ['context']);
}

if (!($options['salesChannelContext'] ?? null) instanceof SalesChannelContext) {
throw new MissingOptionsException(sprintf('Option "salesChannelContext" must be given for constraint %s', self::class), ['salesChannelContext']);
throw new MissingOptionsException(\sprintf('Option "salesChannelContext" must be given for constraint %s', self::class), ['salesChannelContext']);
}

parent::__construct($options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct($options = null)
parent::__construct($options);

if (!$this->context instanceof SalesChannelContext) {
throw new MissingOptionsException(sprintf('Option "context" must be given for constraint %s', self::class), ['context']);
throw new MissingOptionsException(\sprintf('Option "context" must be given for constraint %s', self::class), ['context']);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CustomerVatIdentification extends Constraint
public function __construct($options = null)
{
if (!\is_string($options['countryId'] ?? null)) {
throw new MissingOptionsException(sprintf('Option "countryId" must be given for constraint %s', self::class), ['countryId']);
throw new MissingOptionsException(\sprintf('Option "countryId" must be given for constraint %s', self::class), ['countryId']);
}

parent::__construct($options);
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Checkout/Document/DocumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static function generationError(?string $message = null, ?\Throwable $e =
return new self(
Response::HTTP_NOT_FOUND,
self::GENERATION_ERROR,
sprintf('Unable to generate document. %s', $message),
\sprintf('Unable to generate document. %s', $message),
[
'$message' => $message,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class InvalidDocumentException extends ShopwareHttpException
{
public function __construct(string $documentId)
{
$message = sprintf('The document with id "%s" is invalid or could not be found.', $documentId);
$message = \sprintf('The document with id "%s" is invalid or could not be found.', $documentId);
parent::__construct($message);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class InvalidDocumentRendererException extends ShopwareHttpException
{
public function __construct(string $type)
{
$message = sprintf('Unable to find a document renderer with type "%s"', $type);
$message = \sprintf('Unable to find a document renderer with type "%s"', $type);
parent::__construct($message);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class InvalidFileGeneratorTypeException extends ShopwareHttpException
{
public function __construct(string $type)
{
$message = sprintf('Unable to find a file generator with type "%s"', $type);
$message = \sprintf('Unable to find a file generator with type "%s"', $type);
parent::__construct($message);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(
private readonly string $name,
?string $reason = null
) {
$this->message = sprintf(
$this->message = \sprintf(
'Payment method %s not available. Reason: %s',
$name,
$reason
Expand All @@ -35,7 +35,7 @@ public function getName(): string

public function getId(): string
{
return sprintf('%s-%s', self::KEY, $this->name);
return \sprintf('%s-%s', self::KEY, $this->name);
}

public function getMessageKey(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,31 @@ public function __construct(

// @deprecated tag:v6.7.0 - all following can be removed
foreach (\array_keys($syncHandlers->getProvidedServices()) as $serviceId) {
trigger_deprecation('shopware/core', '', sprintf('The tag `shopware.payment.method.sync` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
trigger_deprecation('shopware/core', '', \sprintf('The tag `shopware.payment.method.sync` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
$handler = $syncHandlers->get($serviceId);
$this->handlers[(string) $serviceId] = $handler;
}

foreach (\array_keys($asyncHandlers->getProvidedServices()) as $serviceId) {
trigger_deprecation('shopware/core', '', sprintf('The tag `shopware.payment.method.async` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
trigger_deprecation('shopware/core', '', \sprintf('The tag `shopware.payment.method.async` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
$handler = $asyncHandlers->get($serviceId);
$this->handlers[(string) $serviceId] = $handler;
}

foreach (\array_keys($preparedHandlers->getProvidedServices()) as $serviceId) {
trigger_deprecation('shopware/core', '', sprintf('The tag `shopware.payment.method.prepared` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
trigger_deprecation('shopware/core', '', \sprintf('The tag `shopware.payment.method.prepared` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
$handler = $preparedHandlers->get($serviceId);
$this->handlers[(string) $serviceId] = $handler;
}

foreach (\array_keys($refundHandlers->getProvidedServices()) as $serviceId) {
trigger_deprecation('shopware/core', '', sprintf('The tag `shopware.payment.method.refund` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
trigger_deprecation('shopware/core', '', \sprintf('The tag `shopware.payment.method.refund` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
$handler = $refundHandlers->get($serviceId);
$this->handlers[(string) $serviceId] = $handler;
}

foreach (\array_keys($recurringHandlers->getProvidedServices()) as $serviceId) {
trigger_deprecation('shopware/core', '', sprintf('The tag `shopware.payment.method.recurring` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
trigger_deprecation('shopware/core', '', \sprintf('The tag `shopware.payment.method.recurring` is deprecated for service %s and will be removed in 6.7.0. Use `shopware.payment.handler` instead.', $serviceId));
$handler = $recurringHandlers->get($serviceId);
$this->handlers[(string) $serviceId] = $handler;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Checkout/Payment/Cart/Token/JWTFactoryV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public function generateToken(TokenStruct $tokenStruct): string
// @see https://github.com/php/php-src/issues/9950
if ($tokenStruct->getExpires() > 0) {
$expires = $expires->modify(
sprintf('+%d seconds', $tokenStruct->getExpires())
\sprintf('+%d seconds', $tokenStruct->getExpires())
);
} else {
$expires = $expires->modify(
sprintf('-%d seconds', abs($tokenStruct->getExpires()))
\sprintf('-%d seconds', abs($tokenStruct->getExpires()))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private function generatePaymentName(
return null;
}

return sprintf(
return \sprintf(
'%s | %s',
$paymentName,
$label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(string $name)
{
$this->name = $name;

$this->message = sprintf('Promotion %s was no longer valid!', $this->name);
$this->message = \sprintf('Promotion %s was no longer valid!', $this->name);

parent::__construct($this->message);
}
Expand All @@ -36,7 +36,7 @@ public function getName(): string

public function getId(): string
{
return sprintf('%s-%s', self::KEY, $this->name);
return \sprintf('%s-%s', self::KEY, $this->name);
}

public function getMessageKey(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PromotionExcludedError extends Error

public function __construct(protected string $name)
{
$this->message = sprintf('Promotion %s was excluded for cart.', $this->name);
$this->message = \sprintf('Promotion %s was excluded for cart.', $this->name);

parent::__construct($this->message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(string $name)
{
$this->name = $name;

$this->message = sprintf('Promotion %s not eligible for cart!', $this->name);
$this->message = \sprintf('Promotion %s not eligible for cart!', $this->name);

parent::__construct($this->message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(string $promotionCode)
{
$this->promotionCode = $promotionCode;

$this->message = sprintf('Promotion with code %s not found!', $this->promotionCode);
$this->message = \sprintf('Promotion with code %s not found!', $this->promotionCode);

parent::__construct($this->message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PromotionsOnCartPriceZeroError extends Error
*/
public function __construct(protected array $promotions)
{
$this->message = sprintf(
$this->message = \sprintf(
'Promotions %s were excluded for cart because the price of the cart is zero.',
$this->getParameters()['promotions']
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(LineItem $discountLineItem)
{
$this->name = $discountLineItem->getLabel();
$this->discountLineItemId = $discountLineItem->getId();
$this->message = sprintf(
$this->message = \sprintf(
'Discount %s has been added',
$this->name
);
Expand Down Expand Up @@ -51,7 +51,7 @@ public function getParameters(): array

public function getId(): string
{
return sprintf('%s-%s', self::KEY, $this->discountLineItemId);
return \sprintf('%s-%s', self::KEY, $this->discountLineItemId);
}

public function getLevel(): int
Expand Down
Loading

0 comments on commit 6b71407

Please sign in to comment.