private function suggestPropertyName(string $badProperty) : string
{
$badProperty = \strtolower($badProperty);
$bestMatch = "";
$bestMatchPercentage = 0.0;
$byRefPercentage = 0.0;
foreach ($this as $property => $value) {
// Never suggest properties that begin with an underscore
if ($property[0] === "_") {
continue;
}
\similar_text($badProperty, \strtolower($property), $byRefPercentage);
if ($byRefPercentage > $bestMatchPercentage) {
$bestMatchPercentage = $byRefPercentage;
$bestMatch = $property;
}
}
return $bestMatchPercentage >= $this->__propertySuggestThreshold ? $bestMatch : "";
}