prakasmiko
try
The problem seems to be with the signal handler function definition in the listenForSignals method. Specifically, the line fn 0 => $this->shouldQuit is mentioned in the error message, where 0 should be an argument to the SIGQUIT signal, but it is misinterpreted as a function argument. This is probably because the fn keyword is incorrectly parsed as a function parameter here.
To fix this, you can replace the fn keyword with the function keyword to ensure that the function is defined correctly.