<commit_before><?php

class EtapesActions extends sfActions {

    protected $_etapes_config = null;

    public function __construct($context, $moduleName, $actionName) {
        parent::__construct($context, $moduleName, $actionName);
        $this->_etapes_config = new EtapesConfig();
    }

    protected function redirectByBoutonsEtapes($boutons_suppl = null) {
        if ($this->askRedirectToNextEtapes()) {
            $this->redirectToNextEtapes();
        } elseif ($this->askRedirectToPreviousEtapes()) {
            $this->redirectToPreviousEtapes();
        } elseif ($this->askRedirectToPrevisualiser()) {
            $this->redirectToPrevisualiser();
        } elseif (!is_null($boutons_suppl) && is_array($boutons_suppl)) {
            foreach($boutons_suppl as $bouton_suppl => $action) {
                if (in_array($bouton_suppl, $this->getBoutons())) {
                    if ($action == 'next') {
                        $this->redirectToNextEtapes();
                    } elseif ($action == 'previous') {
                        $this->redirectToPreviousEtapes();
                    } elseif($action == 'previsualiser') {
                        $this->redirectToPrevisualiser();
                    }
                }
            }
        } else {
            $this->redirect($this->getRoute()->generate());
        }
    }

    protected function getBoutons() {
        $boutons = array();
        if (is_array($this->getRequest()->getParameter('boutons'))) {
            $boutons = array_keys($this->getRequest()->getParameter('boutons'));
        }
        return $boutons;
    }<commit_msg>probleme action etap redirect sur lui meme<commit_after><?php

class EtapesActions extends sfActions {

    protected $_etapes_config = null;

    public function __construct($context, $moduleName, $actionName) {
        parent::__construct($context, $moduleName, $actionName);
        $this->_etapes_config = new EtapesConfig();
    }

    protected function redirectByBoutonsEtapes($boutons_suppl = null) {
        if ($this->askRedirectToNextEtapes()) {
            $this->redirectToNextEtapes();
        } elseif ($this->askRedirectToPreviousEtapes()) {
            $this->redirectToPreviousEtapes();
        } elseif ($this->askRedirectToPrevisualiser()) {
            $this->redirectToPrevisualiser();
        } elseif (!is_null($boutons_suppl) && is_array($boutons_suppl)) {
            foreach($boutons_suppl as $bouton_suppl => $action) {
                if (in_array($bouton_suppl, $this->getBoutons())) {
                    if ($action == 'next') {
                        $this->redirectToNextEtapes();
                    } elseif ($action == 'previous') {
                        $this->redirectToPreviousEtapes();
                    } elseif($action == 'previsualiser') {
                        $this->redirectToPrevisualiser();
                    }
                }
            }
        } else {
            $this->redirect($this->getRoute()->getParameters());
        }
    }

    protected function getBoutons() {
        $boutons = array();
        if (is_array($this->getRequest()->getParameter('boutons'))) {
            $boutons = array_keys($this->getRequest()->getParameter('boutons'));
        }
        return $boutons;
    }
{'fraction_non_alphanumeric': 0.13841463414634148, 'fraction_numerical': 0.0, 'mean_word_length': 2.1397129186602872, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '4032399', 'n_tokens_mistral': 934, 'n_tokens_neox': 884, 'n_words': 138}