######################### auxilary functions ################################## penalizes differing method names with 100
($f1, $f2)
| 45 | ########################## auxilary functions ################################## |
| 46 | /// penalizes differing method names with 100 |
| 47 | function penalize_name($f1, $f2) { |
| 48 | # extract name (between whitepace and bracket |
| 49 | $tmp = trim(substr($f1, 0, strpos($f1, "("))); |
| 50 | $tmp = strtr($tmp, array("operator " => "operator", "operator\t" => "operator")); |
| 51 | $n1 = trim(substr($tmp, max(strrpos($tmp, " "), strrpos($tmp, "\t")))); |
| 52 | |
| 53 | # extract name (between whitepace and bracket |
| 54 | $tmp = trim(substr($f2, 0, strpos($f2, "("))); |
| 55 | $tmp = strtr($tmp, array("operator " => "operator", "operator\t" => "operator")); |
| 56 | $n2 = trim(substr($tmp, max(strrpos($tmp, " "), strrpos($tmp, "\t")))); |
| 57 | |
| 58 | if($n1 == $n2) |
| 59 | { |
| 60 | return 0; |
| 61 | } |
| 62 | return 100; |
| 63 | } |
| 64 | |
| 65 | ######################## parameter handling #################################### |
| 66 | $verbose = false; |
no test coverage detected