<commit_before><?php
/**
 * @author    Labs64 <<EMAIL>>
 * @license   Apache-2.0
 * @link      http://netlicensing.io
 * @copyright 2017 Labs64 NetLicensing
 */

namespace NetLicensing;

/**
 * Class ProductDiscount
 *
 * @property int $totalPrice
 * @property string $currency
 * @property int $amountFix
 * @property int $amountPercent
 *
 *
 * @method int getTotalPrice($default = null)
 * @method string getCurrency($default = null)
 * @method int getAmountFix($default = null)
 * @method int getAmountPercent($default = null)
 * @method ProductDiscount setTotalPrice($totalPrice)
 * @method ProductDiscount setCurrency($currency)
 *
 *
 * @package NetLicensing
 */
class ProductDiscount extends BaseEntity
{
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'totalPrice' => 'float',
        'amountFix' => 'float',
        'amountPercent' => 'int',
    ];

    public function setAmountFix($amountFix)
    {
        $this->setProperty('amountFix', $amountFix)
            ->removeProperty('amountPercent');

        return $this;
    }

    public function setAmountPercent($amountPercent)
    {
        $this->setProperty('amountPercent', $amountPercent)
            ->removeProperty('amountFix');

        return $this;
    }

    public function __toString()
    {
        $totalPrice = $this->getTotalPrice();
        $currency = $this->getCurrency();

        $amount = '';

        if (!is_null($this->getAmountFix())) $amount = $this->getAmountFix();
        if (!is_null($this->getAmountPercent())) $amount = $this->getAmountPercent() . '%';

        return $totalPrice . ';' . $currency . ';' . $amount;
    }
}<commit_msg>Change ProductDisount casts<commit_after><?php
/**
 * @author    Labs64 <<EMAIL>>
 * @license   Apache-2.0
 * @link      http://netlicensing.io
 * @copyright 2017 Labs64 NetLicensing
 */

namespace NetLicensing;

/**
 * Class ProductDiscount
 *
 * @property int $totalPrice
 * @property string $currency
 * @property int $amountFix
 * @property int $amountPercent
 *
 *
 * @method int getTotalPrice($default = null)
 * @method string getCurrency($default = null)
 * @method int getAmountFix($default = null)
 * @method int getAmountPercent($default = null)
 * @method ProductDiscount setTotalPrice($totalPrice)
 * @method ProductDiscount setCurrency($currency)
 *
 *
 * @package NetLicensing
 */
class ProductDiscount extends BaseEntity
{
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'totalPrice' => 'double',
        'amountFix' => 'double',
        'amountPercent' => 'double',
    ];

    public function setAmountFix($amountFix)
    {
        $this->setProperty('amountFix', $amountFix)
            ->removeProperty('amountPercent');

        return $this;
    }

    public function setAmountPercent($amountPercent)
    {
        $this->setProperty('amountPercent', $amountPercent)
            ->removeProperty('amountFix');

        return $this;
    }

    public function __toString()
    {
        $totalPrice = $this->getTotalPrice();
        $currency = $this->getCurrency();

        $amount = '';

        if (!is_null($this->getAmountFix())) $amount = $this->getAmountFix();
        if (!is_null($this->getAmountPercent())) $amount = $this->getAmountPercent() . '%';

        return $totalPrice . ';' . $currency . ';' . $amount;
    }
}
{'fraction_non_alphanumeric': 0.1451286498988147, 'fraction_numerical': 0.005782017924255565, 'mean_word_length': 2.9362912400455063, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 33, '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': '2197232', 'n_tokens_mistral': 1022, 'n_tokens_neox': 991, 'n_words': 224}