Changing protected methods to specify protected access.

This commit is contained in:
predominant 2010-04-05 13:21:28 +10:00
parent 1497ec3910
commit 50a547167b
49 changed files with 145 additions and 290 deletions

View file

@ -166,9 +166,8 @@ class ShellDispatcher {
/**
* Defines current working environment.
*
* @access protected
*/
function _initEnvironment() {
protected function _initEnvironment() {
$this->stdin = fopen('php://stdin', 'r');
$this->stdout = fopen('php://stdout', 'w');
$this->stderr = fopen('php://stderr', 'w');
@ -389,9 +388,8 @@ class ShellDispatcher {
*
* @param string $plugin Optionally the name of a plugin
* @return mixed False if no shell could be found or an object on success
* @access protected
*/
function _getShell($plugin = null) {
protected function _getShell($plugin = null) {
foreach ($this->shellPaths as $path) {
$this->shellPath = $path . $this->shell . '.php';
$pluginShellPath = DS . $plugin . DS . 'vendors' . DS . 'shells' . DS;
@ -641,9 +639,8 @@ class ShellDispatcher {
*
* @param $status see http://php.net/exit for values
* @return void
* @access protected
*/
function _stop($status = 0) {
protected function _stop($status = 0) {
exit($status);
}
}

View file

@ -229,9 +229,8 @@ class AclShell extends Shell {
* @param array $node Array of node information.
* @param integer $indent indent level.
* @return void
* @access protected
*/
function _outputNode($class, $node, $indent) {
protected function _outputNode($class, $node, $indent) {
$indent = str_repeat(' ', $indent);
$data = $node[$class];
if ($data['alias']) {

View file

@ -323,9 +323,8 @@ class ConsoleShell extends Shell {
*
* @param string $modelToCheck
* @return boolean true if is an available model, false otherwise
* @access protected
*/
function _isValidModel($modelToCheck) {
protected function _isValidModel($modelToCheck) {
return in_array($modelToCheck, $this->models);
}
@ -334,9 +333,8 @@ class ConsoleShell extends Shell {
* all routes found
*
* @return boolean True if config reload was a success, otherwise false
* @access protected
*/
function _loadRoutes() {
protected function _loadRoutes() {
$router =& Router::getInstance();
$router->reload();

View file

@ -192,9 +192,8 @@ class Shell extends Object {
/**
* Displays a header for the shell
*
* @access protected
*/
function _welcome() {
protected function _welcome() {
$this->Dispatch->clear();
$this->out();
$this->out('Welcome to CakePHP v' . Configure::version() . ' Console');
@ -209,9 +208,8 @@ class Shell extends Object {
* makes $this->DbConfig available to subclasses
*
* @return bool
* @access protected
*/
function _loadDbConfig() {
protected function _loadDbConfig() {
if (config('database') && class_exists('DATABASE_CONFIG')) {
$this->DbConfig =& new DATABASE_CONFIG();
return true;
@ -228,9 +226,8 @@ class Shell extends Object {
* if public $uses is an array of models will load those models
*
* @return bool
* @access protected
*/
function _loadModels() {
protected function _loadModels() {
if ($this->uses === null || $this->uses === false) {
return;
}
@ -424,9 +421,8 @@ class Shell extends Object {
*
* @param integer $expectedNum Expected number of paramters
* @param string $command Command
* @access protected
*/
function _checkArgs($expectedNum, $command = null) {
protected function _checkArgs($expectedNum, $command = null) {
if (!$command) {
$command = $this->command;
}
@ -496,9 +492,8 @@ class Shell extends Object {
* Action to create a Unit Test
*
* @return boolean Success
* @access protected
*/
function _checkUnitTest() {
protected function _checkUnitTest() {
if (App::import('vendor', 'simpletest' . DS . 'simpletest')) {
return true;
}
@ -530,9 +525,8 @@ class Shell extends Object {
*
* @param string $name Controller class name
* @return string Path to controller
* @access protected
*/
function _controllerPath($name) {
protected function _controllerPath($name) {
return strtolower(Inflector::underscore($name));
}
@ -541,9 +535,8 @@ class Shell extends Object {
*
* @param string $name Controller class name
* @return string Controller plural name
* @access protected
*/
function _controllerName($name) {
protected function _controllerName($name) {
return Inflector::pluralize(Inflector::camelize($name));
}
@ -552,9 +545,8 @@ class Shell extends Object {
*
* @param string $name Name
* @return string Camelized and singularized controller name
* @access protected
*/
function _modelName($name) {
protected function _modelName($name) {
return Inflector::camelize(Inflector::singularize($name));
}
@ -563,9 +555,8 @@ class Shell extends Object {
*
* @param string $name Controller class name
* @return string Singular model key
* @access protected
*/
function _modelKey($name) {
protected function _modelKey($name) {
return Inflector::underscore(Inflector::singularize($name)) . '_id';
}
@ -574,9 +565,8 @@ class Shell extends Object {
*
* @param string $key Foreign key
* @return string Model name
* @access protected
*/
function _modelNameFromKey($key) {
protected function _modelNameFromKey($key) {
return Inflector::camelize(str_replace('_id', '', $key));
}
@ -585,9 +575,8 @@ class Shell extends Object {
*
* @param string $name
* @return string $name
* @access protected
*/
function _singularName($name) {
protected function _singularName($name) {
return Inflector::variable(Inflector::singularize($name));
}
@ -596,9 +585,8 @@ class Shell extends Object {
*
* @param string $name Name to use
* @return string Plural name for views
* @access protected
*/
function _pluralName($name) {
protected function _pluralName($name) {
return Inflector::variable(Inflector::pluralize($name));
}
@ -607,9 +595,8 @@ class Shell extends Object {
*
* @param string $name Controller name
* @return string Singular human name
* @access protected
*/
function _singularHumanName($name) {
protected function _singularHumanName($name) {
return Inflector::humanize(Inflector::underscore(Inflector::singularize($name)));
}
@ -618,9 +605,8 @@ class Shell extends Object {
*
* @param string $name Controller name
* @return string Plural human name
* @access protected
*/
function _pluralHumanName($name) {
protected function _pluralHumanName($name) {
return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name)));
}

View file

@ -247,9 +247,8 @@ class FixtureTask extends BakeTask {
*
* @param array $table Table schema array
* @return string fields definitions
* @access protected
*/
function _generateSchema($tableInfo) {
protected function _generateSchema($tableInfo) {
$schema = $this->_Schema->generateTable('f', $tableInfo);
return substr($schema, 10, -2);
}
@ -259,9 +258,8 @@ class FixtureTask extends BakeTask {
*
* @param array $table Table schema array
* @return array Array of records to use in the fixture.
* @access protected
*/
function _generateRecords($tableInfo, $recordCount = 1) {
protected function _generateRecords($tableInfo, $recordCount = 1) {
$records = array();
for ($i = 0; $i < $recordCount; $i++) {
$record = array();
@ -331,9 +329,8 @@ class FixtureTask extends BakeTask {
*
* @param array $records Array of records to be converted to string
* @return string A string value of the $records array.
* @access protected
*/
function _makeRecordString($records) {
protected function _makeRecordString($records) {
$out = "array(\n";
foreach ($records as $record) {
$values = array();
@ -355,9 +352,8 @@ class FixtureTask extends BakeTask {
* @param string $modelName name of the model to take records from.
* @param string $useTable Name of table to use.
* @return array Array of records.
* @access protected
*/
function _getRecordsFromTable($modelName, $useTable = null) {
protected function _getRecordsFromTable($modelName, $useTable = null) {
if ($this->interactive) {
$condition = null;
$prompt = __("Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10", true);

View file

@ -294,9 +294,8 @@ class TestTask extends BakeTask {
*
* @param Model $subject A Model class to scan for associations and pull fixtures off of.
* @return void
* @access protected
*/
function _processModel(&$subject) {
protected function _processModel(&$subject) {
$this->_addFixture($subject->name);
$associated = $subject->getAssociated();
foreach ($associated as $alias => $type) {
@ -319,9 +318,8 @@ class TestTask extends BakeTask {
*
* @param Controller $subject A controller to pull model names off of.
* @return void
* @access protected
*/
function _processController(&$subject) {
protected function _processController(&$subject) {
$subject->constructClasses();
$models = array(Inflector::classify($subject->name));
if (!empty($subject->uses)) {
@ -338,9 +336,8 @@ class TestTask extends BakeTask {
*
* @param string $name Name of the Model class that a fixture might be required for.
* @return void
* @access protected
*/
function _addFixture($name) {
protected function _addFixture($name) {
$parent = get_parent_class($name);
$prefix = 'app.';
if (strtolower($parent) != 'appmodel' && strtolower(substr($parent, -8)) == 'appmodel') {

View file

@ -179,9 +179,8 @@ class Dispatcher extends Object {
* @param array $params Parameters with at least the 'action' to invoke
* @param boolean $missingAction Set to true if missing action should be rendered, false otherwise
* @return string Output as sent by controller
* @access protected
*/
function _invoke(&$controller, $params) {
protected function _invoke(&$controller, $params) {
$controller->constructClasses();
$controller->startupProcess();
@ -370,9 +369,8 @@ class Dispatcher extends Object {
* @param boolean $reverse If true all the params are shifted one forward, so plugin becomes
* controller, controller becomes action etc. If false, plugin is made equal to controller
* @return array Restructured array
* @access protected
*/
function _restructureParams($params, $reverse = false) {
protected function _restructureParams($params, $reverse = false) {
if ($reverse === true) {
extract(Router::getArgs($params['action']));
$params = array_merge($params, array(
@ -648,9 +646,8 @@ class Dispatcher extends Object {
* @param string $assetFile Path to the asset file in the file system
* @param string $ext The extension of the file to determine its mime type
* @return void
* @access protected
*/
function _deliverAsset($assetFile, $ext) {
protected function _deliverAsset($assetFile, $ext) {
$ob = @ini_get("zlib.output_compression") !== '1' && extension_loaded("zlib") && (strpos(env('HTTP_ACCEPT_ENCODING'), 'gzip') !== false);
if ($ob && Configure::read('Asset.compress')) {
ob_start();

View file

@ -136,9 +136,8 @@ class Cache {
*
* @param string $name Name of the config array that needs an engine instance built
* @return void
* @access protected
*/
function _buildEngine($name) {
protected function _buildEngine($name) {
$config = $this->__config[$name];
list($plugin, $class) = pluginSplit($config['engine']);

View file

@ -117,9 +117,8 @@ class CakeLog {
*
* @param string $loggerName the plugin.className of the logger class you want to build.
* @return mixed boolean false on any failures, string of classname to use if search was successful.
* @access protected
*/
function _getLogger($loggerName) {
protected function _getLogger($loggerName) {
list($plugin, $loggerName) = pluginSplit($loggerName);
if ($plugin) {
@ -173,9 +172,8 @@ class CakeLog {
* Configures the automatic/default stream a FileLog.
*
* @return void
* @access protected
*/
function _autoConfig() {
protected function _autoConfig() {
if (!class_exists('FileLog')) {
App::import('Core', 'log/FileLog');
}

View file

@ -587,9 +587,8 @@ class CakeSession extends Object {
* Helper method to create a new session.
*
* @return void
* @access protected
*/
function _checkValid() {
protected function _checkValid() {
if ($this->read('Config')) {
if ((Configure::read('Session.checkAgent') === false || $this->_userAgent == $this->read('Config.userAgent')) && $this->time <= $this->read('Config.time')) {
$time = $this->read('Config.time');

View file

@ -191,9 +191,8 @@ class Component extends Object {
* @param object $object Object with a Components array
* @param object $parent the parent of the current object
* @return void
* @access protected
*/
function _loadComponents(&$object, $parent = null) {
protected function _loadComponents(&$object, $parent = null) {
$base = $this->__controllerVars['base'];
$normal = Set::normalize($object->components);
foreach ((array)$normal as $component => $config) {

View file

@ -71,9 +71,8 @@ class AclComponent extends Object {
/**
* Empty class defintion, to be overridden in subclasses.
*
* @access protected
*/
function _initACL() {
protected function _initACL() {
}
/**
@ -460,9 +459,8 @@ class DbAcl extends AclBase {
*
* @param array $keys Permission model info
* @return array ACO keys
* @access protected
*/
function _getAcoKeys($keys) {
protected function _getAcoKeys($keys) {
$newKeys = array();
$keys = array_keys($keys);
foreach ($keys as $key) {

View file

@ -421,9 +421,8 @@ class SecurityComponent extends Object {
* @param string $method The HTTP method to assign controller actions to
* @param array $actions Controller actions to set the required HTTP method to.
* @return void
* @access protected
*/
function _requireMethod($method, $actions = array()) {
protected function _requireMethod($method, $actions = array()) {
if (isset($actions[0]) && is_array($actions[0])) {
$actions = $actions[0];
}
@ -435,9 +434,8 @@ class SecurityComponent extends Object {
*
* @param object $controller Instantiating controller
* @return bool true if $method is required
* @access protected
*/
function _methodsRequired(&$controller) {
protected function _methodsRequired(&$controller) {
foreach (array('Post', 'Get', 'Put', 'Delete') as $method) {
$property = 'require' . $method;
if (is_array($this->$property) && !empty($this->$property)) {
@ -460,9 +458,8 @@ class SecurityComponent extends Object {
*
* @param object $controller Instantiating controller
* @return bool true if secure connection required
* @access protected
*/
function _secureRequired(&$controller) {
protected function _secureRequired(&$controller) {
if (is_array($this->requireSecure) && !empty($this->requireSecure)) {
$requireSecure = array_map('strtolower', $this->requireSecure);
@ -482,9 +479,8 @@ class SecurityComponent extends Object {
*
* @param object $controller Instantiating controller
* @return bool true if authentication required
* @access protected
*/
function _authRequired(&$controller) {
protected function _authRequired(&$controller) {
if (is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($controller->data)) {
$requireAuth = array_map('strtolower', $this->requireAuth);
@ -518,9 +514,8 @@ class SecurityComponent extends Object {
*
* @param object $controller Instantiating controller
* @return bool true if login is required
* @access protected
*/
function _loginRequired(&$controller) {
protected function _loginRequired(&$controller) {
if (is_array($this->requireLogin) && !empty($this->requireLogin)) {
$requireLogin = array_map('strtolower', $this->requireLogin);
@ -566,9 +561,8 @@ class SecurityComponent extends Object {
*
* @param object $controller Instantiating controller
* @return bool true if submitted form is valid
* @access protected
*/
function _validatePost(&$controller) {
protected function _validatePost(&$controller) {
if (empty($controller->data)) {
return true;
}
@ -647,9 +641,8 @@ class SecurityComponent extends Object {
*
* @param object $controller Instantiating controller
* @return bool Success
* @access protected
*/
function _generateToken(&$controller) {
protected function _generateToken(&$controller) {
if (isset($controller->params['requested']) && $controller->params['requested'] === 1) {
if ($this->Session->check('_Token')) {
$tokenData = unserialize($this->Session->read('_Token'));
@ -693,9 +686,8 @@ class SecurityComponent extends Object {
*
* @param array $options Default login options
* @return void
* @access protected
*/
function _setLoginDefaults(&$options) {
protected function _setLoginDefaults(&$options) {
$options = array_merge(array(
'type' => 'basic',
'realm' => env('SERVER_NAME'),
@ -712,9 +704,8 @@ class SecurityComponent extends Object {
* @param string $method Method to execute
* @param array $params Parameters to send to method
* @return mixed Controller callback method's response
* @access protected
*/
function _callback(&$controller, $method, $params = array()) {
protected function _callback(&$controller, $method, $params = array()) {
if (is_callable(array($controller, $method))) {
return call_user_func_array(array(&$controller, $method), empty($params) ? null : $params);
} else {

View file

@ -394,9 +394,8 @@ class Controller extends Object {
* Merge components, helpers, and uses vars from AppController and PluginAppController.
*
* @return void
* @access protected
*/
function __mergeVars() {
protected function __mergeVars() {
$pluginName = Inflector::camelize($this->plugin);
$pluginController = $pluginName . 'AppController';

View file

@ -206,9 +206,8 @@ class Scaffold extends Object {
* Outputs the content of a scaffold method passing it through the Controller::afterFilter()
*
* @return void
* @access protected
*/
function _output() {
protected function _output() {
$this->controller->afterFilter();
echo($this->controller->output);
}
@ -550,9 +549,8 @@ class ScaffoldView extends ThemeView {
* Override _getViewFileName
*
* @return string action
* @access protected
*/
function _getViewFileName($name = null) {
protected function _getViewFileName($name = null) {
if ($name === null) {
$name = $this->action;
}

View file

@ -562,9 +562,8 @@ class Debugger extends Object {
* @param string $format Format to use, including 'js' for JavaScript-enhanced HTML, 'html' for
* straight HTML output, or 'txt' for unformatted text.
* @param array $strings Template strings to be used for the output format.
* @access protected
*/
function output($format = null, $strings = array()) {
protected function output($format = null, $strings = array()) {
$_this =& Debugger::getInstance();
$data = null;

View file

@ -433,9 +433,8 @@ class ErrorHandler extends Object {
/**
* Output message
*
* @access protected
*/
function _outputMessage($template) {
protected function _outputMessage($template) {
$this->controller->render($template);
$this->controller->afterFilter();
echo $this->controller->output;

View file

@ -430,9 +430,8 @@ class HttpSocket extends CakeSocket {
*
* @param string $message Message to parse
* @return array Parsed message (with indexed elements such as raw, status, header, body)
* @access protected
*/
function _parseResponse($message) {
protected function _parseResponse($message) {
if (is_array($message)) {
return $message;
} elseif (!is_string($message)) {
@ -494,9 +493,8 @@ class HttpSocket extends CakeSocket {
* @param string $body A string continaing the body to decode.
* @param mixed $encoding Can be false in case no encoding is being used, or a string representing the encoding.
* @return mixed Array of response headers and body or false.
* @access protected
*/
function _decodeBody($body, $encoding = 'chunked') {
protected function _decodeBody($body, $encoding = 'chunked') {
if (!is_string($body)) {
return false;
}
@ -520,9 +518,8 @@ class HttpSocket extends CakeSocket {
*
* @param string $body A string continaing the chunked body to decode.
* @return mixed Array of response headers and body or false.
* @access protected
*/
function _decodeChunkedBody($body) {
protected function _decodeChunkedBody($body) {
if (!is_string($body)) {
return false;
}
@ -582,9 +579,8 @@ class HttpSocket extends CakeSocket {
*
* @param mixed $uri URI, See HttpSocket::_parseUri()
* @return array Current configuration settings
* @access protected
*/
function _configUri($uri = null) {
protected function _configUri($uri = null) {
if (empty($uri)) {
return false;
}
@ -616,9 +612,8 @@ class HttpSocket extends CakeSocket {
* @param mixed $uri Either A $uri array, or a request string. Will use $this->config if left empty.
* @param string $uriTemplate The Uri template/format to use.
* @return mixed A fully qualified URL formated according to $uriTemplate, or false on failure
* @access protected
*/
function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%port/%path?%query#%fragment') {
protected function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%port/%path?%query#%fragment') {
if (is_string($uri)) {
$uri = array('host' => $uri);
}
@ -664,9 +659,8 @@ class HttpSocket extends CakeSocket {
* @param string $uri URI to parse
* @param mixed $base If true use default URI config, otherwise indexed array to set 'scheme', 'host', 'port', etc.
* @return array Parsed URI
* @access protected
*/
function _parseUri($uri = null, $base = array()) {
protected function _parseUri($uri = null, $base = array()) {
$uriBase = array(
'scheme' => array('http', 'https'),
'host' => null,
@ -730,9 +724,8 @@ class HttpSocket extends CakeSocket {
* @param mixed $query A query string to parse into an array or an array to return directly "as is"
* @return array The $query parsed into a possibly multi-level array. If an empty $query is
* given, an empty array is returned.
* @access protected
*/
function _parseQuery($query) {
protected function _parseQuery($query) {
if (is_array($query)) {
return $query;
}
@ -788,9 +781,8 @@ class HttpSocket extends CakeSocket {
* @param array $request Needs to contain a 'uri' key. Should also contain a 'method' key, otherwise defaults to GET.
* @param string $versionToken The version token to use, defaults to HTTP/1.1
* @return string Request line
* @access protected
*/
function _buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') {
protected function _buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') {
$asteriskMethods = array('OPTIONS');
if (is_string($request)) {
@ -822,9 +814,8 @@ class HttpSocket extends CakeSocket {
*
* @param array $data Data to serialize
* @return string Serialized variable
* @access protected
*/
function _httpSerialize($data = array()) {
protected function _httpSerialize($data = array()) {
if (is_string($data)) {
return $data;
}
@ -839,9 +830,8 @@ class HttpSocket extends CakeSocket {
*
* @param array $header Header to build
* @return string Header built from array
* @access protected
*/
function _buildHeader($header, $mode = 'standard') {
protected function _buildHeader($header, $mode = 'standard') {
if (is_string($header)) {
return $header;
} elseif (!is_array($header)) {
@ -868,9 +858,8 @@ class HttpSocket extends CakeSocket {
*
* @param array $header Header as an indexed array (field => value)
* @return array Parsed header
* @access protected
*/
function _parseHeader($header) {
protected function _parseHeader($header) {
if (is_array($header)) {
foreach ($header as $field => $value) {
unset($header[$field]);

View file

@ -272,9 +272,8 @@ class Inflector {
* @param string $key Original value
* @param string $value Inflected value
* @return string Inflected value, from cache
* @access protected
*/
function _cache($type, $key, $value = false) {
protected function _cache($type, $key, $value = false) {
$key = '_' . $key;
$type = '_' . $type;
if ($value !== false) {

View file

@ -332,9 +332,8 @@ class TranslateBehavior extends ModelBehavior {
* Get selected locale for model
*
* @return mixed string or false
* @access protected
*/
function _getLocale(&$model) {
protected function _getLocale(&$model) {
if (!isset($model->locale) || is_null($model->locale)) {
if (!class_exists('I18n')) {
App::import('Core', 'i18n');

View file

@ -798,9 +798,8 @@ class TreeBehavior extends ModelBehavior {
* @param AppModel $Model Model instance
* @param mixed $parentId
* @return boolean true on success, false on failure
* @access protected
*/
function _setParent(&$Model, $parentId = null, $created = false) {
protected function _setParent(&$Model, $parentId = null, $created = false) {
extract($this->settings[$Model->alias]);
list($node) = array_values($Model->find('first', array(
'conditions' => array($scope, $Model->escapeField() => $Model->id),

View file

@ -110,9 +110,8 @@ class CakeSchema extends Object {
*
* @param array $data loaded object properties
* @return void
* @access protected
*/
function _build($data) {
protected function _build($data) {
$file = null;
foreach ($data as $key => $val) {
if (!empty($val)) {

View file

@ -187,9 +187,8 @@ class DboMssql extends DboSource {
*
* @param string $sql SQL statement
* @return resource Result resource identifier
* @access protected
*/
function _execute($sql) {
protected function _execute($sql) {
$result = @mssql_query($sql, $this->connection);
$this->__lastQueryHadError = ($result === false);
return $result;
@ -701,9 +700,8 @@ class DboMssql extends DboSource {
* @param string $table
* @param string $fields
* @param array $values
* @access protected
*/
function insertMulti($table, $fields, $values) {
protected function insertMulti($table, $fields, $values) {
$primaryKey = $this->_getPrimaryKey($table);
$hasPrimaryKey = $primaryKey != null && (
(is_array($fields) && in_array($primaryKey, $fields)

View file

@ -582,9 +582,8 @@ class DboMysql extends DboMysqlBase {
*
* @param string $sql SQL statement
* @return resource Result resource identifier
* @access protected
*/
function _execute($sql) {
protected function _execute($sql) {
return mysql_query($sql, $this->connection);
}

View file

@ -106,9 +106,8 @@ class DboMysqli extends DboMysqlBase {
*
* @param string $sql SQL statement
* @return resource Result resource identifier
* @access protected
*/
function _execute($sql) {
protected function _execute($sql) {
if (preg_match('/^\s*call/i', $sql)) {
return $this->_executeProcedure($sql);
}
@ -120,9 +119,8 @@ class DboMysqli extends DboMysqlBase {
*
* @param string $sql SQL statement (procedure call)
* @return resource Result resource identifier for first recordset
* @access protected
*/
function _executeProcedure($sql) {
protected function _executeProcedure($sql) {
$answer = mysqli_multi_query($this->connection, $sql);
$firstResult = mysqli_store_result($this->connection);

View file

@ -259,9 +259,8 @@ class DboOracle extends DboSource {
*
* @param string $sql
* @return false if sql is nor a SELECT
* @access protected
*/
function _scrapeSQL($sql) {
protected function _scrapeSQL($sql) {
$sql = str_replace("\"", '', $sql);
$preFrom = preg_split('/\bFROM\b/', $sql);
$preFrom = $preFrom[0];
@ -330,9 +329,8 @@ class DboOracle extends DboSource {
*
* @param string $sql SQL statement
* @return resource Result resource identifier or null
* @access protected
*/
function _execute($sql) {
protected function _execute($sql) {
$this->_statementId = @ociparse($this->connection, $sql);
if (!$this->_statementId) {
$this->_setError($this->connection);

View file

@ -1556,9 +1556,8 @@ class DboSource extends DataSource {
* @param boolean $quoteValues If values should be quoted, or treated as SQL snippets
* @param boolean $alias Include the model alias in the field name
* @return array Fields and values, quoted and preparted
* @access protected
*/
function _prepareUpdateFields(&$model, $fields, $quoteValues = true, $alias = false) {
protected function _prepareUpdateFields(&$model, $fields, $quoteValues = true, $alias = false) {
$quotedAlias = $this->startQuote . $model->alias . $this->endQuote;
$updates = array();
@ -1624,9 +1623,8 @@ class DboSource extends DataSource {
* @param Model $model
* @param mixed $conditions
* @return array List of record IDs
* @access protected
*/
function _matchRecords(&$model, $conditions = null) {
protected function _matchRecords(&$model, $conditions = null) {
if ($conditions === true) {
$conditions = $this->conditions(true);
} elseif ($conditions === null) {
@ -1670,9 +1668,8 @@ class DboSource extends DataSource {
*
* @param object $model
* @return array
* @access protected
*/
function _getJoins($model) {
protected function _getJoins($model) {
$join = array();
$joins = array_merge($model->getAssociated('hasOne'), $model->getAssociated('belongsTo'));
@ -2528,9 +2525,8 @@ class DboSource extends DataSource {
* @param string $table
* @param string $fields
* @param array $values
* @access protected
*/
function insertMulti($table, $fields, $values) {
protected function insertMulti($table, $fields, $values) {
$table = $this->fullTableName($table);
if (is_array($fields)) {
$fields = implode(', ', array_map(array(&$this, 'name'), $fields));

View file

@ -490,9 +490,8 @@ class Model extends Overloadable {
* @param string $method Name of method to call.
* @param array $params Parameters for the method.
* @return mixed Whatever is returned by called method
* @access protected
*/
function call__($method, $params) {
protected function call__($method, $params) {
$result = $this->Behaviors->dispatchMethod($this, $method, $params);
if ($result !== array('unhandled')) {
@ -1511,9 +1510,8 @@ class Model extends Overloadable {
* @param array $data The fields of the record that will be updated
* @return array Returns updated foreign key values, along with an 'old' key containing the old
* values, or empty if no foreign keys are updated.
* @access protected
*/
function _prepareUpdateFields($data) {
protected function _prepareUpdateFields($data) {
$foreignKeys = array();
foreach ($this->belongsTo as $assoc => $info) {
if ($info['counterCache']) {
@ -1819,9 +1817,8 @@ class Model extends Overloadable {
* @param string $id ID of record that was deleted
* @param boolean $cascade Set to true to delete records that depend on this record
* @return void
* @access protected
*/
function _deleteDependent($id, $cascade) {
protected function _deleteDependent($id, $cascade) {
if (!empty($this->__backAssociation)) {
$savedAssociatons = $this->__backAssociation;
$this->__backAssociation = array();
@ -1861,9 +1858,8 @@ class Model extends Overloadable {
*
* @param string $id ID of record that was deleted
* @return void
* @access protected
*/
function _deleteLinks($id) {
protected function _deleteLinks($id) {
foreach ($this->hasAndBelongsToMany as $assoc => $data) {
$joinModel = $data['with'];
$records = $this->{$joinModel}->find('all', array(
@ -2208,9 +2204,8 @@ class Model extends Overloadable {
* @param mixed $query
* @param array $results
* @return array
* @access protected
*/
function _findNeighbors($state, $query, $results = array()) {
protected function _findNeighbors($state, $query, $results = array()) {
if ($state == 'before') {
$query = array_merge(array('recursive' => 0), $query);
extract($query);
@ -2267,9 +2262,8 @@ class Model extends Overloadable {
* @param mixed $query
* @param array $results
* @return array Threaded results
* @access protected
*/
function _findThreaded($state, $query, $results = array()) {
protected function _findThreaded($state, $query, $results = array()) {
if ($state == 'before') {
return $query;
} elseif ($state == 'after') {

View file

@ -156,9 +156,8 @@ class Object {
*
* @param array $properties An associative array containing properties and corresponding values.
* @return void
* @access protected
*/
function _set($properties = array()) {
protected function _set($properties = array()) {
if (is_array($properties) && !empty($properties)) {
$vars = get_object_vars($this);
foreach ($properties as $key => $val) {
@ -236,9 +235,8 @@ class Object {
* @param string $name name used for object to cache
* @param object $object the object to persist
* @return boolean true on save, throws error if file can not be created
* @access protected
*/
function _savePersistent($name, &$object) {
protected function _savePersistent($name, &$object) {
$file = 'persistent' . DS . strtolower($name) . '.php';
$objectArray = array(&$object);
$data = str_replace('\\', '\\\\', serialize($objectArray));

View file

@ -1321,9 +1321,8 @@ class CakeRoute {
* properties to compile a regular expression that can be used to parse request strings.
*
* @return void
* @access protected
*/
function _writeRoute() {
protected function _writeRoute() {
if (empty($this->template) || ($this->template === '/')) {
$this->_compiledRoute = '#^/*$#';
$this->keys = array();
@ -1522,9 +1521,8 @@ class CakeRoute {
*
* @param array $params The params to convert to a string url.
* @return string Composed route string.
* @access protected
*/
function _writeUrl($params) {
protected function _writeUrl($params) {
if (isset($params['plugin'], $params['controller']) && $params['plugin'] === $params['controller']) {
unset($params['controller']);
}

View file

@ -562,9 +562,8 @@ class Validation extends Object {
*
* @param string $check IP Address to test
* @return boolean Success
* @access protected
*/
function _ipv4($check) {
protected function _ipv4($check) {
if (function_exists('filter_var')) {
return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)) !== false;
}
@ -579,9 +578,8 @@ class Validation extends Object {
*
* @param string $check IP Address to test
* @return boolean Success
* @access protected
*/
function _ipv6($check) {
protected function _ipv6($check) {
if (function_exists('filter_var')) {
return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV6)) !== false;
}
@ -912,9 +910,8 @@ class Validation extends Object {
* Runs a regular expression match.
*
* @return boolean Success of match
* @access protected
*/
function _check() {
protected function _check() {
$_this =& Validation::getInstance();
if (preg_match($_this->regex, $_this->check)) {
$_this->error[] = false;
@ -931,9 +928,8 @@ class Validation extends Object {
*
* @param array $params Parameters sent to validation method
* @return void
* @access protected
*/
function _extract($params) {
protected function _extract($params) {
$_this =& Validation::getInstance();
extract($params, EXTR_OVERWRITE);
@ -959,9 +955,8 @@ class Validation extends Object {
*
* @see http://en.wikipedia.org/wiki/Luhn_algorithm
* @return boolean Success
* @access protected
*/
function _luhn() {
protected function _luhn() {
$_this =& Validation::getInstance();
if ($_this->deep !== true) {
return true;

View file

@ -146,9 +146,8 @@ class Helper extends Overloadable {
/**
* Default overload methods
*
* @access protected
*/
function get__($name) {}
protected function get__($name) {}
function set__($name, $value) {}
function call__($method, $params) {
trigger_error(sprintf(__('Method %1$s::%2$s does not exist', true), get_class($this), $method), E_USER_WARNING);
@ -714,9 +713,8 @@ class Helper extends Overloadable {
* @param string $field The field name to initialize.
* @param array $options Array of options to use while initializing an input field.
* @return array Array options for the form input.
* @access protected
*/
function _initInputField($field, $options = array()) {
protected function _initInputField($field, $options = array()) {
if ($field !== null) {
$this->setEntity($field);
}

View file

@ -914,9 +914,8 @@ class AjaxHelper extends AppHelper {
*
* @param array $options Option array where a callback is specified
* @return array Options with their callbacks properly set
* @access protected
*/
function _buildCallbacks($options) {
protected function _buildCallbacks($options) {
$callbacks = array();
foreach ($this->callbacks as $callback) {

View file

@ -95,9 +95,8 @@ class FormHelper extends AppHelper {
* $this->fieldset.
*
* @return Model Returns a model instance
* @access protected
*/
function &_introspectModel($model) {
protected function &_introspectModel($model) {
$object = null;
if (is_string($model) && strpos($model, '.') !== false) {
$path = explode('.', $model);
@ -140,9 +139,8 @@ class FormHelper extends AppHelper {
* Returns if a field is required to be filled based on validation properties from the validating object
*
* @return boolean true if field is required to be filled, false otherwise
* @access protected
*/
function _isRequiredField($validateProperties) {
protected function _isRequiredField($validateProperties) {
$required = false;
if (is_array($validateProperties)) {
@ -900,9 +898,8 @@ class FormHelper extends AppHelper {
* @param array $options The array of options you want to extract.
* @param mixed $default The default option value
* @return the contents of the option or default
* @access protected
*/
function _extractOption($name, $options, $default = null) {
protected function _extractOption($name, $options, $default = null) {
if (array_key_exists($name, $options)) {
return $options[$name];
}
@ -914,9 +911,8 @@ class FormHelper extends AppHelper {
*
* @param array $options Options for the label element.
* @return string Generated label element
* @access protected
*/
function _inputLabel($fieldName, $label, $options) {
protected function _inputLabel($fieldName, $label, $options) {
$labelAttributes = $this->domId(array(), 'for');
if ($options['type'] === 'date' || $options['type'] === 'datetime') {
if (isset($options['dateFormat']) && $options['dateFormat'] === 'NONE') {
@ -1864,9 +1860,8 @@ class FormHelper extends AppHelper {
* @param array $options
* @param string $key
* @return array
* @access protected
*/
function _name($options = array(), $field = null, $key = 'name') {
protected function _name($options = array(), $field = null, $key = 'name') {
if ($this->requestType == 'get') {
if ($options === null) {
$options = array();
@ -2104,9 +2099,8 @@ class FormHelper extends AppHelper {
* @param string $field Name of the field to initialize options for.
* @param array $options Array of options to append options into.
* @return array Array of options for the input.
* @access protected
*/
function _initInputField($field, $options = array()) {
protected function _initInputField($field, $options = array()) {
if (isset($options['secure'])) {
$secure = $options['secure'];
unset($options['secure']);

View file

@ -268,9 +268,8 @@ class JsHelper extends AppHelper {
* Generates the object string for variables passed to javascript.
*
* @return string Generated JSON object of all set vars
* @access protected
*/
function _createVars() {
protected function _createVars() {
if (!empty($this->__jsVars)) {
$setVar = (strpos($this->setVariable, '.')) ? $this->setVariable : 'window.' . $this->setVariable;
$this->buffer($setVar . ' = ' . $this->object($this->__jsVars) . ';', true);
@ -400,9 +399,8 @@ class JsHelper extends AppHelper {
* @param array $options Options to filter.
* @param array $additional Array of additional keys to extract and include in the return options array.
* @return array Array of js options and Htmloptions
* @access protected
*/
function _getHtmlOptions($options, $additional = array()) {
protected function _getHtmlOptions($options, $additional = array()) {
$htmlKeys = array_merge(array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'), $additional);
$htmlOptions = array();
foreach ($htmlKeys as $key) {
@ -656,9 +654,8 @@ class JsBaseEngineHelper extends AppHelper {
*
* @param string $string The string that needs to be utf8->hex encoded
* @return void
* @access protected
*/
function _utf8ToHex($string) {
protected function _utf8ToHex($string) {
$length = strlen($string);
$return = '';
for ($i = 0; $i < $length; ++$i) {
@ -972,9 +969,8 @@ class JsBaseEngineHelper extends AppHelper {
* @param array $options Options to be converted
* @param array $safeKeys Keys that should not be escaped.
* @return string Parsed JSON options without enclosing { }.
* @access protected
*/
function _parseOptions($options, $safeKeys = array()) {
protected function _parseOptions($options, $safeKeys = array()) {
$out = array();
$safeKeys = array_flip($safeKeys);
foreach ($options as $key => $value) {
@ -994,9 +990,8 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $method Name of method whose options are being worked with.
* @param array $options Array of options to map.
* @return array Array of mapped options.
* @access protected
*/
function _mapOptions($method, $options) {
protected function _mapOptions($method, $options) {
if (!isset($this->_optionMap[$method])) {
return $options;
}
@ -1017,9 +1012,8 @@ class JsBaseEngineHelper extends AppHelper {
* @param array $options Array of options being parsed
* @param string $callbacks Additional Keys that contain callbacks
* @return array Array of options with callbacks added.
* @access protected
*/
function _prepareCallbacks($method, $options, $callbacks = array()) {
protected function _prepareCallbacks($method, $options, $callbacks = array()) {
$wrapCallbacks = true;
if (isset($options['wrapCallbacks'])) {
$wrapCallbacks = $options['wrapCallbacks'];
@ -1054,9 +1048,8 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $method Name of method processing options for.
* @param array $options Array of options to process.
* @return string Parsed options string.
* @access protected
*/
function _processOptions($method, $options) {
protected function _processOptions($method, $options) {
$options = $this->_mapOptions($method, $options);
$options = $this->_prepareCallbacks($method, $options);
$options = $this->_parseOptions($options, array_keys($this->_callbackArguments[$method]));
@ -1068,9 +1061,8 @@ class JsBaseEngineHelper extends AppHelper {
*
* @param array $parameters Array of parameters to convert to a query string
* @return string Querystring fragment
* @access protected
*/
function _toQuerystring($parameters) {
protected function _toQuerystring($parameters) {
$out = '';
$keys = array_keys($parameters);
$count = count($parameters);

View file

@ -386,9 +386,8 @@ class PaginatorHelper extends AppHelper {
/**
* Protected method for generating prev/next links
*
* @access protected
*/
function __pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) {
protected function __pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) {
$check = 'has' . $which;
$_defaults = array(
'url' => array(), 'step' => 1, 'escape' => true,
@ -464,9 +463,8 @@ class PaginatorHelper extends AppHelper {
* @param string $model Model name to get parameters for.
* @param integer $page Page number you are checking.
* @return boolean Whether model has $page
* @access protected
*/
function __hasPage($model, $page) {
protected function __hasPage($model, $page) {
$params = $this->params($model);
if (!empty($params)) {
if ($params["{$page}Page"] == true) {

View file

@ -225,9 +225,8 @@ class MediaView extends View {
* Method to set headers
* @param mixed $header
* @param boolean $boolean
* @access protected
*/
function _header($header, $boolean = true) {
protected function _header($header, $boolean = true) {
if (is_array($header)) {
foreach ($header as $string => $boolean) {
if (is_numeric($string)) {
@ -244,9 +243,8 @@ class MediaView extends View {
/**
* Method to output headers
* @access protected
*/
function _output() {
protected function _output() {
foreach ($this->_headers as $key => $value) {
$header = key($value);
header($header, $value[$header]);

View file

@ -681,9 +681,8 @@ class View extends Object {
* @param boolean $loadHelpers Boolean to indicate that helpers should be loaded.
* @param boolean $cached Whether or not to trigger the creation of a cache file.
* @return string Rendered output
* @access protected
*/
function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = false) {
protected function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = false) {
$loadedHelpers = array();
if ($this->helpers != false && $loadHelpers === true) {
@ -747,9 +746,8 @@ class View extends Object {
* @param array $helpers List of helpers to load.
* @param string $parent holds name of helper, if loaded helper has helpers
* @return array Array containing the loaded helpers.
* @access protected
*/
function &_loadHelpers(&$loaded, $helpers, $parent = null) {
protected function &_loadHelpers(&$loaded, $helpers, $parent = null) {
foreach ($helpers as $i => $helper) {
$options = array();
@ -814,9 +812,8 @@ class View extends Object {
*
* @param string $name Controller action to find template filename for
* @return string Template filename
* @access protected
*/
function _getViewFileName($name = null) {
protected function _getViewFileName($name = null) {
$subDir = null;
if (!is_null($this->subDir)) {
@ -874,9 +871,8 @@ class View extends Object {
*
* @param string $name The name of the layout to find.
* @return string Filename for layout file (.ctp).
* @access protected
*/
function _getLayoutFileName($name = null) {
protected function _getLayoutFileName($name = null) {
if ($name === null) {
$name = $this->layout;
}
@ -907,9 +903,8 @@ class View extends Object {
*
* @param string $viewFileName the filename that should exist
* @return false
* @access protected
*/
function _missingView($file, $error = 'missingView') {
protected function _missingView($file, $error = 'missingView') {
if ($error === 'missingView') {
$this->cakeError('missingView', array(
'className' => $this->name,
@ -934,9 +929,8 @@ class View extends Object {
* @param string $plugin Optional plugin name to scan for view files.
* @param boolean $cached Set to true to force a refresh of view paths.
* @return array paths
* @access protected
*/
function _paths($plugin = null, $cached = true) {
protected function _paths($plugin = null, $cached = true) {
if ($plugin === null && $cached === true && !empty($this->__paths)) {
return $this->__paths;
}

View file

@ -742,9 +742,8 @@ class XmlNode extends Object {
* if given the $recursive parameter.
*
* @param boolean $recursive Recursively delete elements.
* @access protected
*/
function _killParent($recursive = true) {
protected function _killParent($recursive = true) {
unset($this->__parent, $this->_log);
if ($recursive && $this->hasChildren()) {
for ($i = 0; $i < count($this->children); $i++) {

View file

@ -82,9 +82,8 @@ class TestShellDispatcher extends ShellDispatcher {
* _initEnvironment method
*
* @return void
* @access protected
*/
function _initEnvironment() {
protected function _initEnvironment() {
}
/**
@ -122,9 +121,8 @@ class TestShellDispatcher extends ShellDispatcher {
* _stop method
*
* @return void
* @access protected
*/
function _stop($status = 0) {
protected function _stop($status = 0) {
$this->stopped = 'Stopped with status: ' . $status;
return $status;
}
@ -144,9 +142,8 @@ class TestShellDispatcher extends ShellDispatcher {
*
* @param mixed $plugin
* @return mixed
* @access protected
*/
function _getShell($plugin = null) {
protected function _getShell($plugin = null) {
if (isset($this->TestShell)) {
return $this->TestShell;
}

View file

@ -66,9 +66,8 @@ class TestShell extends Shell {
*
* @param integer $status
* @return void
* @access protected
*/
function _stop($status = 0) {
protected function _stop($status = 0) {
$this->stopped = $status;
}
}

View file

@ -80,9 +80,8 @@ class ProjectTaskTest extends CakeTestCase {
* creates a test project that is used for testing project task.
*
* @return void
* @access protected
*/
function _setupTestProject() {
protected function _setupTestProject() {
$skel = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
$this->Task->setReturnValueAt(0, 'in', 'y');
$this->Task->setReturnValueAt(1, 'in', 'n');

View file

@ -119,9 +119,8 @@ class TestTaskArticle extends Model {
* Example protected method
*
* @return void
* @access protected
*/
function _innerMethod() {
protected function _innerMethod() {
}
}

View file

@ -40,9 +40,8 @@ class TestDispatcher extends Dispatcher {
* @param mixed $params
* @param mixed $missingAction
* @return void
* @access protected
*/
function _invoke(&$controller, $params) {
protected function _invoke(&$controller, $params) {
restore_error_handler();
if ($result = parent::_invoke($controller, $params)) {
if ($result[0] === 'missingAction') {
@ -68,9 +67,8 @@ class TestDispatcher extends Dispatcher {
* _stop method
*
* @return void
* @access protected
*/
function _stop() {
protected function _stop() {
return true;
}
}
@ -184,9 +182,8 @@ class SomePagesController extends AppController {
* protected method
*
* @return void
* @access protected
*/
function _protected() {
protected function _protected() {
return true;
}

View file

@ -58,9 +58,8 @@ class CakeTestDispatcher extends Dispatcher {
* @param array $params
* @param boolean $missingAction
* @return Controller
* @access protected
*/
function _invoke(&$controller, $params, $missingAction = false) {
protected function _invoke(&$controller, $params, $missingAction = false) {
$this->controller =& $controller;
if (isset($this->testCase) && method_exists($this->testCase, 'startController')) {
@ -682,9 +681,8 @@ class CakeTestCase extends UnitTestCase {
* Initialize DB connection.
*
* @return void
* @access protected
*/
function _initDb() {
protected function _initDb() {
$testDbAvailable = in_array('test', array_keys(ConnectionManager::enumConnectionObjects()));
$_prefix = null;
@ -718,9 +716,8 @@ class CakeTestCase extends UnitTestCase {
* Load fixtures specified in public $fixtures.
*
* @return void
* @access protected
*/
function _loadFixtures() {
protected function _loadFixtures() {
if (!isset($this->fixtures) || empty($this->fixtures)) {
return;
}

View file

@ -150,9 +150,8 @@ class CakeBaseReporter extends SimpleReporter {
* but in a separate function to reduce dependancies.
*
* @return float Time in microseconds
* @access protected
*/
function _getTime() {
protected function _getTime() {
list($usec, $sec) = explode(' ', microtime());
return ((float)$sec + (float)$usec);
}

View file

@ -163,9 +163,8 @@ class CakeCliReporter extends CakeBaseReporter {
* Get the time and memory stats for this test case/group
*
* @return string String content to display
* @access protected
*/
function _timeStats() {
protected function _timeStats() {
$out = 'Time taken by tests (in seconds): ' . $this->_timeDuration . "\n";
if (function_exists('memory_get_peak_usage')) {
$out .= 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n";

View file

@ -351,9 +351,8 @@ class CakeHtmlReporter extends CakeBaseReporter {
*
* @param string $message Plain text or Unicode message.
* @return string Browser readable message.
* @access protected
*/
function _htmlEntities($message) {
protected function _htmlEntities($message) {
return htmlentities($message, ENT_COMPAT, $this->_characterSet);
}
}

View file

@ -220,9 +220,8 @@ class TestManager {
* Builds the list of test cases from a given directory
*
* @param string $directory Directory to get test case list from.
* @access protected
*/
function &_getTestCaseList($directory = '.') {
protected function &_getTestCaseList($directory = '.') {
$fileList =& $this->_getTestFileList($directory);
$testCases = array();
foreach ($fileList as $testCaseFile) {
@ -235,9 +234,8 @@ class TestManager {
* Returns a list of test files from a given directory
*
* @param string $directory Directory to get test case files from.
* @access protected
*/
function &_getTestFileList($directory = '.') {
protected function &_getTestFileList($directory = '.') {
$return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestCaseFile'));
return $return;
}
@ -258,9 +256,8 @@ class TestManager {
* Returns a list of group test files from a given directory
*
* @param string $directory The directory to get group test files from.
* @access protected
*/
function &_getTestGroupFileList($directory = '.') {
protected function &_getTestGroupFileList($directory = '.') {
$return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestGroupFile'));
return $return;
}
@ -269,9 +266,8 @@ class TestManager {
* Returns a list of group test files from a given directory
*
* @param string $directory The directory to get group tests from.
* @access protected
*/
function &_getTestGroupList($directory = '.') {
protected function &_getTestGroupList($directory = '.') {
$fileList =& $this->_getTestGroupFileList($directory);
$groupTests = array();
@ -286,9 +282,8 @@ class TestManager {
* Returns a list of class names from a group test file
*
* @param string $groupTestFile The groupTest file to scan for TestSuite classnames.
* @access protected
*/
function &_getGroupTestClassNames($groupTestFile) {
protected function &_getGroupTestClassNames($groupTestFile) {
$file = implode("\n", file($groupTestFile));
preg_match("~lass\s+?(.*)\s+?extends TestSuite~", $file, $matches);
if (!empty($matches)) {
@ -305,9 +300,8 @@ class TestManager {
*
* @param string $directory The directory to scan for files.
* @param mixed $fileTestFunction
* @access protected
*/
function &_getRecursiveFileList($directory = '.', $fileTestFunction) {
protected function &_getRecursiveFileList($directory = '.', $fileTestFunction) {
$fileList = array();
if (!is_dir($directory)) {
return $fileList;
@ -331,9 +325,8 @@ class TestManager {
*
* @param string $file
* @return boolean Whether $file is a test case.
* @access protected
*/
function _isTestCaseFile($file) {
protected function _isTestCaseFile($file) {
return $this->_hasExpectedExtension($file, $this->_testExtension);
}
@ -342,9 +335,8 @@ class TestManager {
*
* @param string $file
* @return boolean Whether $file is a group
* @access protected
*/
function _isTestGroupFile($file) {
protected function _isTestGroupFile($file) {
return $this->_hasExpectedExtension($file, $this->_groupExtension);
}
@ -354,9 +346,8 @@ class TestManager {
* @param string $file
* @param string $extension
* @return void
* @access protected
*/
function _hasExpectedExtension($file, $extension) {
protected function _hasExpectedExtension($file, $extension) {
return $extension == strtolower(substr($file, (0 - strlen($extension))));
}
@ -365,9 +356,8 @@ class TestManager {
*
* @param string $type either 'cases' or 'groups'
* @return string The path tests are located on
* @access protected
*/
function _getTestsPath($type = 'cases') {
protected function _getTestsPath($type = 'cases') {
if (!empty($this->appTest)) {
if ($type == 'cases') {
$result = APP_TEST_CASES;