[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/console/src/Event/ -> ConsoleEvent.php (source)

   1  <?php
   2  /**
   3   * Part of the Joomla Framework Console Package
   4   *
   5   * @copyright  Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE
   7   */
   8  
   9  namespace Joomla\Console\Event;
  10  
  11  use Joomla\Console\Application;
  12  use Joomla\Console\Command\AbstractCommand;
  13  use Joomla\Event\Event;
  14  
  15  /**
  16   * Base event class for console events.
  17   *
  18   * @since  2.0.0
  19   */
  20  class ConsoleEvent extends Event
  21  {
  22      /**
  23       * The active application.
  24       *
  25       * @var    Application
  26       * @since  2.0.0
  27       */
  28      private $application;
  29  
  30      /**
  31       * The command being executed.
  32       *
  33       * @var    AbstractCommand|null
  34       * @since  2.0.0
  35       */
  36      private $command;
  37  
  38      /**
  39       * Event constructor.
  40       *
  41       * @param   string                $name         The event name.
  42       * @param   Application           $application  The active application.
  43       * @param   AbstractCommand|null  $command      The command being executed.
  44       *
  45       * @since   2.0.0
  46       */
  47  	public function __construct(string $name, Application $application, ?AbstractCommand $command = null)
  48      {
  49          parent::__construct($name);
  50  
  51          $this->application = $application;
  52          $this->command     = $command;
  53      }
  54  
  55      /**
  56       * Get the active application.
  57       *
  58       * @return  Application
  59       *
  60       * @since   2.0.0
  61       */
  62  	public function getApplication(): Application
  63      {
  64          return $this->application;
  65      }
  66  
  67      /**
  68       * Get the command being executed.
  69       *
  70       * @return  AbstractCommand|null
  71       *
  72       * @since   2.0.0
  73       */
  74  	public function getCommand(): ?AbstractCommand
  75      {
  76          return $this->command;
  77      }
  78  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer