Permalink
Browse files

rename protected variable to $_engine

  • Loading branch information...
1 parent fe479c6 commit 5eb1979b0495e612a2842c2ed0a6e109e8da8e20 @rchavik rchavik committed Feb 14, 2012
@@ -26,11 +26,11 @@
class NumberHelperTestObject extends NumberHelper {
public function attach(CakeNumberMock $cakeNumber) {
- $this->_CakeNumber = $cakeNumber;
+ $this->_engine = $cakeNumber;
}
public function engine() {
- return $this->_CakeNumber;
+ return $this->_engine;
}
}
@@ -23,11 +23,11 @@
class TextHelperTestObject extends TextHelper {
public function attach(StringMock $string) {
- $this->_String = $string;
+ $this->_engine = $string;
}
public function engine() {
- return $this->_String;
+ return $this->_engine;
}
}
@@ -26,11 +26,11 @@
class TimeHelperTestObject extends TimeHelper {
public function attach(CakeTimeMock $cakeTime) {
- $this->_CakeTime = $cakeTime;
+ $this->_engine = $cakeTime;
}
public function engine() {
- return $this->_CakeTime;
+ return $this->_engine;
}
}
@@ -35,7 +35,7 @@ class NumberHelper extends AppHelper {
/** CakeNumber instance
*/
- protected $_CakeNumber = null;
+ protected $_engine = null;
/* Default Constructor
*
@@ -48,7 +48,7 @@ function __construct(View $View, $settings = array()) {
list($plugin, $engineClass) = pluginSplit($settings['engine'], true);
App::uses($engineClass, $plugin . 'Utility');
if (class_exists($engineClass)) {
- $this->_CakeNumber = new $engineClass($settings);
+ $this->_engine = new $engineClass($settings);
} else {
throw new CakeException(__d('cake_dev', '%s could not be found', $engineClass));
}
@@ -58,7 +58,7 @@ function __construct(View $View, $settings = array()) {
* Call methods from CakeNumber utility class
*/
public function __call($method, $params) {
- return call_user_func_array(array($this->_CakeNumber, $method), $params);
+ return call_user_func_array(array($this->_engine, $method), $params);
}
/**
@@ -70,7 +70,7 @@ public function __call($method, $params) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::precision
*/
public function precision($number, $precision = 3) {
- return $this->_CakeNumber->precision($number, $precision);
+ return $this->_engine->precision($number, $precision);
}
/**
@@ -81,7 +81,7 @@ public function precision($number, $precision = 3) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toReadableSize
*/
public function toReadableSize($size) {
- return $this->_CakeNumber->toReadableSize($size);
+ return $this->_engine->toReadableSize($size);
}
/**
@@ -93,7 +93,7 @@ public function toReadableSize($size) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toPercentage
*/
public function toPercentage($number, $precision = 2) {
- return $this->_CakeNumber->toPercentage($number, $precision);
+ return $this->_engine->toPercentage($number, $precision);
}
/**
@@ -106,7 +106,7 @@ public function toPercentage($number, $precision = 2) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::format
*/
public function format($number, $options = false) {
- return $this->_CakeNumber->format($number, $options);
+ return $this->_engine->format($number, $options);
}
/**
@@ -120,7 +120,7 @@ public function format($number, $options = false) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::currency
*/
public function currency($number, $currency = 'USD', $options = array()) {
- return $this->_CakeNumber->currency($number, $currency, $options);
+ return $this->_engine->currency($number, $currency, $options);
}
/**
@@ -133,7 +133,7 @@ public function currency($number, $currency = 'USD', $options = array()) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::addFormat
*/
public function addFormat($formatName, $options) {
- return $this->_CakeNumber->addFormat($formatName, $options);
+ return $this->_engine->addFormat($formatName, $options);
}
}
@@ -51,7 +51,7 @@ class TextHelper extends AppHelper {
/**
* String utility instance
*/
- protected $_String;
+ protected $_engine;
/**
* Constructor
@@ -65,7 +65,7 @@ public function __construct(View $View, $settings = array()) {
list($plugin, $engineClass) = pluginSplit($settings['engine'], true);
App::uses($engineClass, $plugin . 'Utility');
if (class_exists($engineClass)) {
- $this->_String = new $engineClass($settings);
+ $this->_engine = new $engineClass($settings);
} else {
throw new CakeException(__d('cake_dev', '%s could not be found', $engineClass));
}
@@ -75,7 +75,7 @@ public function __construct(View $View, $settings = array()) {
* Call methods from String utility class
*/
public function __call($method, $params) {
- return call_user_func_array(array($this->_String, $method), $params);
+ return call_user_func_array(array($this->_engine, $method), $params);
}
/**
@@ -214,7 +214,7 @@ public function autoLink($text, $options = array()) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::highlight
*/
public function highlight($text, $phrase, $options = array()) {
- return $this->_String->highlight($text, $phrase, $options);
+ return $this->_engine->highlight($text, $phrase, $options);
}
/**
@@ -225,7 +225,7 @@ public function highlight($text, $phrase, $options = array()) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::stripLinks
*/
public function stripLinks($text) {
- return $this->_String->stripLinks($text);
+ return $this->_engine->stripLinks($text);
}
/**
@@ -238,7 +238,7 @@ public function stripLinks($text) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::truncate
*/
public function truncate($text, $length = 100, $options = array()) {
- return $this->_String->truncate($text, $length, $options);
+ return $this->_engine->truncate($text, $length, $options);
}
/**
@@ -252,7 +252,7 @@ public function truncate($text, $length = 100, $options = array()) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::excerpt
*/
public function excerpt($text, $phrase, $radius = 100, $ending = '...') {
- return $this->_String->excerpt($text, $phrase, $radius, $ending);
+ return $this->_engine->excerpt($text, $phrase, $radius, $ending);
}
/**
@@ -265,7 +265,7 @@ public function excerpt($text, $phrase, $radius = 100, $ending = '...') {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/text.html#TextHelper::toList
*/
public function toList($list, $and = 'and', $separator = ', ') {
- return $this->_String->toList($list, $and, $separator);
+ return $this->_engine->toList($list, $and, $separator);
}
}
Oops, something went wrong.

0 comments on commit 5eb1979

Please sign in to comment.