public static function Braintree_Util::cleanClassName in Commerce Braintree 7
removes the Braintree_ header from a classname
Parameters
string $name Braintree_ClassName:
Return value
camelCased classname minus Braintree_ header
3 calls to Braintree_Util::cleanClassName()
- Braintree::returnObjectOrThrowException in braintree_php/
lib/ Braintree.php - Braintree_Result_Successful::__construct in braintree_php/
lib/ Braintree/ Result/ Successful.php - @ignore
- Braintree_UtilTest::testCleanClassName in braintree_php/
tests/ unit/ UtilTest.php
File
- braintree_php/
lib/ Braintree/ Util.php, line 88
Class
- Braintree_Util
- Braintree Utility methods
Code
public static function cleanClassName($name) {
$name = str_replace('Braintree_', '', $name);
// lcfirst only exists >= 5.3
if (false === function_exists('lcfirst')) {
function lcfirst($str) {
return (string) (strtolower(substr($str, 0, 1)) . substr($str, 1));
}
}
return lcfirst($name);
}