Improved quality of docblock comments

This commit is contained in:
2018-04-15 22:08:19 +02:00
parent 20b6f1d42c
commit 31634c5054
9 changed files with 132 additions and 7 deletions

View File

@ -9,6 +9,13 @@ class SignalHandler
private $callbacks;
/**
* Constructor, should only be called once for each signal but can have
* multiple handlers attached.
*
* @param integer $signo
* @param array $callbacks
*/
public function __construct(int $signo, array $callbacks=[])
{
$this->signo = $signo;
@ -21,11 +28,23 @@ class SignalHandler
}
/**
* Append a handler to the signal
*
* @param callable $handler
* @return void
*/
public function addHandler(callable $handler):void
{
$this->callbacks[] = $handler;
}
/**
* Callback for signals
*
* @param int $signo
* @return void
*/
public function onSignal($signo)
{
foreach ($this->callbacks as $callback) {