private function validateCreditCard($parameters) { $fieldName = "credit_card"; if (!v::creditCard()->validate($parameters[$fieldName])) { $this->validationResponse->status = s::VALIDATION_ERROR; $this->validationResponse->errors[$fieldName] = "is invalid"; return false; } return true; }
/** * 检验输入的数据是否为合适的信用卡号码 * * @param int $value 信用卡号码 * @return bool */ public static function creditCard($value) { return Validator::creditCard()->validate($value); }