<commit_before><?php

namespace Bookshelf\DataType;

class BookMetadata {
    public $cover_image;
    public $title;
    public $author;
    public $description;
    public $language; // TODO: Define proper format (i.e. find appropriate ISO guideline)
    public $identifier;

    public function toArray() {
        $result = array();
        if(!empty($cover_image)) $result['cover_image'] = $cover_image;
        if(!empty($title)) $result['title'] = $title;
        if(!empty($author))$result['author'] = $author;
        if(!empty($description)) $result['description'] = $description;
        if(!empty($language)) $result['language'] = $language;
        if(!empty($identifier)) $result['identifier'] = $identifier;
        return $result;
    }

    public function toHtmlTableRow($add_button = '', $api_identifier = '') {
        $result = '<tr>' . ($add_button != '' ? '<td><input type="' . $add_button . '" name="chosen_book[]" value="'. $api_identifier .'">' : '');
        $result .= '<td><img src="' . $this->cover_image . '"></td>';
        $result .= '<td>' . $this->title . ' </td >
        <td>' . $this->author . '</td>
        <td>' . $this->description . '</td>
        <td>' . $this->language . '</td>
        <td>' . $this->identifier . '</td>
        </tr>';
        return $result;
    }
}
<commit_msg>Bugfix in BookMetadata (use correct variables)<commit_after><?php

namespace Bookshelf\DataType;

class BookMetadata {
    public $cover_image;
    public $title;
    public $author;
    public $description;
    public $language;
    public $identifier;

    public function toArray() {
        $result = array();
        if(!empty($this->cover_image)) $result['cover_image'] = $this->cover_image;
        if(!empty($this->title)) $result['title'] = $this->title;
        if(!empty($this->author))$result['author'] = $this->author;
        if(!empty($this->description)) $result['description'] = $this->description;
        if(!empty($this->language)) $result['language'] = $this->language;
        if(!empty($this->identifier)) $result['identifier'] = $this->identifier;
        return $result;
    }

    public function toHtmlTableRow($add_button = '', $api_identifier = '') {
        $result = '<tr>' . ($add_button != '' ? '<td><input type="' . $add_button . '" name="chosen_book[]" value="'. $api_identifier .'">' : '');
        $result .= '<td><img src="' . $this->cover_image . '"></td>';
        $result .= '<td>' . $this->title . ' </td >
        <td>' . $this->author . '</td>
        <td>' . $this->description . '</td>
        <td>' . $this->language . '</td>
        <td>' . $this->identifier . '</td>
        </tr>';
        return $result;
    }
}

{'fraction_non_alphanumeric': 0.2121887774061687, 'fraction_numerical': 0.0, 'mean_word_length': 2.8347578347578346, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 61, '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': '6605338', 'n_tokens_mistral': 820, 'n_tokens_neox': 806, 'n_words': 170}