<commit_before><?php
namespace DemandwareXml;

abstract class Base
{
    protected $attributes = [];
    protected $element;
    protected $elements   = [];

    /**
     * Populates the name of the product/set/bundle/category for the <display-name xml:lang="x-default"> element
     */
    public function setName(string $name)
    {
        $this->elements['display-name'] = $name;
    }

    /**
     * Populates flag elements - only `$online` is required. available is
     *
     * @param $online
     * @param $searchable
     * @param $available This is deprecated according to the XSD, but used so we support it
     * @param $both
     */
    public function setFlags(bool $online, bool $searchable = null, bool $available = null, bool $both = null)
    {
        $this->elements['online-flag'] = $online;

        if (! is_null($searchable)) {
            $this->elements['searchable-flag'] = $searchable;
        }

        if (! is_null($available)) {
            $this->elements['available-flag'] = $available;
        }

        if (! is_null($both)) {
            $this->elements['searchable-if-unavailable-flag'] = $both;
        }
    }

    /**
     * Populates <online-from> and <online-to> dates in Demandware format, if provided
     */
    public function setDates(string $from, string $to = null)
    {
        if (! $this->isEmptyDate($from)) {
            $this->elements['online-from'] = str_replace(' ', 'T', $from);
        }

        if (! $this->isEmptyDate($to)) {
            $this->elements['online-to'] = str_replace(' ', 'T', $to);
        }<commit_msg>Removed pointless docs<commit_after><?php
namespace DemandwareXml;

abstract class Base
{
    protected $attributes = [];
    protected $element;
    protected $elements   = [];

    /**
     * Populates the name of the product/set/bundle/category for the <display-name xml:lang="x-default"> element
     */
    public function setName(string $name)
    {
        $this->elements['display-name'] = $name;
    }

    /**
     * Populates flag elements - only `$online` is required.
     * $available is deprecated according to the XSD, but used so we support it
     */
    public function setFlags(bool $online, bool $searchable = null, bool $available = null, bool $both = null)
    {
        $this->elements['online-flag'] = $online;

        if (! is_null($searchable)) {
            $this->elements['searchable-flag'] = $searchable;
        }

        if (! is_null($available)) {
            $this->elements['available-flag'] = $available;
        }

        if (! is_null($both)) {
            $this->elements['searchable-if-unavailable-flag'] = $both;
        }
    }

    /**
     * Populates <online-from> and <online-to> dates in Demandware format, if provided
     */
    public function setDates(string $from, string $to = null)
    {
        if (! $this->isEmptyDate($from)) {
            $this->elements['online-from'] = str_replace(' ', 'T', $from);
        }

        if (! $this->isEmptyDate($to)) {
            $this->elements['online-to'] = str_replace(' ', 'T', $to);
        }
{'fraction_non_alphanumeric': 0.1526742301458671, 'fraction_numerical': 0.0, 'mean_word_length': 2.343445287107259, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2584620', 'n_tokens_mistral': 914, 'n_tokens_neox': 896, 'n_words': 222}