Permalink
Browse files

Adding proper visibility keywords for class functions

  • Loading branch information...
1 parent e5f2f6a commit 4c042ae1330d66bc310a1ef8b174a4af8c7f3e57 @ADmad ADmad committed May 28, 2011
Showing with 209 additions and 210 deletions.
  1. +2 −2 lib/Cake/Controller/CakeErrorController.php
  2. +6 −6 lib/Cake/Controller/Component.php
  3. +6 −6 lib/Cake/Controller/Scaffold.php
  4. +1 −1 lib/Cake/Core/Configure.php
  5. +2 −2 lib/Cake/Core/Object.php
  6. +1 −1 lib/Cake/Error/ExceptionRenderer.php
  7. +1 −1 lib/Cake/I18n/I18n.php
  8. +5 −5 lib/Cake/I18n/L10n.php
  9. +1 −1 lib/Cake/Model/AclNode.php
  10. +4 −4 lib/Cake/Model/Behavior/TranslateBehavior.php
  11. +5 −5 lib/Cake/Model/Behavior/TreeBehavior.php
  12. +4 −4 lib/Cake/Model/BehaviorCollection.php
  13. +5 −5 lib/Cake/Model/CakeSchema.php
  14. +2 −2 lib/Cake/Model/Datasource/DataSource.php
  15. +16 −16 lib/Cake/Model/Datasource/Database/Mysql.php
  16. +20 −20 lib/Cake/Model/Datasource/Database/Oracle.php
  17. +25 −25 lib/Cake/Model/Datasource/Database/Postgres.php
  18. +17 −17 lib/Cake/Model/Datasource/Database/Sqlite.php
  19. +14 −14 lib/Cake/Model/Datasource/DboSource.php
  20. +2 −2 lib/Cake/Model/Datasource/Session/DatabaseSession.php
  21. +35 −36 lib/Cake/Model/Model.php
  22. +9 −9 lib/Cake/Model/ModelBehavior.php
  23. +1 −1 lib/Cake/Model/Permission.php
  24. +2 −2 lib/Cake/Network/CakeSocket.php
  25. +1 −1 lib/Cake/Network/Email/SmtpTransport.php
  26. +1 −1 lib/Cake/Network/Http/HttpResponse.php
  27. +1 −1 lib/Cake/Utility/Debugger.php
  28. +3 −3 lib/Cake/Utility/File.php
  29. +4 −4 lib/Cake/Utility/Folder.php
  30. +1 −1 lib/Cake/Utility/Security.php
  31. +6 −6 lib/Cake/View/Helper.php
  32. +2 −2 lib/Cake/View/MediaView.php
  33. +2 −2 lib/Cake/View/ThemeView.php
  34. +2 −2 lib/Cake/View/View.php
