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

Breadcrumb

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

function PEAR_Exception::signal

Send a signal to all observers

Return value

void

1 call to PEAR_Exception::signal()
PEAR_Exception::__construct in vendor/pear/pear_exception/PEAR/Exception.php
Supported signatures:

File

vendor/pear/pear_exception/PEAR/Exception.php, line 193

Class

PEAR_Exception
Base PEAR_Exception Class

Code

protected function signal() {
    foreach (self::$_observers as $func) {
        if (is_callable($func)) {
            call_user_func($func, $this);
            continue;
        }
        settype($func, 'array');
        switch ($func[0]) {
            case self::OBSERVER_PRINT:
                $f = isset($func[1]) ? $func[1] : '%s';
                printf($f, $this->getMessage());
                break;
            case self::OBSERVER_TRIGGER:
                $f = isset($func[1]) ? $func[1] : E_USER_NOTICE;
                trigger_error($this->getMessage(), $f);
                break;
            case self::OBSERVER_DIE:
                $f = isset($func[1]) ? $func[1] : '%s';
                die(printf($f, $this->getMessage()));
                break;
            default:
                trigger_error('invalid observer type', E_USER_WARNING);
        }
    }
}

API Navigation

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