[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/console/src/Event/ -> TerminateEvent.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\Console\ConsoleEvents;
  14  
  15  /**
  16   * Event triggered immediately before the process is terminated.
  17   *
  18   * @since  2.0.0
  19   */
  20  class TerminateEvent extends ConsoleEvent
  21  {
  22      /**
  23       * The exit code to use for the application.
  24       *
  25       * @var    integer
  26       * @since  2.0.0
  27       */
  28      private $exitCode;
  29  
  30      /**
  31       * Event constructor.
  32       *
  33       * @param   integer               $exitCode     The Throwable object with the error data.
  34       * @param   Application           $application  The active application.
  35       * @param   AbstractCommand|null  $command      The command being executed.
  36       *
  37       * @since   2.0.0
  38       */
  39  	public function __construct(int $exitCode, Application $application, ?AbstractCommand $command = null)
  40      {
  41          parent::__construct(ConsoleEvents::TERMINATE, $application, $command);
  42  
  43          $this->exitCode = $exitCode;
  44      }
  45  
  46      /**
  47       * Gets the exit code.
  48       *
  49       * @return  integer
  50       *
  51       * @since   2.0.0
  52       */
  53  	public function getExitCode(): int
  54      {
  55          return $this->exitCode;
  56      }
  57  
  58      /**
  59       * Sets the exit code.
  60       *
  61       * @param   integer  $exitCode  The command exit code.
  62       *
  63       * @return  void
  64       *
  65       * @since   2.0.0
  66       */
  67  	public function setExitCode(int $exitCode): void
  68      {
  69          $this->exitCode = $exitCode;
  70      }
  71  }


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