<commit_before><?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Adteam\Core\Checkout\Checkout;

use Adteam\Core\Checkout\Entity\CoreConfigs;
use Doctrine\ORM\EntityManager;
use Zend\ServiceManager\ServiceManager;
/**
 * Description of Steps
 *
 * @author dev
 */
class Steps {
    
    /**
     *
     * @var type 
     */
    protected $service;
    
    /**
     * 
     * @param ServiceManager $service
     */
    public function __construct(ServiceManager $service) {
        $this->service = $service;
    }

    /**
     * ['none'|'fulfill'] Debe o no llenar encuesta
     * ['user-address' | 'cedis'| 'none'] CEDIS o Direccion del usuario o nada
     * 
     * @return type
     */
    public function getSettings()
    {
        $result = $this->getConfigs();
        return [
            'settings'=>[
                'surveyMode'=>$result['survey.isMandatory']==='1'?'fulfill':'none',
                'deliveryMode'=> $this->hasEditable($result),
                ]
        ];
    }
    
    private function hasEditable($configs)
    {
        return $configs['checkout.delivery.userEditable']==='editable'?<commit_msg>Revert "version 1.2.2"<commit_after><?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Adteam\Core\Checkout\Checkout;

use Adteam\Core\Checkout\Entity\CoreConfigs;
use Doctrine\ORM\EntityManager;
use Zend\ServiceManager\ServiceManager;
/**
 * Description of Steps
 *
 * @author dev
 */
class Steps {
    
    /**
     *
     * @var type 
     */
    protected $service;
    
    /**
     * 
     * @param ServiceManager $service
     */
    public function __construct(ServiceManager $service) {
        $this->service = $service;
    }

    /**
     * ['none'|'fulfill'] Debe o no llenar encuesta
     * ['user-address' | 'cedis'| 'none'] CEDIS o Direccion del usuario o nada
     * 
     * @return type
     */
    public function getSettings()
    {
        $result = $this->getConfigs();
        return [
            'settings'=>[
                'surveyMode'=>$result['survey.isMandatory']==='1'?'fulfill':'none',
                'deliveryMode'=> $this->hasEditable($result['checkout.delivery.mode']),
                ]
        ];
    }
    
    /**
     * 
     * @param type $configs
     * @return type
     */
    private function hasEditable($configs)
    {
        return $configs['checkout.delivery.userEditable']==='editable'?
{'fraction_non_alphanumeric': 0.13580246913580246, 'fraction_numerical': 0.0018705574261129816, 'mean_word_length': 2.3094059405940595, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '6237324', 'n_tokens_mistral': 832, 'n_tokens_neox': 807, 'n_words': 182}