Amp\Struct::suggestPropertyName PHP Method

suggestPropertyName() private method

private suggestPropertyName ( string $badProperty ) : string
$badProperty string
return string
    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 : "";
    }