Core/src/Compute/Metadata.php
public function getProjectId()
    {
        if (!isset($this->projectId)) {
            $this->projectId = $this->get('project/project-id');
        }

        return $this->projectId;
    }
public function getProjectId()
    {
        if (!isset($this->projectId)) {
            $this->projectId = $this->get('project/project-id');
        }

        return $this->projectId;
    }
public function getProjectId ( ) { if ( ! isset ( $ this -> projectId ) ) { $ this -> projectId = $ this -> get ( 'project/project-id' ) ; } return $ this -> projectId ; }
Detect and return the project ID

Example:
```
$projectId = $metadata->getProjectId();
```

@return string
Detect and return the project ID