src/Process/Signals.php
public function executeListener($signal, $exit = true)
    {
        $return = null;

        if (isset($this->listeners[$signal])) {
            $return = call_user_func_array($this->listeners[$signal], [$signal]);
        }

        if (true === $exit) {
            // exit the application
            posix_kill(posix_getpid(), SIGKILL);
        }

        return $return;
    }
public function executeListener($signal, $exit = true)
    {
        $return = null;

        if (isset($this->listeners[$signal])) {
            $return = call_user_func_array($this->listeners[$signal], [$signal]);
        }

        if (true === $exit) {
            // exit the application
            posix_kill(posix_getpid(), SIGKILL);
        }

        return $return;
    }
public function executeListener ( $ signal , $ exit = true ) { $ return = null ; if ( isset ( $ this -> listeners [ $ signal ] ) ) { $ return = call_user_func_array ( $ this -> listeners [ $ signal ] , [ $ signal ] ) ; } if ( true === $ exit ) { // exit the application posix_kill ( posix_getpid ( ) , SIGKILL ) ; } return $ return ; }
Method which is executed when a signal is received

@param int  $signal signal Id
@param bool $exit

@return mixed
Method which is executed when a signal is received