<commit_before><?php

namespace Boom\Chunk;

use \Boom\Page as Page;
use \Boom\Link\Link as Link;
use \View as View;

class Asset extends \Boom\Chunk
{
    protected $_asset;
    protected $_default_template = 'image';
    protected $_type = 'asset';
    private $link;

    public function __construct(Page\Page $page, $chunk, $editable = true)
    {
        parent::__construct($page, $chunk, $editable);

        $this->_asset = \Boom\Asset\Factory::fromModel($this->_chunk->target);
    }

    protected function _show()
    {
        $link = $this->getLink();

        $v = new View($this->viewDirectory."asset/$this->_template", [
            'asset' => $this->asset(),
            'caption' => $this->getCaption()
        ]);

        if ($link) {
            $v->set([
                'title' => $link->getTitle(),
                'url' => $link->url()
            ]);
        }

        return $v;
    }

    protected function _show_default()
    {
        return new View($this->viewDirectory."default/asset/$this->_template");
    }

    public function attributes()
    {
        return [
            $this->attributePrefix.'target' => $this->target(),
        ];
    }

    public function asset()
    {
        return $this->_asset;
    }

    public function getCaption()
    {
        return $this->_chunk->caption;
    }

    public function getLink()
    {
        if ($this->link === null && $this->_chunk->url) {
            $this->link = Link::factory($this->_chunk->url);
        }

        return $this->link;
    }

    public function hasContent()
    {
        return $this->_chunk->loaded() && $this->_asset->loaded();
    }<commit_msg>Added method Chunk\Asset->getTitle()<commit_after><?php

namespace Boom\Chunk;

use \Boom\Page as Page;
use \Boom\Link\Link as Link;
use \View as View;

class Asset extends \Boom\Chunk
{
    protected $_asset;
    protected $_default_template = 'image';
    protected $_type = 'asset';
    private $link;

    public function __construct(Page\Page $page, $chunk, $editable = true)
    {
        parent::__construct($page, $chunk, $editable);

        $this->_asset = \Boom\Asset\Factory::fromModel($this->_chunk->target);
    }

    protected function _show()
    {
        $link = $this->getLink();

        $v = new View($this->viewDirectory."asset/$this->_template", [
            'asset' => $this->asset(),
            'caption' => $this->getCaption()
        ]);

        if ($link) {
            $v->set([
                'title' => $link->getTitle(),
                'url' => $link->url()
            ]);
        }

        return $v;
    }

    protected function _show_default()
    {
        return new View($this->viewDirectory."default/asset/$this->_template");
    }

    public function attributes()
    {
        return [
            $this->attributePrefix.'target' => $this->target(),
        ];
    }

    public function asset()
    {
        return $this->_asset;
    }

    public function getCaption()
    {
        return $this->_chunk->caption;
    }

    public function getLink()
    {
        if ($this->link === null && $this->_chunk->url) {
            $this->link = Link::factory($this->_chunk->url);
        }

        return $this->link;
    }

    public function getTitle()
    {
        return $this->_chunk->title;
    }

    public function hasContent()
    {
        return $this->_chunk->loaded() && $this->_asset->loaded();
    }
{'fraction_non_alphanumeric': 0.1622960372960373, 'fraction_numerical': 0.0, 'mean_word_length': 1.9878154917319408, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 74, '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': '2617326', 'n_tokens_mistral': 1028, 'n_tokens_neox': 997, 'n_words': 209}