protected function handle($signal, $handler, $placement)
    {
        declare (ticks = 1);

        $signalNumber = $this->translateSignal($signal);

        if (is_int($handler) && in_array($handler, [SIG_IGN, SIG_DFL])) {
            unset($this->handlers[$signalNumber]);
            $this->registerHandler($signalNumber, $handler);

            return;
        }

        $this->placeHandler($signalNumber, $handler, $placement);
    }
protected function handle($signal, $handler, $placement)
    {
        declare (ticks = 1);

        $signalNumber = $this->translateSignal($signal);

        if (is_int($handler) && in_array($handler, [SIG_IGN, SIG_DFL])) {
            unset($this->handlers[$signalNumber]);
            $this->registerHandler($signalNumber, $handler);

            return;
        }

        $this->placeHandler($signalNumber, $handler, $placement);
    }
protected function handle ( $ signal , $ handler , $ placement ) { declare ( ticks = 1 ) ; $ signalNumber = $ this -> translateSignal ( $ signal ) ; if ( is_int ( $ handler ) && in_array ( $ handler , [ SIG_IGN , SIG_DFL ] ) ) { unset ( $ this -> handlers [ $ signalNumber ] ) ; $ this -> registerHandler ( $ signalNumber , $ handler ) ; return ; } $ this -> placeHandler ( $ signalNumber , $ handler , $ placement ) ; }
Define a handler for the given signal.

@param string|int   $signal    Signal name, PCNTL constant name or PCNTL constant value.
@param callable|int $handler   The signal handler.
@param string       $placement Placement of handler ("set", "append" or "prepend").
Define a handler for the given signal .