diff --git a/cake/console/cake.php b/cake/console/cake.php index 4428b9d828d..e1f06cd5ea1 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -127,9 +127,8 @@ class ShellDispatcher { * * @param array $args the argv * @return void - * @access public */ - function ShellDispatcher($args = array()) { + public function ShellDispatcher($args = array()) { set_time_limit(0); $this->__initConstants(); @@ -281,9 +280,8 @@ function __bootstrap() { * Clear the console * * @return void - * @access public */ - function clear() { + public function clear() { if (empty($this->params['noclear'])) { if ( DS === '/') { passthru('clear'); @@ -297,9 +295,8 @@ function clear() { * Dispatches a CLI request * * @return boolean - * @access public */ - function dispatch() { + public function dispatch() { $arg = $this->shiftArgs(); if (!$arg) { @@ -429,9 +426,8 @@ function _getShell($plugin = null) { * @param mixed $options Array or string of options. * @param string $default Default input value. * @return Either the default value, or the user-provided input. - * @access public */ - function getInput($prompt, $options = null, $default = null) { + public function getInput($prompt, $options = null, $default = null) { if (!is_array($options)) { $printOptions = ''; } else { @@ -462,9 +458,8 @@ function getInput($prompt, $options = null, $default = null) { * @param string $string String to output. * @param boolean $newline If true, the outputs gets an added newline. * @return integer Returns the number of bytes output to stdout. - * @access public */ - function stdout($string, $newline = true) { + public function stdout($string, $newline = true) { if ($newline) { return fwrite($this->stdout, $string . "\n"); } else { @@ -476,9 +471,8 @@ function stdout($string, $newline = true) { * Outputs to the stderr filehandle. * * @param string $string Error text to output. - * @access public */ - function stderr($string) { + public function stderr($string) { fwrite($this->stderr, $string); } @@ -486,9 +480,8 @@ function stderr($string) { * Parses command line options * * @param array $params Parameters to parse - * @access public */ - function parseParams($params) { + public function parseParams($params) { $this->__parseParams($params); $defaults = array('app' => 'app', 'root' => dirname(dirname(dirname(__FILE__))), 'working' => null, 'webroot' => 'webroot'); $params = array_merge($defaults, array_intersect_key($this->params, $defaults)); @@ -562,18 +555,16 @@ function __parseParams($params) { * Removes first argument and shifts other arguments up * * @return mixed Null if there are no arguments otherwise the shifted argument - * @access public */ - function shiftArgs() { + public function shiftArgs() { return array_shift($this->args); } /** * Shows console help * - * @access public */ - function help() { + public function help() { $this->clear(); $this->stdout("\nWelcome to CakePHP v" . Configure::version() . " Console"); $this->stdout("---------------------------------------------------------------"); diff --git a/cake/console/error.php b/cake/console/error.php index f64d8d788f3..62e33d808ec 100644 --- a/cake/console/error.php +++ b/cake/console/error.php @@ -58,9 +58,8 @@ function __construct($method, $messages) { * Displays an error page (e.g. 404 Not found). * * @param array $params Parameters (code, name, and message) - * @access public */ - function error($params) { + public function error($params) { extract($params, EXTR_OVERWRITE); $this->stderr($code . $name . $message."\n"); $this->_stop(); @@ -70,9 +69,8 @@ function error($params) { * Convenience method to display a 404 page. * * @param array $params Parameters (url, message) - * @access public */ - function error404($params) { + public function error404($params) { extract($params, EXTR_OVERWRITE); $this->error(array( 'code' => '404', @@ -86,9 +84,8 @@ function error404($params) { * Renders the Missing Controller web page. * * @param array $params Parameters (className) - * @access public */ - function missingController($params) { + public function missingController($params) { extract($params, EXTR_OVERWRITE); $controllerName = str_replace('Controller', '', $className); $this->stderr(sprintf(__("Missing Controller '%s'", true), $controllerName)); @@ -99,9 +96,8 @@ function missingController($params) { * Renders the Missing Action web page. * * @param array $params Parameters (action, className) - * @access public */ - function missingAction($params) { + public function missingAction($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Method '%s' in '%s'", true), $action, $className)); $this->_stop(); @@ -111,9 +107,8 @@ function missingAction($params) { * Renders the Private Action web page. * * @param array $params Parameters (action, className) - * @access public */ - function privateAction($params) { + public function privateAction($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Trying to access private method '%s' in '%s'", true), $action, $className)); $this->_stop(); @@ -123,9 +118,8 @@ function privateAction($params) { * Renders the Missing Table web page. * * @param array $params Parameters (table, className) - * @access public */ - function missingTable($params) { + public function missingTable($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing database table '%s' for model '%s'", true), $table, $className)); $this->_stop(); @@ -135,9 +129,8 @@ function missingTable($params) { * Renders the Missing Database web page. * * @param array $params Parameters - * @access public */ - function missingDatabase($params = array()) { + public function missingDatabase($params = array()) { $this->stderr(__("Missing Database", true)); $this->_stop(); } @@ -146,9 +139,8 @@ function missingDatabase($params = array()) { * Renders the Missing View web page. * * @param array $params Parameters (file, action, className) - * @access public */ - function missingView($params) { + public function missingView($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing View '%s' for '%s' in '%s'", true), $file, $action, $className)); $this->_stop(); @@ -158,9 +150,8 @@ function missingView($params) { * Renders the Missing Layout web page. * * @param array $params Parameters (file) - * @access public */ - function missingLayout($params) { + public function missingLayout($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Layout '%s'", true), $file)); $this->_stop(); @@ -170,9 +161,8 @@ function missingLayout($params) { * Renders the Database Connection web page. * * @param array $params Parameters - * @access public */ - function missingConnection($params) { + public function missingConnection($params) { extract($params, EXTR_OVERWRITE); $this->stderr(__("Missing Database Connection. Try 'cake bake'", true)); $this->_stop(); @@ -182,9 +172,8 @@ function missingConnection($params) { * Renders the Missing Helper file web page. * * @param array $params Parameters (file, helper) - * @access public */ - function missingHelperFile($params) { + public function missingHelperFile($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Helper file '%s' for '%s'", true), $file, Inflector::camelize($helper))); $this->_stop(); @@ -194,9 +183,8 @@ function missingHelperFile($params) { * Renders the Missing Helper class web page. * * @param array $params Parameters (file, helper) - * @access public */ - function missingHelperClass($params) { + public function missingHelperClass($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Helper class '%s' in '%s'", true), Inflector::camelize($helper), $file)); $this->_stop(); @@ -206,9 +194,8 @@ function missingHelperClass($params) { * Renders the Missing Component file web page. * * @param array $params Parameters (file, component) - * @access public */ - function missingComponentFile($params) { + public function missingComponentFile($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Component file '%s' for '%s'", true), $file, Inflector::camelize($component))); $this->_stop(); @@ -218,9 +205,8 @@ function missingComponentFile($params) { * Renders the Missing Component class web page. * * @param array $params Parameters (file, component) - * @access public */ - function missingComponentClass($params) { + public function missingComponentClass($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Component class '%s' in '%s'", true), Inflector::camelize($component), $file)); $this->_stop(); @@ -230,9 +216,8 @@ function missingComponentClass($params) { * Renders the Missing Model class web page. * * @param array $params Parameters (className) - * @access public */ - function missingModel($params) { + public function missingModel($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing model '%s'", true), $className)); $this->_stop(); @@ -243,9 +228,8 @@ function missingModel($params) { * * @param string $string String to output. * @param boolean $newline If true, the outputs gets an added newline. - * @access public */ - function stdout($string, $newline = true) { + public function stdout($string, $newline = true) { if ($newline) { fwrite($this->stdout, $string . "\n"); } else { @@ -257,9 +241,8 @@ function stdout($string, $newline = true) { * Outputs to the stderr filehandle. * * @param string $string Error text to output. - * @access public */ - function stderr($string) { + public function stderr($string) { fwrite($this->stderr, "Error: ". $string . "\n"); } } diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 0ab5ea6dd39..2289e5f3719 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -63,9 +63,8 @@ class AclShell extends Shell { /** * Override startup of the Shell * - * @access public */ - function startup() { + public function startup() { if (isset($this->params['connection'])) { $this->connection = $this->params['connection']; } @@ -102,9 +101,8 @@ function startup() { /** * Override main() for help message hook * - * @access public */ - function main() { + public function main() { $out = __("Available ACL commands:", true) . "\n"; $out .= "\t - create\n"; $out .= "\t - delete\n"; @@ -124,9 +122,8 @@ function main() { /** * Creates an ARO/ACO node * - * @access public */ - function create() { + public function create() { $this->_checkArgs(3, 'create'); $this->checkNodeType(); extract($this->__dataVars()); @@ -159,9 +156,8 @@ function create() { /** * Delete an ARO/ACO node. * - * @access public */ - function delete() { + public function delete() { $this->_checkArgs(2, 'delete'); $this->checkNodeType(); extract($this->__dataVars()); @@ -178,9 +174,8 @@ function delete() { /** * Set parent for an ARO/ACO node. * - * @access public */ - function setParent() { + public function setParent() { $this->_checkArgs(3, 'setParent'); $this->checkNodeType(); extract($this->__dataVars()); @@ -204,9 +199,8 @@ function setParent() { /** * Get path to specified ARO/ACO node. * - * @access public */ - function getPath() { + public function getPath() { $this->_checkArgs(2, 'getPath'); $this->checkNodeType(); extract($this->__dataVars()); @@ -250,9 +244,8 @@ function _outputNode($class, $node, $indent) { /** * Check permission for a given ARO to a given ACO. * - * @access public */ - function check() { + public function check() { $this->_checkArgs(3, 'check'); extract($this->__getParams()); @@ -266,9 +259,8 @@ function check() { /** * Grant permission for a given ARO to a given ACO. * - * @access public */ - function grant() { + public function grant() { $this->_checkArgs(3, 'grant'); extract($this->__getParams()); @@ -282,9 +274,8 @@ function grant() { /** * Deny access for an ARO to an ACO. * - * @access public */ - function deny() { + public function deny() { $this->_checkArgs(3, 'deny'); extract($this->__getParams()); @@ -298,9 +289,8 @@ function deny() { /** * Set an ARO to inhermit permission to an ACO. * - * @access public */ - function inherit() { + public function inherit() { $this->_checkArgs(3, 'inherit'); extract($this->__getParams()); @@ -314,9 +304,8 @@ function inherit() { /** * Show a specific ARO/ACO node. * - * @access public */ - function view() { + public function view() { $this->_checkArgs(1, 'view'); $this->checkNodeType(); extract($this->__dataVars()); @@ -376,9 +365,8 @@ function view() { /** * Initialize ACL database. * - * @access public */ - function initdb() { + public function initdb() { $this->Dispatch->args = array('schema', 'run', 'create', 'DbAcl'); $this->Dispatch->dispatch(); } @@ -386,9 +374,8 @@ function initdb() { /** * Show help screen. * - * @access public */ - function help() { + public function help() { $head = "-----------------------------------------------\n"; $head .= __("Usage: cake acl ...", true) . "\n"; $head .= "-----------------------------------------------\n"; @@ -482,9 +469,8 @@ function help() { /** * Check that first argument specifies a valid Node type (ARO/ACO) * - * @access public */ - function checkNodeType() { + public function checkNodeType() { if (!isset($this->args[0])) { return false; } @@ -499,9 +485,8 @@ function checkNodeType() { * @param string $type Node type (ARO/ACO) * @param integer $id Node id * @return boolean Success - * @access public */ - function nodeExists() { + public function nodeExists() { if (!$this->checkNodeType() && !isset($this->args[1])) { return false; } diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index 5b60fa04f0f..2aa6008e318 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -39,9 +39,8 @@ class ApiShell extends Shell { /** * Override intialize of the Shell * - * @access public */ - function initialize() { + public function initialize() { $this->paths = array_merge($this->paths, array( 'behavior' => LIBS . 'model' . DS . 'behaviors' . DS, 'cache' => LIBS . 'cache' . DS, @@ -57,9 +56,8 @@ function initialize() { /** * Override main() to handle action * - * @access public */ - function main() { + public function main() { if (empty($this->args)) { return $this->help(); } @@ -140,9 +138,8 @@ function main() { /** * Show help for this shell. * - * @access public */ - function help() { + public function help() { $head = "Usage: cake api [] [-m ]\n"; $head .= "-----------------------------------------------\n"; $head .= "Parameters:\n\n"; diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index c88f4b496f2..2c619838be0 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -42,9 +42,8 @@ class BakeShell extends Shell { /** * Override loadTasks() to handle paths * - * @access public */ - function loadTasks() { + public function loadTasks() { parent::loadTasks(); $task = Inflector::classify($this->command); if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig'))) { @@ -66,9 +65,8 @@ function loadTasks() { /** * Override main() to handle action * - * @access public */ - function main() { + public function main() { if (!is_dir($this->DbConfig->path)) { if ($this->Project->execute()) { $this->DbConfig->path = $this->params['working'] . DS . 'config' . DS; @@ -129,9 +127,8 @@ function main() { /** * Quickly bake the MVC * - * @access public */ - function all() { + public function all() { $this->hr(); $this->out('Bake All'); $this->hr(); @@ -199,9 +196,8 @@ function all() { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->out('CakePHP Bake:'); $this->hr(); $this->out('The Bake script generates controllers, views and models for your application.'); diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 94f3186477b..c458506fcd7 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -51,9 +51,8 @@ class ConsoleShell extends Shell { /** * Override intialize of the Shell * - * @access public */ - function initialize() { + public function initialize() { require_once CAKE . 'dispatcher.php'; $this->Dispatcher = new Dispatcher(); $this->models = App::objects('model'); @@ -76,9 +75,8 @@ function initialize() { /** * Prints the help message * - * @access public */ - function help() { + public function help() { $out = 'Console help:'; $out .= '-------------'; $out .= 'The interactive console is a tool for testing parts of your app before you'; @@ -139,9 +137,8 @@ function help() { /** * Override main() to handle action * - * @access public */ - function main($command = null) { + public function main($command = null) { while (true) { if (empty($command)) { $command = trim($this->in('')); diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php index 5d28b16daf7..24e7caf89d6 100644 --- a/cake/console/libs/i18n.php +++ b/cake/console/libs/i18n.php @@ -45,9 +45,8 @@ class I18nShell extends Shell { /** * Override startup of the Shell * - * @access public */ - function startup() { + public function startup() { $this->_welcome(); if (isset($this->params['datasource'])) { $this->dataSource = $this->params['datasource']; @@ -64,9 +63,8 @@ function startup() { /** * Override main() for help message hook * - * @access public */ - function main() { + public function main() { $this->out(__('I18n Shell', true)); $this->hr(); $this->out(__('[E]xtract POT file from sources', true)); @@ -98,9 +96,8 @@ function main() { /** * Initialize I18N database. * - * @access public */ - function initdb() { + public function initdb() { $this->Dispatch->args = array('schema', 'create', 'i18n'); $this->Dispatch->dispatch(); } @@ -108,9 +105,8 @@ function initdb() { /** * Show help screen. * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out(__('I18n Shell:', true)); $this->hr(); diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 9ecd9a7942c..c287bc5787e 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -43,9 +43,8 @@ class SchemaShell extends Shell { /** * Override initialize * - * @access public */ - function initialize() { + public function initialize() { $this->_welcome(); $this->out('Cake Schema Shell'); $this->hr(); @@ -54,9 +53,8 @@ function initialize() { /** * Override startup * - * @access public */ - function startup() { + public function startup() { $name = $file = $path = $connection = $plugin = null; if (!empty($this->params['name'])) { $name = $this->params['name']; @@ -97,9 +95,8 @@ function startup() { /** * Override main * - * @access public */ - function main() { + public function main() { $this->help(); } @@ -107,9 +104,8 @@ function main() { * Read and output contents of schema object * path to read as second arg * - * @access public */ - function view() { + public function view() { $File = new File($this->Schema->path . DS . $this->params['file']); if ($File->exists()) { $this->out($File->read()); @@ -125,9 +121,8 @@ function view() { * Read database and Write schema object * accepts a connection as first arg or path to save as second arg * - * @access public */ - function generate() { + public function generate() { $this->out(__('Generating Schema...', true)); $options = array(); if (isset($this->params['f'])) { @@ -197,9 +192,8 @@ function generate() { * If -write contains a full path name the file will be saved there. If -write only * contains no DS, that will be used as the file name, in the same dir as the schema file. * - * @access public */ - function dump() { + public function dump() { $write = false; $Schema = $this->Schema->load(); if (!$Schema) { @@ -427,9 +421,8 @@ function __run($contents, $event, &$Schema) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $help = <<_loadModels(); } @@ -185,9 +184,8 @@ function initialize() { * allows for checking and configuring prior to command or main execution * can be overriden in subclasses * - * @access public */ - function startup() { + public function startup() { $this->_welcome(); } @@ -268,9 +266,8 @@ function _loadModels() { * Loads tasks defined in public $tasks * * @return bool - * @access public */ - function loadTasks() { + public function loadTasks() { if ($this->tasks === null || $this->tasks === false || $this->tasks === true || empty($this->tasks)) { return true; } @@ -329,9 +326,8 @@ function loadTasks() { * @param mixed $options Array or string of options. * @param string $default Default input value. * @return Either the default value, or the user-provided input. - * @access public */ - function in($prompt, $options = null, $default = null) { + public function in($prompt, $options = null, $default = null) { if (!$this->interactive) { return $default; } @@ -363,9 +359,8 @@ function in($prompt, $options = null, $default = null) { * @param mixed $message A string or a an array of strings to output * @param integer $newlines Number of newlines to append * @return integer Returns the number of bytes returned from writing to stdout. - * @access public */ - function out($message = null, $newlines = 1) { + public function out($message = null, $newlines = 1) { if (is_array($message)) { $message = implode($this->nl(), $message); } @@ -378,9 +373,8 @@ function out($message = null, $newlines = 1) { * * @param mixed $message A string or a an array of strings to output * @param integer $newlines Number of newlines to append - * @access public */ - function err($message = null, $newlines = 1) { + public function err($message = null, $newlines = 1) { if (is_array($message)) { $message = implode($this->nl(), $message); } @@ -402,9 +396,8 @@ function nl($multiplier = 1) { * Outputs a series of minus characters to the standard output, acts as a visual separator. * * @param integer $newlines Number of newlines to pre- and append - * @access public */ - function hr($newlines = 0) { + public function hr($newlines = 0) { $this->out(null, $newlines); $this->out('---------------------------------------------------------------'); $this->out(null, $newlines); @@ -416,9 +409,8 @@ function hr($newlines = 0) { * * @param string $title Title of the error * @param string $message An optional error message - * @access public */ - function error($title, $message = null) { + public function error($title, $message = null) { $this->err(sprintf(__('Error: %s', true), $title)); if (!empty($message)) { @@ -453,9 +445,8 @@ function _checkArgs($expectedNum, $command = null) { * @param string $path Where to put the file. * @param string $contents Content to put in the file. * @return boolean Success - * @access public */ - function createFile($path, $contents) { + public function createFile($path, $contents) { $path = str_replace(DS . DS, DS, $path); $this->out(); @@ -491,9 +482,8 @@ function createFile($path, $contents) { /** * Outputs usage text on the standard output. Implement it in subclasses. * - * @access public */ - function help() { + public function help() { if ($this->command != null) { $this->err("Unknown {$this->name} command `{$this->command}`."); $this->err("For usage, try `cake {$this->shell} help`.", 2); @@ -528,9 +518,8 @@ function _checkUnitTest() { * * @param string $file Absolute file path * @return sting short path - * @access public */ - function shortPath($file) { + public function shortPath($file) { $shortPath = str_replace(ROOT, null, $file); $shortPath = str_replace('..' . DS, '', $shortPath); return str_replace(DS . DS, DS, $shortPath); diff --git a/cake/console/libs/tasks/bake.php b/cake/console/libs/tasks/bake.php index 38128cfcb4c..08ca80728ec 100644 --- a/cake/console/libs/tasks/bake.php +++ b/cake/console/libs/tasks/bake.php @@ -47,9 +47,8 @@ class BakeTask extends Shell { * and returns the correct path. * * @return string Path to output. - * @access public */ - function getPath() { + public function getPath() { $path = $this->path; if (isset($this->plugin)) { $name = substr($this->name, 0, strlen($this->name) - 4); diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 444f8291523..c42cdc597b0 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -47,17 +47,15 @@ class ControllerTask extends BakeTask { /** * Override initialize * - * @access public */ - function initialize() { + public function initialize() { } /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); } @@ -382,9 +380,8 @@ function _doPropertyChoices($prompt, $example) { * @param string $useDbConfig Database configuration name * @param boolean $interactive Whether you are using listAll interactively and want options output. * @return array Set of controllers - * @access public */ - function listAll($useDbConfig = null) { + public function listAll($useDbConfig = null) { if (is_null($useDbConfig)) { $useDbConfig = $this->connection; } @@ -408,9 +405,8 @@ function listAll($useDbConfig = null) { * * @param string $useDbConfig Connection name to get a controller name for. * @return string Controller name - * @access public */ - function getName($useDbConfig = null) { + public function getName($useDbConfig = null) { $controllers = $this->listAll($useDbConfig); $enteredController = ''; @@ -439,9 +435,8 @@ function getName($useDbConfig = null) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake controller ..."); $this->hr(); diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index ee75b781954..788bdc1b596 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -58,18 +58,16 @@ class DbConfigTask extends Shell { * initialization callback * * @var string - * @access public */ - function initialize() { + public function initialize() { $this->path = $this->params['working'] . DS . 'config' . DS; } /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); $this->_stop(); @@ -244,9 +242,8 @@ function __verify($config) { * * @param array $configs Configuration settings to use * @return boolean Success - * @access public */ - function bake($configs) { + public function bake($configs) { if (!is_dir($this->path)) { $this->err($this->path . ' not found'); return false; diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index 0c30e29097d..23a0af77806 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -186,9 +186,8 @@ function __extract() { * Show help options * * @return void - * @access public */ - function help() { + public function help() { $this->out(__('CakePHP Language String Extraction:', true)); $this->hr(); $this->out(__('The Extract script generates .pot file(s) with translations', true)); diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 87822b65c75..083165da7a1 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -53,9 +53,8 @@ class FixtureTask extends BakeTask { /** * Override initialize * - * @access public */ - function __construct(&$dispatch) { + public function __construct(&$dispatch) { parent::__construct($dispatch); $this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS; } @@ -64,9 +63,8 @@ function __construct(&$dispatch) { * Execution method always used for tasks * Handles dispatching to interactive, named, or all processess. * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); } @@ -126,9 +124,8 @@ function __interactive() { * * @param string $modelName Name of model you are dealing with. * @return array Array of import options. - * @access public */ - function importOptions($modelName) { + public function importOptions($modelName) { $options = array(); $doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n'); if ($doSchema == 'y') { @@ -155,9 +152,8 @@ function importOptions($modelName) { * @param string $useTable Name of table to use. * @param array $importOptions Options for public $import * @return string Baked fixture content - * @access public */ - function bake($model, $useTable = false, $importOptions = array()) { + public function bake($model, $useTable = false, $importOptions = array()) { if (!class_exists('CakeSchema')) { App::import('Model', 'CakeSchema', false); } @@ -216,9 +212,8 @@ function bake($model, $useTable = false, $importOptions = array()) { * @param string $model name of the model being generated * @param string $fixture Contents of the fixture file. * @return string Content saved into fixture file. - * @access public */ - function generateFixtureFile($model, $otherVars) { + public function generateFixtureFile($model, $otherVars) { $defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null); $vars = array_merge($defaults, $otherVars); @@ -394,9 +389,8 @@ function _getRecordsFromTable($modelName, $useTable = null) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake fixture "); $this->hr(); diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 61395b9f3a7..e9691cd3a2b 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -71,9 +71,8 @@ class ModelTask extends BakeTask { /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { App::import('Model', 'Model', false); if (empty($this->args)) { @@ -277,9 +276,8 @@ function _printAssociation($modelName, $type, $associations) { * * @param array $fields Array of fields that might have a primary key. * @return string Name of field that is a primary key. - * @access public */ - function findPrimaryKey($fields) { + public function findPrimaryKey($fields) { foreach ($fields as $name => $field) { if (isset($field['key']) && $field['key'] == 'primary') { break; @@ -311,9 +309,8 @@ function findDisplayField($fields) { * * @param object $model Model to have validations generated for. * @return array $validate Array of user selected validations. - * @access public */ - function doValidation(&$model) { + public function doValidation(&$model) { if (!is_object($model)) { return false; } @@ -446,9 +443,8 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { * * @param object $model * @return array $assocaitons - * @access public */ - function doAssociations(&$model) { + public function doAssociations(&$model) { if (!is_object($model)) { return false; } @@ -772,9 +768,8 @@ function bakeTest($className) { * outputs the a list of possible models or controllers from database * * @param string $useDbConfig Database configuration name - * @access public */ - function listAll($useDbConfig = null) { + public function listAll($useDbConfig = null) { $this->_tables = $this->getAllTables($useDbConfig); if ($this->interactive === true) { @@ -855,9 +850,8 @@ function getAllTables($useDbConfig = null) { * Forces the user to specify the model he wants to bake, and returns the selected model name. * * @return string the model name - * @access public */ - function getName($useDbConfig = null) { + public function getName($useDbConfig = null) { $this->listAll($useDbConfig); $enteredModel = ''; @@ -886,9 +880,8 @@ function getName($useDbConfig = null) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake model "); $this->hr(); diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index e8c5f3371dc..698c88583e7 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -222,9 +222,8 @@ function findPath($pathOptions) { * Help * * @return void - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake plugin ..."); $this->hr(); diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index c64d65e1479..661f90a8024 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -38,9 +38,8 @@ class ProjectTask extends Shell { * finds the app directory in it. Then it calls bake() with that information. * * @param string $project Project path - * @access public */ - function execute($project = null) { + public function execute($project = null) { if ($project === null) { if (isset($this->args[0])) { $project = $this->args[0]; @@ -187,9 +186,8 @@ function bake($path, $skel = null, $skip = array('empty')) { * * @param string $dir Path to project * @return boolean Success - * @access public */ - function createHome($dir) { + public function createHome($dir) { $app = basename($dir); $path = $dir . 'views' . DS . 'pages' . DS; $source = CAKE . 'console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp'; @@ -202,9 +200,8 @@ function createHome($dir) { * * @param string $path Project path * @return boolean Success - * @access public */ - function securitySalt($path) { + public function securitySalt($path) { $File =& new File($path . 'config' . DS . 'core.php'); $contents = $File->read(); if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.salt\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { @@ -226,9 +223,8 @@ function securitySalt($path) { * * @param string $path Project path * @return boolean Success - * @access public - */ - function securityCipherSeed($path) { + */ + public function securityCipherSeed($path) { $File =& new File($path . 'config' . DS . 'core.php'); $contents = $File->read(); if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.cipherSeed\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { @@ -250,9 +246,8 @@ function securityCipherSeed($path) { * * @param string $path Project path * @return boolean Success - * @access public */ - function corePath($path) { + public function corePath($path) { if (dirname($path) !== CAKE_CORE_INCLUDE_PATH) { $File =& new File($path . 'webroot' . DS . 'index.php'); $contents = $File->read(); @@ -285,9 +280,8 @@ function corePath($path) { * * @param string $name Name to use as admin routing * @return boolean Success - * @access public */ - function cakeAdmin($name) { + public function cakeAdmin($name) { $path = (empty($this->configPath)) ? CONFIGS : $this->configPath; $File =& new File($path . 'core.php'); $contents = $File->read(); @@ -308,9 +302,8 @@ function cakeAdmin($name) { * Checks for Configure::read('Routing.prefixes') and forces user to input it if not enabled * * @return string Admin route to use - * @access public */ - function getPrefix() { + public function getPrefix() { $admin = ''; $prefixes = Configure::read('Routing.prefixes'); if (!empty($prefixes)) { @@ -353,9 +346,8 @@ function getPrefix() { * Help * * @return void - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake project "); $this->hr(); diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 356cf23135e..74d32b7fcf7 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -64,9 +64,8 @@ class TestTask extends BakeTask { /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); } @@ -114,9 +113,8 @@ function __interactive($type = null) { * * @param string $type Type of object to bake test case for ie. Model, Controller * @param string $className the 'cake name' for the class ie. Posts for the PostsController - * @access public */ - function bake($type, $className) { + public function bake($type, $className) { if ($this->typeCanDetectFixtures($type) && $this->isLoadableClass($type, $className)) { $this->out(__('Bake is detecting possible fixtures..', true)); $testSubject =& $this->buildTestSubject($type, $className); @@ -155,9 +153,8 @@ function bake($type, $className) { * Interact with the user and get their chosen type. Can exit the script. * * @return string Users chosen type. - * @access public */ - function getObjectType() { + public function getObjectType() { $this->hr(); $this->out(__("Select an object type:", true)); $this->hr(); @@ -180,9 +177,8 @@ function getObjectType() { * * @param string $objectType Type of object to list classes for i.e. Model, Controller. * @return string Class name the user chose. - * @access public */ - function getClassName($objectType) { + public function getClassName($objectType) { $options = App::objects(strtolower($objectType)); $this->out(sprintf(__('Choose a %s class', true), $objectType)); $keys = array(); @@ -204,9 +200,8 @@ function getClassName($objectType) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $className the Classname of the class the test is being generated for. * @return boolean - * @access public */ - function typeCanDetectFixtures($type) { + public function typeCanDetectFixtures($type) { $type = strtolower($type); return ($type == 'controller' || $type == 'model'); } @@ -217,9 +212,8 @@ function typeCanDetectFixtures($type) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $className the Classname of the class the test is being generated for. * @return boolean - * @access public */ - function isLoadableClass($type, $class) { + public function isLoadableClass($type, $class) { return App::import($type, $class); } @@ -230,9 +224,8 @@ function isLoadableClass($type, $class) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $class the Classname of the class the test is being generated for. * @return object And instance of the class that is going to be tested. - * @access public */ - function &buildTestSubject($type, $class) { + public function &buildTestSubject($type, $class) { ClassRegistry::flush(); App::import($type, $class); $class = $this->getRealClassName($type, $class); @@ -250,9 +243,8 @@ function &buildTestSubject($type, $class) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $class the Classname of the class the test is being generated for. * @return string Real classname - * @access public */ - function getRealClassName($type, $class) { + public function getRealClassName($type, $class) { if (strtolower($type) == 'model') { return $class; } @@ -265,9 +257,8 @@ function getRealClassName($type, $class) { * * @param string $className Name of class to look at. * @return array Array of method names. - * @access public */ - function getTestableMethods($className) { + public function getTestableMethods($className) { $classMethods = get_class_methods($className); $parentMethods = get_class_methods(get_parent_class($className)); $thisMethods = array_diff($classMethods, $parentMethods); @@ -286,9 +277,8 @@ function getTestableMethods($className) { * * @param object $subject The object you want to generate fixtures for. * @return array Array of fixtures to be included in the test. - * @access public */ - function generateFixtureList(&$subject) { + public function generateFixtureList(&$subject) { $this->_fixtures = array(); if (is_a($subject, 'Model')) { $this->_processModel($subject); @@ -365,9 +355,8 @@ function _addFixture($name) { * Interact with the user to get additional fixtures they want to use. * * @return array Array of fixtures the user wants to add. - * @access public */ - function getUserFixtures() { + public function getUserFixtures() { $proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n'); $fixtures = array(); if (strtolower($proceed) == 'y') { @@ -385,9 +374,8 @@ function getUserFixtures() { * * @param string $type The type of object tests are being generated for eg. controller. * @return boolean - * @access public */ - function hasMockClass($type) { + public function hasMockClass($type) { $type = strtolower($type); return $type == 'controller'; } @@ -398,9 +386,8 @@ function hasMockClass($type) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $className the Classname of the class the test is being generated for. * @return string Constructor snippet for the thing you are building. - * @access public */ - function generateConstructor($type, $fullClassName) { + public function generateConstructor($type, $fullClassName) { $type = strtolower($type); if ($type == 'model') { return "ClassRegistry::init('$fullClassName');\n"; @@ -419,9 +406,8 @@ function generateConstructor($type, $fullClassName) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $className the Classname of the class the test is being generated for. * @return string filename the test should be created on. - * @access public */ - function testCaseFileName($type, $className) { + public function testCaseFileName($type, $className) { $path = $this->getPath();; $path .= 'cases' . DS . Inflector::tableize($type) . DS; if (strtolower($type) == 'controller') { @@ -434,9 +420,8 @@ function testCaseFileName($type, $className) { * Show help file. * * @return void - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake test "); $this->hr(); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 790ab8c0c52..e42e3ed8d96 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -88,17 +88,15 @@ class ViewTask extends BakeTask { /** * Override initialize * - * @access public */ - function initialize() { + public function initialize() { } /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); } @@ -359,9 +357,8 @@ function customAction() { * @param string $action Action to bake * @param string $content Content to write * @return boolean Success - * @access public */ - function bake($action, $content = '') { + public function bake($action, $content = '') { if ($content === true) { $content = $this->getContent($action); } @@ -376,9 +373,8 @@ function bake($action, $content = '') { * @param string $action name to generate content to * @param array $vars passed for use in templates * @return string content from template - * @access public */ - function getContent($action, $vars = null) { + public function getContent($action, $vars = null) { if (!$vars) { $vars = $this->__loadController(); } @@ -398,9 +394,8 @@ function getContent($action, $vars = null) { * * @param string $action name * @return string template name - * @access public */ - function getTemplate($action) { + public function getTemplate($action) { if ($action != $this->template && in_array($action, $this->noTemplateActions)) { return false; } @@ -425,9 +420,8 @@ function getTemplate($action) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake view ..."); $this->hr(); diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 4dfb1f6bf47..6f4c91db885 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -73,9 +73,8 @@ class TestSuiteShell extends Shell { * Initialization method installs Simpletest and loads all plugins * * @return void - * @access public */ - function initialize() { + public function initialize() { $corePath = App::core('cake'); if (isset($corePath[0])) { define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); @@ -100,9 +99,8 @@ function initialize() { * Parse the arguments given into the Shell object properties. * * @return void - * @access public */ - function parseArgs() { + public function parseArgs() { if (empty($this->args)) { return; } @@ -146,9 +144,8 @@ function getManager() { * Main entry point to this shell * * @return void - * @access public */ - function main() { + public function main() { $this->out(__('CakePHP Test Shell', true)); $this->hr(); @@ -174,9 +171,8 @@ function main() { * Help screen * * @return void - * @access public */ - function help() { + public function help() { $this->out('Usage: '); $this->out("\tcake testsuite category test_type file"); $this->out("\t\t- category - \"app\", \"core\" or name of a plugin"); diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 9e91c68e25d..3762ea3da9a 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -92,9 +92,8 @@ function __construct($url = null, $base = false) { * @param string $url URL information to work on * @param array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params * @return boolean Success - * @access public */ - function dispatch($url = null, $additionalParams = array()) { + public function dispatch($url = null, $additionalParams = array()) { if ($this->base === false) { $this->base = $this->baseUrl(); } @@ -236,9 +235,8 @@ function __extractParams($url, $additionalParams = array()) { * * @param string $fromUrl URL to mine for parameter information. * @return array Parameters found in POST and GET. - * @access public */ - function parseParams($fromUrl) { + public function parseParams($fromUrl) { $params = array(); if (isset($_POST)) { @@ -315,9 +313,8 @@ function parseParams($fromUrl) { * Returns a base URL and sets the proper webroot * * @return string Base URL - * @access public */ - function baseUrl() { + public function baseUrl() { $dir = $webroot = null; $config = Configure::read('App'); extract($config); @@ -461,9 +458,8 @@ function __loadController($params) { * constructs a new one, using the PHP_SELF constant and other variables. * * @return string URI - * @access public */ - function uri() { + public function uri() { foreach (array('HTTP_X_REWRITE_URL', 'REQUEST_URI', 'argv') as $var) { if ($uri = env($var)) { if ($var == 'argv') { @@ -508,9 +504,8 @@ function uri() { * @param string $uri Request URI * @param string $base Base path * @return string URL - * @access public */ - function getUrl($uri = null, $base = null) { + public function getUrl($uri = null, $base = null) { if (empty($_GET['url'])) { if ($uri == null) { $uri = $this->uri(); @@ -557,9 +552,8 @@ function getUrl($uri = null, $base = null) { * Outputs cached dispatch view cache * * @param string $url Requested URL - * @access public */ - function cached($url) { + public function cached($url) { if (Configure::read('Cache.check') === true) { $path = $this->here; if ($this->here == '/') { @@ -594,9 +588,8 @@ function cached($url) { * * @param $url string $url Requested URL * @return boolean True on success if the asset file was found and sent - * @access public */ - function asset($url) { + public function asset($url) { if (strpos($url, '..') !== false || strpos($url, '.') === false) { return false; } diff --git a/cake/libs/cache.php b/cake/libs/cache.php index a3e918656b3..e5e2f28b6bc 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -361,9 +361,8 @@ function read($key, $config = null) { * default config will be used. * @return mixed new value, or false if the data doesn't exist, is not integer, * or if there was an error fetching it. - * @access public */ - function increment($key, $offset = 1, $config = null) { + public function increment($key, $offset = 1, $config = null) { $self =& Cache::getInstance(); if (!$config) { @@ -395,9 +394,8 @@ function increment($key, $offset = 1, $config = null) { * default config will be used. * @return mixed new value, or false if the data doesn't exist, is not integer, * or if there was an error fetching it - * @access public */ - function decrement($key, $offset = 1, $config = null) { + public function decrement($key, $offset = 1, $config = null) { $self =& Cache::getInstance(); if (!$config) { @@ -558,9 +556,8 @@ class CacheEngine { * * @param array $params Associative array of parameters for the engine * @return boolean True if the engine has been succesfully initialized, false if not - * @access public */ - function init($settings = array()) { + public function init($settings = array()) { $this->settings = array_merge( array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100), $this->settings, @@ -577,9 +574,8 @@ function init($settings = array()) { * * Permanently remove all expired and deleted data * - * @access public */ - function gc() { + public function gc() { } /** @@ -589,9 +585,8 @@ function gc() { * @param mixed $value Data to be cached * @param mixed $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$value, $duration) { + public function write($key, &$value, $duration) { trigger_error(sprintf(__('Method write() not implemented in %s', true), get_class($this)), E_USER_ERROR); } @@ -600,9 +595,8 @@ function write($key, &$value, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { trigger_error(sprintf(__('Method read() not implemented in %s', true), get_class($this)), E_USER_ERROR); } @@ -612,9 +606,8 @@ function read($key) { * @param string $key Identifier for the data * @param integer $offset How much to add * @return New incremented value, false otherwise - * @access public */ - function increment($key, $offset = 1) { + public function increment($key, $offset = 1) { trigger_error(sprintf(__('Method increment() not implemented in %s', true), get_class($this)), E_USER_ERROR); } /** @@ -623,9 +616,8 @@ function increment($key, $offset = 1) { * @param string $key Identifier for the data * @param integer $value How much to substract * @return New incremented value, false otherwise - * @access public */ - function decrement($key, $offset = 1) { + public function decrement($key, $offset = 1) { trigger_error(sprintf(__('Method decrement() not implemented in %s', true), get_class($this)), E_USER_ERROR); } /** @@ -633,9 +625,8 @@ function decrement($key, $offset = 1) { * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { } /** @@ -643,18 +634,16 @@ function delete($key) { * * @param boolean $check if true will check expiration, otherwise delete all * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear($check) { + public function clear($check) { } /** * Cache Engine settings * * @return array settings - * @access public */ - function settings() { + public function settings() { return $this->settings; } @@ -663,9 +652,8 @@ function settings() { * * @param string $key the key passed over * @return mixed string $key or false - * @access public */ - function key($key) { + public function key($key) { if (empty($key)) { return false; } diff --git a/cake/libs/cache/apc.php b/cake/libs/cache/apc.php index 3a86e099bbb..2fbf08ab31a 100644 --- a/cake/libs/cache/apc.php +++ b/cake/libs/cache/apc.php @@ -36,9 +36,8 @@ class ApcEngine extends CacheEngine { * @param array $setting array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not * @see CacheEngine::__defaults - * @access public */ - function init($settings = array()) { + public function init($settings = array()) { parent::init(array_merge(array('engine' => 'Apc', 'prefix' => Inflector::slug(APP_DIR) . '_'), $settings)); return function_exists('apc_cache_info'); } @@ -50,9 +49,8 @@ function init($settings = array()) { * @param mixed $value Data to be cached * @param integer $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$value, $duration) { + public function write($key, &$value, $duration) { $expires = time() + $duration; apc_store($key.'_expires', $expires, $duration); return apc_store($key, $value, $duration); @@ -63,9 +61,8 @@ function write($key, &$value, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { $time = time(); $cachetime = intval(apc_fetch($key.'_expires')); if ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime) { @@ -81,9 +78,8 @@ function read($key) { * @param integer $offset How much to increment * @param integer $duration How long to cache the data, in seconds * @return New incremented value, false otherwise - * @access public */ - function increment($key, $offset = 1) { + public function increment($key, $offset = 1) { return apc_inc($key, $offset); } @@ -94,9 +90,8 @@ function increment($key, $offset = 1) { * @param integer $offset How much to substract * @param integer $duration How long to cache the data, in seconds * @return New decremented value, false otherwise - * @access public */ - function decrement($key, $offset = 1) { + public function decrement($key, $offset = 1) { return apc_dec($key, $offset); } @@ -105,9 +100,8 @@ function decrement($key, $offset = 1) { * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { return apc_delete($key); } @@ -115,9 +109,8 @@ function delete($key) { * Delete all keys from the cache * * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear() { + public function clear() { return apc_clear_cache('user'); } } diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index 2c677f35992..656e3511f91 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -69,9 +69,8 @@ class FileEngine extends CacheEngine { * * @param array $setting array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not - * @access public */ - function init($settings = array()) { + public function init($settings = array()) { parent::init(array_merge( array( 'engine' => 'File', 'path' => CACHE, 'prefix'=> 'cake_', 'lock'=> false, @@ -98,9 +97,8 @@ function init($settings = array()) { * Garbage collection. Permanently remove all expired and deleted data * * @return boolean True if garbage collection was succesful, false on failure - * @access public */ - function gc() { + public function gc() { return $this->clear(true); } @@ -111,9 +109,8 @@ function gc() { * @param mixed $data Data to be cached * @param mixed $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$data, $duration) { + public function write($key, &$data, $duration) { if ($data === '' || !$this->_init) { return false; } @@ -151,9 +148,8 @@ function write($key, &$data, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { if ($this->_setKey($key) === false || !$this->_init || !$this->_File->exists()) { return false; } @@ -184,9 +180,8 @@ function read($key) { * * @param string $key Identifier for the data * @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { if ($this->_setKey($key) === false || !$this->_init) { return false; } @@ -198,9 +193,8 @@ function delete($key) { * * @param boolean $check Optional - only delete expired cache items * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear($check) { + public function clear($check) { if (!$this->_init) { return false; } diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index 0e54da760e6..30d602e2ba4 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -55,9 +55,8 @@ class MemcacheEngine extends CacheEngine { * * @param array $setting array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not - * @access public */ - function init($settings = array()) { + public function init($settings = array()) { if (!class_exists('Memcache')) { return false; } @@ -101,9 +100,8 @@ function init($settings = array()) { * @param mixed $value Data to be cached * @param integer $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$value, $duration) { + public function write($key, &$value, $duration) { $expires = time() + $duration; $this->__Memcache->set($key . '_expires', $expires, $this->settings['compress'], $expires); return $this->__Memcache->set($key, $value, $this->settings['compress'], $expires); @@ -114,9 +112,8 @@ function write($key, &$value, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { $time = time(); $cachetime = intval($this->__Memcache->get($key . '_expires')); if ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime) { @@ -132,9 +129,8 @@ function read($key) { * @param integer $offset How much to increment * @param integer $duration How long to cache the data, in seconds * @return New incremented value, false otherwise - * @access public */ - function increment($key, $offset = 1) { + public function increment($key, $offset = 1) { if ($this->settings['compress']) { trigger_error(sprintf(__('Method increment() not implemented for compressed cache in %s', true), get_class($this)), E_USER_ERROR); } @@ -148,9 +144,8 @@ function increment($key, $offset = 1) { * @param integer $offset How much to substract * @param integer $duration How long to cache the data, in seconds * @return New decremented value, false otherwise - * @access public */ - function decrement($key, $offset = 1) { + public function decrement($key, $offset = 1) { if ($this->settings['compress']) { trigger_error(sprintf(__('Method decrement() not implemented for compressed cache in %s', true), get_class($this)), E_USER_ERROR); } @@ -162,9 +157,8 @@ function decrement($key, $offset = 1) { * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { return $this->__Memcache->delete($key); } @@ -172,9 +166,8 @@ function delete($key) { * Delete all keys from the cache * * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear() { + public function clear() { return $this->__Memcache->flush(); } @@ -184,9 +177,8 @@ function clear() { * @param string $host host ip address or name * @param integer $port Server port * @return boolean True if memcache server was connected - * @access public */ - function connect($host, $port = 11211) { + public function connect($host, $port = 11211) { if ($this->__Memcache->getServerStatus($host, $port) === 0) { if ($this->__Memcache->connect($host, $port)) { return true; diff --git a/cake/libs/cache/xcache.php b/cake/libs/cache/xcache.php index f6e094001f7..ef2dca1245c 100644 --- a/cake/libs/cache/xcache.php +++ b/cake/libs/cache/xcache.php @@ -46,9 +46,8 @@ class XcacheEngine extends CacheEngine { * * @param array $setting array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not - * @access public */ - function init($settings) { + public function init($settings) { parent::init(array_merge(array( 'engine' => 'Xcache', 'prefix' => Inflector::slug(APP_DIR) . '_', 'PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password' ), $settings) @@ -63,9 +62,8 @@ function init($settings) { * @param mixed $value Data to be cached * @param integer $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$value, $duration) { + public function write($key, &$value, $duration) { $expires = time() + $duration; xcache_set($key . '_expires', $expires, $duration); return xcache_set($key, $value, $duration); @@ -76,9 +74,8 @@ function write($key, &$value, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { if (xcache_isset($key)) { $time = time(); $cachetime = intval(xcache_get($key . '_expires')); @@ -98,9 +95,8 @@ function read($key) { * @param integer $offset How much to increment * @param integer $duration How long to cache the data, in seconds * @return New incremented value, false otherwise - * @access public */ - function increment($key, $offset = 1) { + public function increment($key, $offset = 1) { return xcache_inc($key, $offset); } @@ -112,9 +108,8 @@ function increment($key, $offset = 1) { * @param integer $offset How much to substract * @param integer $duration How long to cache the data, in seconds * @return New decremented value, false otherwise - * @access public */ - function decrement($key, $offset = 1) { + public function decrement($key, $offset = 1) { return xcache_dec($key, $offset); } /** @@ -122,9 +117,8 @@ function decrement($key, $offset = 1) { * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { return xcache_unset($key); } @@ -132,9 +126,8 @@ function delete($key) { * Delete all keys from the cache * * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear() { + public function clear() { $this->__auth(); $max = xcache_count(XC_TYPE_VAR); for ($i = 0; $i < $max; $i++) { diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index bf85595c164..a187539433a 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -135,9 +135,8 @@ class CakeSession extends Object { * * @param string $base The base path for the Session * @param boolean $start Should session be started right now - * @access public */ - function __construct($base = null, $start = true) { + public function __construct($base = null, $start = true) { App::import('Core', array('Set', 'Security')); $this->time = time(); @@ -198,9 +197,8 @@ function __construct($base = null, $start = true) { * Starts the Session. * * @return boolean True if session was started - * @access public */ - function start() { + public function start() { if ($this->started()) { return true; } @@ -230,9 +228,8 @@ function started() { * * @param string $name Variable name to check for * @return boolean True if variable is there - * @access public */ - function check($name) { + public function check($name) { if (empty($name)) { return false; } @@ -245,9 +242,8 @@ function check($name) { * * @param id $name string * @return string Session id - * @access public */ - function id($id = null) { + public function id($id = null) { if ($id) { $this->id = $id; session_id($this->id); @@ -264,9 +260,8 @@ function id($id = null) { * * @param string $name Session variable to remove * @return boolean Success - * @access public */ - function delete($name) { + public function delete($name) { if ($this->check($name)) { if (in_array($name, $this->watchKeys)) { trigger_error(sprintf(__('Deleting session key {%s}', true), $name), E_USER_NOTICE); @@ -317,9 +312,8 @@ function __error($errorNumber) { * Returns last occurred error as a string, if any. * * @return mixed Error description as a string, or false. - * @access public */ - function error() { + public function error() { if ($this->lastError) { return $this->__error($this->lastError); } else { @@ -331,9 +325,8 @@ function error() { * Returns true if session is valid. * * @return boolean Success - * @access public */ - function valid() { + public function valid() { if ($this->read('Config')) { if ((Configure::read('Session.checkAgent') === false || $this->_userAgent == $this->read('Config.userAgent')) && $this->time <= $this->read('Config.time')) { if ($this->error === false) { @@ -352,9 +345,8 @@ function valid() { * * @param mixed $name The name of the session variable (or a path as sent to Set.extract) * @return mixed The value of the session variable - * @access public */ - function read($name = null) { + public function read($name = null) { if (is_null($name)) { return $this->__returnSessionVars(); } @@ -389,9 +381,8 @@ function __returnSessionVars() { * * @param mixed $var The variable path to watch * @return void - * @access public */ - function watch($var) { + public function watch($var) { if (empty($var)) { return false; } @@ -405,9 +396,8 @@ function watch($var) { * * @param mixed $var The variable path to watch * @return void - * @access public */ - function ignore($var) { + public function ignore($var) { if (!in_array($var, $this->watchKeys)) { return; } @@ -426,9 +416,8 @@ function ignore($var) { * @param mixed $name Name of variable * @param string $value Value to write * @return boolean True if the write was successful, false if the write failed - * @access public */ - function write($name, $value) { + public function write($name, $value) { if (empty($name)) { return false; } @@ -443,9 +432,8 @@ function write($name, $value) { * Helper method to destroy invalid sessions. * * @return void - * @access public */ - function destroy() { + public function destroy() { $_SESSION = array(); $this->__construct($this->path); $this->start(); @@ -671,9 +659,8 @@ function __regenerateId() { /** * Restarts this session. * - * @access public */ - function renew() { + public function renew() { $this->__regenerateId(); } diff --git a/cake/libs/cake_socket.php b/cake/libs/cake_socket.php index 0c14876b933..c5995c1ac30 100644 --- a/cake/libs/cake_socket.php +++ b/cake/libs/cake_socket.php @@ -102,9 +102,8 @@ function __construct($config = array()) { * Connect the socket to the given host and port. * * @return boolean Success - * @access public */ - function connect() { + public function connect() { if ($this->connection != null) { $this->disconnect(); } @@ -136,9 +135,8 @@ function connect() { * Get the host name of the current connection. * * @return string Host name - * @access public */ - function host() { + public function host() { if (Validation::ip($this->config['host'])) { return gethostbyaddr($this->config['host']); } else { @@ -150,9 +148,8 @@ function host() { * Get the IP address of the current connection. * * @return string IP address - * @access public */ - function address() { + public function address() { if (Validation::ip($this->config['host'])) { return $this->config['host']; } else { @@ -164,9 +161,8 @@ function address() { * Get all IP addresses associated with the current connection. * * @return array IP addresses - * @access public */ - function addresses() { + public function addresses() { if (Validation::ip($this->config['host'])) { return array($this->config['host']); } else { @@ -178,9 +174,8 @@ function addresses() { * Get the last error as a string. * * @return string Last error - * @access public */ - function lastError() { + public function lastError() { if (!empty($this->lastError)) { return $this->lastError['num'] . ': ' . $this->lastError['str']; } else { @@ -193,9 +188,8 @@ function lastError() { * * @param integer $errNum Error code * @param string $errStr Error string - * @access public */ - function setLastError($errNum, $errStr) { + public function setLastError($errNum, $errStr) { $this->lastError = array('num' => $errNum, 'str' => $errStr); } @@ -204,9 +198,8 @@ function setLastError($errNum, $errStr) { * * @param string $data The data to write to the socket * @return boolean Success - * @access public */ - function write($data) { + public function write($data) { if (!$this->connected) { if (!$this->connect()) { return false; @@ -222,9 +215,8 @@ function write($data) { * * @param integer $length Optional buffer length to read; defaults to 1024 * @return mixed Socket data - * @access public */ - function read($length = 1024) { + public function read($length = 1024) { if (!$this->connected) { if (!$this->connect()) { return false; @@ -248,18 +240,16 @@ function read($length = 1024) { * Abort socket operation. * * @return boolean Success - * @access public */ - function abort() { + public function abort() { } /** * Disconnect the socket from the current connection. * * @return boolean Success - * @access public */ - function disconnect() { + public function disconnect() { if (!is_resource($this->connection)) { $this->connected = false; return true; @@ -285,9 +275,8 @@ function __destruct() { * Resets the state of this Socket instance to it's initial state (before Object::__construct got executed) * * @return boolean True on success - * @access public */ - function reset($state = null) { + public function reset($state = null) { if (empty($state)) { static $initalState = array(); if (empty($initalState)) { diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index dd78c35c986..42aa17f9e5a 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -60,9 +60,8 @@ class ClassRegistry { * Return a singleton instance of the ClassRegistry. * * @return ClassRegistry instance - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { $instance[0] =& new ClassRegistry(); diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 4fef8051d76..7fd198a25f9 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -40,9 +40,8 @@ class Configure extends Object { * Returns a singleton instance of the Configure class. * * @return Configure instance - * @access public */ - function &getInstance($boot = true) { + public function &getInstance($boot = true) { static $instance = array(); if (!$instance) { if (!class_exists('Set')) { @@ -76,9 +75,8 @@ function &getInstance($boot = true) { * @param array $config Name of var to write * @param mixed $value Value to set for var * @return boolean True if write was successful - * @access public */ - function write($config, $value = null) { + public function write($config, $value = null) { $_this =& Configure::getInstance(); if (!is_array($config)) { @@ -148,9 +146,8 @@ function write($config, $value = null) { * @link http://book.cakephp.org/view/927/read * @param string $var Variable to obtain. Use '.' to access array elements. * @return string value of Configure::$var - * @access public */ - function read($var = 'debug') { + public function read($var = 'debug') { $_this =& Configure::getInstance(); if ($var === 'debug') { @@ -198,9 +195,8 @@ function read($var = 'debug') { * @link http://book.cakephp.org/view/928/delete * @param string $var the var to be deleted * @return void - * @access public */ - function delete($var = null) { + public function delete($var = null) { $_this =& Configure::getInstance(); if (strpos($var, '.') === false) { @@ -226,9 +222,8 @@ function delete($var = null) { * @param string $fileName name of file to load, extension must be .php and only the name * should be used, not the extenstion * @return mixed false if file not found, void if load successful - * @access public */ - function load($fileName) { + public function load($fileName) { $found = $plugin = $pluginPath = false; list($plugin, $fileName) = pluginSplit($fileName); if ($plugin) { @@ -275,9 +270,8 @@ function load($fileName) { * * @link http://book.cakephp.org/view/930/version * @return string Current version of CakePHP - * @access public */ - function version() { + public function version() { $_this =& Configure::getInstance(); if (!isset($_this->Cake['version'])) { @@ -300,9 +294,8 @@ function version() { * @param string $name file name. * @param array $data array of values to store. * @return void - * @access public */ - function store($type, $name, $data = array()) { + public function store($type, $name, $data = array()) { $write = true; $content = ''; @@ -627,9 +620,8 @@ class App extends Object { * * @param string $type type of path * @return string array - * @access public */ - function path($type) { + public function path($type) { $_this =& App::getInstance(); if (!isset($_this->{$type})) { return array(); @@ -644,9 +636,8 @@ function path($type) { * @param array $paths paths defines in config/bootstrap.php * @param boolean $reset true will set paths, false merges paths [default] false * @return void - * @access public */ - function build($paths = array(), $reset = false) { + public function build($paths = array(), $reset = false) { $_this =& App::getInstance(); $defaults = array( 'models' => array(MODELS), @@ -723,9 +714,8 @@ function pluginPath($plugin) { * @param string $type valid values are: 'model', 'behavior', 'controller', 'component', * 'view', 'helper', 'datasource', 'libs', and 'cake' * @return array numeric keyed array of core lib paths - * @access public */ - function core($type = null) { + public function core($type = null) { static $paths = false; if ($paths === false) { $paths = Cache::read('core_paths', '_cake_core_'); @@ -765,9 +755,8 @@ function core($type = null) { * type will be used. * @param boolean $cache Set to false to rescan objects of the chosen type. Defaults to true. * @return mixed Either false on incorrect / miss. Or an array of found objects. - * @access public */ - function objects($type, $path = null, $cache = true) { + public function objects($type, $path = null, $cache = true) { $objects = array(); $extension = false; $name = $type; @@ -838,9 +827,8 @@ function objects($type, $path = null, $cache = true) { * @param boolean $return, return the loaded file, the file must have a return * statement in it to work: return $variable; * @return boolean true if Class is already in memory or if file is found and loaded, false if not - * @access public */ - function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) { + public function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) { $plugin = $directory = null; if (is_array($type)) { @@ -958,9 +946,8 @@ function import($type = null, $name = null, $parent = true, $search = array(), $ * Returns a single instance of App. * * @return object - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { $instance[0] =& new App(); diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 6400fc6cb2c..b6f6b0c11f4 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -64,9 +64,8 @@ class Component extends Object { * * @param object $controller Controller with components to load * @return void - * @access public */ - function init(&$controller) { + public function init(&$controller) { if (!is_array($controller->components)) { return; } @@ -131,9 +130,8 @@ function beforeRender(&$controller) { * * @param object $controller Controller with components to beforeRedirect * @return void - * @access public */ - function beforeRedirect(&$controller, $url, $status = null, $exit = true) { + public function beforeRedirect(&$controller, $url, $status = null, $exit = true) { $response = array(); foreach ($this->_primary as $name) { @@ -177,9 +175,8 @@ function shutdown(&$controller) { * @param Controller $controller Controller instance * @param string $callback Callback to trigger. * @return void - * @access public */ - function triggerCallback($callback, &$controller) { + public function triggerCallback($callback, &$controller) { foreach ($this->_primary as $name) { $component =& $this->_loaded[$name]; if (method_exists($component, $callback) && $component->enabled === true) { diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 417282161f2..1690f569595 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -63,9 +63,8 @@ function __construct() { * * @param object $controller Controller using this component * @return boolean Proceed with component usage (true), or fail (false) - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { return true; } @@ -85,9 +84,8 @@ function _initACL() { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function check($aro, $aco, $action = "*") { + public function check($aro, $aco, $action = "*") { return $this->_Instance->check($aro, $aco, $action); } @@ -99,9 +97,8 @@ function check($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function allow($aro, $aco, $action = "*") { + public function allow($aro, $aco, $action = "*") { return $this->_Instance->allow($aro, $aco, $action); } @@ -113,9 +110,8 @@ function allow($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function deny($aro, $aco, $action = "*") { + public function deny($aro, $aco, $action = "*") { return $this->_Instance->deny($aro, $aco, $action); } @@ -127,9 +123,8 @@ function deny($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function inherit($aro, $aco, $action = "*") { + public function inherit($aro, $aco, $action = "*") { return $this->_Instance->inherit($aro, $aco, $action); } @@ -140,9 +135,8 @@ function inherit($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function grant($aro, $aco, $action = "*") { + public function grant($aro, $aco, $action = "*") { return $this->_Instance->grant($aro, $aco, $action); } @@ -153,9 +147,8 @@ function grant($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function revoke($aro, $aco, $action = "*") { + public function revoke($aro, $aco, $action = "*") { return $this->_Instance->revoke($aro, $aco, $action); } } @@ -187,18 +180,16 @@ function __construct() { * @param string $aro ARO The requesting object identifier. * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) - * @access public */ - function check($aro, $aco, $action = "*") { + public function check($aro, $aco, $action = "*") { } /** * Empty method to be overridden in subclasses * * @param object $component Component - * @access public */ - function initialize(&$component) { + public function initialize(&$component) { } } @@ -242,9 +233,8 @@ function __construct() { * * @param AclComponent $component * @return void - * @access public */ - function initialize(&$component) { + public function initialize(&$component) { $component->Aro =& $this->Aro; $component->Aco =& $this->Aco; } @@ -256,9 +246,8 @@ function initialize(&$component) { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success (true if ARO has access to action in ACO, false otherwise) - * @access public */ - function check($aro, $aco, $action = "*") { + public function check($aro, $aco, $action = "*") { if ($aro == null || $aco == null) { return false; } @@ -347,9 +336,8 @@ function check($aro, $aco, $action = "*") { * @param string $actions Action (defaults to *) * @param integer $value Value to indicate access type (1 to give access, -1 to deny, 0 to inherit) * @return boolean Success - * @access public */ - function allow($aro, $aco, $actions = "*", $value = 1) { + public function allow($aro, $aco, $actions = "*", $value = 1) { $perms = $this->getAclLink($aro, $aco); $permKeys = $this->_getAcoKeys($this->Aro->Permission->schema()); $save = array(); @@ -398,9 +386,8 @@ function allow($aro, $aco, $actions = "*", $value = 1) { * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @return boolean Success - * @access public */ - function deny($aro, $aco, $action = "*") { + public function deny($aro, $aco, $action = "*") { return $this->allow($aro, $aco, $action, -1); } @@ -411,9 +398,8 @@ function deny($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @return boolean Success - * @access public */ - function inherit($aro, $aco, $action = "*") { + public function inherit($aro, $aco, $action = "*") { return $this->allow($aro, $aco, $action, 0); } @@ -425,9 +411,8 @@ function inherit($aro, $aco, $action = "*") { * @param string $actions Action (defaults to *) * @return boolean Success * @see allow() - * @access public */ - function grant($aro, $aco, $action = "*") { + public function grant($aro, $aco, $action = "*") { return $this->allow($aro, $aco, $action); } @@ -439,9 +424,8 @@ function grant($aro, $aco, $action = "*") { * @param string $actions Action (defaults to *) * @return boolean Success * @see deny() - * @access public */ - function revoke($aro, $aco, $action = "*") { + public function revoke($aro, $aco, $action = "*") { return $this->deny($aro, $aco, $action); } @@ -451,9 +435,8 @@ function revoke($aro, $aco, $action = "*") { * @param string $aro ARO The requesting object identifier. * @param string $aco ACO The controlled object identifier. * @return array Indexed array with: 'aro', 'aco' and 'link' - * @access public */ - function getAclLink($aro, $aco) { + public function getAclLink($aro, $aco) { $obj = array(); $obj['Aro'] = $this->Aro->node($aro); $obj['Aco'] = $this->Aco->node($aco); @@ -524,9 +507,8 @@ function __construct() { * @param string $aco ACO * @param string $aco_action Action * @return boolean Success - * @access public */ - function check($aro, $aco, $aco_action = null) { + public function check($aro, $aco, $aco_action = null) { if ($this->config == null) { $this->config = $this->readConfigFile(CONFIGS . 'acl.ini.php'); } @@ -579,9 +561,8 @@ function check($aro, $aco, $aco_action = null) { * * @param string $fileName File * @return array INI section structure - * @access public */ - function readConfigFile($fileName) { + public function readConfigFile($fileName) { $fileLineArray = file($fileName); foreach ($fileLineArray as $fileLine) { @@ -622,9 +603,8 @@ function readConfigFile($fileName) { * * @param array $array Array to trim * @return array Trimmed array - * @access public */ - function arrayTrim($array) { + public function arrayTrim($array) { foreach ($array as $key => $value) { $array[$key] = trim($value); } diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 8cca285a577..fc377c18366 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -251,9 +251,8 @@ class AuthComponent extends Object { * * @param object $controller A reference to the instantiating controller object * @return void - * @access public */ - function initialize(&$controller, $settings = array()) { + public function initialize(&$controller, $settings = array()) { $this->params = $controller->params; $crud = array('create', 'read', 'update', 'delete'); $this->actionMap = array_merge($this->actionMap, array_combine($crud, $crud)); @@ -288,9 +287,8 @@ function initialize(&$controller, $settings = array()) { * * @param object $controller A reference to the instantiating controller object * @return boolean - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { $isErrorOrTests = ( strtolower($controller->name) == 'cakeerror' || (strtolower($controller->name) == 'tests' && Configure::read() > 0) @@ -487,9 +485,8 @@ function __setDefaults() { * @param mixed $object object, model object, or model name * @param mixed $user The user to check the authorization of * @return boolean True if $user is authorized, otherwise false - * @access public */ - function isAuthorized($type = null, $object = null, $user = null) { + public function isAuthorized($type = null, $object = null, $user = null) { if (empty($user) && !$this->user()) { return false; } elseif (empty($user)) { @@ -589,9 +586,8 @@ function __authType($auth = null) { * @param string $action Controller action name * @param string ... etc. * @return void - * @access public */ - function allow() { + public function allow() { $args = func_get_args(); if (empty($args) || $args == array('*')) { $this->allowedActions = $this->_methods; @@ -611,9 +607,8 @@ function allow() { * @param string ... etc. * @return void * @see AuthComponent::allow() - * @access public */ - function deny() { + public function deny() { $args = func_get_args(); if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; @@ -632,9 +627,8 @@ function deny() { * * @param array $map Actions to map * @return void - * @access public */ - function mapActions($map = array()) { + public function mapActions($map = array()) { $crud = array('create', 'read', 'update', 'delete'); foreach ($map as $action => $type) { if (in_array($action, $crud) && is_array($type)) { @@ -657,9 +651,8 @@ function mapActions($map = array()) { * * @param mixed $data User object * @return boolean True on login success, false on failure - * @access public */ - function login($data = null) { + public function login($data = null) { $this->__setDefaults(); $this->_loggedIn = false; @@ -680,9 +673,8 @@ function login($data = null) { * @param mixed $url Optional URL to redirect the user to after logout * @return string AuthComponent::$loginAction * @see AuthComponent::$loginAction - * @access public */ - function logout() { + public function logout() { $this->__setDefaults(); $this->Session->delete($this->sessionKey); $this->Session->delete('Auth.redirect'); @@ -695,9 +687,8 @@ function logout() { * * @param string $key field to retrive. Leave null to get entire User record * @return mixed User record. or null if no user is logged in. - * @access public */ - function user($key = null) { + public function user($key = null) { $this->__setDefaults(); if (!$this->Session->check($this->sessionKey)) { return null; @@ -720,9 +711,8 @@ function user($key = null) { * * @param mixed $url Optional URL to write as the login redirect URL. * @return string Redirect URL - * @access public */ - function redirect($url = null) { + public function redirect($url = null) { if (!is_null($url)) { $redir = $url; $this->Session->write('Auth.redirect', $redir); @@ -750,9 +740,8 @@ function redirect($url = null) { * @param string $action Optional. The action to validate against. * @see AuthComponent::identify() * @return boolean True if the user validates, false otherwise. - * @access public */ - function validate($object, $user = null, $action = null) { + public function validate($object, $user = null, $action = null) { if (empty($user)) { $user = $this->user(); } @@ -769,9 +758,8 @@ function validate($object, $user = null, $action = null) { * user against. The current request action is used if * none is specified. * @return boolean ACO node path - * @access public */ - function action($action = ':plugin/:controller/:action') { + public function action($action = ':plugin/:controller/:action') { $plugin = empty($this->params['plugin']) ? null : Inflector::camelize($this->params['plugin']) . '/'; return str_replace( array(':controller', ':action', ':plugin/'), @@ -786,9 +774,8 @@ function action($action = ':plugin/:controller/:action') { * * @param string $name Model name (defaults to AuthComponent::$userModel) * @return object A reference to a model object - * @access public */ - function &getModel($name = null) { + public function &getModel($name = null) { $model = null; if (!$name) { $name = $this->userModel; @@ -815,9 +802,8 @@ function &getModel($name = null) { * Uses the current user session if none specified. * @param array $conditions Optional. Additional conditions to a find. * @return array User record data, or null, if the user could not be identified. - * @access public */ - function identify($user = null, $conditions = null) { + public function identify($user = null, $conditions = null) { if ($conditions === false) { $conditions = null; } elseif (is_array($conditions)) { @@ -891,9 +877,8 @@ function identify($user = null, $conditions = null) { * * @param array $data Set of data to look for passwords * @return array Data with passwords hashed - * @access public */ - function hashPasswords($data) { + public function hashPasswords($data) { if (is_object($this->authenticate) && method_exists($this->authenticate, 'hashPasswords')) { return $this->authenticate->hashPasswords($data); } @@ -912,9 +897,8 @@ function hashPasswords($data) { * * @param string $password Password to hash * @return string Hashed password - * @access public */ - function password($password) { + public function password($password) { return Security::hash($password, null, true); } @@ -922,9 +906,8 @@ function password($password) { * Component shutdown. If user is logged in, wipe out redirect. * * @param object $controller Instantiating controller - * @access public */ - function shutdown(&$controller) { + public function shutdown(&$controller) { if ($this->_loggedIn) { $this->Session->delete('Auth.redirect'); } diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index ce6266006f2..2bc6a0512e2 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -160,9 +160,8 @@ class CookieComponent extends Object { * Main execution method. * * @param object $controller A reference to the instantiating controller object - * @access public */ - function initialize(&$controller, $settings) { + public function initialize(&$controller, $settings) { $this->key = Configure::read('Security.salt'); $this->_set($settings); } @@ -170,9 +169,8 @@ function initialize(&$controller, $settings) { /** * Start CookieComponent for use in the controller * - * @access public */ - function startup() { + public function startup() { $this->__expire($this->time); if (isset($_COOKIE[$this->name])) { @@ -196,9 +194,8 @@ function startup() { * @param mixed $value Value * @param boolean $encrypt Set to true to encrypt value, false otherwise * @param string $expires Can be either Unix timestamp, or date string - * @access public */ - function write($key, $value = null, $encrypt = true, $expires = null) { + public function write($key, $value = null, $encrypt = true, $expires = null) { if (is_null($encrypt)) { $encrypt = true; } @@ -234,9 +231,8 @@ function write($key, $value = null, $encrypt = true, $expires = null) { * * @param mixed $key Key of the value to be obtained. If none specified, obtain map key => values * @return string or null, value for specified key - * @access public */ - function read($key = null) { + public function read($key = null) { if (empty($this->__values) && isset($_COOKIE[$this->name])) { $this->__values = $this->__decrypt($_COOKIE[$this->name]); } @@ -270,9 +266,8 @@ function read($key = null) { * * @param string $key Key of the value to be deleted * @return void - * @access public */ - function delete($key) { + public function delete($key) { if (empty($this->__values)) { $this->read(); } @@ -293,9 +288,8 @@ function delete($key) { * Failure to do so will result in header already sent errors. * * @return void - * @access public */ - function destroy() { + public function destroy() { if (isset($_COOKIE[$this->name])) { $this->__values = $this->__decrypt($_COOKIE[$this->name]); } diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index bf3253b799f..63655ab49d8 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -302,9 +302,8 @@ class EmailComponent extends Object{ * Initialize component * * @param object $controller Instantiating controller - * @access public */ - function initialize(&$controller, $settings = array()) { + public function initialize(&$controller, $settings = array()) { $this->Controller =& $controller; if (Configure::read('App.encoding') !== null) { $this->charset = Configure::read('App.encoding'); @@ -316,9 +315,8 @@ function initialize(&$controller, $settings = array()) { * Startup component * * @param object $controller Instantiating controller - * @access public */ - function startup(&$controller) {} + public function startup(&$controller) {} /** * Send an email using the specified content, template and layout @@ -327,9 +325,8 @@ function startup(&$controller) {} * @param string $template Template to use when sending email * @param string $layout Layout to use to enclose email body * @return boolean Success - * @access public */ - function send($content = null, $template = null, $layout = null) { + public function send($content = null, $template = null, $layout = null) { $this->_createHeader(); if ($template) { @@ -389,9 +386,8 @@ function send($content = null, $template = null, $layout = null) { /** * Reset all EmailComponent internal variables to be able to send out a new email. * - * @access public */ - function reset() { + public function reset() { $this->template = null; $this->to = array(); $this->from = null; diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 6b63552b6f3..1ee6bf3e48c 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -195,9 +195,8 @@ function __construct() { * @param array $settings Array of settings to _set(). * @return void * @see Router::parseExtensions() - * @access public */ - function initialize(&$controller, $settings = array()) { + public function initialize(&$controller, $settings = array()) { if (isset($controller->params['url']['ext'])) { $this->ext = $controller->params['url']['ext']; } @@ -220,9 +219,8 @@ function initialize(&$controller, $settings = array()) { * * @param object $controller A reference to the controller * @return void - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { if (!$this->enabled) { return; } @@ -259,9 +257,8 @@ function startup(&$controller) { * * @param object $controller A reference to the controller * @param mixed $url A string or array containing the redirect location - * @access public */ - function beforeRedirect(&$controller, $url) { + public function beforeRedirect(&$controller, $url) { if (!$this->isAjax()) { return; } @@ -279,9 +276,8 @@ function beforeRedirect(&$controller, $url) { * Returns true if the current HTTP request is Ajax, false otherwise * * @return boolean True if call is Ajax - * @access public */ - function isAjax() { + public function isAjax() { return env('HTTP_X_REQUESTED_WITH') === "XMLHttpRequest"; } @@ -289,9 +285,8 @@ function isAjax() { * Returns true if the current HTTP request is coming from a Flash-based client * * @return boolean True if call is from Flash - * @access public */ - function isFlash() { + public function isFlash() { return (preg_match('/^(Shockwave|Adobe) Flash/', env('HTTP_USER_AGENT')) == 1); } @@ -299,9 +294,8 @@ function isFlash() { * Returns true if the current request is over HTTPS, false otherwise. * * @return bool True if call is over HTTPS - * @access public */ - function isSSL() { + public function isSSL() { return env('HTTPS'); } @@ -309,9 +303,8 @@ function isSSL() { * Returns true if the current call accepts an XML response, false otherwise * * @return boolean True if client accepts an XML response - * @access public */ - function isXml() { + public function isXml() { return $this->prefers('xml'); } @@ -319,9 +312,8 @@ function isXml() { * Returns true if the current call accepts an RSS response, false otherwise * * @return boolean True if client accepts an RSS response - * @access public */ - function isRss() { + public function isRss() { return $this->prefers('rss'); } @@ -329,9 +321,8 @@ function isRss() { * Returns true if the current call accepts an Atom response, false otherwise * * @return boolean True if client accepts an RSS response - * @access public */ - function isAtom() { + public function isAtom() { return $this->prefers('atom'); } @@ -360,9 +351,8 @@ function isMobile() { * Returns true if the client accepts WAP content * * @return bool - * @access public */ - function isWap() { + public function isWap() { return $this->prefers('wap'); } @@ -370,9 +360,8 @@ function isWap() { * Returns true if the current call a POST request * * @return boolean True if call is a POST - * @access public */ - function isPost() { + public function isPost() { return (strtolower(env('REQUEST_METHOD')) == 'post'); } @@ -380,9 +369,8 @@ function isPost() { * Returns true if the current call a PUT request * * @return boolean True if call is a PUT - * @access public */ - function isPut() { + public function isPut() { return (strtolower(env('REQUEST_METHOD')) == 'put'); } @@ -390,9 +378,8 @@ function isPut() { * Returns true if the current call a GET request * * @return boolean True if call is a GET - * @access public */ - function isGet() { + public function isGet() { return (strtolower(env('REQUEST_METHOD')) == 'get'); } @@ -400,9 +387,8 @@ function isGet() { * Returns true if the current call a DELETE request * * @return boolean True if call is a DELETE - * @access public */ - function isDelete() { + public function isDelete() { return (strtolower(env('REQUEST_METHOD')) == 'delete'); } @@ -411,9 +397,8 @@ function isDelete() { * The Prototype library sets a special "Prototype version" HTTP header. * * @return string Prototype version of component making Ajax call - * @access public */ - function getAjaxVersion() { + public function getAjaxVersion() { if (env('HTTP_X_PROTOTYPE_VERSION') != null) { return env('HTTP_X_PROTOTYPE_VERSION'); } @@ -430,9 +415,8 @@ function getAjaxVersion() { * @param mixed $type The Content-type or array of Content-types assigned to the name, * i.e. "text/html", or "application/xml" * @return void - * @access public */ - function setContent($name, $type = null) { + public function setContent($name, $type = null) { if (is_array($name)) { $this->__requestContent = array_merge($this->__requestContent, $name); return; @@ -444,9 +428,8 @@ function setContent($name, $type = null) { * Gets the server name from which this request was referred * * @return string Server address - * @access public */ - function getReferer() { + public function getReferer() { if (env('HTTP_HOST') != null) { $sessHost = env('HTTP_HOST'); } @@ -461,9 +444,8 @@ function getReferer() { * Gets remote client IP * * @return string Client IP address - * @access public */ - function getClientIP($safe = true) { + public function getClientIP($safe = true) { if (!$safe && env('HTTP_X_FORWARDED_FOR') != null) { $ipaddr = preg_replace('/(?:,.*)/', '', env('HTTP_X_FORWARDED_FOR')); } else { @@ -538,9 +520,8 @@ function accepts($type = null) { * * @param mixed $type Can be null (or no parameter), a string type name, or an array of types * @return mixed - * @access public */ - function requestedWith($type = null) { + public function requestedWith($type = null) { if (!$this->isPost() && !$this->isPut()) { return null; } @@ -746,9 +727,8 @@ function respondAs($type, $options = array()) { * * @return mixed A string content type alias, or raw content type if no alias map exists, * otherwise null - * @access public */ - function responseType() { + public function responseType() { if ($this->__responseTypeSet == null) { return null; } @@ -760,9 +740,8 @@ function responseType() { * * @param mixed $type Content type * @return mixed Alias - * @access public */ - function mapType($ctype) { + public function mapType($ctype) { if (is_array($ctype)) { $out = array(); foreach ($ctype as $t) { diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 4d09d80a87b..5191db08f00 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -174,9 +174,8 @@ class SecurityComponent extends Object { * @param object $controller Controller instance for the request * @param array $settings Settings to set to the component * @return void - * @access public */ - function initialize(&$controller, $settings = array()) { + public function initialize(&$controller, $settings = array()) { $this->_set($settings); } @@ -185,9 +184,8 @@ function initialize(&$controller, $settings = array()) { * * @param object $controller Instantiating controller * @return void - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { $this->_action = strtolower($controller->action); $this->_methodsRequired($controller); $this->_secureRequired($controller); @@ -214,9 +212,8 @@ function startup(&$controller) { * Sets the actions that require a POST request, or empty for all actions * * @return void - * @access public */ - function requirePost() { + public function requirePost() { $args = func_get_args(); $this->_requireMethod('Post', $args); } @@ -225,9 +222,8 @@ function requirePost() { * Sets the actions that require a GET request, or empty for all actions * * @return void - * @access public */ - function requireGet() { + public function requireGet() { $args = func_get_args(); $this->_requireMethod('Get', $args); } @@ -236,9 +232,8 @@ function requireGet() { * Sets the actions that require a PUT request, or empty for all actions * * @return void - * @access public */ - function requirePut() { + public function requirePut() { $args = func_get_args(); $this->_requireMethod('Put', $args); } @@ -247,9 +242,8 @@ function requirePut() { * Sets the actions that require a DELETE request, or empty for all actions * * @return void - * @access public */ - function requireDelete() { + public function requireDelete() { $args = func_get_args(); $this->_requireMethod('Delete', $args); } @@ -258,9 +252,8 @@ function requireDelete() { * Sets the actions that require a request that is SSL-secured, or empty for all actions * * @return void - * @access public */ - function requireSecure() { + public function requireSecure() { $args = func_get_args(); $this->_requireMethod('Secure', $args); } @@ -269,9 +262,8 @@ function requireSecure() { * Sets the actions that require an authenticated request, or empty for all actions * * @return void - * @access public */ - function requireAuth() { + public function requireAuth() { $args = func_get_args(); $this->_requireMethod('Auth', $args); } @@ -280,9 +272,8 @@ function requireAuth() { * Sets the actions that require an HTTP-authenticated request, or empty for all actions * * @return void - * @access public */ - function requireLogin() { + public function requireLogin() { $args = func_get_args(); $base = $this->loginOptions; @@ -305,9 +296,8 @@ function requireLogin() { * * @param string $type Either 'basic', 'digest', or null. If null/empty, will try both. * @return mixed If successful, returns an array with login name and password, otherwise null. - * @access public */ - function loginCredentials($type = null) { + public function loginCredentials($type = null) { switch (strtolower($type)) { case 'basic': $login = array('username' => env('PHP_AUTH_USER'), 'password' => env('PHP_AUTH_PW')); @@ -344,9 +334,8 @@ function loginCredentials($type = null) { * * @param array $options Set of options for header * @return string HTTP-authentication request header - * @access public */ - function loginRequest($options = array()) { + public function loginRequest($options = array()) { $options = array_merge($this->loginOptions, $options); $this->_setLoginDefaults($options); $auth = 'WWW-Authenticate: ' . ucfirst($options['type']); @@ -366,9 +355,8 @@ function loginRequest($options = array()) { * * @param string $digest Digest authentication response * @return array Digest authentication parameters - * @access public */ - function parseDigestAuthData($digest) { + public function parseDigestAuthData($digest) { if (substr($digest, 0, 7) == 'Digest ') { $digest = substr($digest, 7); } diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 17d46584b63..3decd3f517d 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -66,9 +66,8 @@ function __construct($base = null) { * * @param object $controller Instantiating controller * @return void - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { if ($this->started() === false && $this->__active === true) { $this->__start(); } @@ -79,9 +78,8 @@ function startup(&$controller) { * * @param string $base The base path for the Session * @return void - * @access public */ - function activate($base = null) { + public function activate($base = null) { if ($this->__active === true) { return; } @@ -98,9 +96,8 @@ function activate($base = null) { * This should be in a Controller.key format for better organizing * @param string $value The value you want to store in a session. * @return boolean Success - * @access public */ - function write($name, $value = null) { + public function write($name, $value = null) { if ($this->__active === true) { $this->__start(); if (is_array($name)) { @@ -127,9 +124,8 @@ function write($name, $value = null) { * * @param string $name the name of the session key you want to read * @return mixed value from the session vars - * @access public */ - function read($name = null) { + public function read($name = null) { if ($this->__active === true) { $this->__start(); return parent::read($name); @@ -144,9 +140,8 @@ function read($name = null) { * * @param string $name the name of the session key you want to delete * @return boolean true is session variable is set and can be deleted, false is variable was not set. - * @access public */ - function delete($name) { + public function delete($name) { if ($this->__active === true) { $this->__start(); return parent::delete($name); @@ -161,9 +156,8 @@ function delete($name) { * * @param string $name the name of the session key you want to check * @return boolean true is session variable is set, false if not - * @access public */ - function check($name) { + public function check($name) { if ($this->__active === true) { $this->__start(); return parent::check($name); @@ -177,9 +171,8 @@ function check($name) { * In your controller: $this->Session->error(); * * @return string Last session error - * @access public */ - function error() { + public function error() { if ($this->__active === true) { $this->__start(); return parent::error(); @@ -198,9 +191,8 @@ function error() { * @param string $element Element to wrap flash message in. * @param array $params Parameters to be sent to layout as view variables * @param string $key Message key, default is 'flash' - * @access public */ - function setFlash($message, $element = 'default', $params = array(), $key = 'flash') { + public function setFlash($message, $element = 'default', $params = array(), $key = 'flash') { if ($this->__active === true) { $this->__start(); $this->write('Message.' . $key, compact('message', 'element', 'params')); @@ -213,9 +205,8 @@ function setFlash($message, $element = 'default', $params = array(), $key = 'fla * In your controller: $this->Session->renew(); * * @return void - * @access public */ - function renew() { + public function renew() { if ($this->__active === true) { $this->__start(); parent::renew(); @@ -228,9 +219,8 @@ function renew() { * In your controller: $this->Session->valid(); * * @return boolean true is session is valid, false is session is invalid - * @access public */ - function valid() { + public function valid() { if ($this->__active === true) { $this->__start(); return parent::valid(); @@ -244,9 +234,8 @@ function valid() { * In your controller: $this->Session->destroy(); * * @return void - * @access public */ - function destroy() { + public function destroy() { if ($this->__active === true) { $this->__start(); parent::destroy(); @@ -261,9 +250,8 @@ function destroy() { * * @param $id string * @return string - * @access public */ - function id($id = null) { + public function id($id = null) { return parent::id($id); } diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index f82906fa841..73d01c6db8f 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -519,9 +519,8 @@ function constructClasses() { * - triggers Component `startup` methods. * * @return void - * @access public */ - function startupProcess() { + public function startupProcess() { $this->Component->initialize($this); $this->beforeFilter(); $this->Component->triggerCallback('startup', $this); @@ -535,9 +534,8 @@ function startupProcess() { * - calls the Controller's `afterFilter` method. * * @return void - * @access public */ - function shutdownProcess() { + public function shutdownProcess() { $this->Component->triggerCallback('shutdown', $this); $this->afterFilter(); } @@ -608,9 +606,8 @@ function httpCodes($code = null) { * @param string $modelClass Name of model class to load * @param mixed $id Initial ID the instanced model class should have * @return mixed true when single model found and instance created error returned if models not found. - * @access public */ - function loadModel($modelClass = null, $id = null) { + public function loadModel($modelClass = null, $id = null) { if ($modelClass === null) { $modelClass = $this->modelClass; } @@ -738,9 +735,8 @@ function redirect($url, $status = null, $exit = true) { * * @param string $status The header message that is being set. * @return void - * @access public */ - function header($status) { + public function header($status) { header($status); } @@ -783,9 +779,8 @@ function set($one, $two = null) { * @param mixed Any other parameters passed to this method will be passed as * parameters to the new action. * @return mixed Returns the return value of the called action - * @access public */ - function setAction($action) { + public function setAction($action) { $this->action = $action; $args = func_get_args(); unset($args[0]); @@ -811,9 +806,8 @@ function isAuthorized() { * Returns number of errors in a submitted FORM. * * @return integer Number of errors - * @access public */ - function validate() { + public function validate() { $args = func_get_args(); $errors = call_user_func_array(array(&$this, 'validateErrors'), $args); @@ -830,9 +824,8 @@ function validate() { * * @param mixed A list of models as a variable argument * @return array Validation errors, or false if none - * @access public */ - function validateErrors() { + public function validateErrors() { $objects = func_get_args(); if (empty($objects)) { diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index 74979eaab97..eed42e06a2f 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -58,9 +58,8 @@ class PagesController extends AppController { * Displays a view * * @param mixed What page to display - * @access public */ - function display() { + public function display() { $path = func_get_args(); $count = count($path); diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 4aac720608b..0653d2fe6d5 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -242,9 +242,8 @@ function log($var, $level = LOG_DEBUG) { * @param integer $line Line that triggered the error * @param array $context Context * @return boolean true if error was handled - * @access public */ - function handleError($code, $description, $file = null, $line = null, $context = null) { + public function handleError($code, $description, $file = null, $line = null, $context = null) { if (error_reporting() == 0 || $code === 2048 || $code === 8192) { return; } diff --git a/cake/libs/error.php b/cake/libs/error.php index be6dae1929a..4163ae943f2 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -129,9 +129,8 @@ function __construct($method, $messages) { * Displays an error page (e.g. 404 Not found). * * @param array $params Parameters for controller - * @access public */ - function error($params) { + public function error($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( 'code' => $code, @@ -146,9 +145,8 @@ function error($params) { * Convenience method to display a 404 page. * * @param array $params Parameters for controller - * @access public */ - function error404($params) { + public function error404($params) { extract($params, EXTR_OVERWRITE); if (!isset($url)) { @@ -169,9 +167,8 @@ function error404($params) { * Convenience method to display a 500 page. * * @param array $params Parameters for controller - * @access public */ - function error500($params) { + public function error500($params) { extract($params, EXTR_OVERWRITE); if (!isset($url)) { @@ -191,9 +188,8 @@ function error500($params) { * Renders the Missing Controller web page. * * @param array $params Parameters for controller - * @access public */ - function missingController($params) { + public function missingController($params) { extract($params, EXTR_OVERWRITE); $controllerName = str_replace('Controller', '', $className); @@ -209,9 +205,8 @@ function missingController($params) { * Renders the Missing Action web page. * * @param array $params Parameters for controller - * @access public */ - function missingAction($params) { + public function missingAction($params) { extract($params, EXTR_OVERWRITE); $controllerName = str_replace('Controller', '', $className); @@ -228,9 +223,8 @@ function missingAction($params) { * Renders the Private Action web page. * * @param array $params Parameters for controller - * @access public */ - function privateAction($params) { + public function privateAction($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -245,9 +239,8 @@ function privateAction($params) { * Renders the Missing Table web page. * * @param array $params Parameters for controller - * @access public */ - function missingTable($params) { + public function missingTable($params) { extract($params, EXTR_OVERWRITE); $this->controller->header("HTTP/1.0 500 Internal Server Error"); @@ -264,9 +257,8 @@ function missingTable($params) { * Renders the Missing Database web page. * * @param array $params Parameters for controller - * @access public */ - function missingDatabase($params = array()) { + public function missingDatabase($params = array()) { $this->controller->header("HTTP/1.0 500 Internal Server Error"); $this->controller->set(array( 'code' => '500', @@ -279,9 +271,8 @@ function missingDatabase($params = array()) { * Renders the Missing View web page. * * @param array $params Parameters for controller - * @access public */ - function missingView($params) { + public function missingView($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -297,9 +288,8 @@ function missingView($params) { * Renders the Missing Layout web page. * * @param array $params Parameters for controller - * @access public */ - function missingLayout($params) { + public function missingLayout($params) { extract($params, EXTR_OVERWRITE); $this->controller->layout = 'default'; @@ -314,9 +304,8 @@ function missingLayout($params) { * Renders the Database Connection web page. * * @param array $params Parameters for controller - * @access public */ - function missingConnection($params) { + public function missingConnection($params) { extract($params, EXTR_OVERWRITE); $this->controller->header("HTTP/1.0 500 Internal Server Error"); @@ -332,9 +321,8 @@ function missingConnection($params) { * Renders the Missing Helper file web page. * * @param array $params Parameters for controller - * @access public */ - function missingHelperFile($params) { + public function missingHelperFile($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -349,9 +337,8 @@ function missingHelperFile($params) { * Renders the Missing Helper class web page. * * @param array $params Parameters for controller - * @access public */ - function missingHelperClass($params) { + public function missingHelperClass($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -366,9 +353,8 @@ function missingHelperClass($params) { * Renders the Missing Behavior file web page. * * @param array $params Parameters for controller - * @access public */ - function missingBehaviorFile($params) { + public function missingBehaviorFile($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -383,9 +369,8 @@ function missingBehaviorFile($params) { * Renders the Missing Behavior class web page. * * @param array $params Parameters for controller - * @access public */ - function missingBehaviorClass($params) { + public function missingBehaviorClass($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -400,9 +385,8 @@ function missingBehaviorClass($params) { * Renders the Missing Component file web page. * * @param array $params Parameters for controller - * @access public */ - function missingComponentFile($params) { + public function missingComponentFile($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -418,9 +402,8 @@ function missingComponentFile($params) { * Renders the Missing Component class web page. * * @param array $params Parameters for controller - * @access public */ - function missingComponentClass($params) { + public function missingComponentClass($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -436,9 +419,8 @@ function missingComponentClass($params) { * Renders the Missing Model class web page. * * @param unknown_type $params Parameters for controller - * @access public */ - function missingModel($params) { + public function missingModel($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( diff --git a/cake/libs/file.php b/cake/libs/file.php index ee942877376..748d50d159a 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -118,9 +118,8 @@ function __destruct() { * Creates the File. * * @return boolean Success - * @access public */ - function create() { + public function create() { $dir = $this->Folder->pwd(); if (is_dir($dir) && is_writable($dir) && !$this->exists()) { $old = umask(0); @@ -138,9 +137,8 @@ function create() { * @param string $mode A valid 'fopen' mode string (r|w|a ...) * @param boolean $force If true then the file will be re-opened even if its already opened, otherwise it won't * @return boolean True on success, false on failure - * @access public */ - function open($mode = 'r', $force = false) { + public function open($mode = 'r', $force = false) { if (!$force && is_resource($this->handle)) { return true; } @@ -165,9 +163,8 @@ function open($mode = 'r', $force = false) { * @param string $mode A `fread` compatible mode. * @param boolean $force If true then the file will be re-opened even if its already opened, otherwise it won't * @return mixed string on success, false on failure - * @access public */ - function read($bytes = false, $mode = 'rb', $force = false) { + public function read($bytes = false, $mode = 'rb', $force = false) { if ($bytes === false && $this->lock === null) { return file_get_contents($this->path); } @@ -202,9 +199,8 @@ function read($bytes = false, $mode = 'rb', $force = false) { * @param mixed $offset The $offset in bytes to seek. If set to false then the current offset is returned. * @param integer $seek PHP Constant SEEK_SET | SEEK_CUR | SEEK_END determining what the $offset is relative to * @return mixed True on success, false on failure (set mode), false on failure or integer offset on success (get mode) - * @access public */ - function offset($offset = false, $seek = SEEK_SET) { + public function offset($offset = false, $seek = SEEK_SET) { if ($offset === false) { if (is_resource($this->handle)) { return ftell($this->handle); @@ -222,9 +218,8 @@ function offset($offset = false, $seek = SEEK_SET) { * * @param string $data Data to prepare for writing. * @return string The with converted line endings. - * @access public */ - function prepare($data, $forceWindows = false) { + public function prepare($data, $forceWindows = false) { $lineBreak = "\n"; if (DIRECTORY_SEPARATOR == '\\' || $forceWindows === true) { $lineBreak = "\r\n"; @@ -239,9 +234,8 @@ function prepare($data, $forceWindows = false) { * @param string $mode Mode of writing. {@link http://php.net/fwrite See fwrite()}. * @param string $force force the file to open * @return boolean Success - * @access public */ - function write($data, $mode = 'w', $force = false) { + public function write($data, $mode = 'w', $force = false) { $success = false; if ($this->open($mode, $force) === true) { if ($this->lock !== null) { @@ -266,9 +260,8 @@ function write($data, $mode = 'w', $force = false) { * @param string $data Data to write * @param string $force force the file to open * @return boolean Success - * @access public */ - function append($data, $force = false) { + public function append($data, $force = false) { return $this->write($data, 'a', $force); } @@ -276,9 +269,8 @@ function append($data, $force = false) { * Closes the current file if it is opened. * * @return boolean True if closing was successful or file was already closed, otherwise false - * @access public */ - function close() { + public function close() { if (!is_resource($this->handle)) { return true; } @@ -289,9 +281,8 @@ function close() { * Deletes the File. * * @return boolean Success - * @access public */ - function delete() { + public function delete() { clearstatcache(); if ($this->exists()) { return unlink($this->path); @@ -303,9 +294,8 @@ function delete() { * Returns the File info. * * @return string The File extension - * @access public */ - function info() { + public function info() { if ($this->info == null) { $this->info = pathinfo($this->path); } @@ -319,9 +309,8 @@ function info() { * Returns the File extension. * * @return string The File extension - * @access public */ - function ext() { + public function ext() { if ($this->info == null) { $this->info(); } @@ -335,9 +324,8 @@ function ext() { * Returns the File name without extension. * * @return string The File name without extension. - * @access public */ - function name() { + public function name() { if ($this->info == null) { $this->info(); } @@ -355,9 +343,8 @@ function name() { * @param string $name The name of the file to make safe if different from $this->name * @param strin $ext The name of the extension to make safe if different from $this->ext * @return string $ext the extension of the file - * @access public */ - function safe($name = null, $ext = null) { + public function safe($name = null, $ext = null) { if (!$name) { $name = $this->name; } @@ -372,9 +359,8 @@ function safe($name = null, $ext = null) { * * @param mixed $maxsize in MB or true to force * @return string md5 Checksum {@link http://php.net/md5_file See md5_file()} - * @access public */ - function md5($maxsize = 5) { + public function md5($maxsize = 5) { if ($maxsize === true) { return md5_file($this->path); } @@ -391,9 +377,8 @@ function md5($maxsize = 5) { * Returns the full path of the File. * * @return string Full path to file - * @access public */ - function pwd() { + public function pwd() { if (is_null($this->path)) { $this->path = $this->Folder->slashTerm($this->Folder->pwd()) . $this->name; } @@ -404,9 +389,8 @@ function pwd() { * Returns true if the File exists. * * @return boolean true if it exists, false otherwise - * @access public */ - function exists() { + public function exists() { return (file_exists($this->path) && is_file($this->path)); } @@ -414,9 +398,8 @@ function exists() { * Returns the "chmod" (permissions) of the File. * * @return string Permissions for the file - * @access public */ - function perms() { + public function perms() { if ($this->exists()) { return substr(sprintf('%o', fileperms($this->path)), -4); } @@ -427,9 +410,8 @@ function perms() { * Returns the Filesize * * @return integer size of the file in bytes, or false in case of an error - * @access public */ - function size() { + public function size() { if ($this->exists()) { return filesize($this->path); } @@ -440,9 +422,8 @@ function size() { * Returns true if the File is writable. * * @return boolean true if its writable, false otherwise - * @access public */ - function writable() { + public function writable() { return is_writable($this->path); } @@ -450,9 +431,8 @@ function writable() { * Returns true if the File is executable. * * @return boolean true if its executable, false otherwise - * @access public */ - function executable() { + public function executable() { return is_executable($this->path); } @@ -460,9 +440,8 @@ function executable() { * Returns true if the File is readable. * * @return boolean true if file is readable, false otherwise - * @access public */ - function readable() { + public function readable() { return is_readable($this->path); } @@ -470,9 +449,8 @@ function readable() { * Returns the File's owner. * * @return integer the Fileowner - * @access public */ - function owner() { + public function owner() { if ($this->exists()) { return fileowner($this->path); } @@ -483,9 +461,8 @@ function owner() { * Returns the File's group. * * @return integer the Filegroup - * @access public */ - function group() { + public function group() { if ($this->exists()) { return filegroup($this->path); } @@ -496,9 +473,8 @@ function group() { * Returns last access time. * * @return integer timestamp Timestamp of last access time - * @access public */ - function lastAccess() { + public function lastAccess() { if ($this->exists()) { return fileatime($this->path); } @@ -509,9 +485,8 @@ function lastAccess() { * Returns last modified time. * * @return integer timestamp Timestamp of last modification - * @access public */ - function lastChange() { + public function lastChange() { if ($this->exists()) { return filemtime($this->path); } @@ -522,9 +497,8 @@ function lastChange() { * Returns the current folder. * * @return Folder Current folder - * @access public */ - function &Folder() { + public function &Folder() { return $this->Folder; } @@ -534,9 +508,8 @@ function &Folder() { * @param string $dest destination for the copy * @param boolean $overwrite Overwrite $dest if exists * @return boolean Succes - * @access public */ - function copy($dest, $overwrite = true) { + public function copy($dest, $overwrite = true) { if (!$this->exists() || is_file($dest) && !$overwrite) { return false; } diff --git a/cake/libs/folder.php b/cake/libs/folder.php index a3031f0185f..20eddf4e325 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -123,9 +123,8 @@ function __construct($path = false, $create = false, $mode = false) { * Return current path. * * @return string Current path - * @access public */ - function pwd() { + public function pwd() { return $this->path; } @@ -134,9 +133,8 @@ function pwd() { * * @param string $path Path to the directory to change to * @return string The new path. Returns false on failure - * @access public */ - function cd($path) { + public function cd($path) { $path = $this->realpath($path); if (is_dir($path)) { return $this->path = $path; @@ -153,9 +151,8 @@ function cd($path) { * @param mixed $exceptions Either an array or boolean true will not grab dot files * @param boolean $fullPath True returns the full path * @return mixed Contents of current directory as an array, an empty array on failure - * @access public */ - function read($sort = true, $exceptions = false, $fullPath = false) { + public function read($sort = true, $exceptions = false, $fullPath = false) { $dirs = $files = array(); if (!$this->pwd()) { @@ -198,9 +195,8 @@ function read($sort = true, $exceptions = false, $fullPath = false) { * @param string $pattern Preg_match pattern (Defaults to: .*) * @param boolean $sort Whether results should be sorted. * @return array Files that match given pattern - * @access public */ - function find($regexpPattern = '.*', $sort = false) { + public function find($regexpPattern = '.*', $sort = false) { list($dirs, $files) = $this->read($sort); return array_values(preg_grep('/^' . $regexpPattern . '$/i', $files)); ; } @@ -211,9 +207,8 @@ function find($regexpPattern = '.*', $sort = false) { * @param string $pattern Preg_match pattern (Defaults to: .*) * @param boolean $sort Whether results should be sorted. * @return array Files matching $pattern - * @access public */ - function findRecursive($pattern = '.*', $sort = false) { + public function findRecursive($pattern = '.*', $sort = false) { if (!$this->pwd()) { return array(); } @@ -330,9 +325,8 @@ function addPathElement($path, $element) { * * @param string $path The path to check. * @return bool - * @access public */ - function inCakePath($path = '') { + public function inCakePath($path = '') { $dir = substr(Folder::slashTerm(ROOT), 0, -1); $newdir = $dir . $path; @@ -345,9 +339,8 @@ function inCakePath($path = '') { * @param string $path The path to check that the current pwd() resides with in. * @param boolean $reverse * @return bool - * @access public */ - function inPath($path = '', $reverse = false) { + public function inPath($path = '', $reverse = false) { $dir = Folder::slashTerm($path); $current = Folder::slashTerm($this->pwd()); @@ -367,9 +360,8 @@ function inPath($path = '', $reverse = false) { * @param boolean $recursive chmod recursively, set to false to only change the current directory. * @param array $exceptions array of files, directories to skip * @return boolean Returns TRUE on success, FALSE on failure - * @access public */ - function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { + public function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { if (!$mode) { $mode = $this->mode; } @@ -418,9 +410,8 @@ function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { * @param mixed $exceptions Array of files to exclude, defaults to excluding hidden files. * @param string $type either file or dir. null returns both files and directories * @return mixed array of nested directories and files in each directory - * @access public */ - function tree($path, $exceptions = true, $type = null) { + public function tree($path, $exceptions = true, $type = null) { $original = $this->path; $path = rtrim($path, DS); if (!$this->cd($path)) { @@ -474,9 +465,8 @@ function __tree($path, $exceptions) { * @param string $pathname The directory structure to create * @param integer $mode octal value 0755 * @return boolean Returns TRUE on success, FALSE on failure - * @access public */ - function create($pathname, $mode = false) { + public function create($pathname, $mode = false) { if (is_dir($pathname) || empty($pathname)) { return true; } @@ -513,9 +503,8 @@ function create($pathname, $mode = false) { * * @param string $directory Path to directory * @return int size in bytes of current folder - * @access public */ - function dirsize() { + public function dirsize() { $size = 0; $directory = Folder::slashTerm($this->path); $stack = array($directory); @@ -550,9 +539,8 @@ function dirsize() { * * @param string $path Path of directory to delete * @return boolean Success - * @access public */ - function delete($path = null) { + public function delete($path = null) { if (!$path) { $path = $this->pwd(); } @@ -607,9 +595,8 @@ function delete($path = null) { * * @param mixed $options Either an array of options (see above) or a string of the destination directory. * @return bool Success - * @access public */ - function copy($options = array()) { + public function copy($options = array()) { if (!$this->pwd()) { return false; } @@ -693,9 +680,8 @@ function copy($options = array()) { * * @param array $options (to, from, chmod, skip) * @return boolean Success - * @access public */ - function move($options) { + public function move($options) { $to = null; if (is_string($options)) { $to = $options; @@ -715,9 +701,8 @@ function move($options) { * get messages from latest method * * @return array - * @access public */ - function messages() { + public function messages() { return $this->__messages; } @@ -725,9 +710,8 @@ function messages() { * get error from latest method * * @return array - * @access public */ - function errors() { + public function errors() { return $this->__errors; } diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 767f149d987..f70a057b6d1 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -160,9 +160,8 @@ class HttpSocket extends CakeSocket { * See HttpSocket::$config for options that can be used. * * @param mixed $config Configuration information, either a string url or an array of options. - * @access public */ - function __construct($config = array()) { + public function __construct($config = array()) { if (is_string($config)) { $this->_configUri($config); } elseif (is_array($config)) { @@ -181,9 +180,8 @@ function __construct($config = array()) { * * @param mixed $request Either an URI string, or an array defining host/uri * @return mixed false on error, request body on success - * @access public */ - function request($request = array()) { + public function request($request = array()) { $this->reset(false); if (is_string($request)) { @@ -308,9 +306,8 @@ function request($request = array()) { * @param array $query Querystring parameters to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request, either false on failure or the response to the request. - * @access public */ - function get($uri = null, $query = array(), $request = array()) { + public function get($uri = null, $query = array(), $request = array()) { if (!empty($query)) { $uri = $this->_parseUri($uri); if (isset($uri['query'])) { @@ -341,9 +338,8 @@ function get($uri = null, $query = array(), $request = array()) { * @param array $data Array of POST data keys and values. * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request, either false on failure or the response to the request. - * @access public */ - function post($uri = null, $data = array(), $request = array()) { + public function post($uri = null, $data = array(), $request = array()) { $request = Set::merge(array('method' => 'POST', 'uri' => $uri, 'body' => $data), $request); return $this->request($request); } @@ -355,9 +351,8 @@ function post($uri = null, $data = array(), $request = array()) { * @param array $data Array of PUT data keys and values. * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request - * @access public */ - function put($uri = null, $data = array(), $request = array()) { + public function put($uri = null, $data = array(), $request = array()) { $request = Set::merge(array('method' => 'PUT', 'uri' => $uri, 'body' => $data), $request); return $this->request($request); } @@ -369,9 +364,8 @@ function put($uri = null, $data = array(), $request = array()) { * @param array $data Query to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request - * @access public */ - function delete($uri = null, $data = array(), $request = array()) { + public function delete($uri = null, $data = array(), $request = array()) { $request = Set::merge(array('method' => 'DELETE', 'uri' => $uri, 'body' => $data), $request); return $this->request($request); } @@ -402,9 +396,8 @@ function delete($uri = null, $data = array(), $request = array()) { * @param mixed $url Either a string or array of url options to create a url with. * @param string $uriTemplate A template string to use for url formatting. * @return mixed Either false on failure or a string containing the composed url. - * @access public */ - function url($url = null, $uriTemplate = null) { + public function url($url = null, $uriTemplate = null) { if (is_null($url)) { $url = '/'; } @@ -1042,9 +1035,8 @@ function _tokenEscapeChars($hex = true, $chars = null) { * * @param boolean $full If set to false only HttpSocket::response and HttpSocket::request are reseted * @return boolean True on success - * @access public */ - function reset($full = true) { + public function reset($full = true) { static $initalState = array(); if (empty($initalState)) { $initalState = get_class_vars(__CLASS__); diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index e20e241c58f..e6ebee9145c 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -103,9 +103,8 @@ class I18n extends Object { * Return a static instance of the I18n class * * @return object I18n - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { $instance[0] =& new I18n(); @@ -124,9 +123,8 @@ function &getInstance() { * @param string $category Category The integer value of the category to use. * @param integer $count Count Count is used with $plural to choose the correct plural form. * @return string translated string. - * @access public */ - function translate($singular, $plural = null, $domain = null, $category = 6, $count = null) { + public function translate($singular, $plural = null, $domain = null, $category = 6, $count = null) { $_this =& I18n::getInstance(); if (strpos($singular, "\r\n") !== false) { diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 1be467e95eb..7441e700cd4 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -255,9 +255,8 @@ class Inflector { * Gets a reference to the Inflector object instance * * @return object - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index 0bd41e80c9d..a5c7fae5edd 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -340,9 +340,8 @@ function __construct() { * the method will get the settings from L10n::__setLanguage(); * * @param string $language Language (if null will use DEFAULT_LANGUAGE if defined) - * @access public */ - function get($language = null) { + public function get($language = null) { if ($language !== null) { return $this->__setLanguage($language); } elseif ($this->__autoLanguage() === false) { @@ -434,9 +433,8 @@ function __autoLanguage() { * @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, * or false when language/locale doesn't exist - * @access public */ - function map($mixed = null) { + public function map($mixed = null) { if (is_array($mixed)) { $result = array(); foreach ($mixed as $_mixed) { @@ -462,9 +460,8 @@ function map($mixed = null) { * @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, * or false when language doesn't exist - * @access public */ - function catalog($language = null) { + public function catalog($language = null) { if (is_array($language)) { $result = array(); foreach ($language as $_language) { diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php index 002a3073a4d..a2e86bcf6ea 100644 --- a/cake/libs/magic_db.php +++ b/cake/libs/magic_db.php @@ -78,9 +78,8 @@ function read($magicDb = null) { * * @param string $data A MagicDb string to turn into an array * @return array A parsed MagicDb array or an empty array if the $data param was invalid. Returns the db property if $data is not set. - * @access public */ - function toArray($data = null) { + public function toArray($data = null) { if (is_array($data)) { return $data; } @@ -132,9 +131,8 @@ function toArray($data = null) { * * @param mixed $magicDb A $magicDb string / array to validate (optional) * @return boolean True if the $magicDb / instance db validates, false if not - * @access public */ - function validates($magicDb = null) { + public function validates($magicDb = null) { if (is_null($magicDb)) { $magicDb = $this->db; } elseif (!is_array($magicDb)) { @@ -150,9 +148,8 @@ function validates($magicDb = null) { * @param string $file Absolute path to the file to analyze * @param array $options TBT * @return mixed - * @access public */ - function analyze($file, $options = array()) { + public function analyze($file, $options = array()) { if (!is_string($file)) { return false; } @@ -201,9 +198,8 @@ class MagicFileResource extends Object{ * * @param unknown $file * @return void - * @access public */ - function __construct($file) { + public function __construct($file) { if (file_exists($file)) { $this->resource =& new File($file); } else { @@ -216,9 +212,8 @@ function __construct($file) { * * @param unknown $magic * @return void - * @access public */ - function test($magic) { + public function test($magic) { $offset = null; $type = null; $expected = null; @@ -245,9 +240,8 @@ function test($magic) { * @param unknown $type * @param unknown $length * @return void - * @access public */ - function read($length = null) { + public function read($length = null) { if (!is_object($this->resource)) { return substr($this->resource, $this->offset, $length); } @@ -260,9 +254,8 @@ function read($length = null) { * @param unknown $type * @param unknown $expected * @return void - * @access public */ - function extract($offset, $type, $expected) { + public function extract($offset, $type, $expected) { switch ($type) { case 'string': $this->offset($offset); @@ -280,9 +273,8 @@ function extract($offset, $type, $expected) { * @param unknown $offset * @param unknown $whence * @return void - * @access public */ - function offset($offset = null) { + public function offset($offset = null) { if (is_null($offset)) { if (!is_object($this->resource)) { return $this->offset; diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index c30dffd1587..304d5e7cf3d 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -41,9 +41,8 @@ class AclBehavior extends ModelBehavior { * * @param mixed $config * @return void - * @access public */ - function setup(&$model, $config = array()) { + public function setup(&$model, $config = array()) { if (is_string($config)) { $config = array('type' => $config); } @@ -68,9 +67,8 @@ function setup(&$model, $config = array()) { * * @param mixed $ref * @return array - * @access public */ - function node(&$model, $ref = null) { + public function node(&$model, $ref = null) { $type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])]; if (empty($ref)) { $ref = array('model' => $model->name, 'foreign_key' => $model->id); @@ -83,9 +81,8 @@ function node(&$model, $ref = null) { * * @param boolean $created True if this is a new record * @return void - * @access public */ - function afterSave(&$model, $created) { + public function afterSave(&$model, $created) { $type = $this->__typeMaps[strtolower($this->settings[$model->alias]['type'])]; $parent = $model->parentNode(); if (!empty($parent)) { @@ -108,9 +105,8 @@ function afterSave(&$model, $created) { * Destroys the ARO/ACO node bound to the deleted record * * @return void - * @access public */ - function afterDelete(&$model) { + public function afterDelete(&$model) { $type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])]; $node = Set::extract($this->node($model), "0.{$type}.id"); if (!empty($node)) { diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index f5d6a1b084d..1c82542dd38 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -61,9 +61,8 @@ class ContainableBehavior extends ModelBehavior { * * @param object $Model Model using the behavior * @param array $settings Settings to override for model. - * @access public */ - function setup(&$Model, $settings = array()) { + public function setup(&$Model, $settings = array()) { if (!isset($this->settings[$Model->alias])) { $this->settings[$Model->alias] = array('recursive' => true, 'notices' => true, 'autoFields' => true); } @@ -93,9 +92,8 @@ function setup(&$Model, $settings = array()) { * @param object $Model Model using the behavior * @param array $query Query parameters as set by cake * @return array - * @access public */ - function beforeFind(&$Model, $query) { + public function beforeFind(&$Model, $query) { $reset = (isset($query['reset']) ? $query['reset'] : true); $noContain = ((isset($this->runtime[$Model->alias]['contain']) && empty($this->runtime[$Model->alias]['contain'])) || (isset($query['contain']) && empty($query['contain']))); $contain = array(); @@ -214,9 +212,8 @@ function beforeFind(&$Model, $query) { * @param object $Model Model on which we are resetting * @param array $results Results of the find operation * @param bool $primary true if this is the primary model that issued the find operation, false otherwise - * @access public */ - function afterFind(&$Model, $results, $primary) { + public function afterFind(&$Model, $results, $primary) { if (!empty($Model->__backContainableAssociation)) { foreach ($Model->__backContainableAssociation as $relation => $bindings) { $Model->{$relation} = $bindings; @@ -231,9 +228,8 @@ function afterFind(&$Model, $results, $primary) { * * @param object $Model Model on which binding restriction is being applied * @return void - * @access public */ - function contain(&$Model) { + public function contain(&$Model) { $args = func_get_args(); $contain = call_user_func_array('am', array_slice($args, 1)); $this->runtime[$Model->alias]['contain'] = $contain; @@ -246,9 +242,8 @@ function contain(&$Model) { * * @param object $Model Model on which to reset bindings * @return void - * @access public */ - function resetBindings(&$Model) { + public function resetBindings(&$Model) { if (!empty($Model->__backOriginalAssociation)) { $Model->__backAssociation = $Model->__backOriginalAssociation; unset($Model->__backOriginalAssociation); @@ -271,9 +266,8 @@ function resetBindings(&$Model) { * @param array $containments Current set of containments * @param bool $throwErrors Wether unexisting bindings show throw errors * @return array Containments - * @access public */ - function containments(&$Model, $contain, $containments = array(), $throwErrors = null) { + public function containments(&$Model, $contain, $containments = array(), $throwErrors = null) { $options = array('className', 'joinTable', 'with', 'foreignKey', 'associationForeignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'unique', 'finderQuery', 'deleteQuery', 'insertQuery'); $keep = array(); $depth = array(); @@ -375,9 +369,8 @@ function containments(&$Model, $contain, $containments = array(), $throwErrors = * @param array $map Map of relations for given model * @param mixed $fields If array, fields to initially load, if false use $Model as primary model * @return array Fields - * @access public */ - function fieldDependencies(&$Model, $map, $fields = array()) { + public function fieldDependencies(&$Model, $map, $fields = array()) { if ($fields === false) { foreach ($map as $parent => $children) { foreach ($children as $type => $bindings) { @@ -421,9 +414,8 @@ function fieldDependencies(&$Model, $map, $fields = array()) { * * @param array $containments Containments * @return array Built containments - * @access public */ - function containmentsMap($containments) { + public function containmentsMap($containments) { $map = array(); foreach ($containments['models'] as $name => $model) { $instance =& $model['instance']; diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index a6104d13fd3..7e15f2ef295 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -46,9 +46,8 @@ class TranslateBehavior extends ModelBehavior { * * @param array $config * @return mixed - * @access public */ - function setup(&$model, $config = array()) { + public function setup(&$model, $config = array()) { $db =& ConnectionManager::getDataSource($model->useDbConfig); if (!$db->connected) { trigger_error( @@ -68,9 +67,8 @@ function setup(&$model, $config = array()) { * Callback * * @return void - * @access public */ - function cleanup(&$model) { + public function cleanup(&$model) { $this->unbindTranslation($model); unset($this->settings[$model->alias]); unset($this->runtime[$model->alias]); @@ -81,9 +79,8 @@ function cleanup(&$model) { * * @param array $query * @return array Modified query - * @access public */ - function beforeFind(&$model, $query) { + public function beforeFind(&$model, $query) { $locale = $this->_getLocale($model); if (empty($locale)) { return $query; @@ -207,9 +204,8 @@ function beforeFind(&$model, $query) { * @param array $results * @param boolean $primary * @return array Modified results - * @access public */ - function afterFind(&$model, $results, $primary) { + public function afterFind(&$model, $results, $primary) { $this->runtime[$model->alias]['fields'] = array(); $locale = $this->_getLocale($model); @@ -250,9 +246,8 @@ function afterFind(&$model, $results, $primary) { * beforeValidate Callback * * @return boolean - * @access public */ - function beforeValidate(&$model) { + public function beforeValidate(&$model) { $locale = $this->_getLocale($model); if (empty($locale)) { return true; @@ -284,9 +279,8 @@ function beforeValidate(&$model) { * * @param boolean $created * @return void - * @access public */ - function afterSave(&$model, $created) { + public function afterSave(&$model, $created) { if (!isset($this->runtime[$model->alias]['beforeSave'])) { return true; } @@ -327,9 +321,8 @@ function afterSave(&$model, $created) { * afterDelete Callback * * @return void - * @access public */ - function afterDelete(&$model) { + public function afterDelete(&$model) { $RuntimeModel =& $this->translateModel($model); $conditions = array('model' => $model->alias, 'foreign_key' => $model->id); $RuntimeModel->deleteAll($conditions); @@ -358,9 +351,8 @@ function _getLocale(&$model) { * Get instance of model for translations * * @return object - * @access public */ - function &translateModel(&$model) { + public function &translateModel(&$model) { if (!isset($this->runtime[$model->alias]['model'])) { if (!isset($model->translateModel) || empty($model->translateModel)) { $className = 'I18nModel'; diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index bf48a72cd6e..fca1e906f4c 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -55,9 +55,8 @@ class TreeBehavior extends ModelBehavior { * @param object $Model instance of model * @param array $config array of configuration settings. * @return void - * @access public */ - function setup(&$Model, $config = array()) { + public function setup(&$Model, $config = array()) { if (!is_array($config)) { $config = array('type' => $config); } @@ -81,9 +80,8 @@ function setup(&$Model, $config = array()) { * @param AppModel $Model Model instance. * @param boolean $created indicates whether the node just saved was created or updated * @return boolean true on success, false on failure - * @access public */ - function afterSave(&$Model, $created) { + public function afterSave(&$Model, $created) { extract($this->settings[$Model->alias]); if ($created) { if ((isset($Model->data[$Model->alias][$parent])) && $Model->data[$Model->alias][$parent]) { @@ -102,9 +100,8 @@ function afterSave(&$Model, $created) { * * @param AppModel $Model Model instance * @return boolean true to continue, false to abort the delete - * @access public */ - function beforeDelete(&$Model) { + public function beforeDelete(&$Model) { extract($this->settings[$Model->alias]); list($name, $data) = array($Model->alias, $Model->read()); $data = $data[$name]; @@ -135,9 +132,8 @@ function beforeDelete(&$Model) { * @since 1.2 * @param AppModel $Model Model instance * @return boolean true to continue, false to abort the save - * @access public */ - function beforeSave(&$Model) { + public function beforeSave(&$Model) { extract($this->settings[$Model->alias]); $this->_addToWhitelist($Model, array($left, $right)); @@ -205,9 +201,8 @@ function beforeSave(&$Model) { * @param mixed $id The ID of the record to read or false to read all top level nodes * @param boolean $direct whether to count direct, or all, children * @return integer number of child nodes - * @access public */ - function childcount(&$Model, $id = null, $direct = false) { + public function childcount(&$Model, $id = null, $direct = false) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -251,9 +246,8 @@ function childcount(&$Model, $id = null, $direct = false) { * @param integer $page Page number, for accessing paged data * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of child nodes - * @access public */ - function children(&$Model, $id = null, $direct = false, $fields = null, $order = null, $limit = null, $page = 1, $recursive = null) { + public function children(&$Model, $id = null, $direct = false, $fields = null, $order = null, $limit = null, $page = 1, $recursive = null) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -308,9 +302,8 @@ function children(&$Model, $id = null, $direct = false, $fields = null, $order = * @param string $spacer The character or characters which will be repeated * @param integer $recursive The number of levels deep to fetch associated records * @return array An associative array of records, where the id is the key, and the display field is the value - * @access public */ - function generatetreelist(&$Model, $conditions = null, $keyPath = null, $valuePath = null, $spacer = '_', $recursive = null) { + public function generatetreelist(&$Model, $conditions = null, $keyPath = null, $valuePath = null, $spacer = '_', $recursive = null) { $overrideRecursive = $recursive; extract($this->settings[$Model->alias]); if (!is_null($overrideRecursive)) { @@ -363,9 +356,8 @@ function generatetreelist(&$Model, $conditions = null, $keyPath = null, $valuePa * @param mixed $id The ID of the record to read * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of data for the parent node - * @access public */ - function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { + public function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -396,9 +388,8 @@ function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { * @param mixed $fields Either a single string of a field name, or an array of field names * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of nodes from top most parent to current node - * @access public */ - function getpath(&$Model, $id = null, $fields = null, $recursive = null) { + public function getpath(&$Model, $id = null, $fields = null, $recursive = null) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -433,9 +424,8 @@ function getpath(&$Model, $id = null, $fields = null, $recursive = null) { * @param mixed $id The ID of the record to move * @param mixed $number how many places to move the node or true to move to last position * @return boolean true on success, false on failure - * @access public */ - function movedown(&$Model, $id = null, $number = 1) { + public function movedown(&$Model, $id = null, $number = 1) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -491,9 +481,8 @@ function movedown(&$Model, $id = null, $number = 1) { * @param mixed $id The ID of the record to move * @param mixed $number how many places to move the node, or true to move to first position * @return boolean true on success, false on failure - * @access public */ - function moveup(&$Model, $id = null, $number = 1) { + public function moveup(&$Model, $id = null, $number = 1) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -555,9 +544,8 @@ function moveup(&$Model, $id = null, $number = 1) { * @param mixed $missingParentAction 'return' to do nothing and return, 'delete' to * delete, or the id of the parent to set as the parent_id * @return boolean true on success, false on failure - * @access public */ - function recover(&$Model, $mode = 'parent', $missingParentAction = null) { + public function recover(&$Model, $mode = 'parent', $missingParentAction = null) { if (is_array($mode)) { extract (array_merge(array('mode' => 'parent'), $mode)); } @@ -672,9 +660,8 @@ function reorder(&$Model, $options = array()) { * @param mixed $id The ID of the record to remove * @param boolean $delete whether to delete the node after reparenting children (if any) * @return boolean true on success, false on failure - * @access public */ - function removefromtree(&$Model, $id = null, $delete = false) { + public function removefromtree(&$Model, $id = null, $delete = false) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -740,9 +727,8 @@ function removefromtree(&$Model, $id = null, $delete = false) { * @param AppModel $Model Model instance * @return mixed true if the tree is valid or empty, otherwise an array of (error type [index, node], * [incorrect left/right index,node id], message) - * @access public */ - function verify(&$Model) { + public function verify(&$Model) { extract($this->settings[$Model->alias]); if (!$Model->find('count', array('conditions' => $scope))) { return true; diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index fb6db056628..e481c10bd5d 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -139,9 +139,8 @@ function _build($data) { * * @param array $events schema object properties * @return boolean Should process continue - * @access public */ - function before($event = array()) { + public function before($event = array()) { return true; } @@ -149,9 +148,8 @@ function before($event = array()) { * After callback to be implemented in subclasses * * @param array $events schema object properties - * @access public */ - function after($event = array()) { + public function after($event = array()) { } /** @@ -159,9 +157,8 @@ function after($event = array()) { * * @param array $options schema object properties * @return array Set of name and tables - * @access public */ - function &load($options = array()) { + public function &load($options = array()) { if (is_string($options)) { $options = array('path' => $options); } @@ -198,9 +195,8 @@ function &load($options = array()) { * * @param array $options schema object properties * @return array Array indexed by name and tables - * @access public */ - function read($options = array()) { + public function read($options = array()) { extract(array_merge( array( 'connection' => $this->connection, @@ -319,9 +315,8 @@ function read($options = array()) { * @param mixed $object schema object or options array * @param array $options schema object properties to override object * @return mixed false or string written to file - * @access public */ - function write($object, $options = array()) { + public function write($object, $options = array()) { if (is_object($object)) { $object = get_object_vars($object); $this->_build($object); @@ -427,9 +422,8 @@ function generateTable($table, $fields) { * @param mixed $old Schema object or array * @param mixed $new Schema object or array * @return array Tables (that are added, dropped, or changed) - * @access public */ - function compare($old, $new = null) { + public function compare($old, $new = null) { if (empty($new)) { $new =& $this; } @@ -513,9 +507,8 @@ function compare($old, $new = null) { * * @param array $values options keys(type, null, default, key, length, extra) * @return array Formatted values - * @access public */ - function __values($values) { + public function __values($values) { $vals = array(); if (is_array($values)) { foreach ($values as $key => $val) { @@ -535,9 +528,8 @@ function __values($values) { * * @param array $Obj model object * @return array Formatted columns - * @access public */ - function __columns(&$Obj) { + public function __columns(&$Obj) { $db =& ConnectionManager::getDataSource($Obj->useDbConfig); $fields = $Obj->schema(true); $columns = $props = array(); diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index c23ce9b037c..94120d865d3 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -221,9 +221,8 @@ function __construct($config = array()) { * * @param mixed $data * @return array Array of sources available in this datasource. - * @access public */ - function listSources($data = null) { + public function listSources($data = null) { if ($this->cacheSources === false) { return null; } @@ -250,9 +249,8 @@ function listSources($data = null) { * * @param boolean $reset Whether or not the source list should be reset. * @return array Array of sources available in this datasource - * @access public */ - function sources($reset = false) { + public function sources($reset = false) { if ($reset === true) { $this->_sources = null; } @@ -264,9 +262,8 @@ function sources($reset = false) { * * @param Model $model * @return array Array of Metadata for the $model - * @access public */ - function describe(&$model) { + public function describe(&$model) { if ($this->cacheSources === false) { return null; } @@ -288,9 +285,8 @@ function describe(&$model) { * Begin a transaction * * @return boolean Returns true if a transaction is not in progress - * @access public */ - function begin(&$model) { + public function begin(&$model) { return !$this->_transactionStarted; } @@ -298,9 +294,8 @@ function begin(&$model) { * Commit a transaction * * @return boolean Returns true if a transaction is in progress - * @access public */ - function commit(&$model) { + public function commit(&$model) { return $this->_transactionStarted; } @@ -308,9 +303,8 @@ function commit(&$model) { * Rollback a transaction * * @return boolean Returns true if a transaction is in progress - * @access public */ - function rollback(&$model) { + public function rollback(&$model) { return $this->_transactionStarted; } @@ -319,9 +313,8 @@ function rollback(&$model) { * * @param string $real Real column type (i.e. "varchar(255)") * @return string Abstract column type (i.e. "string") - * @access public */ - function column($real) { + public function column($real) { return false; } @@ -334,9 +327,8 @@ function column($real) { * @param array $fields An Array of fields to be saved. * @param array $values An Array of values to save. * @return boolean success - * @access public */ - function create(&$model, $fields = null, $values = null) { + public function create(&$model, $fields = null, $values = null) { return false; } @@ -348,9 +340,8 @@ function create(&$model, $fields = null, $values = null) { * @param Model $model The model being read. * @param array $queryData An array of query data used to find the data you want * @return mixed - * @access public */ - function read(&$model, $queryData = array()) { + public function read(&$model, $queryData = array()) { return false; } @@ -363,9 +354,8 @@ function read(&$model, $queryData = array()) { * @param array $fields Array of fields to be updated * @param array $values Array of values to be update $fields to. * @return boolean Success - * @access public */ - function update(&$model, $fields = null, $values = null) { + public function update(&$model, $fields = null, $values = null) { return false; } @@ -376,9 +366,8 @@ function update(&$model, $fields = null, $values = null) { * * @param Model $model The model class having record(s) deleted * @param mixed $id Primary key of the model - * @access public */ - function delete(&$model, $id = null) { + public function delete(&$model, $id = null) { if ($id == null) { $id = $model->id; } @@ -389,9 +378,8 @@ function delete(&$model, $id = null) { * * @param unknown_type $source * @return mixed Last ID key generated in previous INSERT - * @access public */ - function lastInsertId($source = null) { + public function lastInsertId($source = null) { return false; } @@ -400,9 +388,8 @@ function lastInsertId($source = null) { * * @param unknown_type $source * @return integer Number of rows returned by last operation - * @access public */ - function lastNumRows($source = null) { + public function lastNumRows($source = null) { return false; } @@ -411,9 +398,8 @@ function lastNumRows($source = null) { * * @param unknown_type $source * @return integer Number of rows affected by last query. - * @access public */ - function lastAffected($source = null) { + public function lastAffected($source = null) { return false; } @@ -423,9 +409,8 @@ function lastAffected($source = null) { * before establishing a connection. * * @return boolean Whether or not the Datasources conditions for use are met. - * @access public */ - function enabled() { + public function enabled() { return true; } /** @@ -433,9 +418,8 @@ function enabled() { * * @param string $interface The name of the interface (method) * @return boolean True on success - * @access public */ - function isInterfaceSupported($interface) { + public function isInterfaceSupported($interface) { static $methods = false; if ($methods === false) { $methods = array_map('strtolower', get_class_methods($this)); @@ -449,9 +433,8 @@ function isInterfaceSupported($interface) { * * @param array $config The configuration array * @return void - * @access public */ - function setConfig($config = array()) { + public function setConfig($config = array()) { $this->config = array_merge($this->_baseConfig, $this->config, $config); } @@ -572,9 +555,8 @@ function insertQueryData($query, $data, $association, $assocData, &$model, &$lin * @param Model $model Model instance * @param string $key Key name to make * @return string Key name for model. - * @access public */ - function resolveKey(&$model, $key) { + public function resolveKey(&$model, $key) { return $model->alias . $key; } @@ -582,9 +564,8 @@ function resolveKey(&$model, $key) { * Closes the current datasource. * * @return void - * @access public */ - function __destruct() { + public function __destruct() { if ($this->_transactionStarted) { $null = null; $this->rollback($null); diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 3734e4e4312..3ad8a5981df 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -165,9 +165,8 @@ class DboOracle extends DboSource { * Connects to the database using options in the given configuration array. * * @return boolean True if the database could be connected, else false - * @access public */ - function connect() { + public function connect() { $config = $this->config; $this->connected = false; $config['charset'] = !empty($config['charset']) ? $config['charset'] : null; @@ -246,9 +245,8 @@ function getEncoding() { * Disconnects from database. * * @return boolean True if the database could be disconnected, else false - * @access public */ - function disconnect() { + public function disconnect() { if ($this->connection) { $this->connected = !ocilogoff($this->connection); return !$this->connected; @@ -311,9 +309,8 @@ function _scrapeSQL($sql) { * @param integer $limit Maximum number of rows to return * @param integer $offset Row to begin returning * @return modified SQL Query - * @access public */ - function limit($limit = -1, $offset = 0) { + public function limit($limit = -1, $offset = 0) { $this->_limit = (int) $limit; $this->_offset = (int) $offset; } @@ -323,9 +320,8 @@ function limit($limit = -1, $offset = 0) { * this returns false. * * @return integer Number of rows in resultset - * @access public */ - function lastNumRows() { + public function lastNumRows() { return $this->_numRows; } @@ -381,9 +377,8 @@ function _execute($sql) { * Enter description here... * * @return unknown - * @access public */ - function fetchRow() { + public function fetchRow() { if ($this->_currentRow >= $this->_numRows) { ocifreestatement($this->_statementId); $this->_map = null; @@ -421,9 +416,8 @@ function fetchResult() { * * @param string $sequence * @return bool - * @access public */ - function sequenceExists($sequence) { + public function sequenceExists($sequence) { $sql = "SELECT SEQUENCE_NAME FROM USER_SEQUENCES WHERE SEQUENCE_NAME = '$sequence'"; if (!$this->execute($sql)) { return false; @@ -436,9 +430,8 @@ function sequenceExists($sequence) { * * @param string $sequence * @return bool - * @access public */ - function createSequence($sequence) { + public function createSequence($sequence) { $sql = "CREATE SEQUENCE $sequence"; return $this->execute($sql); } @@ -448,9 +441,8 @@ function createSequence($sequence) { * * @param unknown_type $table * @return unknown - * @access public */ - function createTrigger($table) { + public function createTrigger($table) { $sql = "CREATE OR REPLACE TRIGGER pk_$table" . "_trigger BEFORE INSERT ON $table FOR EACH ROW BEGIN SELECT pk_$table.NEXTVAL INTO :NEW.ID FROM DUAL; END;"; return $this->execute($sql); } @@ -460,9 +452,8 @@ function createTrigger($table) { * raised and the application exits. * * @return array tablenames in the database - * @access public */ - function listSources() { + public function listSources() { $cache = parent::listSources(); if ($cache != null) { return $cache; @@ -486,9 +477,8 @@ function listSources() { * * @param object instance of a model to inspect * @return array Fields in table. Keys are name and type - * @access public */ - function describe(&$model) { + public function describe(&$model) { $table = $this->fullTableName($model, false); if (!empty($model->sequence)) { @@ -744,9 +734,8 @@ function alterSchema($compare, $table = null) { * * @param unknown_type $var * @return unknown - * @access public */ - function name($name) { + public function name($name) { if (strpos($name, '.') !== false && strpos($name, '"') === false) { list($model, $field) = explode('.', $name); if ($field[0] == "_") { @@ -802,9 +791,8 @@ function commit() { * * @param string $real Real database-layer column type (i.e. "varchar(255)") * @return string Abstract column type (i.e. "string") - * @access public */ - function column($real) { + public function column($real) { if (is_array($real)) { $col = $real['name']; @@ -853,9 +841,8 @@ function column($real) { * * @param string $data String to be prepared for use in an SQL statement * @return string Quoted and escaped - * @access public */ - function value($data, $column = null, $safe = false) { + public function value($data, $column = null, $safe = false) { $parent = parent::value($data, $column, $safe); if ($parent != null) { @@ -894,9 +881,8 @@ function value($data, $column = null, $safe = false) { * * @param string * @return integer - * @access public */ - function lastInsertId($source) { + public function lastInsertId($source) { $sequence = $this->_sequenceMap[$source]; $sql = "SELECT $sequence.currval FROM dual"; @@ -914,9 +900,8 @@ function lastInsertId($source) { * Returns a formatted error message from previous database operation. * * @return string Error message with error number - * @access public */ - function lastError() { + public function lastError() { return $this->_error; } @@ -924,9 +909,8 @@ function lastError() { * Returns number of affected rows in previous database operation. If no previous operation exists, this returns false. * * @return int Number of affected rows - * @access public */ - function lastAffected() { + public function lastAffected() { return $this->_statementId ? ocirowcount($this->_statementId): false; } diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 37f61b950aa..deb6b161ba8 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -389,9 +389,8 @@ function getSequence($table, $field = 'id') { * @param integer $reset If -1, sequences are dropped, if 0 (default), sequences are reset, * and if 1, sequences are not modified * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. - * @access public */ - function truncate($table, $reset = 0) { + public function truncate($table, $reset = 0) { if (parent::truncate($table)) { $table = $this->fullTableName($table, false); if (isset($this->_sequenceMap[$table]) && $reset !== 1) { diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 290c1798195..03252c8d0b2 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -313,9 +313,8 @@ function update(&$model, $fields = array(), $values = null, $conditions = null) * * @param mixed $table A string or model class representing the table to be truncated * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. - * @access public */ - function truncate($table) { + public function truncate($table) { return $this->execute('DELETE From ' . $this->fullTableName($table)); } diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index e2a845f7295..0075410debf 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -118,9 +118,8 @@ class DboSource extends DataSource { * * @param array $config Array of configuration information for the Datasource. * @param boolean $autoConnect Whether or not the datasource should automatically connect. - * @access public */ - function __construct($config = null, $autoConnect = true) { + public function __construct($config = null, $autoConnect = true) { if (!isset($config['prefix'])) { $config['prefix'] = ''; } @@ -141,9 +140,8 @@ function __construct($config = null, $autoConnect = true) { * * @param array $config An array defining the new configuration settings * @return boolean True on success, false on failure - * @access public */ - function reconnect($config = null) { + public function reconnect($config = null) { $this->disconnect(); $this->setConfig($config); $this->_sources = null; @@ -158,9 +156,8 @@ function reconnect($config = null) { * @param string $column The column into which this data will be inserted * @param boolean $read Value to be used in READ or WRITE context * @return mixed Prepared value or array of values. - * @access public */ - function value($data, $column = null, $read = true) { + public function value($data, $column = null, $read = true) { if (is_array($data) && !empty($data)) { return array_map( array(&$this, 'value'), @@ -184,9 +181,8 @@ function value($data, $column = null, $read = true) { * * @param string $identifier * @return object An object representing a database identifier to be used in a query - * @access public */ - function identifier($identifier) { + public function identifier($identifier) { $obj = new stdClass(); $obj->type = 'identifier'; $obj->value = $identifier; @@ -198,9 +194,8 @@ function identifier($identifier) { * * @param string $expression * @return object An object representing a database expression to be used in a query - * @access public */ - function expression($expression) { + public function expression($expression) { $obj = new stdClass(); $obj->type = 'expression'; $obj->value = $expression; @@ -212,9 +207,8 @@ function expression($expression) { * * @param string $sql SQL statement * @return boolean - * @access public */ - function rawQuery($sql) { + public function rawQuery($sql) { $this->took = $this->error = $this->numRows = false; return $this->execute($sql); } @@ -233,9 +227,8 @@ function rawQuery($sql) { * @param string $sql * @param array $options * @return mixed Resource or object representing the result set, or false on failure - * @access public */ - function execute($sql, $options = array()) { + public function execute($sql, $options = array()) { $defaults = array('stats' => true, 'log' => $this->fullDebug); $options = array_merge($defaults, $options); @@ -263,9 +256,8 @@ function execute($sql, $options = array()) { * DataSource Query abstraction * * @return resource Result resource identifier. - * @access public */ - function query() { + public function query() { $args = func_get_args(); $fields = null; $order = null; @@ -360,9 +352,8 @@ function query() { * Returns a row from current resultset as an array * * @return array The fetched row as an array - * @access public */ - function fetchRow($sql = null) { + public function fetchRow($sql = null) { if (!empty($sql) && is_string($sql) && strlen($sql) > 5) { if (!$this->execute($sql)) { return null; @@ -388,9 +379,8 @@ function fetchRow($sql = null) { * @param string $sql SQL statement * @param boolean $cache Enables returning/storing cached query results * @return array Array of resultset rows, or false if no rows matched - * @access public */ - function fetchAll($sql, $cache = true, $modelName = null) { + public function fetchAll($sql, $cache = true, $modelName = null) { if ($cache && isset($this->_queryCache[$sql])) { if (preg_match('/^\s*select/i', $sql)) { return $this->_queryCache[$sql]; @@ -458,9 +448,8 @@ function fetchVirtualField(&$result) { * @param string $name Name of the field * @param string $sql SQL query * @return mixed Value of field read. - * @access public */ - function field($name, $sql) { + public function field($name, $sql) { $data = $this->fetchRow($sql); if (!isset($data[$name]) || empty($data[$name])) { return false; @@ -507,9 +496,8 @@ function cacheMethod($method, $key, $value = null) { * * @param string $data * @return string SQL field - * @access public */ - function name($data) { + public function name($data) { if (is_object($data) && isset($data->type)) { return $data->value; } @@ -563,9 +551,8 @@ function name($data) { * Checks if the source is connected to the database. * * @return boolean True if the database is connected, else false - * @access public */ - function isConnected() { + public function isConnected() { return $this->connected; } @@ -573,9 +560,8 @@ function isConnected() { * Checks if the result is valid * * @return boolean True if the result is valid else false - * @access public */ - function hasResult() { + public function hasResult() { return is_resource($this->_result); } @@ -584,9 +570,8 @@ function hasResult() { * * @param boolean $sorted Get the queries sorted by time taken, defaults to false. * @return array Array of queries run as an array - * @access public */ - function getLog($sorted = false, $clear = true) { + public function getLog($sorted = false, $clear = true) { if ($sorted) { $log = sortByKey($this->_queriesLog, 'took', 'desc', SORT_NUMERIC); } else { @@ -628,9 +613,8 @@ function showLog($sorted = false) { * * @param string $sql SQL statement * @todo: Add hook to log errors instead of returning false - * @access public */ - function logQuery($sql) { + public function logQuery($sql) { $this->_queriesCnt++; $this->_queriesTime += $this->took; $this->_queriesLog[] = array( @@ -653,9 +637,8 @@ function logQuery($sql) { * and execution time in microseconds. If the query fails, an error is output instead. * * @param string $sql Query to show information on. - * @access public */ - function showQuery($sql) { + public function showQuery($sql) { $error = $this->error; if (strlen($sql) > 200 && !$this->fullDebug && Configure::read() > 1) { $sql = substr($sql, 0, 200) . '[...]'; @@ -677,9 +660,8 @@ function showQuery($sql) { * @param mixed $model Either a Model object or a string table name. * @param boolean $quote Whether you want the table name quoted. * @return string Full quoted table name - * @access public */ - function fullTableName($model, $quote = true) { + public function fullTableName($model, $quote = true) { if (is_object($model)) { $table = $model->tablePrefix . $model->table; } elseif (isset($this->config['prefix'])) { @@ -704,9 +686,8 @@ function fullTableName($model, $quote = true) { * @param array $values An array of values with keys matching the fields. If null, $model->data will * be used to generate values. * @return boolean Success - * @access public */ - function create(&$model, $fields = null, $values = null) { + public function create(&$model, $fields = null, $values = null) { $id = null; if ($fields == null) { @@ -1047,9 +1028,8 @@ function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, * @param string $query Association query * @param array $ids Array of IDs of associated records * @return array Association results - * @access public */ - function fetchAssociated($model, $query, $ids) { + public function fetchAssociated($model, $query, $ids) { $query = str_replace('{$__cakeID__$}', implode(', ', $ids), $query); if (count($ids) > 1) { $query = str_replace('= (', 'IN (', $query); @@ -1190,9 +1170,8 @@ function __mergeAssociation(&$data, $merge, $association, $type, $selfJoin = fal * @param boolean $external * @param array $resultSet * @return mixed - * @access public */ - function generateAssociationQuery(&$model, &$linkModel, $type, $association = null, $assocData = array(), &$queryData, $external = false, &$resultSet) { + public function generateAssociationQuery(&$model, &$linkModel, $type, $association = null, $assocData = array(), &$queryData, $external = false, &$resultSet) { $queryData = $this->__scrubQueryData($queryData); $assocData = $this->__scrubQueryData($assocData); @@ -1356,9 +1335,8 @@ function generateAssociationQuery(&$model, &$linkModel, $type, $association = nu * @param object $model Model object * @param array $association Association array * @return array Conditions array defining the constraint between $model and $association - * @access public */ - function getConstraint($type, $model, $linkModel, $alias, $assoc, $alias2 = null) { + public function getConstraint($type, $model, $linkModel, $alias, $assoc, $alias2 = null) { $assoc = array_merge(array('external' => false, 'self' => false), $assoc); if (array_key_exists('foreignKey', $assoc) && empty($assoc['foreignKey'])) { @@ -1453,9 +1431,8 @@ function buildStatement($query, &$model) { * * @param array $data * @return string - * @access public */ - function renderJoinStatement($data) { + public function renderJoinStatement($data) { extract($data); return trim("{$type} JOIN {$table} {$alias} ON ({$conditions})"); } @@ -1466,9 +1443,8 @@ function renderJoinStatement($data) { * @param string $type type of query being run. e.g select, create, update, delete, schema, alter. * @param array $data Array of data to insert into the query. * @return string Rendered SQL expression to be run. - * @access public */ - function renderStatement($type, $data) { + public function renderStatement($type, $data) { extract($data); $aliases = null; @@ -1546,9 +1522,8 @@ function __mergeConditions($query, $assoc) { * @param array $values * @param mixed $conditions * @return boolean Success - * @access public */ - function update(&$model, $fields = array(), $values = null, $conditions = null) { + public function update(&$model, $fields = array(), $values = null, $conditions = null) { if ($values == null) { $combined = $fields; } else { @@ -1625,9 +1600,8 @@ function _prepareUpdateFields(&$model, $fields, $quoteValues = true, $alias = fa * @param Model $model * @param mixed $conditions * @return boolean Success - * @access public */ - function delete(&$model, $conditions = null) { + public function delete(&$model, $conditions = null) { $alias = $joins = null; $table = $this->fullTableName($model); $conditions = $this->_matchRecords($model, $conditions); @@ -1726,9 +1700,8 @@ function _getJoins($model) { * @param string $func Lowercase name of SQL function, i.e. 'count' or 'max' * @param array $params Function parameters (any values must be quoted manually) * @return string An SQL calculation function - * @access public */ - function calculate(&$model, $func, $params = array()) { + public function calculate(&$model, $func, $params = array()) { $params = (array)$params; switch (strtolower($func)) { @@ -1766,9 +1739,8 @@ function calculate(&$model, $func, $params = array()) { * * @param mixed $table A string or model class representing the table to be truncated * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. - * @access public */ - function truncate($table) { + public function truncate($table) { return $this->execute('TRUNCATE TABLE ' . $this->fullTableName($table)); } @@ -1779,9 +1751,8 @@ function truncate($table) { * @return boolean True on success, false on fail * (i.e. if the database/model does not support transactions, * or a transaction has not started). - * @access public */ - function begin(&$model) { + public function begin(&$model) { if (parent::begin($model) && $this->execute($this->_commands['begin'])) { $this->_transactionStarted = true; return true; @@ -1796,9 +1767,8 @@ function begin(&$model) { * @return boolean True on success, false on fail * (i.e. if the database/model does not support transactions, * or a transaction has not started). - * @access public */ - function commit(&$model) { + public function commit(&$model) { if (parent::commit($model) && $this->execute($this->_commands['commit'])) { $this->_transactionStarted = false; return true; @@ -1813,9 +1783,8 @@ function commit(&$model) { * @return boolean True on success, false on fail * (i.e. if the database/model does not support transactions, * or a transaction has not started). - * @access public */ - function rollback(&$model) { + public function rollback(&$model) { if (parent::rollback($model) && $this->execute($this->_commands['rollback'])) { $this->_transactionStarted = false; return true; @@ -1836,9 +1805,8 @@ function rollback(&$model) { * @return mixed Either null, false, $conditions or an array of default conditions to use. * @see DboSource::update() * @see DboSource::conditions() - * @access public */ - function defaultConditions(&$model, $conditions, $useAlias = true) { + public function defaultConditions(&$model, $conditions, $useAlias = true) { if (!empty($conditions)) { return $conditions; } @@ -1863,9 +1831,8 @@ function defaultConditions(&$model, $conditions, $useAlias = true) { * @param unknown_type $key * @param unknown_type $assoc * @return string - * @access public */ - function resolveKey($model, $key, $assoc = null) { + public function resolveKey($model, $key, $assoc = null) { if (empty($assoc)) { $assoc = $model->alias; } @@ -1880,9 +1847,8 @@ function resolveKey($model, $key, $assoc = null) { * * @param array $data * @return array - * @access public */ - function __scrubQueryData($data) { + public function __scrubQueryData($data) { foreach (array('conditions', 'fields', 'joins', 'order', 'limit', 'offset', 'group') as $key) { if (empty($data[$key])) { $data[$key] = array(); @@ -1917,9 +1883,8 @@ function _constructVirtualFields(&$model, $alias, $fields) { * @param mixed $fields * @param boolean $quote If false, returns fields array unquoted * @return array - * @access public */ - function fields(&$model, $alias = null, $fields = array(), $quote = true) { + public function fields(&$model, $alias = null, $fields = array(), $quote = true) { if (empty($alias)) { $alias = $model->alias; } @@ -2047,9 +2012,8 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { * @param boolean $where If true, "WHERE " will be prepended to the return value * @param Model $model A reference to the Model instance making the query * @return string SQL fragment - * @access public */ - function conditions($conditions, $quoteValues = true, $where = true, $model = null) { + public function conditions($conditions, $quoteValues = true, $where = true, $model = null) { if (is_object($model)) { $cacheKey = array( $model->useDbConfig, @@ -2110,9 +2074,8 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu * @param boolean $quoteValues If true, values should be quoted * @param Model $model A reference to the Model instance making the query * @return string SQL fragment - * @access public */ - function conditionKeysToString($conditions, $quoteValues = true, $model = null) { + public function conditionKeysToString($conditions, $quoteValues = true, $model = null) { $c = 0; $out = array(); $data = $columnType = null; @@ -2346,9 +2309,8 @@ function __quoteMatchedField($match) { * @param integer $limit Limit of results returned * @param integer $offset Offset from which to start results * @return string SQL limit/offset statement - * @access public */ - function limit($limit, $offset = null) { + public function limit($limit, $offset = null) { if ($limit) { $rt = ''; if (!strpos(strtolower($limit), 'limit') || strpos(strtolower($limit), 'limit') === 0) { @@ -2372,9 +2334,8 @@ function limit($limit, $offset = null) { * @param string $direction Direction (ASC or DESC) * @param object $model model reference (used to look for virtual field) * @return string ORDER BY clause - * @access public */ - function order($keys, $direction = 'ASC', $model = null) { + public function order($keys, $direction = 'ASC', $model = null) { if (!is_array($keys)) { $keys = array($keys); } @@ -2436,9 +2397,8 @@ function order($keys, $direction = 'ASC', $model = null) { * * @param string $group Group By Condition * @return mixed string condition or null - * @access public */ - function group($group, $model = null) { + public function group($group, $model = null) { if ($group) { if (!is_array($group)) { $group = array($group); @@ -2458,9 +2418,8 @@ function group($group, $model = null) { * Disconnects database, kills the connection and says the connection is closed. * * @return void - * @access public */ - function close() { + public function close() { $this->disconnect(); } @@ -2470,9 +2429,8 @@ function close() { * @param Model $model Model to search * @param string $sql SQL WHERE clause (condition only, not the "WHERE" part) * @return boolean True if the table has a matching record, else false - * @access public */ - function hasAny(&$Model, $sql) { + public function hasAny(&$Model, $sql) { $sql = $this->conditions($sql); $table = $this->fullTableName($Model); $alias = $this->alias . $this->name($Model->alias); @@ -2492,9 +2450,8 @@ function hasAny(&$Model, $sql) { * * @param string $real Real database-layer column type (i.e. "varchar(255)") * @return mixed An integer or string representing the length of the column - * @access public */ - function length($real) { + public function length($real) { if (!preg_match_all('/([\w\s]+)(?:\((\d+)(?:,(\d+))?\))?(\sunsigned)?(\szerofill)?/', $real, $result)) { trigger_error(__("FIXME: Can't parse field: " . $real, true), E_USER_WARNING); $col = str_replace(array(')', 'unsigned'), '', $real); @@ -2553,9 +2510,8 @@ function length($real) { * * @param mixed $data Value to be translated * @return mixed Converted boolean value - * @access public */ - function boolean($data) { + public function boolean($data) { if ($data === true || $data === false) { if ($data === true) { return 1; @@ -2590,9 +2546,8 @@ function insertMulti($table, $fields, $values) { * * @param string $model Name of model to inspect * @return array Fields in table. Keys are column and unique - * @access public */ - function index($model) { + public function index($model) { return false; } @@ -2603,9 +2558,8 @@ function index($model) { * @param string $tableName Optional. If specified only the table name given will be generated. * Otherwise, all tables defined in the schema are generated. * @return string - * @access public */ - function createSchema($schema, $tableName = null) { + public function createSchema($schema, $tableName = null) { if (!is_a($schema, 'CakeSchema')) { trigger_error(__('Invalid schema object', true), E_USER_WARNING); return null; @@ -2665,9 +2619,8 @@ function alterSchema($compare, $table = null) { * @param string $table Optional. If specified only the table name given will be generated. * Otherwise, all tables defined in the schema are generated. * @return string - * @access public */ - function dropSchema($schema, $table = null) { + public function dropSchema($schema, $table = null) { if (!is_a($schema, 'CakeSchema')) { trigger_error(__('Invalid schema object', true), E_USER_WARNING); return null; @@ -2688,9 +2641,8 @@ function dropSchema($schema, $table = null) { * @param array $column An array structured like the following: array('name'=>'value', 'type'=>'value'[, options]), * where options can be 'default', 'length', or 'key'. * @return string - * @access public */ - function buildColumn($column) { + public function buildColumn($column) { $name = $type = null; extract(array_merge(array('null' => true), $column)); @@ -2754,9 +2706,8 @@ function buildColumn($column) { * @param array $columnData The array of column data. * @param string $position The position type to use. 'beforeDefault' or 'afterDefault' are common * @return string a built column with the field parameters added. - * @access public */ - function _buildFieldParameters($columnString, $columnData, $position) { + public function _buildFieldParameters($columnString, $columnData, $position) { foreach ($this->fieldParameters as $paramName => $value) { if (isset($columnData[$paramName]) && $value['position'] == $position) { if (isset($value['options']) && !in_array($columnData[$paramName], $value['options'])) { @@ -2778,9 +2729,8 @@ function _buildFieldParameters($columnString, $columnData, $position) { * @param array $indexes * @param string $table * @return array - * @access public */ - function buildIndex($indexes, $table = null) { + public function buildIndex($indexes, $table = null) { $join = array(); foreach ($indexes as $name => $value) { $out = ''; @@ -2809,9 +2759,8 @@ function buildIndex($indexes, $table = null) { * @param array $parameters * @param string $table * @return array - * @access public */ - function readTableParameters($name) { + public function readTableParameters($name) { $parameters = array(); if ($this->isInterfaceSupported('listDetailedSources')) { $currentTableDetails = $this->listDetailedSources($name); @@ -2830,9 +2779,8 @@ function readTableParameters($name) { * @param array $parameters * @param string $table * @return array - * @access public */ - function buildTableParameters($parameters, $table = null) { + public function buildTableParameters($parameters, $table = null) { $result = array(); foreach ($parameters as $name => $value) { if (isset($this->tableParameters[$name])) { @@ -2850,9 +2798,8 @@ function buildTableParameters($parameters, $table = null) { * * @param string $value * @return void - * @access public */ - function introspectType($value) { + public function introspectType($value) { if (!is_array($value)) { if ($value === true || $value === false) { return 'boolean'; diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index 1c78532efea..67afad1b6f8 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -67,9 +67,8 @@ function __construct() { * * @param mixed $ref Array with 'model' and 'foreign_key', model object, or string value * @return array Node found in database - * @access public */ - function node($ref = null) { + public function node($ref = null) { $db =& ConnectionManager::getDataSource($this->useDbConfig); $type = $this->alias; $result = null; diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 59035bcb6fa..425e282ee62 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -751,9 +751,8 @@ function __generateAssociation($type) { * * @param string $tableName Name of the custom table * @return void - * @access public */ - function setSource($tableName) { + public function setSource($tableName) { $this->setDataSource($this->useDbConfig); $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->cacheSources = ($this->cacheSources && $db->cacheSources); @@ -837,9 +836,8 @@ function set($one, $two = null) { * @param string $field The name of the field to be deconstructed * @param mixed $data An array or object to be deconstructed into a field * @return mixed The resulting data that should be assigned to a field - * @access public */ - function deconstruct($field, $data) { + public function deconstruct($field, $data) { if (!is_array($data)) { return $data; } @@ -912,9 +910,8 @@ function deconstruct($field, $data) { * * @param mixed $field Set to true to reload schema, or a string to return a specific field * @return array Array of table metadata - * @access public */ - function schema($field = false) { + public function schema($field = false) { if (!is_array($this->_schema) || $field === true) { $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->cacheSources = ($this->cacheSources && $db->cacheSources); @@ -938,9 +935,8 @@ function schema($field = false) { * Returns an associative array of field names and column types. * * @return array Field types indexed by field name - * @access public */ - function getColumnTypes() { + public function getColumnTypes() { $columns = $this->schema(); if (empty($columns)) { trigger_error(__('(Model::getColumnTypes) Unable to build model field data. If you are using a model without a database table, try implementing schema()', true), E_USER_WARNING); @@ -957,9 +953,8 @@ function getColumnTypes() { * * @param string $column The name of the model column * @return string Column type - * @access public */ - function getColumnType($column) { + public function getColumnType($column) { $db =& ConnectionManager::getDataSource($this->useDbConfig); $cols = $this->schema(); $model = null; @@ -986,9 +981,8 @@ function getColumnType($column) { * @return mixed If $name is a string, returns a boolean indicating whether the field exists. * If $name is an array of field names, returns the first field that exists, * or false if none exist. - * @access public */ - function hasField($name, $checkVirtual = false) { + public function hasField($name, $checkVirtual = false) { if (is_array($name)) { foreach ($name as $n) { if ($this->hasField($n, $checkVirtual)) { @@ -1019,9 +1013,8 @@ function hasField($name, $checkVirtual = false) { * * @param mixed $name Name of field to look for * @return boolean indicating whether the field exists as a model virtual field. - * @access public */ - function isVirtualField($field) { + public function isVirtualField($field) { if (empty($this->virtualFields) || !is_string($field)) { return false; } @@ -1044,9 +1037,8 @@ function isVirtualField($field) { * @return mixed If $field is string expression bound to virtual field $field * If $field is null, returns an array of all model virtual fields * or false if none $field exist. - * @access public */ - function getVirtualField($field = null) { + public function getVirtualField($field = null) { if ($field == null) { return empty($this->virtualFields) ? false : $this->virtualFields; } @@ -1464,9 +1456,8 @@ function __saveMulti($joined, $id, &$db) { * @param boolean $created True if a new record was created, otherwise only associations with * 'counterScope' defined get updated * @return void - * @access public */ - function updateCounterCache($keys = array(), $created = false) { + public function updateCounterCache($keys = array(), $created = false) { $keys = empty($keys) ? $this->data[$this->alias] : $keys; $keys['old'] = isset($keys['old']) ? $keys['old'] : array(); @@ -1964,9 +1955,8 @@ function __collectForeignKeys($type = 'belongsTo') { * to ascertain the existence of the record in persistent storage. * * @return boolean True if such a record exists - * @access public */ - function exists() { + public function exists() { if ($this->getID() === false) { return false; } @@ -1980,9 +1970,8 @@ function exists() { * * @param array $conditions SQL conditions array * @return boolean True if such a record exists - * @access public */ - function hasAny($conditions = null) { + public function hasAny($conditions = null) { return ($this->find('count', array('conditions' => $conditions, 'recursive' => -1)) != false); } @@ -2339,9 +2328,8 @@ function __filterResults($results, $primary = true) { * to those originally defined in the model. * * @return boolean Success - * @access public */ - function resetAssociations() { + public function resetAssociations() { if (!empty($this->__backAssociation)) { foreach ($this->__associations as $type) { if (isset($this->__backAssociation[$type])) { @@ -2368,9 +2356,8 @@ function resetAssociations() { * @param array $fields Field/value pairs to search (if no values specified, they are pulled from $this->data) * @param boolean $or If false, all fields specified must match in order for a false return value * @return boolean False if any records matching any fields are found - * @access public */ - function isUnique($fields, $or = true) { + public function isUnique($fields, $or = true) { if (!is_array($fields)) { $fields = func_get_args(); if (is_bool($fields[count($fields) - 1])) { @@ -2639,9 +2626,8 @@ function __validateWithModels($options) { * @param string $field The name of the field to invalidate * @param mixed $value Name of validation rule that was not failed, or validation message to * be returned. If no validation key is provided, defaults to true. - * @access public */ - function invalidate($field, $value = true) { + public function invalidate($field, $value = true) { if (!is_array($this->validationErrors)) { $this->validationErrors = array(); } @@ -2653,9 +2639,8 @@ function invalidate($field, $value = true) { * * @param string $field Returns true if the input string ends in "_id" * @return boolean True if the field is a foreign key listed in the belongsTo array. - * @access public */ - function isForeignKey($field) { + public function isForeignKey($field) { $foreignKeys = array(); if (!empty($this->belongsTo)) { foreach ($this->belongsTo as $assoc => $data) { @@ -2672,9 +2657,8 @@ function isForeignKey($field) { * @param string $field Field to escape (e.g: id) * @param string $alias Alias for the model (e.g: Post) * @return string The name of the escaped field for this Model (i.e. id becomes `Post`.`id`). - * @access public */ - function escapeField($field = null, $alias = null) { + public function escapeField($field = null, $alias = null) { if (empty($alias)) { $alias = $this->alias; } @@ -2693,9 +2677,8 @@ function escapeField($field = null, $alias = null) { * * @param integer $list Index on which the composed ID is located * @return mixed The ID of the current record, false if no ID - * @access public */ - function getID($list = 0) { + public function getID($list = 0) { if (empty($this->id) || (is_array($this->id) && isset($this->id[0]) && empty($this->id[0]))) { return false; } @@ -2725,9 +2708,8 @@ function getID($list = 0) { * Returns the ID of the last record this model inserted. * * @return mixed Last inserted ID - * @access public */ - function getLastInsertID() { + public function getLastInsertID() { return $this->getInsertID(); } @@ -2735,9 +2717,8 @@ function getLastInsertID() { * Returns the ID of the last record this model inserted. * * @return mixed Last inserted ID - * @access public */ - function getInsertID() { + public function getInsertID() { return $this->__insertID; } @@ -2745,9 +2726,8 @@ function getInsertID() { * Sets the ID of the last record this model inserted * * @param mixed Last inserted ID - * @access public */ - function setInsertID($id) { + public function setInsertID($id) { $this->__insertID = $id; } @@ -2755,9 +2735,8 @@ function setInsertID($id) { * Returns the number of rows returned from the last query. * * @return int Number of rows - * @access public */ - function getNumRows() { + public function getNumRows() { $db =& ConnectionManager::getDataSource($this->useDbConfig); return $db->lastNumRows(); } @@ -2766,9 +2745,8 @@ function getNumRows() { * Returns the number of rows affected by the last query. * * @return int Number of rows - * @access public */ - function getAffectedRows() { + public function getAffectedRows() { $db =& ConnectionManager::getDataSource($this->useDbConfig); return $db->lastAffected(); } @@ -2778,9 +2756,8 @@ function getAffectedRows() { * * @param string $dataSource The name of the DataSource, as defined in app/config/database.php * @return boolean True on success - * @access public */ - function setDataSource($dataSource = null) { + public function setDataSource($dataSource = null) { $oldConfig = $this->useDbConfig; if ($dataSource != null) { @@ -2807,9 +2784,8 @@ function setDataSource($dataSource = null) { * Not safe for use with some versions of PHP4, because this class is overloaded. * * @return object A DataSource object - * @access public */ - function &getDataSource() { + public function &getDataSource() { $db =& ConnectionManager::getDataSource($this->useDbConfig); return $db; } @@ -2818,9 +2794,8 @@ function &getDataSource() { * Get associations * * @return array - * @access public */ - function associations() { + public function associations() { return $this->__associations; } @@ -2829,9 +2804,8 @@ function associations() { * * @param string $type Only result associations of this type * @return array Associations - * @access public */ - function getAssociated($type = null) { + public function getAssociated($type = null) { if ($type == null) { $associated = array(); foreach ($this->__associations as $assoc) { @@ -2876,9 +2850,8 @@ function getAssociated($type = null) { * @param mixed $with The 'with' key of the model association * @param array $keys Any join keys which must be merged with the keys queried * @return array - * @access public */ - function joinModel($assoc, $keys = array()) { + public function joinModel($assoc, $keys = array()) { if (is_string($assoc)) { return array($assoc, array_keys($this->{$assoc}->schema())); } elseif (is_array($assoc)) { diff --git a/cake/libs/model/model_behavior.php b/cake/libs/model/model_behavior.php index c5eb06d102c..25c06e6ea4a 100644 --- a/cake/libs/model/model_behavior.php +++ b/cake/libs/model/model_behavior.php @@ -58,9 +58,8 @@ class ModelBehavior extends Object { * * @param object $model Model using this behavior * @param array $config Configuration settings for $model - * @access public */ - function setup(&$model, $config = array()) { } + public function setup(&$model, $config = array()) { } /** * Clean up any initialization this behavior has done on a model. Called when a behavior is dynamically @@ -82,9 +81,8 @@ function cleanup(&$model) { * @param object $model Model using this behavior * @param array $queryData Data used to execute this query, i.e. conditions, order, etc. * @return boolean True if the operation should continue, false if it should abort - * @access public */ - function beforeFind(&$model, $query) { } + public function beforeFind(&$model, $query) { } /** * After find callback. Can be used to modify any results returned by find and findAll. @@ -93,36 +91,32 @@ function beforeFind(&$model, $query) { } * @param mixed $results The results of the find operation * @param boolean $primary Whether this model is being queried directly (vs. being queried as an association) * @return mixed Result of the find operation - * @access public */ - function afterFind(&$model, $results, $primary) { } + public function afterFind(&$model, $results, $primary) { } /** * Before validate callback * * @param object $model Model using this behavior * @return boolean True if validate operation should continue, false to abort - * @access public */ - function beforeValidate(&$model) { } + public function beforeValidate(&$model) { } /** * Before save callback * * @param object $model Model using this behavior * @return boolean True if the operation should continue, false if it should abort - * @access public */ - function beforeSave(&$model) { } + public function beforeSave(&$model) { } /** * After save callback * * @param object $model Model using this behavior * @param boolean $created True if this save created a new record - * @access public */ - function afterSave(&$model, $created) { } + public function afterSave(&$model, $created) { } /** * Before delete callback @@ -130,26 +124,23 @@ function afterSave(&$model, $created) { } * @param object $model Model using this behavior * @param boolean $cascade If true records that depend on this record will also be deleted * @return boolean True if the operation should continue, false if it should abort - * @access public */ - function beforeDelete(&$model, $cascade = true) { } + public function beforeDelete(&$model, $cascade = true) { } /** * After delete callback * * @param object $model Model using this behavior - * @access public */ - function afterDelete(&$model) { } + public function afterDelete(&$model) { } /** * DataSource error callback * * @param object $model Model using this behavior * @param string $error Error generated in DataSource - * @access public */ - function onError(&$model, $error) { } + public function onError(&$model, $error) { } /** * Overrides Object::dispatchMethod to account for PHP4's broken reference support @@ -276,9 +267,8 @@ function init($modelName, $behaviors = array()) { * @param string $behavior CamelCased name of the behavior to load * @param array $config Behavior configuration parameters * @return boolean True on success, false on failure - * @access public */ - function attach($behavior, $config = array()) { + public function attach($behavior, $config = array()) { list($plugin, $name) = pluginSplit($behavior); $class = $name . 'Behavior'; @@ -369,9 +359,8 @@ function attach($behavior, $config = array()) { * * @param string $name CamelCased name of the behavior to unload * @return void - * @access public */ - function detach($name) { + public function detach($name) { if (isset($this->{$name})) { $this->{$name}->cleanup(ClassRegistry::getObject($this->modelName)); unset($this->{$name}); @@ -389,9 +378,8 @@ function detach($name) { * * @param mixed $name CamelCased name of the behavior(s) to enable (string or array) * @return void - * @access public */ - function enable($name) { + public function enable($name) { $this->_disabled = array_diff($this->_disabled, (array)$name); } @@ -401,9 +389,8 @@ function enable($name) { * * @param mixed $name CamelCased name of the behavior(s) to disable (string or array) * @return void - * @access public */ - function disable($name) { + public function disable($name) { foreach ((array)$name as $behavior) { if (in_array($behavior, $this->_attached) && !in_array($behavior, $this->_disabled)) { $this->_disabled[] = $behavior; @@ -418,9 +405,8 @@ function disable($name) { * returns an array of currently-enabled behaviors * @return mixed If $name is specified, returns the boolean status of the corresponding behavior. * Otherwise, returns an array of all enabled behaviors. - * @access public */ - function enabled($name = null) { + public function enabled($name = null) { if (!empty($name)) { return (in_array($name, $this->_attached) && !in_array($name, $this->_disabled)); } @@ -431,9 +417,8 @@ function enabled($name = null) { * Dispatches a behavior method * * @return array All methods for all behaviors attached to this object - * @access public */ - function dispatchMethod(&$model, $method, $params = array(), $strict = false) { + public function dispatchMethod(&$model, $method, $params = array(), $strict = false) { $methods = array_keys($this->__methods); foreach ($methods as $key => $value) { $methods[$key] = strtolower($value); @@ -476,9 +461,8 @@ function dispatchMethod(&$model, $method, $params = array(), $strict = false) { * @param array $params * @param array $options * @return mixed - * @access public */ - function trigger(&$model, $callback, $params = array(), $options = array()) { + public function trigger(&$model, $callback, $params = array(), $options = array()) { if (empty($this->_attached)) { return true; } @@ -509,9 +493,8 @@ function trigger(&$model, $callback, $params = array(), $options = array()) { * Gets the method list for attached behaviors, i.e. all public, non-callback methods * * @return array All public methods for all behaviors attached to this collection - * @access public */ - function methods() { + public function methods() { return $this->__methods; } @@ -522,9 +505,8 @@ function methods() { * returns an array of currently-attached behaviors * @return mixed If $name is specified, returns the boolean status of the corresponding behavior. * Otherwise, returns an array of all attached behaviors. - * @access public */ - function attached($name = null) { + public function attached($name = null) { if (!empty($name)) { return (in_array($name, $this->_attached)); } diff --git a/cake/libs/object.php b/cake/libs/object.php index f8034a5aa99..c87c5621e1d 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -59,9 +59,8 @@ function __construct() { * Each class can override this method as necessary. * * @return string The name of this class - * @access public */ - function toString() { + public function toString() { $class = get_class($this); return $class; } @@ -75,9 +74,8 @@ function toString() { * @param array $extra if array includes the key "return" it sets the AutoRender to true. * @return mixed Boolean true or false on success/failure, or contents * of rendered action if 'return' is set in $extra. - * @access public */ - function requestAction($url, $extra = array()) { + public function requestAction($url, $extra = array()) { if (empty($url)) { return false; } @@ -102,9 +100,8 @@ function requestAction($url, $extra = array()) { * @param string $method Name of the method to call * @param array $params Parameter list to use when calling $method * @return mixed Returns the result of the method call - * @access public */ - function dispatchMethod($method, $params = array()) { + public function dispatchMethod($method, $params = array()) { switch (count($params)) { case 0: return $this->{$method}(); @@ -130,9 +127,8 @@ function dispatchMethod($method, $params = array()) { * * @param $status see http://php.net/exit for values * @return void - * @access public */ - function _stop($status = 0) { + public function _stop($status = 0) { exit($status); } @@ -143,9 +139,8 @@ function _stop($status = 0) { * @param string $msg Log message * @param integer $type Error type constant. Defined in app/config/core.php. * @return boolean Success of log write - * @access public */ - function log($msg, $type = LOG_ERROR) { + public function log($msg, $type = LOG_ERROR) { if (!class_exists('CakeLog')) { require LIBS . 'cake_log.php'; } @@ -182,9 +177,8 @@ function _set($properties = array()) { * @param string $method Method to be called in the error class (AppError or ErrorHandler classes) * @param array $messages Message that is to be displayed by the error class * @return error message - * @access public */ - function cakeError($method, $messages = array()) { + public function cakeError($method, $messages = array()) { if (!class_exists('ErrorHandler')) { App::import('Core', 'Error'); diff --git a/cake/libs/overloadable_php4.php b/cake/libs/overloadable_php4.php index 516f7aa6aee..175a9bbf431 100644 --- a/cake/libs/overloadable_php4.php +++ b/cake/libs/overloadable_php4.php @@ -41,9 +41,8 @@ function __construct() { /** * Overload implementation. * - * @access public */ - function overload() { + public function overload() { if (function_exists('overload')) { if (func_num_args() > 0) { foreach (func_get_args() as $class) { @@ -101,9 +100,8 @@ function __construct() { /** * Overload implementation. * - * @access public */ - function overload() { + public function overload() { if (function_exists('overload')) { if (func_num_args() > 0) { foreach (func_get_args() as $class) { diff --git a/cake/libs/overloadable_php5.php b/cake/libs/overloadable_php5.php index 6a768ac0bd0..f70a8373a94 100644 --- a/cake/libs/overloadable_php5.php +++ b/cake/libs/overloadable_php5.php @@ -31,9 +31,8 @@ class Overloadable extends Object { /** * Overload implementation. No need for implementation in PHP5. * - * @access public */ - function overload() { } + public function overload() { } /** * Magic method handler. @@ -63,9 +62,8 @@ class Overloadable2 extends Object { /** * Overload implementation. No need for implementation in PHP5. * - * @access public */ - function overload() { } + public function overload() { } /** * Magic method handler. diff --git a/cake/libs/router.php b/cake/libs/router.php index e8c3c9649d3..eb6e5c6667e 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1286,9 +1286,8 @@ class CakeRoute { * @param array $defaults Array of defaults for the route. * @param string $params Array of parameters and additional options for the Route * @return void - * @access public */ - function CakeRoute($template, $defaults = array(), $options = array()) { + public function CakeRoute($template, $defaults = array(), $options = array()) { $this->template = $template; $this->defaults = (array)$defaults; $this->options = (array)$options; @@ -1298,9 +1297,8 @@ function CakeRoute($template, $defaults = array(), $options = array()) { * Check if a Route has been compiled into a regular expression. * * @return boolean - * @access public */ - function compiled() { + public function compiled() { return !empty($this->_compiledRoute); } @@ -1309,9 +1307,8 @@ function compiled() { * and populates $this->names with the named routing elements. * * @return array Returns a string regular expression of the compiled route. - * @access public */ - function compile() { + public function compile() { if ($this->compiled()) { return $this->_compiledRoute; } @@ -1373,9 +1370,8 @@ function _writeRoute() { * * @param string $url The url to attempt to parse. * @return mixed Boolean false on failure, otherwise an array or parameters - * @access public */ - function parse($url) { + public function parse($url) { if (!$this->compiled()) { $this->compile(); } @@ -1429,9 +1425,8 @@ function parse($url) { * @param array $url The array to apply persistent parameters to. * @param array $params An array of persistent values to replace persistent ones. * @return array An array with persistent parameters applied. - * @access public */ - function persistParams($url, $params) { + public function persistParams($url, $params) { foreach ($this->options['persist'] as $persistKey) { if (array_key_exists($persistKey, $params) && !isset($url[$persistKey])) { $url[$persistKey] = $params[$persistKey]; @@ -1447,9 +1442,8 @@ function persistParams($url, $params) { * * @param array $url An array of parameters to check matching with. * @return mixed Either a string url for the parameters if they match or false. - * @access public */ - function match($url) { + public function match($url) { if (!$this->compiled()) { $this->compile(); } diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 4c2da5e4f95..a53711a6796 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -164,9 +164,8 @@ function stripScripts($str) { * * @param string $str String to sanitize * @return string sanitized string - * @access public */ - function stripAll($str) { + public function stripAll($str) { $str = Sanitize::stripWhitespace($str); $str = Sanitize::stripImages($str); $str = Sanitize::stripScripts($str); diff --git a/cake/libs/validation.php b/cake/libs/validation.php index a7e3aae43a9..ba75979e621 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -116,9 +116,8 @@ function &getInstance() { * * @param mixed $check Value to check * @return boolean Success - * @access public */ - function notEmpty($check) { + public function notEmpty($check) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -144,9 +143,8 @@ function notEmpty($check) { * * @param mixed $check Value to check * @return boolean Success - * @access public */ - function alphaNumeric($check) { + public function alphaNumeric($check) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -171,9 +169,8 @@ function alphaNumeric($check) { * @param integer $min Minimum value in range (inclusive) * @param integer $max Maximum value in range (inclusive) * @return boolean Success - * @access public */ - function between($check, $min, $max) { + public function between($check, $min, $max) { $length = mb_strlen($check); return ($length >= $min && $length <= $max); } @@ -187,9 +184,8 @@ function between($check, $min, $max) { * * @param mixed $check Value to check * @return boolean Success - * @access public */ - function blank($check) { + public function blank($check) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -292,9 +288,8 @@ function cc($check, $type = 'fast', $deep = false, $regex = null) { * less or equal <=, is less <, equal to ==, not equal != * @param integer $check2 only needed if $check1 is a string * @return boolean Success - * @access public */ - function comparison($check1, $operator = null, $check2 = null) { + public function comparison($check1, $operator = null, $check2 = null) { if (is_array($check1)) { extract($check1, EXTR_OVERWRITE); } @@ -352,9 +347,8 @@ function comparison($check1, $operator = null, $check2 = null) { * As and array: array('check' => value, 'regex' => 'valid regular expression') * @param string $regex If $check is passed as a string, $regex must also be set to valid regular expression * @return boolean Success - * @access public */ - function custom($check, $regex = null) { + public function custom($check, $regex = null) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -384,9 +378,8 @@ function custom($check, $regex = null) { * my 12/2006 separators can be a space, period, dash, forward slash * @param string $regex If a custom regular expression is used this is the only validation that will occur. * @return boolean Success - * @access public */ - function date($check, $format = 'ymd', $regex = null) { + public function date($check, $format = 'ymd', $regex = null) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -422,10 +415,9 @@ function date($check, $format = 'ymd', $regex = null) { * * @param string $check a valid time string * @return boolean Success - * @access public */ - function time($check) { + public function time($check) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -438,9 +430,8 @@ function time($check) { * * @param string $check a valid boolean * @return boolean Success - * @access public */ - function boolean($check) { + public function boolean($check) { $booleanList = array(0, 1, '0', '1', true, false); return in_array($check, $booleanList, true); } @@ -453,9 +444,8 @@ function boolean($check) { * @param integer $places if set $check value must have exactly $places after the decimal point * @param string $regex If a custom regular expression is used this is the only validation that will occur. * @return boolean Success - * @access public */ - function decimal($check, $places = null, $regex = null) { + public function decimal($check, $places = null, $regex = null) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->regex = $regex; @@ -478,9 +468,8 @@ function decimal($check, $places = null, $regex = null) { * @param boolean $deep Perform a deeper validation (if true), by also checking availability of host * @param string $regex Regex to use (if none it will use built in regex) * @return boolean Success - * @access public */ - function email($check, $deep = false, $regex = null) { + public function email($check, $deep = false, $regex = null) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -518,9 +507,8 @@ function email($check, $deep = false, $regex = null) { * @param mixed $check Value to check * @param mixed $comparedTo Value to compare * @return boolean Success - * @access public */ - function equalTo($check, $comparedTo) { + public function equalTo($check, $comparedTo) { return ($check === $comparedTo); } @@ -530,9 +518,8 @@ function equalTo($check, $comparedTo) { * @param mixed $check Value to check * @param array $extensions file extenstions to allow * @return boolean Success - * @access public */ - function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) { + public function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) { if (is_array($check)) { return Validation::extension(array_shift($check), $extensions); } @@ -556,9 +543,8 @@ function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) { * @param string $check The string to test. * @param string $type The IP Version to test against * @return boolean Success - * @access public */ - function ip($check, $type = 'both') { + public function ip($check, $type = 'both') { $_this =& Validation::getInstance(); $success = false; $type = strtolower($type); @@ -611,9 +597,8 @@ function _ipv6($check) { * @param string $check The string to test * @param integer $min The minimal string length * @return boolean Success - * @access public */ - function minLength($check, $min) { + public function minLength($check, $min) { $length = mb_strlen($check); return ($length >= $min); } @@ -624,9 +609,8 @@ function minLength($check, $min) { * @param string $check The string to test * @param integer $max The maximal string length * @return boolean Success - * @access public */ - function maxLength($check, $max) { + public function maxLength($check, $max) { $length = mb_strlen($check); return ($length <= $max); } @@ -637,9 +621,8 @@ function maxLength($check, $max) { * @param string $check Value to check * @param string $symbolPosition Where symbol is located (left/right) * @return boolean Success - * @access public */ - function money($check, $symbolPosition = 'left') { + public function money($check, $symbolPosition = 'left') { $_this =& Validation::getInstance(); $_this->check = $check; @@ -663,9 +646,8 @@ function money($check, $symbolPosition = 'left') { * @param mixed $check Value to check * @param mixed $options Options for the check. * @return boolean Success - * @access public */ - function multiple($check, $options = array()) { + public function multiple($check, $options = array()) { $defaults = array('in' => null, 'max' => null, 'min' => null); $options = array_merge($defaults, $options); $check = array_filter((array)$check); @@ -693,9 +675,8 @@ function multiple($check, $options = array()) { * * @param string $check Value to check * @return boolean Succcess - * @access public */ - function numeric($check) { + public function numeric($check) { return is_numeric($check); } @@ -706,9 +687,8 @@ function numeric($check) { * @param string $regex Regular expression to use * @param string $country Country code (defaults to 'all') * @return boolean Success - * @access public */ - function phone($check, $regex = null, $country = 'all') { + public function phone($check, $regex = null, $country = 'all') { $_this =& Validation::getInstance(); $_this->check = $check; $_this->regex = $regex; @@ -740,9 +720,8 @@ function phone($check, $regex = null, $country = 'all') { * @param string $regex Regular expression to use * @param string $country Country to use for formatting * @return boolean Success - * @access public */ - function postal($check, $regex = null, $country = null) { + public function postal($check, $regex = null, $country = null) { $_this =& Validation::getInstance(); $_this->check = $check; $_this->regex = $regex; @@ -789,9 +768,8 @@ function postal($check, $regex = null, $country = null) { * @param integer $lower Lower limit * @param integer $upper Upper limit * @return boolean Success - * @access public */ - function range($check, $lower = null, $upper = null) { + public function range($check, $lower = null, $upper = null) { if (!is_numeric($check)) { return false; } @@ -808,9 +786,8 @@ function range($check, $lower = null, $upper = null) { * @param string $regex Regular expression to use * @param string $country Country * @return boolean Success - * @access public */ - function ssn($check, $regex = null, $country = null) { + public function ssn($check, $regex = null, $country = null) { $_this =& Validation::getInstance(); $_this->check = $check; $_this->regex = $regex; @@ -843,9 +820,8 @@ function ssn($check, $regex = null, $country = null) { * * @param string $check Value to check * @return boolean Success - * @access public */ - function uuid($check) { + public function uuid($check) { $_this =& Validation::getInstance(); $_this->check = $check; $_this->regex = '/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i'; @@ -868,9 +844,8 @@ function uuid($check) { * @param string $check Value to check * @param boolean $strict Require URL to be prefixed by a valid scheme (one of http(s)/ftp(s)/file/news/gopher) * @return boolean Success - * @access public */ - function url($check, $strict = false) { + public function url($check, $strict = false) { $_this =& Validation::getInstance(); $_this->__populateIp(); $_this->check = $check; @@ -890,9 +865,8 @@ function url($check, $strict = false) { * @param string $check Value to check * @param array $list List to check against * @return boolean Succcess - * @access public */ - function inList($check, $list) { + public function inList($check, $list) { return in_array($check, $list); } @@ -904,9 +878,8 @@ function inList($check, $list) { * @param string $method class method name for validation to run * @param array $args arguments to send to method * @return mixed user-defined class class method returns - * @access public */ - function userDefined($check, $object, $method, $args = null) { + public function userDefined($check, $object, $method, $args = null) { return call_user_func_array(array(&$object, $method), array($check, $args)); } diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 72b4b7f3036..714dace7e79 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -159,9 +159,8 @@ function call__($method, $params) { * * @param $name file name inside app/config to load. * @return array merged tags from config/$name.php - * @access public */ - function loadConfig($name = 'tags') { + public function loadConfig($name = 'tags') { if (file_exists(CONFIGS . $name .'.php')) { require(CONFIGS . $name .'.php'); if (isset($tags)) { @@ -181,9 +180,8 @@ function loadConfig($name = 'tags') { * the reverse routing features of CakePHP. * @param boolean $full If true, the full base URL will be prepended to the result * @return string Full translated URL with base path. - * @access public */ - function url($url = null, $full = false) { + public function url($url = null, $full = false) { return h(Router::url($url, $full)); } @@ -192,9 +190,8 @@ function url($url = null, $full = false) { * * @param string $file The file to create a webroot path to. * @return string Web accessible path to file. - * @access public */ - function webroot($file) { + public function webroot($file) { $asset = explode('?', $file); $asset[1] = isset($asset[1]) ? '?' . $asset[1] : null; $webPath = "{$this->webroot}" . $asset[0]; @@ -236,9 +233,8 @@ function webroot($file) { * * @param string $path The file path to timestamp, the path must be inside WWW_ROOT * @return string Path with a timestamp added, or not. - * @access public */ - function assetTimestamp($path) { + public function assetTimestamp($path) { $timestampEnabled = ( (Configure::read('Asset.timestamp') === true && Configure::read() > 0) || Configure::read('Asset.timestamp') === 'force' @@ -256,9 +252,8 @@ function assetTimestamp($path) { * * @param mixed $output Either an array of strings to clean or a single string to clean. * @return cleaned content for output - * @access public */ - function clean($output) { + public function clean($output) { $this->__reset(); if (empty($output)) { return null; @@ -311,9 +306,8 @@ function clean($output) { * @param string $insertBefore String to be inserted before options. * @param string $insertAfter String to be inserted after options. * @return string Composed attributes. - * @access public */ - function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) { + public function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) { if (is_array($options)) { $options = array_merge(array('escape' => true), $options); @@ -371,9 +365,8 @@ function __formatAttribute($key, $value, $escape = true) { * @param mixed $entity A field name, like "ModelName.fieldName" or "ModelName.ID.fieldName" * @param boolean $setScope Sets the view scope to the model specified in $tagValue * @return void - * @access public */ - function setEntity($entity, $setScope = false) { + public function setEntity($entity, $setScope = false) { $view =& ClassRegistry::getObject('view'); if ($setScope) { @@ -517,9 +510,8 @@ function setEntity($entity, $setScope = false) { * Gets the currently-used model of the rendering context. * * @return string - * @access public */ - function model() { + public function model() { $view =& ClassRegistry::getObject('view'); if (!empty($view->association)) { return $view->association; @@ -532,9 +524,8 @@ function model() { * Gets the ID of the currently-used model of the rendering context. * * @return mixed - * @access public */ - function modelID() { + public function modelID() { $view =& ClassRegistry::getObject('view'); return $view->modelId; } @@ -543,9 +534,8 @@ function modelID() { * Gets the currently-used model field of the rendering context. * * @return string - * @access public */ - function field() { + public function field() { $view =& ClassRegistry::getObject('view'); return $view->field; } @@ -747,9 +737,8 @@ function _initInputField($field, $options = array()) { * @param string $class The classname being added. * @param string $key the key to use for class. * @return array Array of options with $key set. - * @access public */ - function addClass($options = array(), $class = null, $key = 'class') { + public function addClass($options = array(), $class = null, $key = 'class') { if (isset($options[$key]) && trim($options[$key]) != '') { $options[$key] .= ' ' . $class; } else { @@ -777,9 +766,8 @@ function output($str) { * Overridden in subclasses. * * @return void - * @access public */ - function beforeRender() { + public function beforeRender() { } /** @@ -789,9 +777,8 @@ function beforeRender() { * Overridden in subclasses. * * @return void - * @access public */ - function afterRender() { + public function afterRender() { } /** @@ -800,9 +787,8 @@ function afterRender() { * Overridden in subclasses. * * @return void - * @access public */ - function beforeLayout() { + public function beforeLayout() { } /** @@ -811,9 +797,8 @@ function beforeLayout() { * Overridden in subclasses. * * @return void - * @access public */ - function afterLayout() { + public function afterLayout() { } /** diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index bbac4998bab..840cd9e9ff9 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -986,9 +986,8 @@ function _optionsToString($options, $stringOpts = array()) { * Executed after a view has rendered, used to include bufferred code * blocks. * - * @access public */ - function afterRender() { + public function afterRender() { if (env('HTTP_X_UPDATE') != null && !empty($this->__ajaxBuffer)) { @ob_end_clean(); diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 28f761f1643..1e612c157be 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -336,9 +336,8 @@ function create($model = null, $options = array()) { * * @param mixed $options as a string will use $options as the value of button, * @return string a closing FORM tag optional submit button. - * @access public */ - function end($options = null) { + public function end($options = null) { if (!empty($this->params['models'])) { $models = $this->params['models'][0]; } @@ -379,9 +378,8 @@ function end($options = null) { * * @param array $fields The list of fields to use when generating the hash * @return string A hidden input field with a security hash - * @access public */ - function secure($fields = array()) { + public function secure($fields = array()) { if (!isset($this->params['_Token']) || empty($this->params['_Token'])) { return; } @@ -447,9 +445,8 @@ function __secure($field = null, $value = null) { * * @param string $field This should be "Modelname.fieldname" * @return boolean If there are errors this method returns true, else false. - * @access public */ - function isFieldError($field) { + public function isFieldError($field) { $this->setEntity($field); return (bool)$this->tagIsInvalid(); } @@ -468,9 +465,8 @@ function isFieldError($field) { * @param mixed $text Error message or array of $options * @param array $options Rendering options for
wrapper tag * @return string If there are errors this method returns an error message, otherwise null. - * @access public */ - function error($field, $text = null, $options = array()) { + public function error($field, $text = null, $options = array()) { $defaults = array('wrap' => true, 'class' => 'error-message', 'escape' => true); $options = array_merge($defaults, $options); $this->setEntity($field); @@ -578,9 +574,8 @@ function label($fieldName = null, $text = null, $options = array()) { * @param mixed $fields An array of fields to generate inputs for, or null. * @param array $blacklist a simple array of fields to not create inputs for. * @return string Completed form inputs. - * @access public */ - function inputs($fields = null, $blacklist = null) { + public function inputs($fields = null, $blacklist = null) { $fieldset = $legend = true; $model = $this->model(); if (is_array($fields)) { @@ -680,9 +675,8 @@ function inputs($fields = null, $blacklist = null) { * @param string $fieldName This should be "Modelname.fieldname" * @param array $options Each type of input takes different options. * @return string Completed form widget. - * @access public */ - function input($fieldName, $options = array()) { + public function input($fieldName, $options = array()) { $this->setEntity($fieldName); $options = array_merge( @@ -973,9 +967,8 @@ function _inputLabel($fieldName, $label, $options) { * @param string $fieldName Name of a field, like this "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string An HTML text input element. - * @access public */ - function checkbox($fieldName, $options = array()) { + public function checkbox($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options) + array('hiddenField' => true); $value = current($this->value()); $output = ""; @@ -1021,9 +1014,8 @@ function checkbox($fieldName, $options = array()) { * @param array $options Radio button options array. * @param array $attributes Array of HTML attributes, and special attributes above. * @return string Completed radio widget set. - * @access public */ - function radio($fieldName, $options = array(), $attributes = array()) { + public function radio($fieldName, $options = array(), $attributes = array()) { $attributes = $this->_initInputField($fieldName, $attributes); $legend = false; @@ -1104,9 +1096,8 @@ function radio($fieldName, $options = array(), $attributes = array()) { * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string A generated HTML text input element - * @access public */ - function text($fieldName, $options = array()) { + public function text($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, array_merge( array('type' => 'text'), $options )); @@ -1123,9 +1114,8 @@ function text($fieldName, $options = array()) { * @param string $fieldName Name of a field, like in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string A generated password input. - * @access public */ - function password($fieldName, $options = array()) { + public function password($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options); return sprintf( $this->Html->tags['password'], @@ -1144,9 +1134,8 @@ function password($fieldName, $options = array()) { * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes, and special options above. * @return string A generated HTML text input element - * @access public */ - function textarea($fieldName, $options = array()) { + public function textarea($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options); $value = null; @@ -1171,9 +1160,8 @@ function textarea($fieldName, $options = array()) { * @param string $fieldName Name of a field, in the form of "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string A generated hidden input - * @access public */ - function hidden($fieldName, $options = array()) { + public function hidden($fieldName, $options = array()) { $secure = true; if (isset($options['secure'])) { @@ -1202,9 +1190,8 @@ function hidden($fieldName, $options = array()) { * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string A generated file input. - * @access public */ - function file($fieldName, $options = array()) { + public function file($fieldName, $options = array()) { $options = array_merge($options, array('secure' => false)); $options = $this->_initInputField($fieldName, $options); $view =& ClassRegistry::getObject('view'); @@ -1229,9 +1216,8 @@ function file($fieldName, $options = array()) { * @param string $title The button's caption. Not automatically HTML encoded * @param array $options Array of options and HTML attributes. * @return string A HTML button tag. - * @access public */ - function button($title, $options = array()) { + public function button($title, $options = array()) { $options += array('type' => 'submit', 'escape' => false); if ($options['escape']) { $title = h($title); @@ -1270,9 +1256,8 @@ function button($title, $options = array()) { * OR if the first character is not /, image is relative to webroot/img. * @param array $options Array of options. See above. * @return string A HTML submit button - * @access public */ - function submit($caption = null, $options = array()) { + public function submit($caption = null, $options = array()) { if (!$caption) { $caption = __('Submit', true); } @@ -1381,9 +1366,8 @@ function submit($caption = null, $options = array()) { * from POST data will be used when available. * @param array $attributes The HTML attributes of the select element. * @return string Formatted SELECT element - * @access public */ - function select($fieldName, $options = array(), $selected = null, $attributes = array()) { + public function select($fieldName, $options = array(), $selected = null, $attributes = array()) { $select = array(); $showParents = false; $escapeOptions = true; @@ -1479,9 +1463,8 @@ function select($fieldName, $options = array(), $selected = null, $attributes = * @param string $selected Option which is selected. * @param array $attributes HTML attributes for the select element * @return string A generated day select box. - * @access public */ - function day($fieldName, $selected = null, $attributes = array()) { + public function day($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); $selected = $this->__dateTimeSelected('day', $fieldName, $selected, $attributes); @@ -1509,9 +1492,8 @@ function day($fieldName, $selected = null, $attributes = array()) { * @param string $selected Option which is selected. * @param array $attributes Attribute array for the select elements. * @return string Completed year select input - * @access public */ - function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array()) { + public function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array()) { $attributes += array('empty' => true); if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) { if (is_array($value)) { @@ -1561,9 +1543,8 @@ function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $a * @param string $selected Option which is selected. * @param array $attributes Attributes for the select element * @return string A generated month select dropdown. - * @access public */ - function month($fieldName, $selected = null, $attributes = array()) { + public function month($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); $selected = $this->__dateTimeSelected('month', $fieldName, $selected, $attributes); @@ -1597,9 +1578,8 @@ function month($fieldName, $selected = null, $attributes = array()) { * @param string $selected Option which is selected. * @param array $attributes List of HTML attributes * @return string Completed hour select input - * @access public */ - function hour($fieldName, $format24Hours = false, $selected = null, $attributes = array()) { + public function hour($fieldName, $format24Hours = false, $selected = null, $attributes = array()) { $attributes += array('empty' => true); $selected = $this->__dateTimeSelected('hour', $fieldName, $selected, $attributes); @@ -1631,9 +1611,8 @@ function hour($fieldName, $format24Hours = false, $selected = null, $attributes * @param string $selected Option which is selected. * @param string $attributes Array of Attributes * @return string Completed minute select input. - * @access public */ - function minute($fieldName, $selected = null, $attributes = array()) { + public function minute($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); $selected = $this->__dateTimeSelected('min', $fieldName, $selected, $attributes); @@ -1694,9 +1673,8 @@ function __dateTimeSelected($select, $fieldName, $selected, $attributes) { * @param string $attributes Array of Attributes * @param bool $showEmpty Show/Hide an empty option * @return string Completed meridian select input - * @access public */ - function meridian($fieldName, $selected = null, $attributes = array()) { + public function meridian($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) { if (is_array($value)) { @@ -1742,9 +1720,8 @@ function meridian($fieldName, $selected = null, $attributes = array()) { * @param string $selected Option which is selected. * @param string $attributes array of Attributes * @return string Generated set of select boxes for the date and time formats chosen. - * @access public */ - function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $selected = null, $attributes = array()) { + public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $selected = null, $attributes = array()) { $attributes += array('empty' => true); $year = $month = $day = $hour = $min = $meridian = null; diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 0ec9a0d51b1..e2d88963544 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -137,9 +137,8 @@ class HtmlHelper extends AppHelper { * @param mixed $options Link attributes e.g. array('id'=>'selected') * @return void * @see HtmlHelper::link() for details on $options that can be used. - * @access public */ - function addCrumb($name, $link = null, $options = null) { + public function addCrumb($name, $link = null, $options = null) { $this->_crumbs[] = array($name, $link, $options); } @@ -158,9 +157,8 @@ function addCrumb($name, $link = null, $options = null) { * * @param string $type Doctype to use. * @return string Doctype string - * @access public */ - function docType($type = 'xhtml-strict') { + public function docType($type = 'xhtml-strict') { if (isset($this->__docTypes[$type])) { return $this->__docTypes[$type]; } @@ -179,9 +177,8 @@ function docType($type = 'xhtml-strict') { * @param array $options Other attributes for the generated tag. If the type attribute is html, * rss, atom, or icon, the mime-type is returned. * @return string A completed `` element. - * @access public */ - function meta($type, $url = null, $options = array()) { + public function meta($type, $url = null, $options = array()) { $inline = isset($options['inline']) ? $options['inline'] : true; unset($options['inline']); @@ -244,9 +241,8 @@ function meta($type, $url = null, $options = array()) { * @param string $charset The character set to be used in the meta tag. If empty, * The App.encoding value will be used. Example: "utf-8". * @return string A meta tag containing the specified character set. - * @access public */ - function charset($charset = null) { + public function charset($charset = null) { if (empty($charset)) { $charset = strtolower(Configure::read('App.encoding')); } @@ -271,9 +267,8 @@ function charset($charset = null) { * @param array $options Array of HTML attributes. * @param string $confirmMessage JavaScript confirmation message. * @return string An `` element. - * @access public */ - function link($title, $url = null, $options = array(), $confirmMessage = false) { + public function link($title, $url = null, $options = array(), $confirmMessage = false) { $escapeTitle = true; if ($url !== null) { $url = $this->url($url); @@ -325,9 +320,8 @@ function link($title, $url = null, $options = array(), $confirmMessage = false) * @param string $rel Rel attribute. Defaults to "stylesheet". If equal to 'import' the stylesheet will be imported. * @param array $options Array of HTML attributes. * @return string CSS or