File "SameRule.php"

Full Path: /home/warrior1/public_html/languages/wp-content-20241001222009/plugins/file-manager/vendor/bitapps/wp-validator/src/Rules/SameRule.php
File size: 639 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
namespace BitApps\WPValidator\Rules;

use BitApps\WPValidator\Rule;

class SameRule extends Rule
{
    private $message = "The :attribute and :other must match";

    protected $requireParameters = ['other'];

    public function validate($value)
    {
        $this->checkRequiredParameter($this->requireParameters);

        $otherValue = $this->getInputDataContainer()->getAttributeValue($this->getParameter('other'));

        return $value === $otherValue;
    }

    public function getParamKeys()
    {
        return $this->requireParameters;
    }

    public function message()
    {
        return $this->message;
    }
}