public function checkProcessTimeout(): ?string
    {
        try {
            $this->getProcess()->checkTimeout();
        } catch (ProcessTimedOutException $e) {
            $this->setStatus(self::PROCESS_STATUS_DONE);

            return sprintf(
                'Process for class "%s" exceeded the timeout of %d seconds and was killed.',
                $this->getClassName(),
                $e->getExceededTimeout()
            );
        }

        return '';
    }
public function checkProcessTimeout(): ?string
    {
        try {
            $this->getProcess()->checkTimeout();
        } catch (ProcessTimedOutException $e) {
            $this->setStatus(self::PROCESS_STATUS_DONE);

            return sprintf(
                'Process for class "%s" exceeded the timeout of %d seconds and was killed.',
                $this->getClassName(),
                $e->getExceededTimeout()
            );
        }

        return '';
    }
public function checkProcessTimeout ( ) : ? string { try { $ this -> getProcess ( ) -> checkTimeout ( ) ; } catch ( ProcessTimedOutException $ e ) { $ this -> setStatus ( self :: PROCESS_STATUS_DONE ) ; return sprintf ( 'Process for class "%s" exceeded the timeout of %d seconds and was killed.' , $ this -> getClassName ( ) , $ e -> getExceededTimeout ( ) ) ; } return '' ; }
Check if process is not running longer then specified timeout, return error message if so.

@return string Non-empty error message if process timeout exceeded
Check if process is not running longer then specified timeout return error message if so .