protected function getCurrentPid()
    {
        if ($this->currentPid) {
            return $this->currentPid;
        }

        $path = $this->getPidPath();

        return $this->currentPid = file_exists($path)
            ? (int) file_get_contents($path) ?? $this->removePidFile()
            : null;
    }