signal = new Signal($signo); $this->signal->setHandler([ $this, "onSignal" ]); } public function onSignal() { $this->trapped = true; } public function isTrapped($reset=true):bool { if ($this->trapped) { $reset && ($this->trapped = false); return true; } return false; } }