public function updateChangelog(string $version)
    {
        $changelog = sprintf(self::TEMPLATE, $version);
        $contents = file_get_contents($this->changelogFile);
        $contents = preg_replace(
            "/^(\# Changelog\n\n.*?)(\n\n\#\# )/s",
            '$1' .  $changelog . '## ',
            $contents
        );
        file_put_contents($this->changelogFile, $contents);
    }
public function updateChangelog(string $version)
    {
        $changelog = sprintf(self::TEMPLATE, $version);
        $contents = file_get_contents($this->changelogFile);
        $contents = preg_replace(
            "/^(\# Changelog\n\n.*?)(\n\n\#\# )/s",
            '$1' .  $changelog . '## ',
            $contents
        );
        file_put_contents($this->changelogFile, $contents);
    }
public function updateChangelog ( string $ version ) { $ changelog = sprintf ( self :: TEMPLATE , $ version ) ; $ contents = file_get_contents ( $ this -> changelogFile ) ; $ contents = preg_replace ( "/^(\# Changelog\n\n.*?)(\n\n\#\# )/s" , '$1' . $ changelog . '## ' , $ contents ) ; file_put_contents ( $ this -> changelogFile , $ contents ) ; }
Update the CHANGELOG with the new version information.

@param string $version
Update the CHANGELOG with the new version information .