<commit_before><?php

namespace Tienvx\Bundle\MbtBundle\Reporter;

use Exception;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mailer\MailerInterface;
use Tienvx\Bundle\MbtBundle\Entity\Bug;
use Tienvx\Bundle\MbtBundle\Helper\TableHelper;
use Tienvx\Bundle\MbtBundle\Subject\SubjectManager;

class EmailReporter implements ReporterInterface
{
    /**
     * @var MailerInterface
     */
    protected $mailer;

    /**
     * @var SubjectManager
     */
    protected $subjectManager;

    /**
     * @var string
     */
    protected $emailFrom = '';

    /**
     * @var string
     */
    protected $emailTo = '';

    /**
     * @var string
     */
    protected $emailSubject = 'A new bug found!';

    public function __construct(MailerInterface $mailer, SubjectManager $subjectManager)
    {
        $this->mailer = $mailer;
        $this->subjectManager = $subjectManager;
    }

    public static function getName(): string
    {
        return 'email';
    }

    public function getLabel(): string
    {
        return 'Email';
    }

    public static function support(): bool
    {
        return class_exists('Symfony\Component\Mailer\MailerInterface') &&
            class_exists('Symfony\Bridge\Twig\Mime\TemplatedEmail');
    }

    public function setEmailFrom(string $emailFrom)
    {
        $this->emailFrom = $emailFrom;
    }

    public function setEmailTo(string $emailTo)
    {
        $this->emailTo = $emailTo;
    }

    public function setEmailSubject(string $emailSubject)
    {
        $this->emailSubject = $emailSubject;
    }

    /**
     * @param Bug $bug
     *
     * @throws Exception
     */
    public function report(Bug $bug)<commit_msg>Fix missing email reporter<commit_after><?php

namespace Tienvx\Bundle\MbtBundle\Reporter;

use Exception;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mailer\MailerInterface;
use Tienvx\Bundle\MbtBundle\Entity\Bug;
use Tienvx\Bundle\MbtBundle\Helper\TableHelper;
use Tienvx\Bundle\MbtBundle\Subject\SubjectManager;

class EmailReporter implements ReporterInterface
{
    /**
     * @var MailerInterface
     */
    protected $mailer;

    /**
     * @var SubjectManager
     */
    protected $subjectManager;

    /**
     * @var string
     */
    protected $emailFrom = '';

    /**
     * @var string
     */
    protected $emailTo = '';

    /**
     * @var string
     */
    protected $emailSubject = 'A new bug found!';

    public function __construct(MailerInterface $mailer, SubjectManager $subjectManager)
    {
        $this->mailer = $mailer;
        $this->subjectManager = $subjectManager;
    }

    public static function getName(): string
    {
        return 'email';
    }

    public function getLabel(): string
    {
        return 'Email';
    }

    public static function support(): bool
    {
        return interface_exists('Symfony\Component\Mailer\MailerInterface') &&
            class_exists('Symfony\Bridge\Twig\Mime\TemplatedEmail');
    }

    public function setEmailFrom(string $emailFrom)
    {
        $this->emailFrom = $emailFrom;
    }

    public function setEmailTo(string $emailTo)
    {
        $this->emailTo = $emailTo;
    }

    public function setEmailSubject(string $emailSubject)
    {
        $this->emailSubject = $emailSubject;
    }

    /**
     * @param Bug $bug
     *
     * @throws Exception
     */
    public function report(Bug $bug)
{'fraction_non_alphanumeric': 0.11393514460999124, 'fraction_numerical': 0.0, 'mean_word_length': 2.515400410677618, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5371432', 'n_tokens_mistral': 1052, 'n_tokens_neox': 1010, 'n_words': 204}