Your IP : 216.73.216.43


Current Path : /home/rtorresani/www/vendor/paypal/module-braintree-core/Model/Report/ConditionAppliers/
Upload File :
Current File : //home/rtorresani/www/vendor/paypal/module-braintree-core/Model/Report/ConditionAppliers/Text.php

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace PayPal\Braintree\Model\Report\ConditionAppliers;

use Braintree\TextNode;

/**
 * Text applier
 */
class Text implements ApplierInterface
{
    /**
     * @inheritDoc
     */
    public function apply($field, $condition, $value): bool
    {
        $result = false;

        $value = trim($value, "% \r\n\t");
        switch ($condition) {
            case ApplierInterface::EQ:
                $field->is($value);
                $result = true;
                break;
            case ApplierInterface::LIKE:
                $field->contains($value);
                $result = true;
                break;
        }

        return $result;
    }
}