<commit_before><?php

namespace DavidBadura\MarkdownBuilder;

/**
 * @author <NAME> <<EMAIL>>
 */
class MarkdownBuilder
{
    /**
     * @var string
     */
    protected $markdown;

    /**
     * @return MarkdownBuilder
     */
    public function block()
    {
        return new self();
    }

    /**
     * @param string $text
     * @return $this
     */
    public function p($text)
    {
        return $this
            ->writeln($text)
            ->br();
    }

    /**
     * @param string $header
     * @return $this
     */
    public function h1($header)
    {
        $header = $this->singleLine($header);

        return $this
            ->writeln($header)
            ->writeln(str_repeat("=", mb_strlen($header)))
            ->br();
    }

    /**
     * @param string $header
     * @return $this
     */
    public function h2($header)
    {
        $header = $this->singleLine($header);

        return $this
            ->writeln($header)
            ->writeln(str_repeat("-", mb_strlen($header)))
            ->br();
    }

    /**
     * @param string $header
     * @return $this
     */
    public function h3($header)
    {
        $header = $this->singleLine($header);

        return $this
            ->writeln('### ' . $header)
            ->br();
    }

    /**
     * @param string $text
     * @return $this
     */
    public function blockquote($text)
    {
        $lines    = explode("\n", $text);
        $newLines = array_map(function ($line) {
            return trim('>  ' . $line);
        }, $lines);

        $content = implode("\n", $newLines);

        return $this->p($content);
    }

    /**
     * @param array $list
     * @return $this
     */
    public function bulletedList(array $list)
    {
        foreach ($list as $element) {
<commit_msg>Update MarkdownBuilder.php<commit_after><?php

namespace DavidBadura\MarkdownBuilder;

/**
 * @author <NAME> <<EMAIL>>
 */
class MarkdownBuilder
{
    /**
     * @var string
     */
    protected $markdown;

    /**
     * @return MarkdownBuilder
     */
    public function block()
    {
        return new self();
    }

    /**
     * @param string $text
     * @return $this
     */
    public function p($text)
    {
        return $this
            ->writeln($text)
            ->br();
    }

    /**
     * @param string $header
     * @return $this
     */
    public function h1($header)
    {
        $header = $this->singleLine($header);

        return $this
            ->writeln($header)
            ->writeln(str_repeat("=", mb_strlen($header)))
            ->br();
    }

    /**
     * @param string $header
     * @return $this
     */
    public function h2($header)
    {
        $header = $this->singleLine($header);

        return $this
            ->writeln($header)
            ->writeln(str_repeat("-", mb_strlen($header)))
            ->br();
    }

    /**
     * @param string $header
     * @return $this
     */
    public function h3($header)
    {
        $header = $this->singleLine($header);

        return $this
            ->writeln('### ' . $header)
            ->br();
    }

    /**
     * @param string $text
     * @return $this
     */
    public function blockquote($text)
    {
        $lines    = explode("\n", $text);
        $newLines = array_map(function ($line) {
            return trim('>  ' . $line);
        }, $lines);

        $content = implode("\n", $newLines);

        return $this->p($content);
    }
    
    /**
     * @deprecated
     */
    public function blockqoute($text) {
        return $this->blockquote($text);
    }

    /**
     * @param array $list
     * @return $this
     */
    public function bulletedList(array $list)
    {
        foreach ($list as $element) {

{'fraction_non_alphanumeric': 0.1622198505869797, 'fraction_numerical': 0.0016008537886872999, 'mean_word_length': 1.5713305898491083, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4976054', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1130, 'n_words': 237}