Please move to another function and use intermediate variables. The function name should make it clear what is done - e.g. `convertAllPathSegmentsToUpperCamelCase($path)`.