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/mautic.corals.io/app/bundles/MessengerBundle/Validator/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mautic.corals.io/app/bundles/MessengerBundle/Validator/DsnValidator.php
<?php

declare(strict_types=1);

namespace Mautic\MessengerBundle\Validator;

use Mautic\CoreBundle\Helper\Dsn\Dsn as CoreDsn;
use Mautic\MessengerBundle\Validator\Dsn as DsnConstraint;
use Symfony\Component\Messenger\Transport\TransportFactory;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;

/**
 * @deprecated since Mautic 5.0, to be removed in 6.0 with no replacement.
 */
class DsnValidator extends ConstraintValidator
{
    public function __construct(
        private TransportFactory $transportFactory
    ) {
    }

    public function validate($value, Constraint $constraint): void
    {
        if (!is_string($value)) {
            throw new UnexpectedTypeException($value, 'string');
        }

        if (!$constraint instanceof DsnConstraint) {
            throw new UnexpectedTypeException($constraint, DsnConstraint::class);
        }

        if (!$value) {
            return;
        }

        try {
            $dsn = CoreDsn::fromString($value);
        } catch (\InvalidArgumentException) {
            $this->context->addViolation('mautic.messenger.dsn.invalid_dsn');

            return;
        }

        if (!$this->transportFactory->supports($value, $dsn->getOptions())) {
            $this->context->addViolation('mautic.messenger.dsn.unsupported_scheme');
        }
    }
}

Spamworldpro Mini