File manager - Edit - /home/opticamezl/www/newok/Event.zip
Back
PK q��\)�"� � MultiFactor/Captive.phpnu �[��� <?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\CaptiveRenderOptions; 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 onUserMultifactorCaptive event * * @since 4.2.0 */ class Captive extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeObjectAware; /** * Public constructor * * @param MfaTable $record The MFA record to use in the captive login page * * @since 4.2.0 */ public function __construct(MfaTable $record) { parent::__construct('onUserMultifactorCaptive', ['record' => $record]); $this->resultIsNullable = true; $this->resultAcceptableClasses = [ CaptiveRenderOptions::class, ]; } /** * Validate the value of the 'record' named parameter * * @param MfaTable $value The value to validate * * @return MfaTable * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ 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; } /** * Validate the value of the 'record' named parameter * * @param MfaTable $value The value to validate * * @return MfaTable * @since 4.4.0 */ protected function onSetRecord(MfaTable $value): MfaTable { return $this->setRecord($value); } } PK q��\5N�� � MultiFactor/NotifyActionLog.phpnu �[��� <?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; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete event class for the custom events used to notify the User Action Log plugin about Two * Factor Authentication actions. * * @since 4.2.0 */ class NotifyActionLog extends AbstractImmutableEvent { private const ACCEPTABLE_EVENTS = [ 'onComUsersCaptiveValidateSuccess', 'onComUsersViewMethodsAfterDisplay', 'onComUsersCaptiveShowCaptive', 'onComUsersCaptiveShowSelect', 'onComUsersCaptiveValidateFailed', 'onComUsersCaptiveValidateInvalidMethod', 'onComUsersCaptiveValidateTryLimitReached', 'onComUsersCaptiveValidateSuccess', 'onComUsersControllerMethodAfterRegenerateBackupCodes', 'onComUsersControllerMethodBeforeAdd', 'onComUsersControllerMethodBeforeDelete', 'onComUsersControllerMethodBeforeEdit', 'onComUsersControllerMethodBeforeSave', 'onComUsersControllerMethodsBeforeDisable', 'onComUsersControllerMethodsBeforeDoNotShowThisAgain', ]; /** * Public constructor * * @param string $name Event name. Must belong in self::ACCEPTABLE_EVENTS * @param array $arguments Event arguments (different for each event). * * @since 4.2.0 */ public function __construct(string $name, array $arguments = []) { if (!in_array($name, self::ACCEPTABLE_EVENTS)) { throw new \InvalidArgumentException(sprintf('The %s event class does not support the %s event name.', __CLASS__, $name)); } parent::__construct($name, $arguments); } } PK q��\v-�C� � MultiFactor/GetMethod.phpnu �[��� <?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\MethodDescriptor; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete Event class for the onUserMultifactorGetMethod event * * @since 4.2.0 */ class GetMethod extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeObjectAware; /** * Public constructor * * @since 4.2.0 */ public function __construct() { parent::__construct('onUserMultifactorGetMethod', []); $this->resultIsNullable = true; $this->resultAcceptableClasses = [ MethodDescriptor::class, ]; } } PK q��\gI�Z� � MultiFactor/SaveSetup.phpnu �[��� <?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\ResultTypeArrayAware; use Joomla\Component\Users\Administrator\Table\MfaTable; use Joomla\Input\Input; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete Event class for the onUserMultifactorSaveSetup event * * @since 4.2.0 */ class SaveSetup extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeArrayAware; /** * Public constructor * * @param MfaTable $record The record to save into * @param Input $input The application input object * * @since 4.2.0 */ public function __construct(MfaTable $record, Input $input) { parent::__construct( 'onUserMultifactorSaveSetup', [ 'record' => $record, 'input' => $input, ] ); $this->resultIsNullable = true; } /** * Validate the value of the 'record' named parameter * * @param MfaTable $value The value to validate * * @return MfaTable * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ 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; } /** * Validate the value of the 'record' named parameter * * @param Input $value The value to validate * * @return Input * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setInput(Input $value): Input { if (empty($value)) { throw new \DomainException(sprintf('Argument \'input\' of event %s must be an Input object.', $this->name)); } return $value; } /** * Validate the value of the 'record' named parameter * * @param MfaTable $value The value to validate * * @return MfaTable * @since 4.4.0 */ protected function onSetRecord(MfaTable $value): MfaTable { return $this->setRecord($value); } /** * Validate the value of the 'record' named parameter * * @param Input $value The value to validate * * @return Input * @since 4.4.0 */ protected function onSetInput(Input $value): Input { return $this->setInput($value); } } PK q��\�~Ls� � MultiFactor/Callback.phpnu �[��� <?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; // 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 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ 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; } /** * Validate the value of the 'method' named parameter * * @param string|null $value The value to validate * * @return string * @throws \DomainException * @since 4.4.0 */ protected function onSetMethod(string $value): string { return $this->setMethod($value); } } PK q��\���� � MultiFactor/Validate.phpnu �[��� <?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\ResultTypeBooleanAware; use Joomla\CMS\User\User; 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 onUserMultifactorValidate event * * @since 4.2.0 */ class Validate extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeBooleanAware; /** * Public constructor * * @param MfaTable $record The MFA record to validate against * @param User $user The user currently logged into the site * @param string $code The MFA code we are validating * * @since 4.2.0 */ public function __construct(MfaTable $record, User $user, string $code) { parent::__construct( 'onUserMultifactorValidate', [ 'record' => $record, 'user' => $user, 'code' => $code, ] ); } /** * Validate the value of the 'record' named parameter * * @param MfaTable $value The value to validate * * @return MfaTable * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ 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; } /** * Validate the value of the 'user' named parameter * * @param User $value The value to validate * * @return User * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setUser(User $value): User { if (empty($value) || ($value->id <= 0) || ($value->guest == 1)) { throw new \DomainException(sprintf('Argument \'user\' of event %s must be a non-guest User object.', $this->name)); } return $value; } /** * Validate the value of the 'code' named parameter * * @param string|null $value The value to validate * * @return string|null * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setCode(?string $value): ?string { // No validation necessary, the type check in the method options is enough return $value; } /** * Validate the value of the 'record' named parameter * * @param MfaTable $value The value to validate * * @return MfaTable * @since 4.4.0 */ protected function onSetRecord(MfaTable $value): MfaTable { return $this->setRecord($value); } /** * Validate the value of the 'user' named parameter * * @param User $value The value to validate * * @return User * @since 4.4.0 */ protected function onSetUser(User $value): User { return $this->setUser($value); } /** * Validate the value of the 'code' named parameter * * @param string|null $value The value to validate * * @return string|null * @since 4.4.0 */ protected function onSetCode(?string $value): ?string { return $this->setCode($value); } } PK q��\ �!ǣ � MultiFactor/GetSetup.phpnu �[��� <?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 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ 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; } /** * Validate the value of the 'record' named parameter * * @param MfaTable $value The value to validate * * @return MfaTable * @since 4.4.0 */ protected function onSetRecord(MfaTable $value): MfaTable { return $this->setRecord($value); } } PK q��\���( ( $ MultiFactor/BeforeDisplayMethods.phpnu �[��� <?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\User\User; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete Event class for the onUserMultifactorBeforeDisplayMethods event * * @since 4.2.0 */ class BeforeDisplayMethods extends AbstractImmutableEvent { use ResultAware; /** * Public constructor * * @param User $user The user the MFA methods are displayed for * * @since 4.2.0 */ public function __construct(User $user) { parent::__construct('onUserMultifactorBeforeDisplayMethods', ['user' => $user]); } /** * Validate the value of the 'user' named parameter * * @param User $value The value to validate * * @return User * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setUser(User $value): User { if (empty($value) || ($value->id <= 0) || ($value->guest == 1)) { throw new \DomainException(sprintf('Argument \'user\' of event %s must be a non-guest User object.', $this->name)); } return $value; } /** * Validate the value of the 'user' named parameter * * @param User $value The value to validate * * @return User * @since 4.4.0 */ protected function onSetUser(User $value): User { return $this->setUser($value); } } PK q��\U��� GenericEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This class gives a concrete implementation of the AbstractEvent class. * * @see \Joomla\CMS\Event\AbstractEvent * @since 4.0.0 */ class GenericEvent extends AbstractEvent { } PK q��\�SU� � AbstractImmutableEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This class implements the immutable base Event object used system-wide to offer orthogonality. * * @see \Joomla\CMS\Event\AbstractEvent * @since 4.0.0 */ class AbstractImmutableEvent extends AbstractEvent { /** * A flag to see if the constructor has been already called. * * @var boolean * @since 4.0.0 */ private $constructed = false; /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @since 4.0.0 * @throws \BadMethodCallException */ public function __construct(string $name, array $arguments = []) { if ($this->constructed) { throw new \BadMethodCallException( sprintf('Cannot reconstruct the AbstractImmutableEvent %s.', $this->name) ); } $this->constructed = true; parent::__construct($name, $arguments); } /** * Set the value of an event argument. * * @param string $name The argument name. * @param mixed $value The argument value. * * @return void * * @since 4.0.0 * @throws \BadMethodCallException */ public function offsetSet($name, $value) { // B/C check for plugins which use $event['result'] = $result; if ($name === 'result') { parent::offsetSet($name, $value); @trigger_error( 'Setting a result in an immutable event is deprecated, and will not work in Joomla 6. Event ' . $this->getName(), E_USER_DEPRECATED ); return; } throw new \BadMethodCallException( sprintf( 'Cannot set the argument %s of the immutable event %s.', $name, $this->name ) ); } /** * Remove an event argument. * * @param string $name The argument name. * * @return void * * @since 4.0.0 * @throws \BadMethodCallException */ public function offsetUnset($name) { throw new \BadMethodCallException( sprintf( 'Cannot remove the argument %s of the immutable event %s.', $name, $this->name ) ); } } PK q��\��6� ( Plugin/System/Webauthn/AjaxSaveLabel.phpnu �[��� <?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\Plugin\System\Webauthn; use Joomla\CMS\Event\AbstractImmutableEvent; use Joomla\CMS\Event\Result\ResultAware; use Joomla\CMS\Event\Result\ResultAwareInterface; use Joomla\CMS\Event\Result\ResultTypeBooleanAware; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete event class for the onAjaxWebauthnSavelabel event * * @since 4.2.0 */ class AjaxSaveLabel extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeBooleanAware; } PK q��\��R� Plugin/System/Webauthn/Ajax.phpnu �[��� <?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\Plugin\System\Webauthn; use Joomla\CMS\Event\AbstractImmutableEvent; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete event class for the onAjaxWebauthn event * * @since 4.2.0 */ class Ajax extends AbstractImmutableEvent { } PK q��\�˧�� � ) Plugin/System/Webauthn/AjaxInitCreate.phpnu �[��� <?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\Plugin\System\Webauthn; use Joomla\CMS\Event\AbstractImmutableEvent; use Joomla\CMS\Event\Result\ResultAware; use Joomla\CMS\Event\Result\ResultAwareInterface; use Joomla\CMS\Event\Result\ResultTypeObjectAware; use Webauthn\PublicKeyCredentialCreationOptions; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete event class for the onAjaxWebauthnInitcreate event * * @since 4.2.0 */ class AjaxInitCreate extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeObjectAware; /** * Constructor * * @param string $name Event name * @param array $arguments Event arguments * * @since 4.2.0 */ public function __construct(string $name, array $arguments = []) { parent::__construct($name, $arguments); $this->resultAcceptableClasses = [ \stdClass::class, PublicKeyCredentialCreationOptions::class, ]; } } PK q��\!\�-' ' $ Plugin/System/Webauthn/AjaxLogin.phpnu �[��� <?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\Plugin\System\Webauthn; use Joomla\CMS\Event\AbstractImmutableEvent; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete event class for the onAjaxWebauthnLogin event * * @since 4.2.0 */ class AjaxLogin extends AbstractImmutableEvent { } PK q��\�N�A� � ( Plugin/System/Webauthn/AjaxChallenge.phpnu �[��� <?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\Plugin\System\Webauthn; use Joomla\CMS\Event\AbstractImmutableEvent; use Joomla\CMS\Event\Result\ResultAware; use Joomla\CMS\Event\Result\ResultAwareInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete event class for the onAjaxWebauthnChallenge event * * @since 4.2.0 */ class AjaxChallenge extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; /** * Make sure the result is valid JSON or boolean false * * @param mixed $data The data to check * * @return void * @since 4.2.0 */ public function typeCheckResult($data): void { if ($data === false) { return; } if (!is_string($data) || @json_decode($data) === null) { throw new \InvalidArgumentException(sprintf('Event %s only accepts JSON results.', $this->getName())); } } } PK q��\w�� % Plugin/System/Webauthn/AjaxCreate.phpnu �[��� <?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\Plugin\System\Webauthn; use Joomla\CMS\Event\AbstractImmutableEvent; use Joomla\CMS\Event\Result\ResultAware; use Joomla\CMS\Event\Result\ResultAwareInterface; use Joomla\CMS\Event\Result\ResultTypeStringAware; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete event class for the onAjaxWebauthnCreate event * * @since 4.2.0 */ class AjaxCreate extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeStringAware; } PK q��\S梅 % Plugin/System/Webauthn/AjaxDelete.phpnu �[��� <?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\Plugin\System\Webauthn; use Joomla\CMS\Event\AbstractImmutableEvent; use Joomla\CMS\Event\Result\ResultAware; use Joomla\CMS\Event\Result\ResultAwareInterface; use Joomla\CMS\Event\Result\ResultTypeBooleanAware; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Concrete event class for the onAjaxWebauthnDelete event * * @since 4.2.0 */ class AjaxDelete extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeBooleanAware; } PK q��\ ��(� � Table/ObjectCreateEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onObjectCreate event * * @since 4.0.0 */ class ObjectCreateEvent extends AbstractEvent { } PK q��\&*Ӕ� � Table/AfterResetEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterReset event * * @since 4.0.0 */ class AfterResetEvent extends AbstractEvent { } PK q��\��� � Table/AfterCheckinEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterCheckin event * * @since 4.0.0 */ class AfterCheckinEvent extends BeforeCheckinEvent { } PK q��\�l.� Table/BeforeBindEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeBind event * * @since 4.0.0 */ class BeforeBindEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * src mixed An associative array or object to bind to the JTable instance. * ignore mixed An optional array or space separated list of properties to ignore while binding. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('src', $arguments)) { throw new \BadMethodCallException("Argument 'src' is required for event $name"); } if (!\array_key_exists('ignore', $arguments)) { throw new \BadMethodCallException("Argument 'ignore' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the src argument * * @param mixed $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setSrc($value) { if (!empty($value) && !\is_object($value) && !\is_array($value)) { throw new \BadMethodCallException("Argument 'src' of event {$this->name} must be empty, object or array"); } return $value; } /** * Setter for the ignore argument * * @param mixed $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setIgnore($value) { if (!empty($value) && !\is_array($value)) { throw new \BadMethodCallException("Argument 'ignore' of event {$this->name} must be empty or array"); } return $value; } /** * Setter for the src argument * * @param mixed $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetSrc($value) { return $this->setSrc($value); } /** * Setter for the ignore argument * * @param mixed $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetIgnore($value) { return $this->setIgnore($value); } } PK q��\'�*� Table/BeforeMoveEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; use Joomla\Database\DatabaseQuery; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeMove event * * @since 4.0.0 */ class BeforeMoveEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * query DatabaseQuery The query to get the primary keys and ordering values for the selection. * delta int The direction and magnitude to move the row in the ordering sequence. * where string WHERE clause to use for limiting the selection of rows to compact the ordering values. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('query', $arguments)) { throw new \BadMethodCallException("Argument 'query' is required for event $name"); } if (!\array_key_exists('delta', $arguments)) { throw new \BadMethodCallException("Argument 'delta' is required for event $name"); } if (!\array_key_exists('where', $arguments)) { throw new \BadMethodCallException("Argument 'where' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the query argument * * @param DatabaseQuery $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setQuery($value) { if (!($value instanceof DatabaseQuery)) { throw new \BadMethodCallException("Argument 'query' of event {$this->name} must be of DatabaseQuery type"); } return $value; } /** * Setter for the delta argument * * @param int $value The value to set * * @return integer * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setDelta($value) { if (!is_numeric($value)) { throw new \BadMethodCallException("Argument 'delta' of event {$this->name} must be an integer"); } return (int) $value; } /** * Setter for the where argument * * @param string|null $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setWhere($value) { if (!empty($value) && !\is_string($value)) { throw new \BadMethodCallException("Argument 'where' of event {$this->name} must be empty or string"); } return $value; } /** * Setter for the query argument * * @param DatabaseQuery $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetQuery($value) { return $this->setQuery($value); } /** * Setter for the delta argument * * @param int $value The value to set * * @return integer * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetDelta($value) { return $this->setDelta($value); } /** * Setter for the where argument * * @param string|null $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetWhere($value) { return $this->setWhere($value); } } PK q��\C�p~� � Table/BeforeReorderEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; use Joomla\Database\DatabaseQuery; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeReorder event * * @since 4.0.0 */ class BeforeReorderEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * query DatabaseQuery The query to get the primary keys and ordering values for the selection. * where string WHERE clause to use for limiting the selection of rows to compact the ordering values. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('query', $arguments)) { throw new \BadMethodCallException("Argument 'query' is required for event $name"); } if (!\array_key_exists('where', $arguments)) { throw new \BadMethodCallException("Argument 'where' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the query argument * * @param DatabaseQuery $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setQuery($value) { if (!($value instanceof DatabaseQuery)) { throw new \BadMethodCallException("Argument 'query' of event {$this->name} must be of DatabaseQuery type"); } return $value; } /** * Setter for the where argument * * @param array|string|null $value A string or array of where conditions. * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setWhere($value) { if (!empty($value) && !\is_string($value) && !\is_array($value)) { throw new \BadMethodCallException("Argument 'where' of event {$this->name} must be empty or string or array of strings"); } return $value; } /** * Setter for the query argument * * @param DatabaseQuery $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetQuery($value) { return $this->setQuery($value); } /** * Setter for the where argument * * @param array|string|null $value A string or array of where conditions. * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetWhere($value) { return $this->setWhere($value); } } PK q��\ʉm�z z Table/BeforePublishEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforePublish event * * @since 4.0.0 */ class BeforePublishEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * pks mixed An optional array of primary key values to update. * state int The publishing state. eg. [0 = unpublished, 1 = published] * userId int The user id of the user performing the operation. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('pks', $arguments)) { throw new \BadMethodCallException("Argument 'pks' is required for event $name"); } if (!\array_key_exists('state', $arguments)) { throw new \BadMethodCallException("Argument 'state' is required for event $name"); } if (!\array_key_exists('userId', $arguments)) { throw new \BadMethodCallException("Argument 'userId' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the pks argument * * @param array|null $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setQuery($value) { if (!empty($value) && !\is_array($value)) { throw new \BadMethodCallException("Argument 'pks' of event {$this->name} must be empty or an array"); } return $value; } /** * Setter for the state argument * * @param int $value The value to set * * @return integer * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setState($value) { if (!is_numeric($value)) { throw new \BadMethodCallException("Argument 'state' of event {$this->name} must be an integer"); } return (int) $value; } /** * Setter for the userId argument * * @param int $value The value to set * * @return integer * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setUserId($value) { if (!is_numeric($value)) { throw new \BadMethodCallException("Argument 'userId' of event {$this->name} must be an integer"); } return (int) $value; } /** * Setter for the pks argument * * @param array|null $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetQuery($value) { return $this->setQuery($value); } /** * Setter for the state argument * * @param int $value The value to set * * @return integer * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetState($value) { return $this->setState($value); } /** * Setter for the userId argument * * @param int $value The value to set * * @return integer * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetUserId($value) { return $this->setUserId($value); } } PK q��\�� � � Table/AfterStoreEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterStore event * * @since 4.0.0 */ class AfterStoreEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * result boolean Did the save succeed? * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('result', $arguments)) { throw new \BadMethodCallException("Argument 'result' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the result argument * * @param boolean $value The value to set * * @return boolean * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setResult($value) { return $value ? true : false; } /** * Setter for the result argument * * @param boolean $value The value to set * * @return boolean * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetResult($value) { return $this->setResult($value); } } PK q��\hX�d d Table/BeforeDeleteEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeDelete event * * @since 4.0.0 */ class BeforeDeleteEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * pk An optional primary key value to delete. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('pk', $arguments)) { throw new \BadMethodCallException("Argument 'pk' is required for event $name"); } parent::__construct($name, $arguments); } } PK q��\�� Table/BeforeLoadEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeLoad event * * @since 4.0.0 */ class BeforeLoadEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * keys mixed The optional primary key value to load the row by, or an array of fields to match. * reset boolean True to reset the default values before loading the new row. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('keys', $arguments)) { throw new \BadMethodCallException("Argument 'keys' is required for event $name"); } if (!\array_key_exists('reset', $arguments)) { throw new \BadMethodCallException("Argument 'reset' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the reset attribute * * @param mixed $value The value to set * * @return boolean Normalised value * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setReset($value) { return $value ? true : false; } /** * Setter for the reset attribute * * @param mixed $value The value to set * * @return boolean Normalised value * * @since 4.4.0 */ protected function onSetReset($value) { return $this->setReset($value); } } PK q��\�ۡH# # Table/BeforeCheckoutEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeCheckout event * * @since 4.0.0 */ class BeforeCheckoutEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * userId integer The Id of the user checking out the row. * pk mixed An optional primary key value to check out. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('userId', $arguments)) { throw new \BadMethodCallException("Argument 'userId' is required for event $name"); } if (!\array_key_exists('pk', $arguments)) { throw new \BadMethodCallException("Argument 'pk' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the userId argument * * @param mixed $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setUserId($value) { if (!is_numeric($value) || empty($value)) { throw new \BadMethodCallException("Argument 'userId' of event {$this->name} must be an integer"); } return (int) $value; } /** * Setter for the userId argument * * @param mixed $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetUserId($value) { return $this->setUserId($value); } } PK q��\8ż� � Table/BeforeHitEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeHit event * * @since 4.0.0 */ class BeforeHitEvent extends BeforeCheckinEvent { } PK q��\Q@�k� � Table/AfterHitEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterHit event * * @since 4.0.0 */ class AfterHitEvent extends BeforeCheckinEvent { } PK q��\�W� � Table/AfterMoveEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; use stdClass; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterMove event * * @since 4.0.0 */ class AfterMoveEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * row stdClass|null The primary keys and ordering value for the selection. * delta int The direction and magnitude to move the row in the ordering sequence. * where string WHERE clause which was used for limiting the selection of rows to compact the ordering values. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('row', $arguments)) { throw new \BadMethodCallException("Argument 'row' is required for event $name"); } if (!\array_key_exists('delta', $arguments)) { throw new \BadMethodCallException("Argument 'delta' is required for event $name"); } if (!\array_key_exists('where', $arguments)) { throw new \BadMethodCallException("Argument 'ignore' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the rows argument * * @param \stdClass|null $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setRow($value) { if (!($value instanceof \stdClass) && !empty($value)) { throw new \BadMethodCallException("Argument 'row' of event {$this->name} must be an stdClass object or null"); } return $value; } /** * Setter for the delta argument * * @param int $value The value to set * * @return integer * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setDelta($value) { if (!is_numeric($value)) { throw new \BadMethodCallException("Argument 'delta' of event {$this->name} must be an integer"); } return (int) $value; } /** * Setter for the where argument * * @param string|null $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setWhere($value) { if (!empty($value) && !\is_string($value)) { throw new \BadMethodCallException("Argument 'where' of event {$this->name} must be empty or string"); } return $value; } /** * Setter for the rows argument * * @param \stdClass|null $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetRow($value) { return $this->setRow($value); } /** * Setter for the delta argument * * @param int $value The value to set * * @return integer * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetDelta($value) { return $this->setDelta($value); } /** * Setter for the where argument * * @param string|null $value The value to set * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetWhere($value) { return $this->setWhere($value); } } PK q��\Qa��d d Table/AfterDeleteEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterDelete event * * @since 4.0.0 */ class AfterDeleteEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * pk The optional primary key value we deleted. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('pk', $arguments)) { throw new \BadMethodCallException("Argument 'pk' is required for event $name"); } parent::__construct($name, $arguments); } } PK q��\��- - Table/AfterReorderEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterReorder event * * @since 4.0.0 */ class AfterReorderEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * rows stdClass[]|null The primary keys and ordering values for the selection. * where string WHERE clause which was used for limiting the selection of rows to compact the ordering values. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('where', $arguments)) { throw new \BadMethodCallException("Argument 'ignore' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the where argument * * @param array|string|null $value A string or array of where conditions. * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setWhere($value) { if (!empty($value) && !\is_string($value) && !\is_array($value)) { throw new \BadMethodCallException("Argument 'where' of event {$this->name} must be empty or string or array of strings"); } return $value; } /** * Setter for the where argument * * @param array|string|null $value A string or array of where conditions. * * @return mixed * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetWhere($value) { return $this->setWhere($value); } } PK q��\�m^� � Table/BeforeResetEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeReset event * * @since 4.0.0 */ class BeforeResetEvent extends AbstractEvent { } PK q��\L�ʞ� � Table/AfterPublishEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterPublish event * * @since 4.0.0 */ class AfterPublishEvent extends BeforePublishEvent { } PK q��\��Y�� � Table/AfterCheckoutEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterCheckout event * * @since 4.0.0 */ class AfterCheckoutEvent extends BeforeCheckoutEvent { } PK q��\�X8 8 Table/AfterLoadEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterLoad event * * @since 4.0.0 */ class AfterLoadEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * result boolean Did the table record load succeed? * row null|array The values loaded from the database, null if it failed * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('result', $arguments)) { throw new \BadMethodCallException("Argument 'result' is required for event $name"); } if (!\array_key_exists('row', $arguments)) { throw new \BadMethodCallException("Argument 'row' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the result argument * * @param boolean $value The value to set * * @return boolean * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setResult($value) { return $value ? true : false; } /** * Setter for the row argument * * @param array|null $value The value to set * * @return array|null * * @throws \BadMethodCallException if the argument is not of the expected type * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setRow($value) { if (!\is_null($value) && !\is_array($value)) { throw new \BadMethodCallException("Argument 'row' of event {$this->name} is not of the expected type"); } return $value; } /** * Setter for the result argument * * @param boolean $value The value to set * * @return boolean * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetResult($value) { return $this->setResult($value); } /** * Setter for the row argument * * @param array|null $value The value to set * * @return array|null * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetRow($value) { return $this->setRow($value); } } PK q��\���P P Table/AbstractEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; use Joomla\CMS\Event\AbstractImmutableEvent; use Joomla\CMS\Table\TableInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for the Table's events * * @since 4.0.0 */ abstract class AbstractEvent extends AbstractImmutableEvent { /** * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException * * @since 1.0 */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('subject', $arguments)) { throw new \BadMethodCallException("Argument 'subject' of event {$this->name} is required but has not been provided"); } parent::__construct($name, $arguments); } /** * Setter for the subject argument * * @param TableInterface $value The value to set * * @return TableInterface * * @throws \BadMethodCallException If the argument is not of the expected type. * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setSubject($value) { if (!\is_object($value) || !($value instanceof TableInterface)) { throw new \BadMethodCallException("Argument 'subject' of event {$this->name} is not of the expected type"); } return $value; } /** * Setter for the subject argument * * @param TableInterface $value The value to set * * @return TableInterface * * @throws \BadMethodCallException If the argument is not of the expected type. * * @since 4.4.0 */ protected function onSetSubject($value): TableInterface { return $this->setSubject($value); } } PK q��\x l�. . Table/BeforeStoreEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeStore event * * @since 4.0.0 */ class BeforeStoreEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * updateNulls boolean True to update fields even if they are null. * k mixed Name of the primary key fields in the table (string or array of strings). * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('updateNulls', $arguments)) { throw new \BadMethodCallException("Argument 'updateNulls' is required for event $name"); } if (!\array_key_exists('k', $arguments)) { throw new \BadMethodCallException("Argument 'k' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the updateNulls attribute * * @param mixed $value The value to set * * @return boolean Normalised value * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setUpdateNulls($value) { return $value ? true : false; } /** * Setter for the updateNulls attribute * * @param mixed $value The value to set * * @return boolean Normalised value * * @since 4.4.0 */ protected function onSetUpdateNulls($value) { return $this->setUpdateNulls($value); } } PK q��\XlY�� � Table/AfterBindEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onAfterBind event * * @since 4.0.0 */ class AfterBindEvent extends BeforeBindEvent { } PK q��\��Ro� � Table/SetNewTagsEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onSetNewTags event * * @since 4.0.0 * @todo Only used in JModelAdmin::batchTag since we can't use JTable::save as we don't want the data to be saved. Maybe trigger onBeforeStore? */ class SetNewTagsEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * newTags int[] New tags to be added to or replace current tags for an item * replaceTags bool Replace tags (true) or add them (false) * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('newTags', $arguments)) { throw new \BadMethodCallException("Argument 'newTags' is required for event $name"); } if (!\array_key_exists('replaceTags', $arguments)) { throw new \BadMethodCallException("Argument 'replaceTags' is required for event $name"); } parent::__construct($name, $arguments); } /** * Setter for the replaceTags attribute * * @param mixed $value The value to set * * @return boolean Normalised value * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setReplaceTags($value) { return $value ? true : false; } /** * Setter for the replaceTags attribute * * @param mixed $value The value to set * * @return boolean Normalised value * * @since 4.4.0 */ protected function onSetReplaceTags($value) { return $this->setReplaceTags($value); } } PK q��\���y y Table/BeforeCheckinEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onBeforeCheckin event * * @since 4.0.0 */ class BeforeCheckinEvent extends AbstractEvent { /** * Constructor. * * Mandatory arguments: * subject JTableInterface The table we are operating on * pk mixed An optional primary key value to check out. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('pk', $arguments)) { throw new \BadMethodCallException("Argument 'pk' is required for event $name"); } parent::__construct($name, $arguments); } } PK q��\��.� � Table/CheckEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Table; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for JTable's onCheck event * * @since 4.0.0 */ class CheckEvent extends AbstractEvent { } PK q��\/^.]# ]# AbstractEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event; use Joomla\Event\Event; use Joomla\Event\Event as BaseEvent; use Joomla\String\Normalise; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This class implements the base Event object used system-wide to offer orthogonality. Core objects such as Models, * Controllers, etc create such events on-the-fly and dispatch them through the application's Dispatcher (colloquially * known as the "Joomla! plugin system"). This way a suitable plugin, typically a "system" plugin, can modify the * behaviour of any internal class, providing system-wide services such as tags, content versioning, comments or even * low-level services such as the implementation of created/modified/locked behaviours, record hit counter etc. * * You can create a new Event with something like this: * * $event = AbstractEvent::create('onModelBeforeSomething', $myModel, $arguments); * * You can access the subject object from your event Listener using $event['subject']. It is up to your listener to * determine whether it should apply its functionality against the subject. * * This AbstractEvent class implements a mutable event which is allowed to change its arguments at runtime. This is * generally unadvisable. It's best to use AbstractImmutableEvent instead and constrict all your interaction to the * subject class. * * @since 4.0.0 */ abstract class AbstractEvent extends BaseEvent { use CoreEventAware; /** * Creates a new CMS event object for a given event name and subject. The following arguments must be given: * subject object The subject of the event. This is the core object you are going to manipulate. * eventClass string The Event class name. If you do not provide it Joomla\CMS\Events\<eventNameWithoutOnPrefix> * will be used. * * @param string $eventName The name of the event, e.g. onTableBeforeLoad * @param array $arguments Additional arguments to pass to the event * * @return static * * @since 4.0.0 * @throws \BadMethodCallException If you do not provide a subject argument */ public static function create(string $eventName, array $arguments = []) { // Get the class name from the arguments, if specified $eventClassName = ''; if (isset($arguments['eventClass'])) { $eventClassName = $arguments['eventClass']; unset($arguments['eventClass']); } /** * If the class name isn't set/found determine it from the event name, e.g. TableBeforeLoadEvent from * the onTableBeforeLoad event name. */ if (empty($eventClassName) || !class_exists($eventClassName, true)) { $bareName = strpos($eventName, 'on') === 0 ? substr($eventName, 2) : $eventName; $parts = Normalise::fromCamelCase($bareName, true); $eventClassName = __NAMESPACE__ . '\\' . ucfirst(array_shift($parts)) . '\\'; $eventClassName .= implode('', $parts); $eventClassName .= 'Event'; } // Make sure a non-empty subject argument exists and that it is an object if (!isset($arguments['subject']) || empty($arguments['subject']) || !\is_object($arguments['subject'])) { throw new \BadMethodCallException("No subject given for the $eventName event"); } // Create and return the event object if (class_exists($eventClassName, true)) { return new $eventClassName($eventName, $arguments); } /** * The detection code above failed. This is to be expected, it was written back when we only * had the Table events. It does not address most other core events. So, let's use our * fancier detection instead. */ $eventClassName = self::getEventClassByEventName($eventName); if (!empty($eventClassName) && ($eventClassName !== Event::class)) { return new $eventClassName($eventName, $arguments); } return new GenericEvent($eventName, $arguments); } /** * Constructor. Overridden to go through the argument setters. * * @param string $name The event name. * @param array $arguments The event arguments. * * @since 4.0.0 */ public function __construct(string $name, array $arguments = []) { parent::__construct($name, $arguments); $this->arguments = []; foreach ($arguments as $argumentName => $value) { $this->setArgument($argumentName, $value); } } /** * Get an event argument value. * It will use a pre-processing method if one exists. The method has the signature: * * onGet<ArgumentName>($value): mixed * * where: * * $value is the value currently stored in the $arguments array of the event * It returns the value to return to the caller. * * @param string $name The argument name. * @param mixed $default The default value if not found. * * @return mixed The argument value or the default value. * * @since 4.0.0 */ public function getArgument($name, $default = null) { // B/C check for numeric access to named argument, eg $event->getArgument('0'). if (is_numeric($name)) { if (key($this->arguments) != 0) { $argNames = \array_keys($this->arguments); $name = $argNames[$name] ?? ''; } @trigger_error( sprintf( 'Numeric access to named event arguments is deprecated, and will not work in Joomla 6. Event %s argument %s', \get_class($this), $name ), E_USER_DEPRECATED ); } // Look for the method for the value pre-processing/validation $ucfirst = ucfirst($name); $methodName1 = 'onGet' . $ucfirst; $methodName2 = 'get' . $ucfirst; $value = parent::getArgument($name, $default); if (method_exists($this, $methodName1)) { return $this->{$methodName1}($value); } elseif (method_exists($this, $methodName2)) { @trigger_error( sprintf( 'Use method "%s" for value pre-processing is deprecated, and will not work in Joomla 6. Use "%s" instead. Event %s', $methodName2, $methodName1, \get_class($this) ), E_USER_DEPRECATED ); return $this->{$methodName2}($value); } return $value; } /** * Add argument to event. * It will use a pre-processing method if one exists. The method has the signature: * * onSet<ArgumentName>($value): mixed * * where: * * $value is the value being set by the user * It returns the value to return to set in the $arguments array of the event. * * @param string $name Argument name. * @param mixed $value Value. * * @return $this * * @since 4.0.0 */ public function setArgument($name, $value) { // B/C check for numeric access to named argument, eg $event->setArgument('0', $value). if (is_numeric($name)) { if (key($this->arguments) != 0) { $argNames = \array_keys($this->arguments); $name = $argNames[$name] ?? ''; } @trigger_error( sprintf( 'Numeric access to named event arguments is deprecated, and will not work in Joomla 6. Event %s argument %s', \get_class($this), $name ), E_USER_DEPRECATED ); } // Look for the method for the value pre-processing/validation $ucfirst = ucfirst($name); $methodName1 = 'onSet' . $ucfirst; $methodName2 = 'set' . $ucfirst; if (method_exists($this, $methodName1)) { $value = $this->{$methodName1}($value); } elseif (method_exists($this, $methodName2)) { @trigger_error( sprintf( 'Use method "%s" for value pre-processing is deprecated, and will not work in Joomla 6. Use "%s" instead. Event %s', $methodName2, $methodName1, \get_class($this) ), E_USER_DEPRECATED ); $value = $this->{$methodName2}($value); } return parent::setArgument($name, $value); } } PK q��\1.�� ErrorEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event; use Joomla\Application\AbstractApplication; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for representing the application's `onError` event * * @since 4.0.0 */ class ErrorEvent extends AbstractEvent { /** * Get the event's application object * * @return AbstractApplication * * @since 4.0.0 */ public function getApplication(): AbstractApplication { return $this->arguments['application']; } /** * Get the event's error object * * @return \Throwable * * @since 4.0.0 */ public function getError(): \Throwable { return $this->getArgument('subject'); } /** * Set the event's error object * * @param \Throwable $error The new error to process * * @return void * * @since 4.0.0 */ public function setError(\Throwable $error) { $this->setArgument('subject', $error); } } PK q��\�{� � AfterExtensionBootEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event; use Joomla\DI\Container; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for representing the extensions's `onBeforeExtensionBoot` event * * @since 4.0.0 */ class AfterExtensionBootEvent extends AbstractImmutableEvent { /** * Get the event's extension type. Can be: * - component * * @return string * * @since 4.0.0 */ public function getExtensionType(): string { return $this->getArgument('type'); } /** * Get the event's extension name. * * @return string * * @since 4.0.0 */ public function getExtensionName(): string { return $this->arguments['extensionName']; } /** * Get the event's container object * * @return Container * * @since 4.0.0 */ public function getContainer(): Container { return $this->arguments['container']; } } PK q��\z%n� ReshapeArgumentsAware.phpnu �[��� <?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; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * A Trait to reshape arguments maintaining b/c with legacy plugin events. * * Old plugin event handlers expect positional arguments, not named arguments, since they are simple * PHP methods, e.g. * public onExample($foo, $bar, $baz). * Concrete Event classes, however, use named arguments which can be passed in any order. The * following two examples are equivalent: * $event1 = new ConcreteEventClass('onExample', ['foo' => 1, 'bar' => 2, 'baz' => 3]; * $event2 = new ConcreteEventClass('onExample', ['bar' => 2, 'baz' => 3, 'foo' => 1,]; * However, this means that the internal $arguments property of the event object holds the named * arguments in a **different** order in each case. * * When the event handler is aware of the ConcreteEventClass it can retrieve named arguments and * all is good in the world. However, when you have a legacy plugin listener registered through * CMSPlugin::registerLegacyListener you have a major problem! The legacy listener is passing the * arguments **positionally**, in the order they were added to the Event object. * * In the previous example, $event1 would work as expected because the foo, bar, and baz arguments * were given in the same order legacy listeners expected them. On the other hand, $event2 would * fail miserably because the call order would be $bar, $baz, $foo which is NOT what the legacy * listener expected. * * The only way to fix that is to *reshape the argument* in the concrete event's constructor so that * the order of arguments is guaranteed to be the same as expected by legacy listeners. Moreover, * since Joomla is passing all arguments (except the 'result' argument) blindly to the legacy * listener we must ensure that a. all necessary arguments are set and b. any other named arguments * do NOT exist. Otherwise our legacy listeners would receive the wrong number of positional * arguments and break. * * All this is achieved by the reshapeArguments() method in this trait which has to be called in the * constructor of the concrete event class. * * This trait is marked as deprecated with a removal target of 5.0 because in Joomla 5 we will only * be using concrete event classes with named arguments, removing legacy listeners and their * positional arguments headaches. * * @since 4.2.0 * * @deprecated 4.3 will be removed in 6.0 * Will be removed without replacement */ trait ReshapeArgumentsAware { /** * Reshape the arguments array to preserve b/c with legacy listeners * * @param array $arguments The named arguments array passed to the constructor. * @param array $argumentNames The allowed argument names (mandatory AND optional). * @param array $defaults Default values for optional arguments. * * @return array The reshaped arguments. * * @since 4.2.0 */ protected function reshapeArguments(array $arguments, array $argumentNames, array $defaults = []) { $mandatoryKeys = array_diff($argumentNames, array_keys($defaults)); $currentKeys = array_keys($arguments); $missingKeys = array_diff($mandatoryKeys, $currentKeys); $extraKeys = array_diff($currentKeys, $argumentNames); // Am I missing any mandatory arguments? if ($missingKeys) { throw new \DomainException(sprintf('Missing arguments for ‘%s’ event: %s', $this->getName(), implode(', ', $missingKeys))); } // Do I have unknown arguments? if ($extraKeys) { throw new \DomainException(sprintf('Unknown arguments for ‘%s’ event: %s', $this->getName(), implode(', ', $missingKeys))); } // Reconstruct the arguments in the order specified in $argumentTypes $reconstructed = []; foreach ($argumentNames as $key) { $reconstructed[$key] = $arguments[$key] ?? $defaults[$key]; } // Return the reconstructed arguments array return $reconstructed; } } PK q��\�(� � BeforeExtensionBootEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event; use Joomla\DI\Container; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for representing the extensions's `onBeforeExtensionBoot` event * * @since 4.0.0 */ class BeforeExtensionBootEvent extends AbstractImmutableEvent { /** * Get the event's extension type. Can be: * - component * * @return string * * @since 4.0.0 */ public function getExtensionType(): string { return $this->getArgument('type'); } /** * Get the event's extension name. * * @return string * * @since 4.0.0 */ public function getExtensionName(): string { return $this->arguments['extensionName']; } /** * Get the event's container object * * @return Container * * @since 4.0.0 */ public function getContainer(): Container { return $this->arguments['container']; } } PK q��\ثǿ� � + Workflow/WorkflowFunctionalityUsedEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Workflow; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for Workflow Functionality Used events * * @since 4.0.0 */ class WorkflowFunctionalityUsedEvent extends AbstractEvent { /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException * * @since 4.0.0 */ public function __construct($name, array $arguments = []) { $arguments['used'] = false; parent::__construct($name, $arguments); } /** * Set used parameter to true * * @param bool $value The value to set * * @return void * * @since 4.0.0 */ public function setUsed($value = true) { $this->arguments['used'] = $value; if ($value === true) { $this->stopPropagation(); } } } PK q��\�jȡ� � $ Workflow/WorkflowTransitionEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Workflow; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for Workflow Functionality Used events * * @since 4.0.0 */ class WorkflowTransitionEvent extends AbstractEvent { /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException * * @since 4.0.0 */ public function __construct($name, array $arguments = []) { $arguments['stopTransition'] = false; parent::__construct($name, $arguments); } /** * Set used parameter to true * * @param bool $value The value to set * * @return void * * @since 4.0.0 */ public function setStopTransition($value = true) { $this->arguments['stopTransition'] = $value; if ($value === true) { $this->stopPropagation(); } } } PK q��\�qE7 7 Workflow/AbstractEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Workflow; use Joomla\CMS\Event\AbstractImmutableEvent; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for WebAsset events * * @since 4.0.0 */ abstract class AbstractEvent extends AbstractImmutableEvent { /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException * * @since 4.0.0 */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('subject', $arguments)) { throw new \BadMethodCallException("Argument 'subject' of event {$this->name} is required but has not been provided"); } if (!\array_key_exists('extension', $arguments)) { throw new \BadMethodCallException("Argument 'extension' of event {$this->name} is required but has not been provided"); } if (strpos($arguments['extension'], '.') === false) { throw new \BadMethodCallException("Argument 'extension' of event {$this->name} has wrong format. Valid format: 'component.section'"); } if (!\array_key_exists('extensionName', $arguments) || !\array_key_exists('section', $arguments)) { $parts = \explode('.', $arguments['extension']); $arguments['extensionName'] = $arguments['extensionName'] ?? $parts[0]; $arguments['section'] = $arguments['section'] ?? $parts[1]; } parent::__construct($name, $arguments); } } PK q��\���� � View/DisplayEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\View; use Joomla\CMS\Event\AbstractImmutableEvent; use Joomla\CMS\MVC\View\ViewInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for WebAsset events * * @since 4.0.0 */ class DisplayEvent extends AbstractImmutableEvent { /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException * * @since 4.0.0 */ public function __construct($name, array $arguments = []) { if (!isset($arguments['subject'])) { throw new \BadMethodCallException("Argument 'subject' of event {$this->name} is required but has not been provided"); } if (!($arguments['subject'] instanceof ViewInterface)) { throw new \BadMethodCallException("Argument 'subject' of event {$this->name} is not of type 'ViewInterface'"); } if (!isset($arguments['extension'])) { throw new \BadMethodCallException("Argument 'extension' of event {$this->name} is required but has not been provided"); } if (!isset($arguments['extension']) || !is_string($arguments['extension'])) { throw new \BadMethodCallException("Argument 'extension' of event {$this->name} is not of type 'string'"); } if (strpos($arguments['extension'], '.') === false) { throw new \BadMethodCallException("Argument 'extension' of event {$this->name} has wrong format. Valid format: 'component.section'"); } if (!\array_key_exists('extensionName', $arguments) || !\array_key_exists('section', $arguments)) { $parts = explode('.', $arguments['extension']); $arguments['extensionName'] = $arguments['extensionName'] ?? $parts[0]; $arguments['section'] = $arguments['section'] ?? $parts[1]; } parent::__construct($name, $arguments); } } PK q��\�lu�� � Model/BeforeBatchEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\Model; use Joomla\CMS\Event\AbstractImmutableEvent; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for modifying a table object before a batch event is applied * * @since 4.0.0 */ class BeforeBatchEvent extends AbstractImmutableEvent { /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException * * @since 4.0.0 */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('src', $arguments)) { throw new \BadMethodCallException("Argument 'src' is required for event $name"); } if (!\array_key_exists('type', $arguments)) { throw new \BadMethodCallException("Argument 'type' is required for event $name"); } parent::__construct($name, $arguments); } } PK q��\�.�{; ; WebAsset/AbstractEvent.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\WebAsset; use Joomla\CMS\Event\AbstractImmutableEvent; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for WebAsset events * * @since 4.0.0 */ abstract class AbstractEvent extends AbstractImmutableEvent { /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException * * @since 4.0.0 */ public function __construct($name, array $arguments = []) { if (!\array_key_exists('subject', $arguments)) { throw new \BadMethodCallException("Argument 'subject' of event {$this->name} is required but has not been provided"); } parent::__construct($name, $arguments); } } PK q��\�M��c c ) WebAsset/WebAssetRegistryAssetChanged.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Event\WebAsset; use Joomla\CMS\WebAsset\WebAssetItemInterface; use Joomla\CMS\WebAsset\WebAssetRegistryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for WebAssetRegistry "asset changed" events * * @since 4.0.0 */ class WebAssetRegistryAssetChanged extends AbstractEvent { /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws \BadMethodCallException * * @since 4.0.0 */ public function __construct($name, array $arguments = []) { parent::__construct($name, $arguments); // Check for required arguments if (!\array_key_exists('asset', $arguments) || !($arguments['asset'] instanceof WebAssetItemInterface)) { throw new \BadMethodCallException("Argument 'asset' of event $name is not of the expected type"); } if (!\array_key_exists('assetType', $arguments) || !is_string($arguments['assetType'])) { throw new \BadMethodCallException("Argument 'assetType' of event $name is not of the expected type"); } if (!\array_key_exists('change', $arguments) || !is_string($arguments['change'])) { throw new \BadMethodCallException("Argument 'change' of event $name is not of the expected type"); } } /** * Setter for the subject argument * * @param WebAssetRegistryInterface $value The value to set * * @return WebAssetRegistryInterface * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.0.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setSubject($value) { if (!$value || !($value instanceof WebAssetRegistryInterface)) { throw new \BadMethodCallException("Argument 'subject' of event {$this->name} is not of the expected type"); } return $value; } /** * Setter for the subject argument * * @param WebAssetRegistryInterface $value The value to set * * @return WebAssetRegistryInterface * * @throws \BadMethodCallException if the argument is not of the expected type * * @since 4.4.0 */ protected function onSetSubject($value) { return $this->setSubject($value); } /** * Return modified asset * * @return WebAssetItemInterface * * @since 4.0.0 */ public function getAsset(): WebAssetItemInterface { return $this->arguments['asset']; } /** * Return a type of modified asset * * @return string * * @since 4.0.0 */ public function getAssetType(): string { return $this->arguments['assetType']; } /** * Return a type of changes: new, remove, override * * @return string * * @since 4.0.0 */ public function getChange(): string { return $this->arguments['change']; } } PK q��\�D CoreEventAware.phpnu �[��� <?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; use Joomla\CMS\Event\Model\BeforeBatchEvent; use Joomla\CMS\Event\Plugin\System\Webauthn\Ajax as PlgSystemWebauthnAjax; use Joomla\CMS\Event\Plugin\System\Webauthn\AjaxChallenge as PlgSystemWebauthnAjaxChallenge; use Joomla\CMS\Event\Plugin\System\Webauthn\AjaxCreate as PlgSystemWebauthnAjaxCreate; use Joomla\CMS\Event\Plugin\System\Webauthn\AjaxDelete as PlgSystemWebauthnAjaxDelete; use Joomla\CMS\Event\Plugin\System\Webauthn\AjaxInitCreate as PlgSystemWebauthnAjaxInitCreate; use Joomla\CMS\Event\Plugin\System\Webauthn\AjaxLogin as PlgSystemWebauthnAjaxLogin; use Joomla\CMS\Event\Plugin\System\Webauthn\AjaxSaveLabel as PlgSystemWebauthnAjaxSaveLabel; use Joomla\CMS\Event\QuickIcon\GetIconEvent; use Joomla\CMS\Event\Table\AfterBindEvent; use Joomla\CMS\Event\Table\AfterCheckinEvent; use Joomla\CMS\Event\Table\AfterCheckoutEvent; use Joomla\CMS\Event\Table\AfterDeleteEvent; use Joomla\CMS\Event\Table\AfterHitEvent; use Joomla\CMS\Event\Table\AfterLoadEvent; use Joomla\CMS\Event\Table\AfterMoveEvent; use Joomla\CMS\Event\Table\AfterPublishEvent; use Joomla\CMS\Event\Table\AfterReorderEvent; use Joomla\CMS\Event\Table\AfterResetEvent; use Joomla\CMS\Event\Table\AfterStoreEvent; use Joomla\CMS\Event\Table\BeforeBindEvent; use Joomla\CMS\Event\Table\BeforeCheckinEvent; use Joomla\CMS\Event\Table\BeforeCheckoutEvent; use Joomla\CMS\Event\Table\BeforeDeleteEvent; use Joomla\CMS\Event\Table\BeforeHitEvent; use Joomla\CMS\Event\Table\BeforeLoadEvent; use Joomla\CMS\Event\Table\BeforeMoveEvent; use Joomla\CMS\Event\Table\BeforePublishEvent; use Joomla\CMS\Event\Table\BeforeReorderEvent; use Joomla\CMS\Event\Table\BeforeResetEvent; use Joomla\CMS\Event\Table\BeforeStoreEvent; use Joomla\CMS\Event\Table\CheckEvent; use Joomla\CMS\Event\Table\ObjectCreateEvent; use Joomla\CMS\Event\Table\SetNewTagsEvent; use Joomla\CMS\Event\View\DisplayEvent; use Joomla\CMS\Event\Workflow\WorkflowFunctionalityUsedEvent; use Joomla\CMS\Event\Workflow\WorkflowTransitionEvent; use Joomla\Event\Event; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Returns the most suitable event class for a Joomla core event name * * @since 4.2.0 */ trait CoreEventAware { /** * Maps event names to concrete Event classes. * * This is only for events with invariable names. Events with variable names are handled with * PHP logic in the getEventClassByEventName class. * * @var array * @since 4.2.0 */ private static $eventNameToConcreteClass = [ // Model 'onBeforeBatch' => BeforeBatchEvent::class, // Quickicon 'onGetIcon' => GetIconEvent::class, // Table 'onTableAfterBind' => AfterBindEvent::class, 'onTableAfterCheckin' => AfterCheckinEvent::class, 'onTableAfterCheckout' => AfterCheckoutEvent::class, 'onTableAfterDelete' => AfterDeleteEvent::class, 'onTableAfterHit' => AfterHitEvent::class, 'onTableAfterLoad' => AfterLoadEvent::class, 'onTableAfterMove' => AfterMoveEvent::class, 'onTableAfterPublish' => AfterPublishEvent::class, 'onTableAfterReorder' => AfterReorderEvent::class, 'onTableAfterReset' => AfterResetEvent::class, 'onTableAfterStore' => AfterStoreEvent::class, 'onTableBeforeBind' => BeforeBindEvent::class, 'onTableBeforeCheckin' => BeforeCheckinEvent::class, 'onTableBeforeCheckout' => BeforeCheckoutEvent::class, 'onTableBeforeDelete' => BeforeDeleteEvent::class, 'onTableBeforeHit' => BeforeHitEvent::class, 'onTableBeforeLoad' => BeforeLoadEvent::class, 'onTableBeforeMove' => BeforeMoveEvent::class, 'onTableBeforePublish' => BeforePublishEvent::class, 'onTableBeforeReorder' => BeforeReorderEvent::class, 'onTableBeforeReset' => BeforeResetEvent::class, 'onTableBeforeStore' => BeforeStoreEvent::class, 'onTableCheck' => CheckEvent::class, 'onTableObjectCreate' => ObjectCreateEvent::class, 'onTableSetNewTags' => SetNewTagsEvent::class, // View 'onBeforeDisplay' => DisplayEvent::class, 'onAfterDisplay' => DisplayEvent::class, // Workflow 'onWorkflowFunctionalityUsed' => WorkflowFunctionalityUsedEvent::class, 'onWorkflowAfterTransition' => WorkflowTransitionEvent::class, 'onWorkflowBeforeTransition' => WorkflowTransitionEvent::class, // Plugin: System, WebAuthn 'onAjaxWebauthn' => PlgSystemWebauthnAjax::class, 'onAjaxWebauthnChallenge' => PlgSystemWebauthnAjaxChallenge::class, 'onAjaxWebauthnCreate' => PlgSystemWebauthnAjaxCreate::class, 'onAjaxWebauthnDelete' => PlgSystemWebauthnAjaxDelete::class, 'onAjaxWebauthnInitcreate' => PlgSystemWebauthnAjaxInitCreate::class, 'onAjaxWebauthnLogin' => PlgSystemWebauthnAjaxLogin::class, 'onAjaxWebauthnSavelabel' => PlgSystemWebauthnAjaxSaveLabel::class, ]; /** * Get the concrete event class name for the given event name. * * This method falls back to the generic Joomla\Event\Event class if the event name is unknown * to this trait. * * @param string $eventName The event name * * @return string The event class name * @since 4.2.0 */ protected static function getEventClassByEventName(string $eventName): string { return self::$eventNameToConcreteClass[$eventName] ?? Event::class; } } PK q��\���f f QuickIcon/GetIconEvent.phpnu �[��� <?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\QuickIcon; use Joomla\CMS\Event\AbstractImmutableEvent; use Joomla\CMS\Event\ReshapeArgumentsAware; use Joomla\CMS\Event\Result\ResultAware; use Joomla\CMS\Event\Result\ResultAwareInterface; use Joomla\CMS\Event\Result\ResultTypeArrayAware; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Event class for the onGetIcon event. * * @since 4.2.0 */ class GetIconEvent extends AbstractImmutableEvent implements ResultAwareInterface { use ResultAware; use ResultTypeArrayAware; use ReshapeArgumentsAware; /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @since 4.2.0 * @throws \BadMethodCallException */ public function __construct(string $name, array $arguments = []) { $arguments = $this->reshapeArguments($arguments, ['context']); parent::__construct($name, $arguments); } /** * A method to validate the 'context' named parameter. * * @param string $value The calling context for retrieving icons. * * @return string * * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setContext(string $value) { if (empty($value)) { throw new \DomainException(sprintf("Argument 'context' of event %s must be a non-empty string.", $this->name)); } return $value; } /** * A method to validate the 'context' named parameter. * * @param string $value The calling context for retrieving icons. * * @return string * * @since 4.4.0 */ protected function onSetContext(string $value) { return $this->setContext($value); } } PK q��\���� � ! Result/ResultTypeIntegerAware.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for type checking. * * Events using this Trait (and the ResultAware trait) will expect event handlers to set results * of an Integer type. * * @since 4.2.0 */ trait ResultTypeIntegerAware { /** * Can the result attribute values also be NULL? * * @var boolean * @since 4.2.0 */ protected $resultIsNullable = false; /** * Can the result attribute values also be boolean FALSE? * * @var boolean * @since 4.2.0 * * @deprecated 4.3 will be removed in 6.0 * You should use nullable values or exceptions instead of returning boolean false results. */ protected $resultIsFalseable = false; /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void { if ($this->resultIsNullable && $data === null) { return; } if ($this->resultIsFalseable && $data === false) { return; } if (!is_int($data)) { throw new \InvalidArgumentException(sprintf('Event %s only accepts Integer results.', $this->getName())); } } } PK q��\J�;� � Result/ResultTypeMixedAware.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for type checking. * * Events using this Trait (and the ResultAware trait) will expect event handlers to set results * of a any type. THIS IS A COP OUT! If you expect a nullable or union type it's best to implement * the typeCheckResult method yourself to check for the exact types you expect. * * @since 4.2.0 */ trait ResultTypeMixedAware { /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void { // Intentionally left blank; no type check is performed. } } PK q��\G��� � ! Result/ResultTypeNumericAware.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for type checking. * * Events using this Trait (and the ResultAware trait) will expect event handlers to set results * of a Numeric type. * * @since 4.2.0 */ trait ResultTypeNumericAware { /** * Can the result attribute values also be NULL? * * @var boolean * @since 4.2.0 */ protected $resultIsNullable = false; /** * Can the result attribute values also be boolean FALSE? * * @var boolean * @since 4.2.0 * * @deprecated 4.3 will be removed in 6.0 * You should use nullable values or exceptions instead of returning boolean false results. */ protected $resultIsFalseable = false; /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void { if ($this->resultIsNullable && $data === null) { return; } if ($this->resultIsFalseable && $data === false) { return; } if (!is_numeric($data)) { throw new \InvalidArgumentException(sprintf('Event %s only accepts Numeric results.', $this->getName())); } } } PK q��\�3�m� � Result/ResultTypeFloatAware.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for type checking. * * Events using this Trait (and the ResultAware trait) will expect event handlers to set results * of a Float type. * * @since 4.2.0 */ trait ResultTypeFloatAware { /** * Can the result attribute values also be NULL? * * @var boolean * @since 4.2.0 */ protected $resultIsNullable = false; /** * Can the result attribute values also be boolean FALSE? * * @var boolean * @since 4.2.0 * * @deprecated 4.3 will be removed in 6.0 * You should use nullable values or exceptions instead of returning boolean false results. */ protected $resultIsFalseable = false; /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void { if ($this->resultIsNullable && $data === null) { return; } if ($this->resultIsFalseable && $data === false) { return; } if (!is_float($data)) { throw new \InvalidArgumentException(sprintf('Event %s only accepts Float results.', $this->getName())); } } } PK q��\^U�R R ! Result/ResultTypeBooleanAware.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for type checking. * * Events using this Trait (and the ResultAware trait) will expect event handlers to set results * of a Boolean type. * * @since 4.2.0 */ trait ResultTypeBooleanAware { /** * Can the result attribute values also be NULL? * * @var boolean * @since 4.2.0 */ protected $resultIsNullable = false; /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void { if ($this->resultIsNullable && $data === null) { return; } if (!is_bool($data)) { throw new \InvalidArgumentException(sprintf('Event %s only accepts Boolean results.', $this->getName())); } } } PK q��\o82� � Result/ResultTypeStringAware.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for type checking. * * Events using this Trait (and the ResultAware trait) will expect event handlers to set results * of a String type. * * @since 4.2.0 */ trait ResultTypeStringAware { /** * Can the result attribute values also be NULL? * * @var boolean * @since 4.2.0 */ protected $resultIsNullable = false; /** * Can the result attribute values also be boolean FALSE? * * @var boolean * @since 4.2.0 * * @deprecated 4.3 will be removed in 6.0 * You should use nullable values or exceptions instead of returning boolean false results. */ protected $resultIsFalseable = false; /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void { if ($this->resultIsNullable && $data === null) { return; } if ($this->resultIsFalseable && $data === false) { return; } if (!is_string($data)) { throw new \InvalidArgumentException(sprintf('Event %s only accepts String results.', $this->getName())); } } } PK q��\tX�RA A Result/ResultAwareInterface.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Defines an Event which has an append-only array argument named 'result'. * * This is used for Events whose handlers are expected to return something when called, similar to * how many plugin events worked in earlier versions of Joomla. * * This interface is partially implemented by the ResultAware trait. The typeCheckResult method is * implemented by the various ResultType*Aware traits. Your event needs to use both the ResultAware * trait and one of the ResultType*Aware traits. For example, if your event returns boolean results * you need to use the ResultAware and ResultTypeBooleanAware traits in your event. * * @since 4.2.0 */ interface ResultAwareInterface { /** * Appends data to the result array of the event. * * @param mixed $data What to add to the result array. * * @return void * @since 4.2.0 */ public function addResult($data): void; /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void; } PK q��\�I(�� � Result/ResultTypeArrayAware.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for type checking. * * Events using this Trait (and the ResultAware trait) will expect event handlers to set results * of an Array type. * * @since 4.2.0 */ trait ResultTypeArrayAware { /** * Can the result attribute values also be NULL? * * @var boolean * @since 4.2.0 */ protected $resultIsNullable = false; /** * Can the result attribute values also be boolean FALSE? * * @var boolean * @since 4.2.0 * * @deprecated 4.3 will be removed in 6.0 * You should use nullable values or exceptions instead of returning boolean false results. */ protected $resultIsFalseable = false; /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void { if ($this->resultIsNullable && $data === null) { return; } if ($this->resultIsFalseable && $data === false) { return; } if (!is_array($data)) { throw new \InvalidArgumentException(sprintf('Event %s only accepts Array results.', $this->getName())); } } } PK q��\1R�r Result/ResultTypeObjectAware.phpnu �[��� <?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\Result; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for type checking. * * Events using this Trait (and the ResultAware trait) will expect event handlers to set results * of an object type. * * If you do not set a list of acceptable result classes any PHP object will satisfy this type check. * * @since 4.2.0 */ trait ResultTypeObjectAware { /** * Can the result attribute values also be NULL? * * @var boolean * @since 4.2.0 */ protected $resultIsNullable = false; /** * Can the result attribute values also be boolean FALSE? * * @var boolean * @since 4.2.0 * * @deprecated 4.3 will be removed in 6.0 * You should use nullable values or exceptions instead of returning boolean false results. */ protected $resultIsFalseable = false; /** * Acceptable class names for result values. * * @var array * @since 4.2.0 */ protected $resultAcceptableClasses = []; /** * Checks the type of the data being appended to the result argument. * * @param mixed $data The data to type check * * @return void * @throws \InvalidArgumentException * * @internal * @since 4.2.0 */ public function typeCheckResult($data): void { if ($this->resultIsNullable && $data === null) { return; } if ($this->resultIsFalseable && $data === false) { return; } if (!is_object($data)) { throw new \InvalidArgumentException(sprintf('Event %s only accepts object results.', $this->getName())); } if (empty($this->resultAcceptableClasses)) { return; } foreach ($this->resultAcceptableClasses as $className) { if (is_a($data, $className)) { return; } } $acceptableTypes = implode(', ', $this->resultAcceptableClasses); $messageTemplate = 'Event %s only accepts object results which are instances of one of %s.'; throw new \InvalidArgumentException(sprintf($messageTemplate, $this->getName(), $acceptableTypes)); } } PK q��\�%�n� � Result/ResultAware.phpnu �[��� <?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\Result; use BadMethodCallException; use Joomla\Event\Event as BaseEvent; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * This Trait partially implements the ResultAwareInterface for mutable and immutable events. * * You must additionally implement the typeCheckResult method or use one of the ResultType*Aware * traits in your Event handler. * * @since 4.2.0 */ trait ResultAware { /** * Disallow setting the result argument directly with setArgument() instead of going through addResult(). * * You should set this to true ONLY for event names which did NOT exist before Joomla 4.2.0 * or if you are a third party developer introducing new event names for use only in your software. * * @var boolean * @since 4.2.0 * * @deprecated 4.3 will be removed in 6.0 * Using setResult() for the result argument will always be disallowed. */ protected $preventSetArgumentResult = false; /** * Appends data to the result array of the event. * * @param mixed $data What to add to the result array. * * @return void * @since 4.2.0 */ public function addResult($data): void { // Ensure this trait is applied to an Event object. if (!($this instanceof BaseEvent)) { throw new \LogicException(sprintf('Event class ‘%s‘ must implement %s.', get_class($this), BaseEvent::class)); } // Ensure the Event object fully implements the ResultAwareInterface. if (!($this instanceof ResultAwareInterface)) { throw new \LogicException(sprintf('Event class ‘%s‘ must implement %s.', get_class($this), ResultAwareInterface::class)); } // Make sure the data type is correct $this->typeCheckResult($data); // Append the result. We use the arguments property directly to allow this to work on immutable events. $this->arguments['result'] = $this->arguments['result'] ?? []; $this->arguments['result'][] = $data; } /** * Handle setting the result argument directly. * * This method serves a dual purpose: backwards compatibility and enforcing the use of addResult. * * When $this->preventSetArgumentResult is false it acts as a backwards compatibility shim for * event handlers expecting generic event classes instead of the concrete Events implemented in * this package. This allows the migration to concrete event classes throughout the lifetime of * Joomla 4.x. * * When $this->preventSetArgumentResult is false (which will always be the case on Joomla 5.0) * it will throw a BadMethodCallException if the developer tries to call setArgument('result', ...) * instead of going through the addResult() method. * * @param array $value The new result array. * * @return array * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setResult(array $value) { if ($this->preventSetArgumentResult) { throw new \BadMethodCallException('You are not allowed to set the result argument directly. Use addResult() instead.'); } // Always assume that the last element of the array is the result the handler is trying to append. $latestValue = array_pop($value); $this->addResult($latestValue); return $this->arguments['result']; } /** * Handle setting the result argument directly. * * This method serves a dual purpose: backwards compatibility and enforcing the use of addResult. * * When $this->preventSetArgumentResult is false it acts as a backwards compatibility shim for * event handlers expecting generic event classes instead of the concrete Events implemented in * this package. This allows the migration to concrete event classes throughout the lifetime of * Joomla 4.x. * * When $this->preventSetArgumentResult is false (which will always be the case on Joomla 5.0) * it will throw a BadMethodCallException if the developer tries to call setArgument('result', ...) * instead of going through the addResult() method. * * @param array $value The new result array. * * @return array * @since 4.4.0 */ protected function onSetResult(array $value) { return $this->setResult($value); } } PK q��\)�"� � MultiFactor/Captive.phpnu �[��� PK q��\5N�� � � MultiFactor/NotifyActionLog.phpnu �[��� PK q��\v-�C� � � MultiFactor/GetMethod.phpnu �[��� PK q��\gI�Z� � � MultiFactor/SaveSetup.phpnu �[��� PK q��\�~Ls� � "