<commit_before><?php namespace Anomaly\PostsModule\Type;

use Anomaly\PostsModule\Type\Contract\TypeInterface;
use Anomaly\PostsModule\Type\Contract\TypeRepositoryInterface;
use Anomaly\PagesModule\Type\Command\DeleteStream;
use Anomaly\Streams\Platform\Entry\EntryRepository;

/**
 * Class TypeRepository
 *
 * @link          http://pyrocms.com/
 * @author        PyroCMS, Inc. <<EMAIL>>
 * @author        <NAME> <<EMAIL>>
 */
class TypeRepository extends EntryRepository implements TypeRepositoryInterface
{

    /**
     * The type model.
     *
     * @var TypeModel
     */
    protected $model;

    /**
     * Create a new TypeRepository instance.
     *
     * @param TypeModel $model
     */
    public function __construct(TypeModel $model)
    {
        $this->model = $model;
    }

    /**
     * Find a category by it's slug.
     *
     * @param $slug
     * @return null|TypeInterface
     */
    public function findBySlug($slug)
    {
        return $this->model->where('slug', $slug)->first();
    }

    /**
     * Truncate the entries.
     *
     * @return $this
     */
    public function truncate()
    {
        parent::truncate();

        foreach ($this->model->all() as $entry)
        {
            $this->dispatch(new DeleteStream($entry));
        }
<commit_msg>Update TypeRepository.php<commit_after><?php namespace Anomaly\PostsModule\Type;

use Anomaly\PostsModule\Type\Contract\TypeInterface;
use Anomaly\PostsModule\Type\Contract\TypeRepositoryInterface;
use Anomaly\PostsModule\Type\Command\DeleteTypeStream;
use Anomaly\Streams\Platform\Entry\EntryRepository;

/**
 * Class TypeRepository
 *
 * @link          http://pyrocms.com/
 * @author        PyroCMS, Inc. <<EMAIL>>
 * @author        <NAME> <<EMAIL>>
 */
class TypeRepository extends EntryRepository implements TypeRepositoryInterface
{

    /**
     * The type model.
     *
     * @var TypeModel
     */
    protected $model;

    /**
     * Create a new TypeRepository instance.
     *
     * @param TypeModel $model
     */
    public function __construct(TypeModel $model)
    {
        $this->model = $model;
    }

    /**
     * Find a category by it's slug.
     *
     * @param $slug
     * @return null|TypeInterface
     */
    public function findBySlug($slug)
    {
        return $this->model->where('slug', $slug)->first();
    }

    /**
     * Truncate the entries.
     *
     * @return $this
     */
    public function truncate()
    {
        parent::truncate();

        foreach ($this->model->all() as $entry)
        {
            $this->dispatch(new DeleteTypeStream($entry));
        }

{'fraction_non_alphanumeric': 0.12998466257668712, 'fraction_numerical': 0.0, 'mean_word_length': 2.2983565107458914, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, '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': '2616433', 'n_tokens_mistral': 794, 'n_tokens_neox': 768, 'n_words': 161}