Google\Cloud\Dev\Snippet\Parser\Snippet::setLine PHP Method

setLine() public method

Hopefully this is obvious, but be careful using this, and only use it when no other feasible options present themselves. It's pretty easy to make your test useless when you're overwriting the thing you are trying to test. This is provided for cases when a snippet relies on a global, or on something else which can not be overridden or mocked.
public setLine ( integer $line, string $content ) : void
$line integer The line number (0-indexed) to replace.
$content string The PHP code to inject.
return void
    public function setLine($line, $content)
    {
        $snippet = explode("\n", $this->config['content']);
        $snippet[$line] = $content;
        $this->config['content'] = implode("\n", $snippet);
    }