Calls a handler method to report a message

@param string $op The handler constant
@param null|string $data Data required by the handler
194260
public function report($op, $data)
    {
        if ($this->logger || $this->debug) {
            call_user_func(array($this, 'report'.$op), $data);
        }
    }
666857
protected function handle(Handler $handler, Notification $notification)
    {
        try {
            $handler->handle($notification);
            $this->write("RESULT 2\nOK");
        } catch (EventHandlingFailed $e) {
            $this->write("RESULT 4\nFAIL");
        } catch (StopListener $e) {
            $this->listen = false;
        }
    }
748525
public function postPersistNewEvent(Operation $operation, $content = null)
    {
        $this->publishNow($operation);
        $this->em->persist($content);
        $this->em->flush();
    }
1262898
public function notify($event, $payload)
    {
        $result = null;

        foreach ($this->handlers as $condition => $handlers) {
            if ('*' === $condition || ($condition & $event) === $event) {
                foreach ($handlers as $handler) {
                    if ($clause = $this->clauses[spl_object_hash((object) $handler)] ?? null) {
                        if ($clause->intercepted($payload)) {
                            continue;
                        }
                    }
                    $response = $this->callHandler($handler, $payload);

                    switch (true) {
                        case $response instanceof TerminateResult:
                            return $response->content;
                        case true === $response:
                            continue 2;
                        case false === $response:
                            break 2;
                        case !empty($response) && !($result instanceof FinallyResult):
                            $result = $response;
                    }
                }
            }
        }

        return $result instanceof FinallyResult ? $result->content : $result;
    }
1187652
public function callHook(string $name, OperationInterface $operation)
    {
        if (!self::hasHook($name)) {
            return $operation;
        }

        $hook = $this->hooks[$name];

        return call_user_func($hook, $operation);
    }
1335398
public static function signal_handler($signo) {
        // Note: There is no need to manually call the shutdown handler.
        // The fact that we are calling exit() in this script means that the standard shutdown handling is performed
        // anyway.
        switch ($signo) {
            case SIGTERM:
                // Replicate native behaviour.
                echo "Terminated: {$signo}\n";

                // The standard exit code for SIGTERM is 143.
                $exitcode = 143;
                break;
            case SIGINT:
                // Replicate native behaviour.
                echo "\n";

                // The standard exit code for SIGINT (Ctrl+C) is 130.
                $exitcode = 130;
                break;
            default:
                // The signal handler was called with a signal it was not expecting.
                // We should exit and complain.
                echo "Warning: \core_shutdown_manager::signal_handler() was called with an unexpected signal ({$signo}).\n";
                $exitcode = 1;
        }

        exit ($exitcode);
    }
631421
public function addHandler($operation, callable $callback)
    {
        $this->handlers[$operation] = $callback;
        $this->addOperation($operation);
    }
1252084
public function output($data = null, $status = 200)
    {
        $this->getContext()->getOutput()->output($data, $status);
    }
464380
public function signalReceived($signal): void
    {
        $form = $this->getForm();
        /** @var Presenter $presenter */
        $presenter = $this->getPresenter();
        $request = $presenter->getRequest();

        switch ($signal) {
            case 'submit':
                $this->processSubmit($form, $request);
                break;
            case 'validate':
                $this->processValidate($form, $request);
                break;
            case 'render':
                $this->processRender($form, $request);
                break;
            default:
                throw new BadSignalException(
                    sprintf('Missing handler for signal "%s" in %s.', $signal, get_class($this))
                );
        }
    }
480620
protected function runLongOperation($op, $method = 'post', array $body = [])
    {
        $result = $this->runOperation($op, $method, $body);
        $activities = $result->getActivities();
        if (count($activities) !== 1) {
            trigger_error(sprintf("Expected one activity, found %d", count($activities)), E_USER_WARNING);
        }

        return reset($activities);
    }
674261
public function call(string $event, $data = null)
    {
        if (! $this->eventExists($event)) {
            return null;
        }

        // inject request param on connect event
        $isConnect = $event === static::EVENT_CONNECT;
        $dataKey = $isConnect ? 'request' : 'data';

        // dispatch request to pipeline if middleware are set
        if ($isConnect && count($this->middleware)) {
            $data = $this->setRequestThroughMiddleware($data);
        }

        return App::call($this->callbacks[$event], [
            'websocket' => $this,
            $dataKey => $data,
        ]);
    }
266777
public function run(OperationHandlerContract $handler, ExtensionContract $extension, array $flags = []) {
        try {
            $name = $extension->getPackage()->getName();

            if($this->componentsRepository->isRequired($name)) {
                throw new ExtensionException('The package [' . $name . '] cannot be deactivated due is required for whole system.');
            }

            $handler->operationInfo(new Operation('Deactivating the [' . $name . '] extension.'));
            $this->dispatcher->fire(new ComponentDeactivating($extension));
            $this->aclMigration->down($name);

            $this->extensionsRepository->save($extension, [
                'status' => ExtensionContract::STATUS_INSTALLED,
            ]);

            $this->dispatcher->fire(new ComponentDeactivated($extension));

            $operation = new Operation('The package [' . $name . '] has been successfully deactivated.');

            return $handler->operationSuccess($operation);
        }
        catch(\Exception $e) {
            Log::error($e);
            $this->dispatcher->fire(new ComponentInstallationFailed($extension, $e));

            return $handler->operationFailed(new Operation($e->getMessage()));
        }
    }
437254
public function render($tpl, array $data = [], $status = null)
    {
        if ($this->view === null) {
            $this->view = $this->view();
        }
        if ($status !== null) {
            $this->res->setStatus($status)->send();
        }
        $this->view->display($tpl, $data);
    }
1214871
public function onEvent(Event $event = null)
    {
        while (!empty($this->messages)) {
            $message = array_shift($this->messages);

            $this->handle($message, $this->dispatcher);
        }
    }
720901
public function signalReceived($signal)
	{
		if (!$this->tryCall($this->formatSignalMethod($signal), $this->params)) {
			$class = get_class($this);
			throw new BadSignalException("There is no handler for signal '$signal' in class $class.");
		}
	}
79379
function reportInfo(errorHandler, msg) {

        if (errorHandler && errorHandler.info && errorHandler.info(msg))
            throw msg;

    }
1279976
function mod($data, $op = null) {
		if (!($this->data instanceof Expr)) {
			$this->data = new Expr($this->name);
		}
		
		if ($data instanceof Expr) {
			$this->data->add($data);
		} elseif (!isset($op) && is_numeric($data)) {
			$this->data->add(new Expr("+ $data"));
		} else {
			$this->data->add(new Expr("%s %s", isset($op) ? $op : "||", $data));
		}
		
		return $this;
	}