@@ -22,7 +22,7 @@ class CakeErrorController extends AppController {
* @access public
* @return void
*/
- function __construct($request = null) {
+ public function __construct($request = null) {
parent::__construct($request);
$this->constructClasses();
$this->Components->trigger('initialize', array(&$this));
@@ -34,7 +34,7 @@ function __construct($request = null) {
*
* @return void
*/
- function beforeRender() {
+ public function beforeRender() {
parent::beforeRender();
foreach ($this->viewVars as $key => $value) {
if (!is_object($value)){
@@ -19,7 +19,7 @@
/**
* Base class for an individual Component. Components provide resuable bits of
- * controller logic that can be composed into a controller. Components also
+ * controller logic that can be composed into a controller. Components also
* provide request life-cycle callbacks for injecting logic at specific points.
*
* ## Life cycle callbacks
@@ -30,8 +30,8 @@
* - `initialize()` - Fired before the controller's beforeFilter method.
* - `startup()` - Fired after the controller's beforeFilter method.
* - `beforeRender()` - Fired before the view + layout are rendered.
- * - `shutdown()` - Fired after the action is complete and the view has been rendered
- * but before Controller::afterFilter().
+ * - `shutdown()` - Fired after the action is complete and the view has been rendered
+ * but before Controller::afterFilter().
* - `beforeRedirect()` - Fired before a redirect() is done.
*
* @package cake.libs.controller
@@ -132,18 +132,18 @@ public function beforeRender($controller) { }
* @param object $controller Controller with components to shutdown
* @return void
*/
- function shutdown($controller) { }
+ public function shutdown($controller) { }
/**
* Called before Controller::redirect(). Allows you to replace the url that will
* be redirected to with a new url. The return of this method can either be an array or a string.
*
* If the return is an array and contains a 'url' key. You may also supply the following:
- *
+ *
* - `status` The status code for the redirect
* - `exit` Whether or not the redirect should exit.
*
- * If your response is a string or an array that does not contain a 'url' key it will
+ * If your response is a string or an array that does not contain a 'url' key it will
* be used as the new url to redirect to.
*
* @param object $controller Controller with components to beforeRedirect
@@ -106,7 +106,7 @@ class Scaffold {
* @param Controller $controller Controller to scaffold
* @param CakeRequest $request Request parameters.
*/
- function __construct(Controller $controller, CakeRequest $request) {
+ public function __construct(Controller $controller, CakeRequest $request) {
$this->controller = $controller;
$count = count($this->__passedVars);
@@ -254,7 +254,7 @@ protected function _scaffoldSave(CakeRequest $request, $action = 'edit') {
if ($this->ScaffoldModel->save($request->data)) {
if ($this->controller->_afterScaffoldSave($action)) {
- $message = __d('cake',
+ $message = __d('cake',
'The %1$s has been %2$s',
Inflector::humanize($this->modelKey),
$success
@@ -318,9 +318,9 @@ protected function _scaffoldDelete(CakeRequest $request) {
$message = __d('cake', 'The %1$s with id: %2$d has been deleted.', Inflector::humanize($this->modelClass), $id);
return $this->_sendMessage($message);
} else {
- $message = __d('cake',
- 'There was an error deleting the %1$s with id: %2$d',
- Inflector::humanize($this->modelClass),
+ $message = __d('cake',
+ 'There was an error deleting the %1$s with id: %2$d',
+ Inflector::humanize($this->modelClass),
$id
);
return $this->_sendMessage($message);
@@ -331,7 +331,7 @@ protected function _scaffoldDelete(CakeRequest $request) {
}
/**
- * Sends a message to the user. Either uses Sessions or flash messages depending
+ * Sends a message to the user. Either uses Sessions or flash messages depending
* on the availability of a session
*
* @param string $message Message to display
@@ -372,5 +372,5 @@ public static function restore($name, $cacheConfig = 'default') {
* @param string $key
* @return array An array of data to merge into the runtime configuration
*/
- function read($key);
+ public function read($key);
}
@@ -177,7 +177,7 @@ protected function _set($properties = array()) {
* @access protected
* @todo add examples to manual
*/
- function _persist($name, $return = null, &$object, $type = null) {
+ protected function _persist($name, $return = null, &$object, $type = null) {
$file = CACHE . 'persistent' . DS . strtolower($name) . '.php';
if ($return === null) {
if (!file_exists($file)) {
@@ -256,7 +256,7 @@ protected function _savePersistent($name, &$object) {
* @return void
* @access private
*/
- function __openPersistent($name, $type = null) {
+ private function __openPersistent($name, $type = null) {
$file = CACHE . 'persistent' . DS . strtolower($name) . '.php';
include($file);
@@ -89,7 +89,7 @@ class ExceptionRenderer {
* @param string $method Method producing the error
* @param array $messages Error messages
*/
- function __construct(Exception $exception) {
+ public function __construct(Exception $exception) {
$this->controller = $this->_getController($exception);
if (method_exists($this->controller, 'apperror')) {
@@ -558,7 +558,7 @@ private function __parseLiteralValue($string) {
* @param string $domain Domain where format is stored
* @return mixed translated format string if only value or array of translated strings for corresponding format.
*/
- function __translateTime($format, $domain) {
+ private function __translateTime($format, $domain) {
if (!empty($this->__domains[$domain][$this->__lang]['LC_TIME'][$format])) {
if (($trans = $this->__domains[$domain][$this->__lang][$this->category][$format])) {
return $trans;
@@ -328,7 +328,7 @@ class L10n {
/**
* Class constructor
*/
- function __construct() {
+ public function __construct() {
if (defined('DEFAULT_LANGUAGE')) {
$this->default = DEFAULT_LANGUAGE;
}
@@ -356,7 +356,7 @@ public function get($language = null) {
* @param string $language Language (if null will use DEFAULT_LANGUAGE if defined)
* @access private
*/
- function __setLanguage($language = null) {
+ private function __setLanguage($language = null) {
$langKey = null;
if ($language !== null && isset($this->__l10nMap[$language]) && isset($this->__l10nCatalog[$this->__l10nMap[$language]])) {
$langKey = $this->__l10nMap[$language];
@@ -405,7 +405,7 @@ function __setLanguage($language = null) {
* @return boolean Success
* @access private
*/
- function __autoLanguage() {
+ private function __autoLanguage() {
$_detectableLanguages = CakeRequest::acceptLanguage();
foreach ($_detectableLanguages as $key => $langKey) {
if (isset($this->__l10nCatalog[$langKey])) {
@@ -426,7 +426,7 @@ function __autoLanguage() {
* Attempts to find locale for language, or language for locale
*
* @param mixed $mixed 2/3 char string (language/locale), array of those strings, or null
- * @return mixed string language/locale, array of those values, whole map as an array,
+ * @return mixed string language/locale, array of those values, whole map as an array,
* or false when language/locale doesn't exist
*/
public function map($mixed = null) {
@@ -453,7 +453,7 @@ public function map($mixed = null) {
* Attempts to find catalog record for requested language
*
* @param mixed $language string requested language, array of requested languages, or null for whole catalog
- * @return mixed array catalog record for requested language, array of catalog records, whole catalog,
+ * @return mixed array catalog record for requested language, array of catalog records, whole catalog,
* or false when language doesn't exist
*/
public function catalog($language = null) {
@@ -49,7 +49,7 @@ class AclNode extends AppModel {
* Constructor
*
*/
- function __construct() {
+ public function __construct() {
$config = Configure::read('Acl.database');
if (isset($config)) {
$this->useDbConfig = $config;
@@ -29,7 +29,7 @@ class TranslateBehavior extends ModelBehavior {
/**
* Used for runtime configuration of model
- *
+ *
* @var array
*/
public $runtime = array();
@@ -381,7 +381,7 @@ public function translateModel($model) {
* @param boolean $reset
* @return bool
*/
- function bindTranslation($model, $fields, $reset = true) {
+ public function bindTranslation($model, $fields, $reset = true) {
if (is_string($fields)) {
$fields = array($fields);
}
@@ -450,11 +450,11 @@ function bindTranslation($model, $fields, $reset = true) {
* fake field
*
* @param object $model instance of model
- * @param mixed $fields string with field, or array(field1, field2=>AssocName, field3), or null for
+ * @param mixed $fields string with field, or array(field1, field2=>AssocName, field3), or null for
* unbind all original translations
* @return bool
*/
- function unbindTranslation($model, $fields = null) {
+ public function unbindTranslation($model, $fields = null) {
if (empty($fields) && empty($this->settings[$model->alias])) {
return false;
}
@@ -632,7 +632,7 @@ public function recover($Model, $mode = 'parent', $missingParentAction = null) {
* @link http://book.cakephp.org/view/1355/reorder
* @link http://book.cakephp.org/view/1629/Reorder
*/
- function reorder($Model, $options = array()) {
+ public function reorder($Model, $options = array()) {
$options = array_merge(array('id' => null, 'field' => $Model->displayField, 'order' => 'ASC', 'verify' => true), $options);
extract($options);
if ($verify && !$this->verify($Model)) {
@@ -702,7 +702,7 @@ public function removeFromTree($Model, $id = null, $delete = false) {
$db = ConnectionManager::getDataSource($Model->useDbConfig);
$Model->updateAll(
- array($parent => $db->value($node[$parent], $parent)),
+ array($parent => $db->value($node[$parent], $parent)),
array($Model->escapeField($parent) => $node[$Model->primaryKey])
);
$this->__sync($Model, 1, '-', 'BETWEEN ' . ($node[$left] + 1) . ' AND ' . ($node[$right] - 1));
@@ -885,7 +885,7 @@ protected function _setParent($Model, $parentId = null, $created = false) {
* @return int
* @access private
*/
- function __getMax($Model, $scope, $right, $recursive = -1, $created = false) {
+ private function __getMax($Model, $scope, $right, $recursive = -1, $created = false) {
$db = ConnectionManager::getDataSource($Model->useDbConfig);
if ($created) {
if (is_string($scope)) {
@@ -913,7 +913,7 @@ function __getMax($Model, $scope, $right, $recursive = -1, $created = false) {
* @return int
* @access private
*/
- function __getMin($Model, $scope, $left, $recursive = -1) {
+ private function __getMin($Model, $scope, $left, $recursive = -1) {
$db = ConnectionManager::getDataSource($Model->useDbConfig);
$name = $Model->alias . '.' . $left;
list($edge) = array_values($Model->find('first', array(
@@ -936,7 +936,7 @@ function __getMin($Model, $scope, $left, $recursive = -1) {
* @param string $field
* @access private
*/
- function __sync($Model, $shift, $dir = '+', $conditions = array(), $created = false, $field = 'both') {
+ private function __sync($Model, $shift, $dir = '+', $conditions = array(), $created = false, $field = 'both') {
$ModelRecursive = $Model->recursive;
extract($this->settings[$Model->alias]);
$Model->recursive = $recursive;
@@ -59,7 +59,7 @@ class BehaviorCollection extends ObjectCollection {
* @access public
* @return void
*/
- function init($modelName, $behaviors = array()) {
+ public function init($modelName, $behaviors = array()) {
$this->modelName = $modelName;
if (!empty($behaviors)) {
@@ -206,7 +206,7 @@ public function detach($name) {
/**
* Dispatches a behavior method. Will call either normal methods or mapped methods.
*
- * If a method is not handeled by the BehaviorCollection, and $strict is false, a
+ * If a method is not handeled by the BehaviorCollection, and $strict is false, a
* special return of `array('unhandled')` will be returned to signal the method was not found.
*
* @param Model $model The model the method was originally called on.
@@ -217,7 +217,7 @@ public function detach($name) {
*/
public function dispatchMethod($model, $method, $params = array(), $strict = false) {
$method = $this->hasMethod($method, true);
-
+
if ($strict && empty($method)) {
trigger_error(__d('cake_dev', "BehaviorCollection::dispatchMethod() - Method %s not found in any attached behavior", $method), E_USER_WARNING);
return null;
@@ -236,7 +236,7 @@ public function dispatchMethod($model, $method, $params = array(), $strict = fal
}
/**
- * Gets the method list for attached behaviors, i.e. all public, non-callback methods.
+ * Gets the method list for attached behaviors, i.e. all public, non-callback methods.
* This does not include mappedMethods.
*
* @return array All public methods for all behaviors attached to this collection
@@ -79,7 +79,7 @@ class CakeSchema extends Object {
*
* @param array $options optional load object properties
*/
- function __construct($options = array()) {
+ public function __construct($options = array()) {
parent::__construct();
if (empty($options['name'])) {
@@ -391,7 +391,7 @@ public function write($object, $options = array()) {
* @param array $fields Array of field information to generate the table with.
* @return string Variable declaration for a schema class
*/
- function generateTable($table, $fields) {
+ public function generateTable($table, $fields) {
$out = "\tvar \${$table} = array(\n";
if (is_array($fields)) {
$cols = array();
@@ -529,7 +529,7 @@ public function compare($old, $new = null) {
* where match was not found.
* @access protected
*/
- function _arrayDiffAssoc($array1, $array2) {
+ public function _arrayDiffAssoc($array1, $array2) {
$difference = array();
foreach ($array1 as $key => $value) {
if (!array_key_exists($key, $array2)) {
@@ -626,7 +626,7 @@ public function __columns(&$Obj) {
* @param array $old Old indexes
* @return mixed False on failure, or an array of parameters to add & drop.
*/
- function _compareTableParameters($new, $old) {
+ protected function _compareTableParameters($new, $old) {
if (!is_array($new) || !is_array($old)) {
return false;
}
@@ -641,7 +641,7 @@ function _compareTableParameters($new, $old) {
* @param array $old Old indexes
* @return mixed false on failure or array of indexes to add and drop
*/
- function _compareIndexes($new, $old) {
+ protected function _compareIndexes($new, $old) {
if (!is_array($new) || !is_array($old)) {
return false;
}
@@ -87,7 +87,7 @@ class DataSource extends Object {
* @param array $config Array of configuration information for the datasource.
* @return void.
*/
- function __construct($config = array()) {
+ public function __construct($config = array()) {
parent::__construct();
$this->setConfig($config);
}
@@ -329,7 +329,7 @@ function __cacheDescription($object, $data = null) {
* @access public
* @todo Remove and refactor $assocData, ensure uses of the method have the param removed too.
*/
- function insertQueryData($query, $data, $association, $assocData, Model $model, Model $linkModel, $stack) {
+ public function insertQueryData($query, $data, $association, $assocData, Model $model, Model $linkModel, $stack) {
$keys = array('{$__cakeID__$}', '{$__cakeForeignKey__$}');
foreach ($keys as $key) {
Oops, something went wrong.

0 comments on commit 4c042ae

Please sign in to comment.