<commit_before><?php

namespace Synapse\Email;

use Synapse\Resque\Resque;
use Synapse\Stdlib\Arr;

/**
 * General purpose service for handling email entities
 */
class EmailService
{
    /**
     * @var EmailMapper
     */
    protected $emailMapper;

    /**
     * @var array
     */
    protected $emailConfig;

    /**
     * @var Resque
     */
    protected $resque;

    /**
     * @param EmailMapper $mapper
     */
    public function setEmailMapper(EmailMapper $mapper)
    {
        $this->emailMapper = $mapper;
        return $this;
    }

    /**
     * @param array $config
     */
    public function setEmailConfig(array $config)
    {
        $this->emailConfig = $config;
        return $this;
    }

    /**
     * @param Resque $resque
     */
    public function setResque(Resque $resque)
    {
        $this->resque = $resque;
    }

    /**
     * Create an email entity from an array and populate with default data
     *
     * @param  array  $data Data to populate the email
     * @return Email
     */<commit_msg>Refs #154 - EmailService now takes any instanc of AbstractMapper<commit_after><?php

namespace Synapse\Email;

use Synapse\Resque\Resque;
use Synapse\Stdlib\Arr;
use Synapse\Mapper\AbstractMapper;

/**
 * General purpose service for handling email entities
 */
class EmailService
{
    /**
     * @var EmailMapper
     */
    protected $emailMapper;

    /**
     * @var array
     */
    protected $emailConfig;

    /**
     * @var Resque
     */
    protected $resque;

    /**
     * @param EmailMapper $mapper
     */
    public function setEmailMapper(AbstractMapper $mapper)
    {
        $this->emailMapper = $mapper;
        return $this;
    }

    /**
     * @param array $config
     */
    public function setEmailConfig(array $config)
    {
        $this->emailConfig = $config;
        return $this;
    }

    /**
     * @param Resque $resque
     */
    public function setResque(Resque $resque)
    {
        $this->resque = $resque;
    }

    /**
     * Create an email entity from an array and populate with default data
     *
     * @param  array  $data Data to populate the email
     * @return Email
     */
{'fraction_non_alphanumeric': 0.11264367816091954, 'fraction_numerical': 0.001379310344827586, 'mean_word_length': 2.0013793103448276, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3379260', 'n_tokens_mistral': 671, 'n_tokens_neox': 654, 'n_words': 172}