Added __invoke() to SignalTrap and fixed phpunit xml
This commit is contained in:
parent
e8c4a85486
commit
c855f92ecd
@ -9,8 +9,15 @@ use NoccyLabs\Ipc\Signal\SignalTrap;
|
|||||||
$trap = new SignalTrap(SIGINT);
|
$trap = new SignalTrap(SIGINT);
|
||||||
echo "Press ctrl-c...\n";
|
echo "Press ctrl-c...\n";
|
||||||
|
|
||||||
while (!$trap->isTrapped()) {
|
while (!$trap->isTrapped(true)) {
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Thanks!\n";
|
echo "Thanks!\n";
|
||||||
|
echo "And once more...\n";
|
||||||
|
|
||||||
|
while (!$trap(true)) {
|
||||||
|
usleep(10000);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Thanks!\n";
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
beStrictAboutTestsThatDoNotTestAnything="true"
|
beStrictAboutTestsThatDoNotTestAnything="true"
|
||||||
beStrictAboutTodoAnnotatedTests="true"
|
beStrictAboutTodoAnnotatedTests="true"
|
||||||
verbose="true">
|
verbose="true">
|
||||||
<testsuite>
|
<testsuite name="default">
|
||||||
<directory suffix="Test.php">tests</directory>
|
<directory suffix="Test.php">tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
|
||||||
|
@ -45,4 +45,9 @@ class SignalTrap
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public function __invoke($reset=true):bool
|
||||||
|
{
|
||||||
|
return $this->isTrapped($reset);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user