Skip to content

Commit 81d5a6f

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: (22 commits) [Routing] Fix resource miss [Security] Fixed auth provider authenticate() cannot return void declare argument type [FrameworkBundle][Serializer] Move normalizer/encoders definitions to xml file & remove unnecessary checks streamed response should return $this $isClientIpsVali is not used content can be a resource Adding the Form default theme files to be warmed up in Twig's cache Remove BC Break label from `NullDumper` class Username and password in basic auth are allowed to contain '.' Remove obsolete PHPDoc from UriSigner [Serializer] YamlEncoder: throw if the Yaml component isn't installed [Serializer] ObjectNormalizer: throw if PropertyAccess isn't installed [PropertyInfo] Add support for the iterable type pdo session fix Fixed pathinfo calculation for requests starting with a question mark. - fix bad conflict resolving issue - port symfony/symfony#21968 to 3.3+ Fixed unsetting from loosely equal keys OrderedHashMap add DOMElement as return type in Crawler::getIterator to support foreach support in ide Fixed mistake in exception expectation [Debug] Fix same vendor detection in class loader ...
2 parents ad3d37a + 827d816 commit 81d5a6f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Encoder/YamlEncoder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Serializer\Encoder;
1313

14+
use Symfony\Component\Serializer\Exception\RuntimeException;
1415
use Symfony\Component\Yaml\Dumper;
1516
use Symfony\Component\Yaml\Parser;
1617

@@ -29,6 +30,10 @@ class YamlEncoder implements EncoderInterface, DecoderInterface
2930

3031
public function __construct(Dumper $dumper = null, Parser $parser = null, array $defaultContext = array())
3132
{
33+
if (!class_exists(Dumper::class)) {
34+
throw new RuntimeException('The YamlEncoder class requires the "Yaml" component. Install "symfony/yaml" to use it.');
35+
}
36+
3237
$this->dumper = $dumper ?: new Dumper();
3338
$this->parser = $parser ?: new Parser();
3439
$this->defaultContext = array_merge($this->defaultContext, $defaultContext);

Normalizer/ObjectNormalizer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\PropertyAccess\PropertyAccess;
1616
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
1717
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
18+
use Symfony\Component\Serializer\Exception\RuntimeException;
1819
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
1920
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
2021

@@ -32,6 +33,10 @@ class ObjectNormalizer extends AbstractObjectNormalizer
3233

3334
public function __construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null, PropertyAccessorInterface $propertyAccessor = null, PropertyTypeExtractorInterface $propertyTypeExtractor = null)
3435
{
36+
if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccess')) {
37+
throw new RuntimeException('The ObjectNormalizer class requires the "PropertyAccess" component. Install "symfony/property-access" to use it.');
38+
}
39+
3540
parent::__construct($classMetadataFactory, $nameConverter, $propertyTypeExtractor);
3641

3742
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();

0 commit comments

Comments
 (0)