Skip to content

Commit a97129d

Browse files
committed
Add $seconds to keepalive methods
1 parent de23257 commit a97129d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Application.php

+8
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ public function setAlarmInterval(?int $seconds): void
139139
$this->scheduleAlarm();
140140
}
141141

142+
/**
143+
* Gets the interval in seconds on which a SIGALRM signal is dispatched.
144+
*/
145+
public function getAlarmInterval(): ?int
146+
{
147+
return $this->alarmInterval;
148+
}
149+
142150
private function scheduleAlarm(): void
143151
{
144152
if (null !== $this->alarmInterval) {

Tests/ApplicationTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -2305,6 +2305,7 @@ public function testAlarmDispatchWithoutEventDispatcher()
23052305
$application = $this->createSignalableApplication($command, null);
23062306

23072307
$this->assertSame(1, $application->run(new ArrayInput(['alarm'])));
2308+
$this->assertSame(1, $application->getAlarmInterval());
23082309
$this->assertTrue($command->signaled);
23092310
}
23102311

0 commit comments

Comments
 (0)