- md5
- 8be2947896b40caf2079190ff2426494
- sha1
- 6e17d3967853554eb1aeb9968177d34517f21a58
- sha256
- d023c80af4e3d6fec476a1161ddbef90498406c1852aaa7034e16b8cf94c879a
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
<?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.txt
*/
namespace Joomla\CMS\Event\MultiFactor;
use Joomla\CMS\Event\AbstractImmutableEvent;
use Joomla\CMS\Event\Result\ResultAware;
use Joomla\CMS\Event\Result\ResultAwareInterface;
use Joomla\CMS\Event\Result\ResultTypeObjectAware;
use Joomla\Component\Users\Administrator\DataShape\SetupRenderOptions;
use Joomla\Component\Users\Administrator\Table\MfaTable;
// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Concrete Event class for the onUserMultifactorGetSetup event
*
* @since 4.2.0
*/
class GetSetup extends AbstractImmutableEvent implements ResultAwareInterface
{
use ResultAware;
use ResultTypeObjectAware;
/**
* Public constructor
*
* @param MfaTable $record The record to display the setup page for
*
* @since 4.2.0
*/
public function __construct(MfaTable $record)
{
parent::__construct('onUserMultifactorGetSetup', ['record' => $record]);
$this->resultIsNullable = true;
$this->resultAcceptableClasses = [
SetupRenderOptions::class,
];
}
/**
* Validate the value of the 'record' named parameter
*
* @param MfaTable $value The value to validate
*
* @return MfaTable
* @since 4.2.0
*/
public function setRecord(MfaTable $value): MfaTable
{
if (empty($value)) {
throw new \DomainException(sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name));
}
return $value;
}
}
The same content is in 4 releases, Joomla 4.4.0-alpha3 to 4.4.0-beta2. See them all, or every version of this file.