Fixing incorrect Transformer casing throwing an error in case-sensitive environments (https://github.com/woocommerce/woocommerce-admin/pull/7104)

This commit is contained in:
Joel Thiessen 2021-06-03 09:09:19 -07:00 committed by GitHub
parent eb833db73a
commit dc9f44e536
2 changed files with 2 additions and 1 deletions

View File

@ -74,6 +74,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
== Changelog ==
== Unreleased ==
- Fix: Transformer casing is incorrect and creates an error on case-sensitive systems #7104
- Dev: Reduce the specificity and complexity of the ReportError component #6846
- Add: Create onboarding package to house refactored WCPay card and relevant components #7058
- Fix: Preventing redundant notices when installing plugins via payments task list. #7026

View File

@ -21,7 +21,7 @@ class TransformerService {
* @return TransformerInterface|null
*/
public static function create_transformer( $name ) {
$camel_cased = lcfirst( str_replace( ' ', '', ucwords( str_replace( '_', ' ', $name ) ) ) );
$camel_cased = str_replace( ' ', '', ucwords( str_replace( '_', ' ', $name ) ) );
$classname = __NAMESPACE__ . '\\Transformers\\' . $camel_cased;
if ( ! class_exists( $classname ) ) {