<commit_before><?php

namespace Dergipark\WorkflowBundle\EventListener;

use Dergipark\WorkflowBundle\Entity\ArticleWorkflow;
use Dergipark\WorkflowBundle\Entity\ArticleWorkflowSetting;
use Dergipark\WorkflowBundle\Entity\JournalWorkflowStep;
use Dergipark\WorkflowBundle\Entity\StepDialog;
use Dergipark\WorkflowBundle\Event\WorkflowEvent;
use Dergipark\WorkflowBundle\Event\WorkflowEvents;
use Dergipark\WorkflowBundle\Params\JournalWorkflowSteps;
use Dergipark\WorkflowBundle\Params\StepActionTypes;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManager;
use Ojs\CoreBundle\Service\OjsMailer;
use Ojs\UserBundle\Entity\User;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Translation\TranslatorInterface;

class WorkflowMailListener implements EventSubscriberInterface
{
    /**
     * @var RouterInterface
     */
    private $router;

    /**
     * @var EntityManager
     */
    private $em;

    /**
     * @var OjsMailer
     */
    private $ojsMailer;

    /**
     * @var PropertyAccessor
     */
    private $accessor;

    /**
     * @var TranslatorInterface
     */
    private $translator;

    /**
     * WorkflowMailListener constructor.
     *
     * @param RouterInterface       $router
     * @param EntityManager         $em
     * @param OjsMailer             $ojsMailer
     * @param TranslatorInterface   $translator
     */
    public function __construct(
        RouterInterface $router,
        EntityManager $em,
        OjsMailer $ojsMailer,
        TranslatorInterface $translator
    ) {
        $this->router       = $router;
        $this->em           = $em;
        $this->ojsMailer    = $ojsMailer;
        $this->accessor     = PropertyAccess::createPropertyAccessor();
        $this->translator   = $translator;
    }

    /**
     * {@inheritDoc}
     */
    public static function getSubscribedEvents()
    {
        return array(
            WorkflowEvents::WORKFLOW_STARTED                => 'onWorkflowStarted',
            WorkflowEvents::REVIEW_FORM_RESPONSE            => 'onReviewFormResponse',
            WorkflowEvents::REVIEW_FORM_RESPONSE_PREVIEW    => 'onReviewFormResponsePreview',
            WorkflowEvents::REVIEW_FORM_REQUEST             => [['dialogAcceptedCheck'], ['onReviewFormRequest']],
            WorkflowEvents::WORKFLOW_GRANT_USER             => 'onWorkflowGrantUser',
            WorkflowEvents::DIALOG_POST_COMMENT             => [['dialogAcceptedCheck'], ['onDialogPostComment']],
            WorkflowEvents::DIALOG_POST_FILE                => [['dialogAcceptedCheck'], ['onDialogPostFile']],
            WorkflowEvents::CREATE_SPESIFIC_DIALOG          => 'onCreateSpecificDialog',<commit_msg>Get rid of the redundant OJS prefix<commit_after><?php

namespace Dergipark\WorkflowBundle\EventListener;

use Dergipark\WorkflowBundle\Entity\ArticleWorkflow;
use Dergipark\WorkflowBundle\Entity\ArticleWorkflowSetting;
use Dergipark\WorkflowBundle\Entity\JournalWorkflowStep;
use Dergipark\WorkflowBundle\Entity\StepDialog;
use Dergipark\WorkflowBundle\Event\WorkflowEvent;
use Dergipark\WorkflowBundle\Event\WorkflowEvents;
use Dergipark\WorkflowBundle\Params\JournalWorkflowSteps;
use Dergipark\WorkflowBundle\Params\StepActionTypes;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManager;
use Ojs\CoreBundle\Service\Mailer;
use Ojs\UserBundle\Entity\User;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Translation\TranslatorInterface;

class WorkflowMailListener implements EventSubscriberInterface
{
    /**
     * @var RouterInterface
     */
    private $router;

    /**
     * @var EntityManager
     */
    private $em;

    /**
     * @var Mailer
     */
    private $ojsMailer;

    /**
     * @var PropertyAccessor
     */
    private $accessor;

    /**
     * @var TranslatorInterface
     */
    private $translator;

    /**
     * WorkflowMailListener constructor.

     * @param RouterInterface       $router
     * @param EntityManager         $em
     * @param Mailer             $ojsMailer
     * @param TranslatorInterface   $translator
     */
    public function __construct(
        RouterInterface $router,
        EntityManager $em,
        Mailer $ojsMailer,
        TranslatorInterface $translator
    ) {
        $this->router       = $router;
        $this->em           = $em;
        $this->ojsMailer    = $ojsMailer;
        $this->accessor     = PropertyAccess::createPropertyAccessor();
        $this->translator   = $translator;
    }

    /**
     * {@inheritDoc}
     */
    public static function getSubscribedEvents()
    {
        return array(
            WorkflowEvents::WORKFLOW_STARTED                => 'onWorkflowStarted',
            WorkflowEvents::REVIEW_FORM_RESPONSE            => 'onReviewFormResponse',
            WorkflowEvents::REVIEW_FORM_RESPONSE_PREVIEW    => 'onReviewFormResponsePreview',
            WorkflowEvents::REVIEW_FORM_REQUEST             => [['dialogAcceptedCheck'], ['onReviewFormRequest']],
            WorkflowEvents::WORKFLOW_GRANT_USER             => 'onWorkflowGrantUser',
            WorkflowEvents::DIALOG_POST_COMMENT             => [['dialogAcceptedCheck'], ['onDialogPostComment']],
            WorkflowEvents::DIALOG_POST_FILE                => [['dialogAcceptedCheck'], ['onDialogPostFile']],
            WorkflowEvents::CREATE_SPESIFIC_DIALOG          => 'onCreateSpecificDialog',
{'fraction_non_alphanumeric': 0.09677966101694915, 'fraction_numerical': 0.0, 'mean_word_length': 3.0197547683923704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '6121209', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1662, 'n_words': 253}