Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
use Symfony\Component\Messenger\Envelope;
/**
* Marker stamp for messages that can be ack/nack'ed.
*/
final class AckStamp implements NonSendableStampInterface
{
/**
* @param \Closure(Envelope, \Throwable|null) $ack
*/
public function __construct(
private readonly \Closure $ack,
) {
}
public function ack(Envelope $envelope, ?\Throwable $e = null): void
{
($this->ack)($envelope, $e);
}
}

View File

@@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* Stamp used to identify which bus it was passed to.
*
* @author Ryan Weaver <ryan@symfonycasts.com>
*/
final class BusNameStamp implements StampInterface
{
private string $busName;
public function __construct(string $busName)
{
$this->busName = $busName;
}
public function getBusName(): string
{
return $this->busName;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* A marker that this message was consumed by a worker process.
*/
class ConsumedByWorkerStamp implements NonSendableStampInterface
{
}

View File

@@ -0,0 +1,46 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* Apply this stamp to delay delivery of your message on a transport.
*/
final class DelayStamp implements StampInterface
{
private int $delay;
/**
* @param int $delay The delay in milliseconds
*/
public function __construct(int $delay)
{
$this->delay = $delay;
}
public function getDelay(): int
{
return $this->delay;
}
public static function delayFor(\DateInterval $interval): self
{
$now = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
$end = $now->add($interval);
return new self(($end->getTimestamp() - $now->getTimestamp()) * 1000);
}
public static function delayUntil(\DateTimeInterface $dateTime): self
{
return new self(($dateTime->getTimestamp() - time()) * 1000);
}
}

View File

@@ -0,0 +1,23 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* Marker item to tell this message should be handled in after the current bus has finished.
*
* @see \Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
final class DispatchAfterCurrentBusStamp implements NonSendableStampInterface
{
}

View File

@@ -0,0 +1,85 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\Messenger\Exception\HandlerFailedException;
/**
* Stamp applied when a messages fails due to an exception in the handler.
*/
final class ErrorDetailsStamp implements StampInterface
{
private string $exceptionClass;
private int|string $exceptionCode;
private string $exceptionMessage;
private ?FlattenException $flattenException;
public function __construct(string $exceptionClass, int|string $exceptionCode, string $exceptionMessage, ?FlattenException $flattenException = null)
{
$this->exceptionClass = $exceptionClass;
$this->exceptionCode = $exceptionCode;
$this->exceptionMessage = $exceptionMessage;
$this->flattenException = $flattenException;
}
public static function create(\Throwable $throwable): self
{
if ($throwable instanceof HandlerFailedException) {
$throwable = $throwable->getPrevious();
}
$flattenException = null;
if (class_exists(FlattenException::class)) {
$flattenException = FlattenException::createFromThrowable($throwable);
}
return new self($throwable::class, $throwable->getCode(), $throwable->getMessage(), $flattenException);
}
public function getExceptionClass(): string
{
return $this->exceptionClass;
}
public function getExceptionCode(): int|string
{
return $this->exceptionCode;
}
public function getExceptionMessage(): string
{
return $this->exceptionMessage;
}
public function getFlattenException(): ?FlattenException
{
return $this->flattenException;
}
public function equals(?self $that): bool
{
if (null === $that) {
return false;
}
if ($this->flattenException && $that->flattenException) {
return $this->flattenException->getClass() === $that->flattenException->getClass()
&& $this->flattenException->getCode() === $that->flattenException->getCode()
&& $this->flattenException->getMessage() === $that->flattenException->getMessage();
}
return $this->exceptionClass === $that->exceptionClass
&& $this->exceptionCode === $that->exceptionCode
&& $this->exceptionMessage === $that->exceptionMessage;
}
}

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* Marker telling that any batch handlers bound to the envelope should be flushed.
*/
final class FlushBatchHandlersStamp implements NonSendableStampInterface
{
private bool $force;
public function __construct(bool $force)
{
$this->force = $force;
}
public function force(): bool
{
return $this->force;
}
}

View File

@@ -0,0 +1,53 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
use Symfony\Component\Messenger\Handler\HandlerDescriptor;
/**
* Stamp identifying a message handled by the `HandleMessageMiddleware` middleware
* and storing the handler returned value.
*
* This is used by synchronous command buses expecting a return value and the retry logic
* to only execute handlers that didn't succeed.
*
* @see \Symfony\Component\Messenger\Middleware\HandleMessageMiddleware
* @see \Symfony\Component\Messenger\HandleTrait
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
final class HandledStamp implements StampInterface
{
private mixed $result;
private string $handlerName;
public function __construct(mixed $result, string $handlerName)
{
$this->result = $result;
$this->handlerName = $handlerName;
}
public static function fromDescriptor(HandlerDescriptor $handler, mixed $result): self
{
return new self($result, $handler->getName());
}
public function getResult(): mixed
{
return $this->result;
}
public function getHandlerName(): string
{
return $this->handlerName;
}
}

View File

@@ -0,0 +1,31 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* @author Jáchym Toušek <enumag@gmail.com>
*/
final class HandlerArgumentsStamp implements NonSendableStampInterface
{
public function __construct(
private array $additionalArguments,
) {
}
/**
* @return array
*/
public function getAdditionalArguments()
{
return $this->additionalArguments;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
class MessageDecodingFailedStamp implements StampInterface
{
}

View File

@@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
use Symfony\Component\Messenger\Handler\HandlerDescriptor;
/**
* Marker telling that ack should not be done automatically for this message.
*/
final class NoAutoAckStamp implements NonSendableStampInterface
{
private HandlerDescriptor $handlerDescriptor;
public function __construct(HandlerDescriptor $handlerDescriptor)
{
$this->handlerDescriptor = $handlerDescriptor;
}
public function getHandlerDescriptor(): HandlerDescriptor
{
return $this->handlerDescriptor;
}
}

View File

@@ -0,0 +1,21 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* A stamp that should not be included with the Envelope if sent to a transport.
*
* @author Ryan Weaver <ryan@symfonycasts.com>
*/
interface NonSendableStampInterface extends StampInterface
{
}

View File

@@ -0,0 +1,39 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
use Symfony\Component\Messenger\Middleware\SendMessageMiddleware;
/**
* Marker stamp for a received message.
*
* This is mainly used by the `SendMessageMiddleware` middleware to identify
* a message should not be sent if it was just received.
*
* @see SendMessageMiddleware
*
* @author Samuel Roze <samuel.roze@gmail.com>
*/
final class ReceivedStamp implements NonSendableStampInterface
{
private string $transportName;
public function __construct(string $transportName)
{
$this->transportName = $transportName;
}
public function getTransportName(): string
{
return $this->transportName;
}
}

View File

@@ -0,0 +1,47 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
use Symfony\Component\Messenger\Envelope;
/**
* Stamp applied when a messages needs to be redelivered.
*/
final class RedeliveryStamp implements StampInterface
{
private int $retryCount;
private \DateTimeInterface $redeliveredAt;
public function __construct(int $retryCount, ?\DateTimeInterface $redeliveredAt = null)
{
$this->retryCount = $retryCount;
$this->redeliveredAt = $redeliveredAt ?? new \DateTimeImmutable();
}
public static function getRetryCountFromEnvelope(Envelope $envelope): int
{
/** @var self|null $retryMessageStamp */
$retryMessageStamp = $envelope->last(self::class);
return $retryMessageStamp ? $retryMessageStamp->getRetryCount() : 0;
}
public function getRetryCount(): int
{
return $this->retryCount;
}
public function getRedeliveredAt(): \DateTimeInterface
{
return $this->redeliveredAt;
}
}

View File

@@ -0,0 +1,79 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
class RouterContextStamp implements StampInterface
{
private string $baseUrl;
private string $method;
private string $host;
private string $scheme;
private int $httpPort;
private int $httpsPort;
private string $pathInfo;
private string $queryString;
public function __construct(string $baseUrl, string $method, string $host, string $scheme, int $httpPort, int $httpsPort, string $pathInfo, string $queryString)
{
$this->baseUrl = $baseUrl;
$this->method = $method;
$this->host = $host;
$this->scheme = $scheme;
$this->httpPort = $httpPort;
$this->httpsPort = $httpsPort;
$this->pathInfo = $pathInfo;
$this->queryString = $queryString;
}
public function getBaseUrl(): string
{
return $this->baseUrl;
}
public function getMethod(): string
{
return $this->method;
}
public function getHost(): string
{
return $this->host;
}
public function getScheme(): string
{
return $this->scheme;
}
public function getHttpPort(): int
{
return $this->httpPort;
}
public function getHttpsPort(): int
{
return $this->httpsPort;
}
public function getPathInfo(): string
{
return $this->pathInfo;
}
public function getQueryString(): string
{
return $this->queryString;
}
}

View File

@@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* Marker stamp identifying a message sent by the `SendMessageMiddleware`.
*
* @see \Symfony\Component\Messenger\Middleware\SendMessageMiddleware
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
final class SentStamp implements NonSendableStampInterface
{
private string $senderClass;
private ?string $senderAlias;
public function __construct(string $senderClass, ?string $senderAlias = null)
{
$this->senderAlias = $senderAlias;
$this->senderClass = $senderClass;
}
public function getSenderClass(): string
{
return $this->senderClass;
}
public function getSenderAlias(): ?string
{
return $this->senderAlias;
}
}

View File

@@ -0,0 +1,32 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* Stamp applied when a message is sent to the failure transport.
*
* @author Ryan Weaver <ryan@symfonycasts.com>
*/
final class SentToFailureTransportStamp implements StampInterface
{
private string $originalReceiverName;
public function __construct(string $originalReceiverName)
{
$this->originalReceiverName = $originalReceiverName;
}
public function getOriginalReceiverName(): string
{
return $this->originalReceiverName;
}
}

View File

@@ -0,0 +1,24 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
final class SerializedMessageStamp implements NonSendableStampInterface
{
public function __construct(private string $serializedMessage)
{
}
public function getSerializedMessage(): string
{
return $this->serializedMessage;
}
}

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
final class SerializerStamp implements StampInterface
{
private array $context;
public function __construct(array $context)
{
$this->context = $context;
}
public function getContext(): array
{
return $this->context;
}
}

View File

@@ -0,0 +1,23 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* An envelope stamp related to a message.
*
* Stamps must be serializable value objects for transport.
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
interface StampInterface
{
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* Added by a sender or receiver to indicate the id of this message in that transport.
*
* @author Ryan Weaver <ryan@symfonycasts.com>
*/
final class TransportMessageIdStamp implements StampInterface
{
private mixed $id;
/**
* @param mixed $id some "identifier" of the message in a transport
*/
public function __construct(mixed $id)
{
$this->id = $id;
}
public function getId(): mixed
{
return $this->id;
}
}

View File

@@ -0,0 +1,33 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
/**
* Stamp used to override the transport names specified in the Messenger routing configuration file.
*/
final class TransportNamesStamp implements StampInterface
{
private array $transportNames;
/**
* @param string[]|string $transportNames Transport names to be used for the message
*/
public function __construct(array|string $transportNames)
{
$this->transportNames = (array) $transportNames;
}
public function getTransportNames(): array
{
return $this->transportNames;
}
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Stamp;
use Symfony\Component\Validator\Constraints\GroupSequence;
/**
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
final class ValidationStamp implements StampInterface
{
private array|GroupSequence $groups;
/**
* @param string[]|GroupSequence $groups
*/
public function __construct(array|GroupSequence $groups)
{
$this->groups = $groups;
}
public function getGroups(): array|GroupSequence
{
return $this->groups;
}
}