class Rules{ /**
* The value does not match another field in $data.
*
* @param array $data Other field/value pairs
*/
public function differs(?string
$str, string
$field, array
$data): bool
{ if (strpos($field, '.'
) !== false
) { return $str !==
dot_array_search($field,
$data);
} return array_key_exists($field,
$data) &&
$str !==
$data[$field];
} /**
* Equals the static value provided.
*/
public function equals(?string
$str, string
$val): bool
{ return $str ===
$val;
}