Merge branch '4.3' into 4.4

* 4.3:
  bumped Symfony version to 4.3.0
  updated VERSION for 4.3.0-RC1
  updated CHANGELOG for 4.3.0-RC1
  Create an abstract HTTP transport and extend it in all HTTP transports
  Updated "experimental" annotations for 4.3
This commit is contained in:
Nicolas Grekas 2019-05-28 14:57:34 +02:00
commit 94fd42c396
58 changed files with 124 additions and 71 deletions

View File

@ -7,6 +7,26 @@ in 4.3 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.3.0...v4.3.1
* 4.3.0-RC1 (2019-05-28)
* bug #31650 Create an abstract HTTP transport and extend it in all HTTP transports (bocharsky-bw)
* feature #31641 [HttpClient] make $response->getInfo('debug') return extended logs about the HTTP transaction (nicolas-grekas)
* feature #31571 [Contracts] split in one package per sub-contracts (nicolas-grekas)
* bug #31625 [Messenger] Disable the SchemaAssetsFilter when setup the transport (vincenttouzet)
* bug #31621 [Messenger] Fix missing auto_setup for RedisTransport (chalasr)
* bug #31584 [Workflow] Do not trigger extra guards (lyrixx)
* bug #31632 [Messenger] Use "real" memory usage to honor --memory-limit (chalasr)
* bug #31610 [HttpClient] fix handling exceptions thrown before first mock chunk (nicolas-grekas)
* bug #31615 Allow WrappedListener to describe uncallable listeners (derrabus)
* bug #31599 [Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector (althaus)
* bug #31565 [Mime][HttpFoundation] Added mime type audio/x-hx-aac-adts (ifaridjalilov)
* bug #31591 [FrameworkBundle] fix named autowiring aliases for TagAwareCacheInterface (nicolas-grekas)
* bug #31590 [Cache] improve logged messages (nicolas-grekas)
* bug #31586 [HttpClient] display proper error message on TransportException when curl is used (nicolas-grekas)
* bug #31349 [WebProfilerBundle] Use absolute URL for profiler links (Alumbrados)
* bug #31541 [DI] fix using bindings with locators of service subscribers (nicolas-grekas)
* bug #31568 [Process] Fix infinite waiting for stopped process (mshavliuk)
* 4.3.0-BETA2 (2019-05-22)
* bug #31569 [HttpClient] Only use CURLMOPT_MAX_HOST_CONNECTIONS & CURL_VERSION_HTTP2 if defined (GawainLynch)

View File

