<?php

namespace Helpers\Parametres;

/** @phpstan-ignore-next-line */
// phpcs:ignore
define('nbDecimalPU', (int)intval($_SESSION['parametrage']['NB_DECIMAL_PU']??3));

class Constante
{
    /**
     * debut-----fin
     */
    // phpcs:ignore
    const spliter = 'debut-----fin';
    // phpcs:ignore
    const replacePoint = 'pointdeb--pointfin';
    // phpcs:ignore
    const replaceEspace = 'espacedeb--espacefin';

    /** @var int montantEntier */
    // phpcs:ignore
    const montantEntier = 13;
    
    /** @var int montantDecimal */
    // phpcs:ignore
    const montantDecimal = 2;

    /** @var int puEntier  */
    // phpcs:ignore
    const puEntier = 10;

    /** @var mixed PUDECIMAL  */
    const PUDECIMAL = nbDecimalPU;

    /** @var int qteEntier  */
    // phpcs:ignore
    const qteEntier = 8;

    /** @var int qteDecimal  */
    // phpcs:ignore
    const qteDecimal = 3;
    
    /** @var string formatMontant  */
    // phpcs:ignore
    const formatMontant = self::montantEntier.'.'.self::montantDecimal;
    
    /** @var string formatPU  */
    // phpcs:ignore
    const formatPU      = self::puEntier.'.'.self::PUDECIMAL;
    
    /** @var string formatQTE  */
    // phpcs:ignore
    const formatQTE     = self::qteEntier.'.'.self::qteDecimal;

    /**
     * @var string
     */
    // phpcs:ignore
    const fournisseurStock = 'RESERVESTOCK';

    // phpcs:ignore
    const oxaPipe = 'oxa_pip_oxa';

    /**
     * @return float|string|int
     */
    public function getConst(string $name)
    {
        return constant("self::{$name}");
    }
}
