CoreFiles by mySites.guru
ErrorEvent.php62 lines, 1,281 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
74dc14498cd9eaedb710479467610891
sha1
7394887385dc416bfb4bf32f2203167246da5bf6
sha256
a44bd37678927f40062e3e14d92ac0ea930dd5fd993609b2fd85c4f7fc4bb3c7
<?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
 */

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);
    }
}

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