Google\Cloud\Compute\Metadata::getProjectId PHP Method

getProjectId() public method

Example: $projectId = $reader->getProjectId();
public getProjectId ( ) : string
return string
    public function getProjectId()
    {
        if (!isset($this->projectId)) {
            $this->projectId = $this->reader->read('project/project-id');
        }
        return $this->projectId;
    }