Merge branch '4.1'
* 4.1: fixed UUID error message id in translation files Add missing typehint on chain sender Add several missing translations of the UUID validation message. Serbo-Croatian has Serbian plural rule [Validator] Add missing UUID validator message translation (hu) [Validator] Add missing UUID validator message translation (en) add missing translation for uuid validator Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler Fix PHPDoc return type [MonologBridge] Improve FirePHPHandler Fix SVGs not scaling in IE9, IE10, and IE11 Supports nested "abstract" object while serializing and de-serializing
This commit is contained in:
commit
ce2ac0f2f0
@ -38,9 +38,10 @@ class FirePHPHandler extends BaseFirePHPHandler
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent'))
|
$request = $event->getRequest();
|
||||||
&& !$event->getRequest()->headers->has('X-FirePHP-Version')) {
|
if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $request->headers->get('User-Agent'))
|
||||||
$this->sendHeaders = false;
|
&& !$request->headers->has('X-FirePHP-Version')) {
|
||||||
|
self::$sendHeaders = false;
|
||||||
$this->headers = array();
|
$this->headers = array();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -58,7 +59,7 @@ class FirePHPHandler extends BaseFirePHPHandler
|
|||||||
*/
|
*/
|
||||||
protected function sendHeader($header, $content)
|
protected function sendHeader($header, $content)
|
||||||
{
|
{
|
||||||
if (!$this->sendHeaders) {
|
if (!self::$sendHeaders) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
.sf-toolbarreset svg,
|
.sf-toolbarreset svg,
|
||||||
.sf-toolbarreset img {
|
.sf-toolbarreset img {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class GetResponseEvent extends KernelEvent
|
|||||||
/**
|
/**
|
||||||
* Returns the response object.
|
* Returns the response object.
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response|null
|
||||||
*/
|
*/
|
||||||
public function getResponse()
|
public function getResponse()
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Messenger\Transport;
|
namespace Symfony\Component\Messenger\Transport;
|
||||||
|
|
||||||
|
use Symfony\Component\Messenger\Envelope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Tobias Schultze <http://tobion.de>
|
* @author Tobias Schultze <http://tobion.de>
|
||||||
*/
|
*/
|
||||||
@ -29,7 +31,7 @@ class ChainSender implements SenderInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function send($message): void
|
public function send(Envelope $message): void
|
||||||
{
|
{
|
||||||
foreach ($this->senders as $sender) {
|
foreach ($this->senders as $sender) {
|
||||||
$sender->send($message);
|
$sender->send($message);
|
||||||
|
@ -294,7 +294,7 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
|
|||||||
*/
|
*/
|
||||||
private function validateAndDenormalize(string $currentClass, string $attribute, $data, ?string $format, array $context)
|
private function validateAndDenormalize(string $currentClass, string $attribute, $data, ?string $format, array $context)
|
||||||
{
|
{
|
||||||
if (null === $this->propertyTypeExtractor || null === $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)) {
|
if (null === $types = $this->getTypes($currentClass, $attribute)) {
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,6 +357,36 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
|
|||||||
throw new NotNormalizableValueException(sprintf('The type of the "%s" attribute for class "%s" must be one of "%s" ("%s" given).', $attribute, $currentClass, implode('", "', array_keys($expectedTypes)), gettype($data)));
|
throw new NotNormalizableValueException(sprintf('The type of the "%s" attribute for class "%s" must be one of "%s" ("%s" given).', $attribute, $currentClass, implode('", "', array_keys($expectedTypes)), gettype($data)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Type[]|null
|
||||||
|
*/
|
||||||
|
private function getTypes(string $currentClass, string $attribute)
|
||||||
|
{
|
||||||
|
if (null === $this->propertyTypeExtractor) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)) {
|
||||||
|
return $types;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $this->classDiscriminatorResolver && null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForClass($currentClass)) {
|
||||||
|
if ($discriminatorMapping->getTypeProperty() === $attribute) {
|
||||||
|
return array(
|
||||||
|
new Type(Type::BUILTIN_TYPE_STRING),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($discriminatorMapping->getTypesMapping() as $mappedClass) {
|
||||||
|
if (null !== $types = $this->propertyTypeExtractor->getTypes($mappedClass, $attribute)) {
|
||||||
|
return $types;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets an attribute and apply the name converter if necessary.
|
* Sets an attribute and apply the name converter if necessary.
|
||||||
*
|
*
|
||||||
|
@ -22,4 +22,19 @@ class DummyMessageNumberTwo implements DummyMessageInterface
|
|||||||
* @Groups({"two"})
|
* @Groups({"two"})
|
||||||
*/
|
*/
|
||||||
public $three;
|
public $three;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var DummyMessageNumberOne
|
||||||
|
*/
|
||||||
|
private $nested;
|
||||||
|
|
||||||
|
public function setNested(DummyMessageNumberOne $nested)
|
||||||
|
{
|
||||||
|
$this->nested = $nested;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNested(): DummyMessageNumberOne
|
||||||
|
{
|
||||||
|
return $this->nested;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Serializer\Tests;
|
|||||||
|
|
||||||
use Doctrine\Common\Annotations\AnnotationReader;
|
use Doctrine\Common\Annotations\AnnotationReader;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
|
||||||
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata;
|
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata;
|
||||||
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorMapping;
|
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorMapping;
|
||||||
use Symfony\Component\Serializer\Mapping\ClassMetadata;
|
use Symfony\Component\Serializer\Mapping\ClassMetadata;
|
||||||
@ -35,6 +36,7 @@ use Symfony\Component\Serializer\Tests\Fixtures\AbstractDummyFirstChild;
|
|||||||
use Symfony\Component\Serializer\Tests\Fixtures\AbstractDummySecondChild;
|
use Symfony\Component\Serializer\Tests\Fixtures\AbstractDummySecondChild;
|
||||||
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface;
|
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface;
|
||||||
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberOne;
|
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberOne;
|
||||||
|
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberTwo;
|
||||||
use Symfony\Component\Serializer\Tests\Fixtures\TraversableDummy;
|
use Symfony\Component\Serializer\Tests\Fixtures\TraversableDummy;
|
||||||
use Symfony\Component\Serializer\Tests\Fixtures\NormalizableTraversableDummy;
|
use Symfony\Component\Serializer\Tests\Fixtures\NormalizableTraversableDummy;
|
||||||
use Symfony\Component\Serializer\Tests\Normalizer\TestNormalizer;
|
use Symfony\Component\Serializer\Tests\Normalizer\TestNormalizer;
|
||||||
@ -430,6 +432,22 @@ class SerializerTest extends TestCase
|
|||||||
$this->assertEquals('{"two":2,"type":"one"}', $serialized);
|
$this->assertEquals('{"two":2,"type":"one"}', $serialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testDeserializeAndSerializeNestedInterfacedObjectsWithTheClassMetadataDiscriminator()
|
||||||
|
{
|
||||||
|
$nested = new DummyMessageNumberOne();
|
||||||
|
$nested->one = 'foo';
|
||||||
|
|
||||||
|
$example = new DummyMessageNumberTwo();
|
||||||
|
$example->setNested($nested);
|
||||||
|
|
||||||
|
$serializer = $this->serializerWithClassDiscriminator();
|
||||||
|
|
||||||
|
$serialized = $serializer->serialize($example, 'json');
|
||||||
|
$deserialized = $serializer->deserialize($serialized, DummyMessageInterface::class, 'json');
|
||||||
|
|
||||||
|
$this->assertEquals($example, $deserialized);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Symfony\Component\Serializer\Exception\RuntimeException
|
* @expectedException \Symfony\Component\Serializer\Exception\RuntimeException
|
||||||
* @expectedExceptionMessage The type "second" has no mapped class for the abstract object "Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface"
|
* @expectedExceptionMessage The type "second" has no mapped class for the abstract object "Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface"
|
||||||
@ -452,7 +470,7 @@ class SerializerTest extends TestCase
|
|||||||
{
|
{
|
||||||
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
|
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
|
||||||
|
|
||||||
return new Serializer(array(new ObjectNormalizer($classMetadataFactory, null, null, null, new ClassDiscriminatorFromClassMetadata($classMetadataFactory))), array('json' => new JsonEncoder()));
|
return new Serializer(array(new ObjectNormalizer($classMetadataFactory, null, null, new ReflectionExtractor(), new ClassDiscriminatorFromClassMetadata($classMetadataFactory))), array('json' => new JsonEncoder()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ class PluralizationRules
|
|||||||
case 'bs':
|
case 'bs':
|
||||||
case 'hr':
|
case 'hr':
|
||||||
case 'ru':
|
case 'ru':
|
||||||
|
case 'sh':
|
||||||
case 'sr':
|
case 'sr':
|
||||||
case 'uk':
|
case 'uk':
|
||||||
return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
|
return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
|
||||||
|
@ -302,6 +302,10 @@
|
|||||||
<source>An empty file is not allowed.</source>
|
<source>An empty file is not allowed.</source>
|
||||||
<target>No està permès un fixter buit.</target>
|
<target>No està permès un fixter buit.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>Aquest valor no és un UUID vàlid.</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -318,6 +318,10 @@
|
|||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<target>Fehler</target>
|
<target>Fehler</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>Dies ist keine gültige UUID.</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -318,6 +318,10 @@
|
|||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<target>Error</target>
|
<target>Error</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>This is not a valid UUID.</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -318,6 +318,10 @@
|
|||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<target>Error</target>
|
<target>Error</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>Este valor no es un UUID válido.</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -282,6 +282,10 @@
|
|||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<target>Errore</target>
|
<target>Errore</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>Balio hau ez da onartutako UUID bat.</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -318,6 +318,10 @@
|
|||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<target>Erreur</target>
|
<target>Erreur</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>Ceci n'est pas un UUID valide.</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -318,6 +318,10 @@
|
|||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<target>Hiba</target>
|
<target>Hiba</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>Érvénytelen egyedi azonosító (UUID).</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -318,6 +318,10 @@
|
|||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<target>Errore</target>
|
<target>Errore</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>Questo non è un UUID valido.</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -314,6 +314,10 @@
|
|||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<target>Fout</target>
|
<target>Fout</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="83">
|
||||||
|
<source>This is not a valid UUID.</source>
|
||||||
|
<target>Deze waarde is geen geldige UUID waarde.</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
Reference in New Issue
Block a user