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,58 @@
<?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\Exception;
use Symfony\Component\Messenger\Envelope;
/**
* When handling queued messages from {@link DispatchAfterCurrentBusMiddleware},
* some handlers caused an exception. This exception contains all those handler exceptions.
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
class DelayedMessageHandlingException extends RuntimeException implements WrappedExceptionsInterface, EnvelopeAwareExceptionInterface
{
use EnvelopeAwareExceptionTrait;
use WrappedExceptionsTrait;
private array $exceptions;
public function __construct(array $exceptions, ?Envelope $envelope = null)
{
$this->envelope = $envelope;
$exceptionMessages = implode(", \n", array_map(
fn (\Throwable $e) => $e::class.': '.$e->getMessage(),
$exceptions
));
if (1 === \count($exceptions)) {
$message = \sprintf("A delayed message handler threw an exception: \n\n%s", $exceptionMessages);
} else {
$message = \sprintf("Some delayed message handlers threw an exception: \n\n%s", $exceptionMessages);
}
$this->exceptions = $exceptions;
parent::__construct($message, 0, $exceptions[array_key_first($exceptions)]);
}
/**
* @deprecated since Symfony 6.4, use {@see self::getWrappedExceptions()} instead
*/
public function getExceptions(): array
{
trigger_deprecation('symfony/messenger', '6.4', 'The "%s()" method is deprecated, use "%s::getWrappedExceptions()" instead.', __METHOD__, self::class);
return $this->exceptions;
}
}

View File

@@ -0,0 +1,22 @@
<?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\Exception;
use Symfony\Component\Messenger\Envelope;
/**
* @internal
*/
interface EnvelopeAwareExceptionInterface
{
public function getEnvelope(): ?Envelope;
}

View File

@@ -0,0 +1,27 @@
<?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\Exception;
use Symfony\Component\Messenger\Envelope;
/**
* @internal
*/
trait EnvelopeAwareExceptionTrait
{
private ?Envelope $envelope = null;
public function getEnvelope(): ?Envelope
{
return $this->envelope;
}
}

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\Exception;
/**
* Base Messenger component's exception.
*
* @author Samuel Roze <samuel.roze@gmail.com>
*/
interface ExceptionInterface extends \Throwable
{
}

View File

@@ -0,0 +1,75 @@
<?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\Exception;
use Symfony\Component\Messenger\Envelope;
class HandlerFailedException extends RuntimeException implements WrappedExceptionsInterface, EnvelopeAwareExceptionInterface
{
use WrappedExceptionsTrait;
private Envelope $envelope;
/**
* @param \Throwable[] $exceptions The name of the handler should be given as key
*/
public function __construct(Envelope $envelope, array $exceptions)
{
$firstFailure = current($exceptions);
$message = \sprintf('Handling "%s" failed: ', $envelope->getMessage()::class);
parent::__construct(
$message.(1 === \count($exceptions)
? $firstFailure->getMessage()
: \sprintf('%d handlers failed. First failure is: %s', \count($exceptions), $firstFailure->getMessage())
),
(int) $firstFailure->getCode(),
$firstFailure
);
$this->envelope = $envelope;
$this->exceptions = $exceptions;
}
public function getEnvelope(): Envelope
{
return $this->envelope;
}
/**
* @deprecated since Symfony 6.4, use {@see self::getWrappedExceptions()} instead
*
* @return \Throwable[]
*/
public function getNestedExceptions(): array
{
trigger_deprecation('symfony/messenger', '6.4', 'The "%s()" method is deprecated, use "%s::getWrappedExceptions()" instead.', __METHOD__, self::class);
return array_values($this->exceptions);
}
/**
* @deprecated since Symfony 6.4, use {@see self::getWrappedExceptions()} instead
*/
public function getNestedExceptionOfClass(string $exceptionClassName): array
{
trigger_deprecation('symfony/messenger', '6.4', 'The "%s()" method is deprecated, use "%s::getWrappedExceptions()" instead.', __METHOD__, self::class);
return array_values(
array_filter(
$this->exceptions,
fn ($exception) => is_a($exception, $exceptionClassName)
)
);
}
}

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\Exception;
/**
* @author Yonel Ceruto <yonelceruto@gmail.com>
*/
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
}

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\Exception;
/**
* @author Roland Franssen <franssen.roland@gmail.com>
*/
class LogicException extends \LogicException implements ExceptionInterface
{
}

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\Exception;
/**
* Thrown when a message cannot be decoded in a serializer.
*/
class MessageDecodingFailedException extends InvalidArgumentException
{
}

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\Exception;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*/
class NoHandlerForMessageException extends LogicException
{
}

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\Exception;
/**
* @author Jérémy Reynaud <jeremy@reynaud.io>
*/
class NoSenderForMessageException extends LogicException
{
}

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\Exception;
/**
* Marker interface for exceptions to indicate that handling a message should have worked.
*
* If something goes wrong while handling a message that's received from a transport
* and the message should be retried, a handler can throw such an exception.
*
* @author Jérémy Derussé <jeremy@derusse.com>
*/
interface RecoverableExceptionInterface extends \Throwable
{
}

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\Exception;
/**
* A concrete implementation of RecoverableExceptionInterface that can be used directly.
*
* @author Frederic Bouchery <frederic@bouchery.fr>
*/
class RecoverableMessageHandlingException extends RuntimeException implements RecoverableExceptionInterface
{
}

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\Exception;
/**
* @author Tobias Schultze <http://tobion.de>
*/
class RejectRedeliveredMessageException extends RuntimeException
{
}

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\Exception;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}

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\Exception;
/**
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
class StopWorkerException extends RuntimeException implements StopWorkerExceptionInterface
{
public function __construct(string $message = 'Worker should stop.', ?\Throwable $previous = null)
{
parent::__construct($message, 0, $previous);
}
}

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\Exception;
/**
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
interface StopWorkerExceptionInterface extends \Throwable
{
}

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\Exception;
/**
* @author Eric Masoero <em@studeal.fr>
*/
class TransportException extends RuntimeException
{
}

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\Exception;
/**
* Marker interface for exceptions to indicate that handling a message will continue to fail.
*
* If something goes wrong while handling a message that's received from a transport
* and the message should not be retried, a handler can throw such an exception.
*
* @author Tobias Schultze <http://tobion.de>
*/
interface UnrecoverableExceptionInterface extends \Throwable
{
}

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\Exception;
/**
* A concrete implementation of UnrecoverableExceptionInterface that can be used directly.
*
* @author Frederic Bouchery <frederic@bouchery.fr>
*/
class UnrecoverableMessageHandlingException extends RuntimeException implements UnrecoverableExceptionInterface
{
}

