<commit_before><?php
/**
 * (c) shopware AG <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Shopware\Components\SwagImportExport\Transformers;

use Shopware\Components\SwagImportExport\Profile\Profile;

/**
 * Class DecimalTransformer
 */
class DecimalTransformer implements DataTransformerAdapter
{
    /** @var array $decimalValues */
    private $decimalValues = [
        'weight',
        'width',
        'height',
        'length',
        'tax',
        'purchaseUnit',
        'referenceUnit',
        'price',
        'pseudoPrice',
        'purchasePrice',
        'invoiceAmount',
        'invoiceAmountNet',
    ];

    /** @var \Enlight_Plugin_Bootstrap_Config $pluginConfig */
    private $pluginConfig;

    /** @var Profile $profile */
    private $profile;

    /** @var array $treeData */
    private $treeData;

    /**
     * Sets the main config which defines the data restructuring
     *
     * @param array $params
     */
    public function initialize($params)
    {
        list($this->pluginConfig, $this->profile) = $params;
        $this->treeData = $this->getTreeData();
    }

    /**
     * Transforms the data in direction to formatted output file and returns the transformed data.
     *
     * @param array $data<commit_msg>PT-10898 - Convert invoiceShipping and invoiceShippingNet to current decimal value<commit_after><?php
/**
 * (c) shopware AG <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Shopware\Components\SwagImportExport\Transformers;

use Shopware\Components\SwagImportExport\Profile\Profile;

/**
 * Class DecimalTransformer
 */
class DecimalTransformer implements DataTransformerAdapter
{
    /** @var array $decimalValues */
    private $decimalValues = [
        'weight',
        'width',
        'height',
        'length',
        'tax',
        'purchaseUnit',
        'referenceUnit',
        'price',
        'pseudoPrice',
        'purchasePrice',
        'invoiceAmount',
        'invoiceAmountNet',
        'invoiceShipping',
        'invoiceShippingNet',
    ];

    /** @var \Enlight_Plugin_Bootstrap_Config $pluginConfig */
    private $pluginConfig;

    /** @var Profile $profile */
    private $profile;

    /** @var array $treeData */
    private $treeData;

    /**
     * Sets the main config which defines the data restructuring
     *
     * @param array $params
     */
    public function initialize($params)
    {
        list($this->pluginConfig, $this->profile) = $params;
        $this->treeData = $this->getTreeData();
    }

    /**
     * Transforms the data in direction to formatted output file and returns the transformed data.
     *
     * @param array $data
{'fraction_non_alphanumeric': 0.1146051712089448, 'fraction_numerical': 0.0017470300489168414, 'mean_word_length': 2.5967336683417086, 'pattern_counts': {'":': 0, '<': 9, '<?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': '14632', 'n_tokens_mistral': 800, 'n_tokens_neox': 780, 'n_words': 215}