Fixing incorrect Transformer casing throwing an error in case-sensitive environments (https://github.com/woocommerce/woocommerce-admin/pull/7104)
This commit is contained in:
parent
eb833db73a
commit
dc9f44e536
|
@ -74,6 +74,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
== Unreleased ==
|
== 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
|
- Dev: Reduce the specificity and complexity of the ReportError component #6846
|
||||||
- Add: Create onboarding package to house refactored WCPay card and relevant components #7058
|
- 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
|
- Fix: Preventing redundant notices when installing plugins via payments task list. #7026
|
||||||
|
|
|
@ -21,7 +21,7 @@ class TransformerService {
|
||||||
* @return TransformerInterface|null
|
* @return TransformerInterface|null
|
||||||
*/
|
*/
|
||||||
public static function create_transformer( $name ) {
|
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;
|
$classname = __NAMESPACE__ . '\\Transformers\\' . $camel_cased;
|
||||||
if ( ! class_exists( $classname ) ) {
|
if ( ! class_exists( $classname ) ) {
|
||||||
|
|
Loading…
Reference in New Issue