AlkantarClanX12

Your IP : 3.133.146.94


Current Path : /home/thanudqk/128shen.com/wp-content/plugins/contact-form-7/includes/swv/php/rules/
Upload File :
Current File : //home/thanudqk/128shen.com/wp-content/plugins/contact-form-7/includes/swv/php/rules/any.php

<?php

namespace Contactable\SWV;

class AnyRule extends CompositeRule {

	const rule_name = 'any';

	public function matches( $context ) {
		if ( false === parent::matches( $context ) ) {
			return false;
		}

		return true;
	}

	public function validate( $context ) {
		foreach ( $this->rules() as $rule ) {
			if ( $rule->matches( $context ) ) {
				$result = $rule->validate( $context );

				if ( ! is_wp_error( $result ) ) {
					return true;
				}
			}
		}

		return $this->create_error();
	}

}