Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Event.php

class Event

Same name in this branch
  1. 11.1.x vendor/open-telemetry/sdk/Trace/Event.php \OpenTelemetry\SDK\Trace\Event
  2. 11.1.x vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span/Event.php \Opentelemetry\Proto\Trace\V1\Span\Event
  3. 11.1.x vendor/composer/composer/src/Composer/EventDispatcher/Event.php \Composer\EventDispatcher\Event
  4. 11.1.x vendor/symfony/event-dispatcher-contracts/Event.php \Symfony\Contracts\EventDispatcher\Event
  5. 11.1.x core/lib/Drupal/Component/EventDispatcher/Event.php \Drupal\Component\EventDispatcher\Event

The script event class

@author François Pluchino <francois.pluchino@opendisplay.com> @author Nils Adermann <naderman@naderman.de>

Hierarchy

  • class \Composer\EventDispatcher\Event
    • class \Composer\Script\Event extends \Composer\EventDispatcher\Event

Expanded class hierarchy of Event

12 files declare their use of Event
ComponentGenerator.php in composer/Generator/ComponentGenerator.php
Composer.php in composer/Composer.php
Composer.php in core/lib/Drupal/Core/Composer/Composer.php
EventDispatcher.php in vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php
MessagePlugin.php in composer/Plugin/ProjectMessage/MessagePlugin.php

... See full list

3 string references to 'Event'
DatabaseBackend::schemaDefinition in core/lib/Drupal/Core/Flood/DatabaseBackend.php
Defines the schema for the flood table.
EventDriver::isSupported in vendor/revolt/event-loop/src/EventLoop/Driver/EventDriver.php
PerformanceTestRecorder::onRouteBuilderFinish in core/lib/Drupal/Core/Test/PerformanceTestRecorder.php
Records a router rebuild.

File

vendor/composer/composer/src/Composer/Script/Event.php, line 25

Namespace

Composer\Script
View source
class Event extends BaseEvent {
    
    /**
     * @var Composer The composer instance
     */
    private $composer;
    
    /**
     * @var IOInterface The IO instance
     */
    private $io;
    
    /**
     * @var bool Dev mode flag
     */
    private $devMode;
    
    /**
     * @var BaseEvent|null
     */
    private $originatingEvent;
    
    /**
     * Constructor.
     *
     * @param string $name The event name
     * @param Composer $composer The composer object
     * @param IOInterface $io The IOInterface object
     * @param bool $devMode Whether or not we are in dev mode
     * @param array<string|int|float|bool|null> $args Arguments passed by the user
     * @param mixed[] $flags Optional flags to pass data not as argument
     */
    public function __construct(string $name, Composer $composer, IOInterface $io, bool $devMode = false, array $args = [], array $flags = []) {
        parent::__construct($name, $args, $flags);
        $this->composer = $composer;
        $this->io = $io;
        $this->devMode = $devMode;
    }
    
    /**
     * Returns the composer instance.
     */
    public function getComposer() : Composer {
        return $this->composer;
    }
    
    /**
     * Returns the IO instance.
     */
    public function getIO() : IOInterface {
        return $this->io;
    }
    
    /**
     * Return the dev mode flag
     */
    public function isDevMode() : bool {
        return $this->devMode;
    }
    
    /**
     * Set the originating event.
     *
     * @return ?BaseEvent
     */
    public function getOriginatingEvent() : ?BaseEvent {
        return $this->originatingEvent;
    }
    
    /**
     * Set the originating event.
     *
     * @return $this
     */
    public function setOriginatingEvent(BaseEvent $event) : self {
        $this->originatingEvent = $this->calculateOriginatingEvent($event);
        return $this;
    }
    
    /**
     * Returns the upper-most event in chain.
     */
    private function calculateOriginatingEvent(BaseEvent $event) : BaseEvent {
        if ($event instanceof Event && $event->getOriginatingEvent()) {
            return $this->calculateOriginatingEvent($event->getOriginatingEvent());
        }
        return $event;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
Event::$args protected property
Event::$composer private property
Event::$devMode private property
Event::$flags protected property
Event::$io private property
Event::$name protected property
Event::$originatingEvent private property
Event::$propagationStopped private property
Event::calculateOriginatingEvent private function Returns the upper-most event in chain.
Event::getArguments public function Returns the event&#039;s arguments.
Event::getComposer public function Returns the composer instance.
Event::getFlags public function Returns the event&#039;s flags.
Event::getIO public function Returns the IO instance.
Event::getName public function Returns the event&#039;s name.
Event::getOriginatingEvent public function Set the originating event.
Event::isDevMode public function Return the dev mode flag
Event::isPropagationStopped public function Checks if stopPropagation has been called
Event::setOriginatingEvent public function Set the originating event.
Event::stopPropagation public function Prevents the event from being passed to further listeners
Event::__construct public function Constructor. Overrides Event::__construct

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal