CoreFiles by mySites.guru
Callback.php55 lines, 1,314 bytes, from Joomla_4.2.6-Stable-Full_Package.zip
Raw History Compare with 4.2.5
md5
4d52f79ef2d98fde96a1a256b7721f4b
sha1
36fcefa87b8d1eb9f43e54fd5f8054761846bb62
sha256
f36650e11d73cfa5eff8e4bf2d725ef600eaaba17d54d04444333b27f53b179c
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\CMS\Event\MultiFactor;

use DomainException;
use Joomla\CMS\Event\AbstractImmutableEvent;

// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Concrete Event class for the onUserMultifactorCallback event
 *
 * @since 4.2.0
 */
class Callback extends AbstractImmutableEvent
{
    /**
     * Public constructor
     *
     * @param   string  $method  The MFA method name
     *
     * @since 4.2.0
     */
    public function __construct(string $method)
    {
        parent::__construct('onUserMultifactorCallback', ['method' => $method]);
    }

    /**
     * Validate the value of the 'method' named parameter
     *
     * @param   string|null  $value  The value to validate
     *
     * @return  string
     * @throws  DomainException
     * @since   4.2.0
     */
    public function setMethod(string $value): string
    {
        if (empty($value)) {
            throw new DomainException(sprintf("Argument 'method' of event %s must be a non-empty string.", $this->name));
        }

        return $value;
    }
}

The same content is in 27 releases, Joomla 4.2.1 to 4.3.1. See them all, or every version of this file.