<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Santiago
 * Date: 7/15/2015
 * Time: 11:01 AM
 */

namespace Model;

class Book
{
    /**
     * @var string
     */
    protected $isbn10;

    /**
     * @var string
     */
    protected $isbn13;

    /**
     * @var string
     */
    protected $title;

    /**
     * @var string
     */
    protected $authors;

    /**
     * @var string
     */
    protected $publisher;

    /**
     * @var string
     */
    protected $description;

    /**
     * @var string
     */
    protected $pageCount;

    /**
     * @var string
     */
    protected $imageLink;

    public function __construct()
    {

    }

    /**
     * @param $isbn10
     * @param $isbn13
     * @param $title
     * @param $authors
     * @param $publisher
     * @param $description
     * @param $pageCount
     * @param $imageLink
     *
     * @return Book
     */
    public static function buildComplete($isbn10, $isbn13, $title, $authors, $publisher, $description, $pageCount, $imageLink)
    {
        if (is_null($publisher))
        {
            $publisher = "N/A";
        }
        if (is_null($pageCount))
        {
            $pageCount = "N/A";
        }
        if (is_null($isbn10))
        {
            $isbn10 = "N/A";
        }
        if (is_null($isbn13))
        {
            $isbn13 = "N/A";
        }
        if (is_null($title))
        {
            $title = "N/A";
        }
        if (is_null($authors))
        {
            $authors = "N/A";
        }
        if (is_null($publisher))
        {
            $publisher = "N/A";
        }
        if (is_null($description))
        {
            $description = "N/A";
        }
        if (is_null($pageCount))
        {
            $pageCount = "N/A";
        }
        if (is_null($imageLink))
        {
            $imageLink = "N/A";
        }

        $instance = new self();
        $instance->isbn10 = $isbn10;
        $instance->isbn13 = $isbn13;
        $instance->title = $title;
        $instance->authors = $authors;
        $instance->publisher = $publisher;
        $instance->description = $description;
        $instance->pageCount = $pageCount;
        $instance->imageLink = $imageLink;
        return $instance;
    }

    /**
     * @param $title
     * @param $authors
     * @param $publisher
     * @param $description
     * @param $pageCount
     * @param $imageLink
     *
     * @return Book
     */
    public static function buildWithoutIsbn( $title, $authors, $publisher, $description, $pageCount, $imageLink)
    {
        $instance = new self();
        $instance->title = $title;
        $instance->authors = $authors;
        $instance->publisher = $publisher;
        $instance->description = $description;
        $instance->pageCount = $pageCount;
        $instance->imageLink = $imageLink;
        return $instance;
    }


    /**
     * @return string<commit_msg>Removed unused constructor in Books<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Santiago
 * Date: 7/15/2015
 * Time: 11:01 AM
 */

namespace Model;

class Book
{
    /**
     * @var string
     */
    protected $isbn10;

    /**
     * @var string
     */
    protected $isbn13;

    /**
     * @var string
     */
    protected $title;

    /**
     * @var string
     */
    protected $authors;

    /**
     * @var string
     */
    protected $publisher;

    /**
     * @var string
     */
    protected $description;

    /**
     * @var string
     */
    protected $pageCount;

    /**
     * @var string
     */
    protected $imageLink;

    public function __construct()
    {

    }

    /**
     * @param $isbn10
     * @param $isbn13
     * @param $title
     * @param $authors
     * @param $publisher
     * @param $description
     * @param $pageCount
     * @param $imageLink
     *
     * @return Book
     */
    public static function buildComplete($isbn10, $isbn13, $title, $authors, $publisher, $description, $pageCount, $imageLink)
    {

        $instance = new self();
        $instance->setIsbn10($isbn10);
        $instance->setIsbn13($isbn13);
        $instance->setTitle($title);
        $instance->setAuthors($authors);
        $instance->setPublisher($publisher);
        $instance->setDescription($description);
        $instance->setPageCount($pageCount);
        $instance->setImageLink($imageLink);
        return $instance;
    }


    /**
     * @return string
{'fraction_non_alphanumeric': 0.1447576099210823, 'fraction_numerical': 0.015783540022547914, 'mean_word_length': 1.6451997614788312, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '612775', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1377, 'n_words': 280}