private function getChangelogEntry($filename) : ?stdClass
    {
        $contents = file($filename);
        if (false === $contents) {
            throw Exception\ChangelogFileNotFoundException::at($filename);
        }

        $data = (object) [
            'contents' => '',
            'index' => null,
            'length' => 0,
        ];

        foreach ($contents as $index => $line) {
            if (preg_match('/^## \d+\.\d+\.\d+/', $line)) {
                if ($data->index) {
                    break;
                }
                $data->contents = $line;
                $data->index = $index;
                $data->length = 1;
                continue;
            }

            if (! $data->index) {
                continue;
            }

            $data->contents .= $line;
            $data->length += 1;
        }

        return $data->index !== null ? $data : null;
    }