protected function placeHandler($signalNumber, callable $handler, $placement)
    {
        if (! isset($this->handlers[$signalNumber])) {
            $this->handlers[$signalNumber] = [];
            $this->registerHandler($signalNumber, $this);
        }

        switch ($placement) {
            case 'set':
                $this->handlers[$signalNumber] = [$handler];
                break;

            case 'append':
                array_push($this->handlers[$signalNumber], $handler);
                break;

            case 'prepend':
                array_unshift($this->handlers[$signalNumber], $handler);
                break;
        }
    }
protected function placeHandler($signalNumber, callable $handler, $placement)
    {
        if (! isset($this->handlers[$signalNumber])) {
            $this->handlers[$signalNumber] = [];
            $this->registerHandler($signalNumber, $this);
        }

        switch ($placement) {
            case 'set':
                $this->handlers[$signalNumber] = [$handler];
                break;

            case 'append':
                array_push($this->handlers[$signalNumber], $handler);
                break;

            case 'prepend':
                array_unshift($this->handlers[$signalNumber], $handler);
                break;
        }
    }
protected function placeHandler ( $ signalNumber , callable $ handler , $ placement ) { if ( ! isset ( $ this -> handlers [ $ signalNumber ] ) ) { $ this -> handlers [ $ signalNumber ] = [ ] ; $ this -> registerHandler ( $ signalNumber , $ this ) ; } switch ( $ placement ) { case 'set' : $ this -> handlers [ $ signalNumber ] = [ $ handler ] ; break ; case 'append' : array_push ( $ this -> handlers [ $ signalNumber ] , $ handler ) ; break ; case 'prepend' : array_unshift ( $ this -> handlers [ $ signalNumber ] , $ handler ) ; break ; } }
Define a callback handler for the given signal.

@param int      $signalNumber Signal number.
@param callable $handler      The signal handler.
@param string   $placement    Placement of handler ("set", "append" or "prepend").
Define a callback handler for the given signal .