CoreFiles by mySites.guru
AutoMappingTrait.php34 lines, 1,044 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
a8e49c813f27ba28df2fa5bdf6260612
sha1
9b6f58847833aeb7fe07124ddbd4a211cda57ac9
sha256
2b72fb8363d2d04c381009ed3bf4b68582c0f4545ae2e70a2d76805280ae2fc6
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Validator\Mapping\Loader;

use Symfony\Component\Validator\Mapping\AutoMappingStrategy;
use Symfony\Component\Validator\Mapping\ClassMetadata;

/**
 * Utility methods to create auto mapping loaders.
 *
 * @author Kévin Dunglas <[email protected]>
 */
trait AutoMappingTrait
{
    private function isAutoMappingEnabledForClass(ClassMetadata $metadata, ?string $classValidatorRegexp = null): bool
    {
        // Check if AutoMapping constraint is set first
        if (AutoMappingStrategy::NONE !== $strategy = $metadata->getAutoMappingStrategy()) {
            return AutoMappingStrategy::ENABLED === $strategy;
        }

        // Fallback on the config
        return null !== $classValidatorRegexp && preg_match($classValidatorRegexp, $metadata->getClassName());
    }
}

The same content is in 133 releases, Joomla 5.1.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.