private function cmpValues($methodName)
    {
        return function ($value1, $value2) use ($methodName) {
            return strnatcmp($value1->{$methodName}(), $value2->{$methodName}());
        };
    }