Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/cartforge.co/vendor/laminas/laminas-validator/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/cartforge.co/vendor/laminas/laminas-validator/src/StaticValidator.php
<?php

namespace Laminas\Validator;

use Laminas\ServiceManager\ServiceManager;

use function array_values;
use function method_exists;

/**
 * @deprecated Since 2.61.0 This validator will be removed in v3.0 without replacement. Most validators can be
 *             constructed as desired and used in any context.
 *
 * @final
 */
class StaticValidator
{
    /** @var ValidatorPluginManager|null */
    protected static $plugins;

    /**
     * Set plugin manager to use for locating validators
     *
     * @return void
     */
    public static function setPluginManager(?ValidatorPluginManager $plugins = null)
    {
        // Don't share by default to allow different arguments on subsequent calls
        if ($plugins instanceof ValidatorPluginManager) {
            // Vary how the share by default flag is set based on laminas-servicemanager version
            if (method_exists($plugins, 'configure')) {
                $plugins->configure(['shared_by_default' => false]);
            } else {
                $plugins->setShareByDefault(false);
            }
        }
        static::$plugins = $plugins;
    }

    /**
     * Get plugin manager for locating validators
     *
     * @return ValidatorPluginManager
     */
    public static function getPluginManager()
    {
        if (! static::$plugins instanceof ValidatorPluginManager) {
            $plugins = new ValidatorPluginManager(new ServiceManager());
            static::setPluginManager($plugins);

            return $plugins;
        }
        return static::$plugins;
    }

    /**
     * @param  class-string<ValidatorInterface> $classBaseName
     * @param  array                            $options OPTIONAL associative array of options to pass as
     *                                                   the sole argument to the validator constructor.
     * @return bool
     * @throws Exception\InvalidArgumentException For an invalid $options argument.
     */
    public static function execute(mixed $value, $classBaseName, array $options = [])
    {
        if ($options && array_values($options) === $options) {
            throw new Exception\InvalidArgumentException(
                'Invalid options provided via $options argument; must be an associative array'
            );
        }

        $plugins   = static::getPluginManager();
        $validator = $plugins->get($classBaseName, $options);

        return $validator->isValid($value);
    }
}

Spamworldpro Mini