False positive: sentence case
John Morahan - November 21, 2008 - 15:54
| Project: | Coder Tough Love |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
The sentence case rule gave me a false positive on this line:
<?php
$header = array(t('Network'), t('Profile'));
?>Looks like it's treating them as parts of a single string; in fact, they are headers for separate table columns.

#1
Yeah, this is one of those situations where it's a known false positive, and how to get rid of it is a quandary. In previous versions of Coder, that would come through as one string of "Network Profile". Coder Tough Love would treat it as a sentence, and fail it. In the 2.x version of Coder, we'll get that through as an array of "Network" and "Profile", but CTL will munge that into a single string (primarily as a quickie forward-port from 1.x to 2.x API) and, yep, fail it again.
Going forward, we could check each individual array element, and that would allow the above through (as the code will ignore "sentences" of just one word, as well as the first word from every "sentence") without complaint. I worry that it would then start failing on stuff like "This is a ". $dynamic . " string which, granted, shouldn't ever exist."