Skip to content
Permalink
Browse files

Changing protected methods to specify protected access.

  • Loading branch information...
predominant committed Apr 5, 2010
1 parent 1497ec3 commit 50a547167b26e8e613cdb6820b9613b57fe79720
Showing with 145 additions and 290 deletions.
  1. +3 −6 cake/console/cake.php
  2. +1 −2 cake/console/libs/acl.php
  3. +2 −4 cake/console/libs/console.php
  4. +14 −28 cake/console/libs/shell.php
  5. +4 −8 cake/console/libs/tasks/fixture.php
  6. +3 −6 cake/console/libs/tasks/test.php
  7. +3 −6 cake/dispatcher.php
  8. +1 −2 cake/libs/cache.php
  9. +2 −4 cake/libs/cake_log.php
  10. +1 −2 cake/libs/cake_session.php
  11. +1 −2 cake/libs/controller/component.php
  12. +2 −4 cake/libs/controller/components/acl.php
  13. +9 −18 cake/libs/controller/components/security.php
  14. +1 −2 cake/libs/controller/controller.php
  15. +2 −4 cake/libs/controller/scaffold.php
  16. +1 −2 cake/libs/debugger.php
  17. +1 −2 cake/libs/error.php
  18. +11 −22 cake/libs/http_socket.php
  19. +1 −2 cake/libs/inflector.php
  20. +1 −2 cake/libs/model/behaviors/translate.php
  21. +1 −2 cake/libs/model/behaviors/tree.php
  22. +1 −2 cake/libs/model/cake_schema.php
  23. +2 −4 cake/libs/model/datasources/dbo/dbo_mssql.php
  24. +1 −2 cake/libs/model/datasources/dbo/dbo_mysql.php
  25. +2 −4 cake/libs/model/datasources/dbo/dbo_mysqli.php
  26. +2 −4 cake/libs/model/datasources/dbo/dbo_oracle.php
  27. +4 −8 cake/libs/model/datasources/dbo_source.php
  28. +6 −12 cake/libs/model/model.php
  29. +2 −4 cake/libs/object.php
  30. +2 −4 cake/libs/router.php
  31. +5 −10 cake/libs/validation.php
  32. +2 −4 cake/libs/view/helper.php
  33. +1 −2 cake/libs/view/helpers/ajax.php
  34. +6 −12 cake/libs/view/helpers/form.php
  35. +8 −16 cake/libs/view/helpers/js.php
  36. +2 −4 cake/libs/view/helpers/paginator.php
  37. +2 −4 cake/libs/view/media.php
  38. +6 −12 cake/libs/view/view.php
  39. +1 −2 cake/libs/xml.php
  40. +3 −6 cake/tests/cases/console/cake.test.php
  41. +1 −2 cake/tests/cases/console/libs/shell.test.php
  42. +1 −2 cake/tests/cases/console/libs/tasks/project.test.php
  43. +1 −2 cake/tests/cases/console/libs/tasks/test.test.php
  44. +3 −6 cake/tests/cases/dispatcher.test.php
  45. +3 −6 cake/tests/lib/cake_test_case.php
  46. +1 −2 cake/tests/lib/reporter/cake_base_reporter.php
  47. +1 −2 cake/tests/lib/reporter/cake_cli_reporter.php
  48. +1 −2 cake/tests/lib/reporter/cake_html_reporter.php
  49. +10 −20 cake/tests/lib/test_manager.php
@@ -166,9 +166,8 @@ function __initConstants() {
/**
* 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 @@ public function dispatch() {
*
* @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 @@ public function help() {
*
* @param $status see http://php.net/exit for values
* @return void
* @access protected
*/
function _stop($status = 0) {
protected function _stop($status = 0) {
exit($status);
}
}
@@ -229,9 +229,8 @@ public function getPath() {
* @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']) {
@@ -323,9 +323,8 @@ public function main($command = null) {
*
* @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 @@ function _isValidModel($modelToCheck) {
* 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();
@@ -192,9 +192,8 @@ public function startup() {
/**
* 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 @@ function _welcome() {
* 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 @@ function _loadDbConfig() {
* 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 @@ public function error($title, $message = null) {
*
* @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 @@ public function help() {
* 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 @@ public function shortPath($file) {
*
* @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 @@ function _controllerPath($name) {
*
* @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 @@ function _controllerName($name) {
*
* @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 @@ function _modelName($name) {
*
* @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 @@ function _modelKey($name) {
*
* @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 @@ function _modelNameFromKey($key) {
*
* @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 @@ function _singularName($name) {
*
* @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 @@ function _pluralName($name) {
*
* @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 @@ function _singularHumanName($name) {
*
* @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)));
}
@@ -247,9 +247,8 @@ function getPath() {
*
* @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 @@ function _generateSchema($tableInfo) {
*
* @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 @@ function _generateRecords($tableInfo, $recordCount = 1) {
*
* @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 @@ function _makeRecordString($records) {
* @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);
@@ -294,9 +294,8 @@ public function generateFixtureList(&$subject) {
*
* @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 @@ function _processModel(&$subject) {
*
* @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 @@ function _processController(&$subject) {
*
* @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') {
@@ -179,9 +179,8 @@ public function dispatch($url = null, $additionalParams = array()) {
* @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 @@ public function baseUrl() {
* @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 @@ public function asset($url) {
* @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();
@@ -136,9 +136,8 @@ function config($name = null, $settings = array()) {
*
* @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']);
@@ -117,9 +117,8 @@ function config($key, $config) {
*
* @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 @@ function drop($streamName) {
* 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');
}
@@ -587,9 +587,8 @@ function __startSession() {
* 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');
@@ -191,9 +191,8 @@ public function triggerCallback($callback, &$controller) {
* @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) {
Oops, something went wrong.

0 comments on commit 50a5471

Please sign in to comment.
You can’t perform that action at this time.