10000 More intuitive Logic Exception message · symfony/symfony@cf94183 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf94183

Browse files
committed
More intuitive Logic Exception message
1 parent 0bc39e8 commit cf94183

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Serializer/Encoder/YamlEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class YamlEncoder implements EncoderInterface, DecoderInterface
4343
public function __construct(Dumper $dumper = null, Parser $parser = null, array $defaultContext = [])
4444
{
4545
if (!class_exists(Dumper::class)) {
46-
throw new RuntimeException('The YamlEncoder class requires the "Yaml" component. Install "symfony/yaml" to use it.');
46+
throw new RuntimeException('The YamlEncoder class requires the "Yaml" component. Try running "composer require symfony/yaml".');
4747
}
4848

4949
$this->dumper = $dumper ?? new Dumper();

src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ObjectNormalizer extends AbstractObjectNormalizer
3737
public function __construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null, PropertyAccessorInterface $propertyAccessor = null, PropertyTypeExtractorInterface $propertyTypeExtractor = null, ClassDiscriminatorResolverInterface $classDiscriminatorResolver = null, callable $objectClassResolver = null, array $defaultContext = [])
3838
{
3939
if (!class_exists(PropertyAccess::class)) {
40-
throw new LogicException('The ObjectNormalizer class requires the "PropertyAccess" component. Install "symfony/property-access" to use it.');
40+
throw new LogicException('The ObjectNormalizer class requires the "PropertyAccess" component. Try running "composer require symfony/property-access".');
4141
}
4242

4343
parent::__construct($classMetadataFactory, $nameConverter, $propertyTypeExtractor, $classDiscriminatorResolver, $objectClassResolver, $defaultContext);

0 commit comments

Comments
 (0)
0