@ -22,7 +22,7 @@ use Symfony\Component\Messenger\Middleware\StackInterface;
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class DoctrineTransactionMiddleware implements MiddlewareInterface
{

View File

@ -13,10 +13,9 @@ namespace Symfony\Component\Mailer\Bridge\Amazon\Http;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mailer\Transport\AbstractTransport;
use Symfony\Component\Mailer\Transport\Http\AbstractHttpTransport;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
@ -24,11 +23,10 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
*
* @experimental in 4.3
*/
class SesTransport extends AbstractTransport
class SesTransport extends AbstractHttpTransport
{
private const ENDPOINT = 'https://email.%region%.amazonaws.com';
private $client;
private $accessKey;
private $secretKey;
private $region;
@ -38,12 +36,11 @@ class SesTransport extends AbstractTransport
*/
public function __construct(string $accessKey, string $secretKey, string $region = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
$this->client = $client ?? HttpClient::create();
$this->accessKey = $accessKey;
$this->secretKey = $secretKey;
$this->region = $region ?: 'eu-west-1';
parent::__construct($dispatcher, $logger);
parent::__construct($client, $dispatcher, $logger);
}
protected function doSend(SentMessage $message): void

View File

@ -13,10 +13,9 @@ namespace Symfony\Component\Mailer\Bridge\Mailchimp\Http;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mailer\Transport\AbstractTransport;
use Symfony\Component\Mailer\Transport\Http\AbstractHttpTransport;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
@ -24,18 +23,16 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
*
* @experimental in 4.3
*/
class MandrillTransport extends AbstractTransport
class MandrillTransport extends AbstractHttpTransport
{
private const ENDPOINT = 'https://mandrillapp.com/api/1.0/messages/send-raw.json';
private $client;
private $key;
public function __construct(string $key, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
$this->key = $key;
$this->client = $client ?? HttpClient::create();
parent::__construct($dispatcher, $logger);
parent::__construct($client, $dispatcher, $logger);
}
protected function doSend(SentMessage $message): void

View File

@ -13,10 +13,9 @@ namespace Symfony\Component\Mailer\Bridge\Mailgun\Http;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mailer\Transport\AbstractTransport;
use Symfony\Component\Mailer\Transport\Http\AbstractHttpTransport;
use Symfony\Component\Mime\Part\DataPart;
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
use Symfony\Contracts\HttpClient\HttpClientInterface;
@ -26,20 +25,18 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
*
* @experimental in 4.3
*/
class MailgunTransport extends AbstractTransport
class MailgunTransport extends AbstractHttpTransport
{
private const ENDPOINT = 'https://api.mailgun.net/v3/%domain%/messages.mime';
private $key;
private $domain;
private $client;
public function __construct(string $key, string $domain, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
$this->key = $key;
$this->domain = $domain;
$this->client = $client ?? HttpClient::create();
parent::__construct($dispatcher, $logger);
parent::__construct($client, $dispatcher, $logger);
}
protected function doSend(SentMessage $message): void

View File

@ -0,0 +1,42 @@
<?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\Mailer\Transport\Http;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\Mailer\Transport\AbstractTransport;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Victor Bocharsky <victor@symfonycasts.com>
*
* @experimental in 4.3
*/
abstract class AbstractHttpTransport extends AbstractTransport
{
protected $client;
public function __construct(HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
$this->client = $client;
if (null === $client) {
if (!class_exists(HttpClient::class)) {
throw new \LogicException(sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__));
}
$this->client = HttpClient::create();
}
parent::__construct($dispatcher, $logger);
}
}

View File

@ -34,7 +34,7 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class ConsumeMessagesCommand extends Command
{

View File

@ -23,7 +23,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
*
* @author Roland Franssen <franssen.roland@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class DebugCommand extends Command
{

View File

@ -21,7 +21,7 @@ use Symfony\Component\VarDumper\Caster\ClassStub;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class MessengerDataCollector extends DataCollector implements LateDataCollectorInterface
{

View File

@ -28,7 +28,7 @@ use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class MessengerPass implements CompilerPassInterface
{

View File

@ -18,7 +18,7 @@ use Symfony\Component\Messenger\Stamp\StampInterface;
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
final class Envelope
{

View File

@ -16,7 +16,7 @@ namespace Symfony\Component\Messenger\Exception;
*
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface ExceptionInterface extends \Throwable
{

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Messenger\Exception;
/**
* @author Yonel Ceruto <yonelceruto@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Messenger\Exception;
/**
* @author Roland Franssen <franssen.roland@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class LogicException extends \LogicException implements ExceptionInterface
{

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Messenger\Exception;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class NoHandlerForMessageException extends \LogicException implements ExceptionInterface
{

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Messenger\Exception;
/**
* @author Fabien Potencier <fabien@symfony.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class RuntimeException extends \RuntimeException implements ExceptionInterface
{

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Messenger\Exception;
/**
* @author Eric Masoero <em@studeal.fr>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class TransportException extends RuntimeException
{

View File

@ -16,7 +16,7 @@ use Symfony\Component\Validator\ConstraintViolationListInterface;
/**
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class ValidationFailedException extends \RuntimeException implements ExceptionInterface
{

View File

@ -19,7 +19,7 @@ use Symfony\Component\Messenger\Stamp\HandledStamp;
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
trait HandleTrait
{

View File

@ -20,7 +20,7 @@ use Symfony\Component\Messenger\Stamp\ReceivedStamp;
* @author Nicolas Grekas <p@tchwork.com>
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class HandlersLocator implements HandlersLocatorInterface
{

View File

@ -18,7 +18,7 @@ use Symfony\Component\Messenger\Envelope;
*
* @author Nicolas Grekas <p@tchwork.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface HandlersLocatorInterface
{

View File

@ -16,7 +16,7 @@ namespace Symfony\Component\Messenger\Handler;
*
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface MessageHandlerInterface
{

View File

@ -16,7 +16,7 @@ namespace Symfony\Component\Messenger\Handler;
*
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface MessageSubscriberInterface extends MessageHandlerInterface
{

View File

@ -19,7 +19,7 @@ use Symfony\Component\Messenger\Middleware\StackMiddleware;
* @author Matthias Noback <matthiasnoback@gmail.com>
* @author Nicolas Grekas <p@tchwork.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class MessageBus implements MessageBusInterface
{

View File

@ -16,7 +16,7 @@ use Symfony\Component\Messenger\Stamp\StampInterface;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface MessageBusInterface
{

View File

@ -18,7 +18,7 @@ use Symfony\Component\Messenger\Envelope;
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class ActivationMiddleware implements MiddlewareInterface
{

View File

@ -23,7 +23,7 @@ use Symfony\Component\Messenger\Stamp\HandledStamp;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class HandleMessageMiddleware implements MiddlewareInterface
{

View File

@ -16,7 +16,7 @@ use Symfony\Component\Messenger\Envelope;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface MiddlewareInterface
{

View File

@ -26,7 +26,7 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
* @author Samuel Roze <samuel.roze@gmail.com>
* @author Tobias Schultze <http://tobion.de>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class SendMessageMiddleware implements MiddlewareInterface
{

View File

@ -16,7 +16,7 @@ namespace Symfony\Component\Messenger\Middleware;
*
* Implementations must be cloneable, and each clone must unstack the stack independently.
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface StackInterface
{

View File

@ -16,7 +16,7 @@ use Symfony\Component\Messenger\Envelope;
/**
* @author Nicolas Grekas <p@tchwork.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class StackMiddleware implements MiddlewareInterface, StackInterface
{

View File

@ -19,7 +19,7 @@ use Symfony\Component\Stopwatch\Stopwatch;
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class TraceableMiddleware implements MiddlewareInterface
{

View File

@ -19,7 +19,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
/**
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class ValidationMiddleware implements MiddlewareInterface
{

View File

@ -21,7 +21,7 @@ use Symfony\Component\Messenger\Handler\HandlerDescriptor;
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
final class HandledStamp implements StampInterface
{

View File

@ -23,7 +23,7 @@ use Symfony\Component\Messenger\Middleware\SendMessageMiddleware;
*
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
final class ReceivedStamp implements StampInterface
{

View File

@ -18,7 +18,7 @@ namespace Symfony\Component\Messenger\Stamp;
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
final class SentStamp implements StampInterface
{

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Messenger\Stamp;
/**
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
final class SerializerStamp implements StampInterface
{

View File

@ -18,7 +18,7 @@ namespace Symfony\Component\Messenger\Stamp;
*
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface StampInterface
{

View File

@ -16,7 +16,7 @@ use Symfony\Component\Validator\Constraints\GroupSequence;
/**
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
final class ValidationStamp implements StampInterface
{

View File

@ -20,7 +20,7 @@ use Symfony\Component\Messenger\Middleware\StackMiddleware;
/**
* @author Nicolas Grekas <p@tchwork.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
abstract class MiddlewareTestCase extends TestCase
{

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Messenger;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class TraceableMessageBus implements MessageBusInterface
{

View File

@ -12,7 +12,7 @@
namespace Symfony\Component\Messenger\Transport\AmqpExt;
/**
* @experimental in 4.2
* @experimental in 4.3
*/
class AmqpFactory
{

View File

@ -25,7 +25,7 @@ use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
*
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class AmqpReceiver implements ReceiverInterface, MessageCountAwareInterface
{

View File

@ -23,7 +23,7 @@ use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
*
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class AmqpSender implements SenderInterface
{

View File

@ -21,7 +21,7 @@ use Symfony\Component\Messenger\Transport\TransportInterface;
/**
* @author Nicolas Grekas <p@tchwork.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class AmqpTransport implements TransportInterface, SetupableTransportInterface, MessageCountAwareInterface
{

View File

@ -18,7 +18,7 @@ use Symfony\Component\Messenger\Transport\TransportInterface;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class AmqpTransportFactory implements TransportFactoryInterface
{

View File

@ -20,7 +20,7 @@ use Symfony\Component\Messenger\Exception\InvalidArgumentException;
*
* @final
*
* @experimental in 4.2
* @experimental in 4.3
*/
class Connection
{

View File

@ -18,7 +18,7 @@ use Symfony\Component\Messenger\Exception\TransportException;
* @author Samuel Roze <samuel.roze@gmail.com>
* @author Ryan Weaver <ryan@symfonycasts.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface ReceiverInterface
{

View File

@ -16,7 +16,7 @@ use Symfony\Component\Messenger\Envelope;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface SenderInterface
{

View File

@ -23,7 +23,7 @@ use Symfony\Component\Messenger\Handler\HandlersLocator;
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class SendersLocator implements SendersLocatorInterface
{

View File

@ -20,7 +20,7 @@ use Symfony\Component\Messenger\Exception\UnknownSenderException;
* @author Samuel Roze <samuel.roze@gmail.com>
* @author Tobias Schultze <http://tobion.de>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface SendersLocatorInterface
{

View File

@ -18,7 +18,7 @@ use Symfony\Component\Messenger\Stamp\NonSendableStampInterface;
/**
* @author Ryan Weaver<ryan@symfonycasts.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class PhpSerializer implements SerializerInterface
{

View File

@ -28,7 +28,7 @@ use Symfony\Component\Serializer\SerializerInterface as SymfonySerializerInterfa
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class Serializer implements SerializerInterface
{

View File

@ -17,7 +17,7 @@ use Symfony\Component\Messenger\Exception\MessageDecodingFailedException;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface SerializerInterface
{

View File

@ -17,7 +17,7 @@ use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
class TransportFactory implements TransportFactoryInterface
{

View File

@ -18,7 +18,7 @@ use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
*
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface TransportFactoryInterface
{

View File

@ -17,7 +17,7 @@ use Symfony\Component\Messenger\Transport\Sender\SenderInterface;
/**
* @author Nicolas Grekas <p@tchwork.com>
*
* @experimental in 4.2
* @experimental in 4.3
*/
interface TransportInterface extends ReceiverInterface, SenderInterface
{

View File

@ -30,7 +30,7 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*
* @experimental in 4.2
* @experimental in 4.3
*
* @final
*/