schema
3 years ago
AbstractLoader.php
4 years ago
AnnotationLoader.php
1 year ago
AutoMappingTrait.php
1 year ago
FileLoader.php
4 years ago
FilesLoader.php
4 years ago
LoaderChain.php
4 years ago
LoaderInterface.php
4 years ago
PropertyInfoLoader.php
1 year ago
StaticMethodLoader.php
4 years ago
XmlFileLoader.php
4 years ago
XmlFilesLoader.php
4 years ago
YamlFileLoader.php
4 years ago
YamlFilesLoader.php
4 years ago
index.php
3 years ago
AutoMappingTrait.php
18 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Symfony\Component\Validator\Mapping\Loader; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Symfony\Component\Validator\Mapping\AutoMappingStrategy; |
| 5 | use MailPoetVendor\Symfony\Component\Validator\Mapping\ClassMetadata; |
| 6 | trait AutoMappingTrait |
| 7 | { |
| 8 | private function isAutoMappingEnabledForClass(ClassMetadata $metadata, ?string $classValidatorRegexp = null) : bool |
| 9 | { |
| 10 | // Check if AutoMapping constraint is set first |
| 11 | if (AutoMappingStrategy::NONE !== ($strategy = $metadata->getAutoMappingStrategy())) { |
| 12 | return AutoMappingStrategy::ENABLED === $strategy; |
| 13 | } |
| 14 | // Fallback on the config |
| 15 | return null !== $classValidatorRegexp && \preg_match($classValidatorRegexp, $metadata->getClassName()); |
| 16 | } |
| 17 | } |
| 18 |