<commit_before><?php
namespace rock\snippets;

use rock\date\DateTime;
use rock\date\DateTimeInterface;
use rock\template\TemplateException;

/**
 * Snippet "DateView"
 *
 * Get formatted now date:
 * ```
 * [[Date
 *  ?format=`j n`
 * ]]
 * ```
 *
 * With default format:
 *
 * ```
 * [[Date
 *  ?date=`2014-02-12 15:01`
 *  ?format=`dmyhm`
 * ]]
 * ```
 */
/** @noinspection PhpHierarchyChecksInspection */
class Date extends Snippet implements DateTimeInterface
{
    /**
     * Datetime. `now` by default.
     * @var string
     */
    public $date = 'now';
    /**
     * Format of datetime.
     * @var string
     */
    public $format = DateTime::DEFAULT_FORMAT;
    public $timezone;
    public $config = [];

    public function get()
    {
        $dateTime = DateTime::set($this->date, null, $this->config);
        if (isset($this->timezone)) {
            $dateTime->convertTimezone($this->timezone);
        }
        return $dateTime->format($this->format);
    }
}<commit_msg>Unimplement `DateTimeInterface` for `\rock\snippets\Date`.<commit_after><?php
namespace rock\snippets;

use rock\date\DateTime;

/**
 * Snippet "DateView"
 *
 * Get formatted now date:
 * ```
 * [[Date
 *  ?format=`j n`
 * ]]
 * ```
 *
 * With default format:
 *
 * ```
 * [[Date
 *  ?date=`2014-02-12 15:01`
 *  ?format=`dmyhm`
 * ]]
 * ```
 */
class Date extends Snippet
{
    /**
     * Datetime. `now` by default.
     * @var string
     */
    public $date = 'now';
    /**
     * Format of datetime.
     * @var string
     */
    public $format = DateTime::DEFAULT_FORMAT;
    public $timezone;
    public $config = [];

    public function get()
    {
        $dateTime = DateTime::set($this->date, null, $this->config);
        if (isset($this->timezone)) {
            $dateTime->convertTimezone($this->timezone);
        }
        return $dateTime->format($this->format);
    }
}
{'fraction_non_alphanumeric': 0.17728237791932058, 'fraction_numerical': 0.012738853503184714, 'mean_word_length': 2.5167910447761193, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '5135116', 'n_tokens_mistral': 649, 'n_tokens_neox': 628, 'n_words': 127}