Improved quality of docblock comments
This commit is contained in:
@@ -7,17 +7,34 @@ class Signal
|
||||
{
|
||||
private $signo;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param integer $signo
|
||||
*/
|
||||
public function __construct(int $signo)
|
||||
{
|
||||
$this->signo = $signo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a signal handler, overwriting any previous handler
|
||||
*
|
||||
* @param callable $handler
|
||||
* @return void
|
||||
*/
|
||||
public function setHandler(callable $handler):void
|
||||
{
|
||||
pcntl_signal($this->signo, $handler);
|
||||
}
|
||||
|
||||
public function dispatch($pid=null):bool
|
||||
/**
|
||||
* Dispatch the signal to the specified pid. Default is own pid
|
||||
*
|
||||
* @param int $pid
|
||||
* @return boolean
|
||||
*/
|
||||
public function dispatch(int $pid=null):bool
|
||||
{
|
||||
return posix_kill($pid?:posix_getpid(), $this->signo);
|
||||
}
|
||||
|
Reference in New Issue
Block a user