private function normalizeSha(Environment $environment, $sha = null)
    {
        if ($environment->head_commit === null) {
            return null;
        }
        if ($sha === null) {
            return $environment->head_commit;
        }
        if (strpos($sha, 'HEAD') === 0) {
            $sha = $environment->head_commit . substr($sha, 4);
        }

        return $sha;
    }
private function normalizeSha(Environment $environment, $sha = null)
    {
        if ($environment->head_commit === null) {
            return null;
        }
        if ($sha === null) {
            return $environment->head_commit;
        }
        if (strpos($sha, 'HEAD') === 0) {
            $sha = $environment->head_commit . substr($sha, 4);
        }

        return $sha;
    }
private function normalizeSha ( Environment $ environment , $ sha = null ) { if ( $ environment -> head_commit === null ) { return null ; } if ( $ sha === null ) { return $ environment -> head_commit ; } if ( strpos ( $ sha , 'HEAD' ) === 0 ) { $ sha = $ environment -> head_commit . substr ( $ sha , 4 ) ; } return $ sha ; }
Normalize a commit SHA for API and caching purposes.

@param \Platformsh\Client\Model\Environment $environment
@param string|null                          $sha

@return string|null
Normalize a commit SHA for API and caching purposes .