src/SAREhub/Commons/Process/PcntlSignals.php
public function handle($signal, $handler, $namespace = self::DEFAULT_NAMESPACE)
    {
        if (empty($this->handlers[$signal])) {
            $this->handlers[$signal] = [];
        }

        if (empty($this->handlers[$signal][$namespace])) {
            $this->handlers[$signal][$namespace] = [];
        }

        $this->handlers[$signal][$namespace][] = $handler;

        return $this;
    }
public function handle($signal, $handler, $namespace = self::DEFAULT_NAMESPACE)
    {
        if (empty($this->handlers[$signal])) {
            $this->handlers[$signal] = [];
        }

        if (empty($this->handlers[$signal][$namespace])) {
            $this->handlers[$signal][$namespace] = [];
        }

        $this->handlers[$signal][$namespace][] = $handler;

        return $this;
    }
public function handle ( $ signal , $ handler , $ namespace = self :: DEFAULT_NAMESPACE ) { if ( empty ( $ this -> handlers [ $ signal ] ) ) { $ this -> handlers [ $ signal ] = [ ] ; } if ( empty ( $ this -> handlers [ $ signal ] [ $ namespace ] ) ) { $ this -> handlers [ $ signal ] [ $ namespace ] = [ ] ; } $ this -> handlers [ $ signal ] [ $ namespace ] [ ] = $ handler ; return $ this ; }
Registers handler for signal in selected namespace.
@param int $signal Signal id (\SIG* constants)
@param callable $handler Handler callback
@param string $namespace
@return $this
Registers handler for signal in selected namespace .