<commit_before><?php

namespace BoomCMS\Core\Page\Finder;

use BoomCMS\Core\Finder\Filter;
use Illuminate\Database\Eloquent\Builder;

class Tag extends Filter
{
    /**
	 *
	 * @var \Boom\Tag\Tag
	 */
    protected $_tag;

    public function __construct(\Boom\Tag\Tag $tag)
    {
        $this->_tag = $tag;
    }

    public function execute(Builder $query)
    {
        return $query
            ->join('pages_tags', 'page.id', '=', 'pages_tags.page_id')
            ->where('pages_tags.tag_id', '=', $this->_tag->getId());
    }

    public function shouldBeApplied()
    {
        return $this->_tag->loaded();
    }
}<commit_msg>Fixed page finder tag filter<commit_after><?php

namespace BoomCMS\Core\Page\Finder;

use BoomCMS\Core\Finder\Filter;
use BoomCMS\Core\Tag\Tag as TagObject;

use Illuminate\Database\Eloquent\Builder;

class Tag extends Filter
{
    /**
	 *
	 * @var TagObject
	 */
    protected $tag;

    public function __construct(TagObject $tag)
    {
        $this->tag = $tag;
    }

    public function execute(Builder $query)
    {
        return $query
            ->join('pages_tags', 'page.id', '=', 'pages_tags.page_id')
            ->where('pages_tags.tag_id', '=', $this->tag->getId());
    }

    public function shouldBeApplied()
    {
        return $this->tag->loaded();
    }
}
{'fraction_non_alphanumeric': 0.15361216730038021, 'fraction_numerical': 0.0, 'mean_word_length': 2.547169811320755, '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': '7470005', 'n_tokens_mistral': 448, 'n_tokens_neox': 438, 'n_words': 82}