View File

@@ -0,0 +1,48 @@
<?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\Exception;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Validator\ConstraintViolationListInterface;
/**
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
class ValidationFailedException extends RuntimeException implements EnvelopeAwareExceptionInterface
{
use EnvelopeAwareExceptionTrait;
private ConstraintViolationListInterface $violations;
private object $violatingMessage;
public function __construct(object $violatingMessage, ConstraintViolationListInterface $violations, ?Envelope $envelope = null)
{
$this->violatingMessage = $violatingMessage;
$this->violations = $violations;
$this->envelope = $envelope;
parent::__construct(\sprintf('Message of type "%s" failed validation.', $this->violatingMessage::class));
}
/**
* @return object
*/
public function getViolatingMessage()
{
return $this->violatingMessage;
}
public function getViolations(): ConstraintViolationListInterface
{
return $this->violations;
}
}

View File

@@ -0,0 +1,25 @@
<?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\Exception;
/**
* Exception that holds multiple exceptions thrown by one or more handlers and/or messages.
*
* @author Jeroen <https://github.com/Jeroeny>
*/
interface WrappedExceptionsInterface
{
/**
* @return \Throwable[]
*/
public function getWrappedExceptions(?string $class = null, bool $recursive = false): array;
}

View File

@@ -0,0 +1,56 @@
<?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\Exception;
/**
* @author Jeroen <https://github.com/Jeroeny>
*
* @internal
*/
trait WrappedExceptionsTrait
{
private array $exceptions;
/**
* @return \Throwable[]
*/
public function getWrappedExceptions(?string $class = null, bool $recursive = false): array
{
return $this->getWrappedExceptionsRecursively($class, $recursive, $this->exceptions);
}
/**
* @param class-string<\Throwable>|null $class
* @param iterable<\Throwable> $exceptions
*
* @return \Throwable[]
*/
private function getWrappedExceptionsRecursively(?string $class, bool $recursive, iterable $exceptions): array
{
$unwrapped = [];
foreach ($exceptions as $key => $exception) {
if ($recursive && $exception instanceof WrappedExceptionsInterface) {
$unwrapped[] = $this->getWrappedExceptionsRecursively($class, $recursive, $exception->getWrappedExceptions());
continue;
}
if ($class && !is_a($exception, $class)) {
continue;
}
$unwrapped[] = [$key => $exception];
}
return array_merge(...$unwrapped);
}
}