test(classifier): boundary + array-value tests for has_short_latin_name; @return tags
- Add @return bool to has_valid_email_anywhere docblock
- Add @return bool to has_short_latin_name docblock
- Add Cyrillic note to has_short_latin_name docblock
- Add test_has_short_latin_name_true_for_single_letter_boundary (lower bound)
- Add test_has_short_latin_name_false_for_four_letters_boundary (upper bound)
- Add test_has_short_latin_name_false_for_array_value_with_space_join (regression)
Addresses code review feedback from commit 660a0d2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -226,6 +226,7 @@ final class Classifier
|
||||
* shape). Deeper nesting is intentionally NOT supported.
|
||||
*
|
||||
* @param array<string,string|string[]> $fields CF7 posted_data
|
||||
* @return bool True if any value contains a syntactically valid email
|
||||
*/
|
||||
public static function has_valid_email_anywhere(array $fields): bool
|
||||
{
|
||||
@@ -252,7 +253,10 @@ final class Classifier
|
||||
* the value-based heuristic in FieldDetector::find_name(). Returns false if no name
|
||||
* field is present (i.e. forms without a name field are immune to this rule).
|
||||
*
|
||||
* Cyrillic look-alikes (e.g. 'ОВ') are rejected because the regex is byte-range.
|
||||
*
|
||||
* @param array<string,string|string[]> $fields CF7 posted_data
|
||||
* @return bool True if a name field exists and is 1-3 ASCII alphanumeric chars
|
||||
*/
|
||||
public static function has_short_latin_name(array $fields): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user