Adding documentation to classes belonging to Cake console.

Standarizing on datatypes used in phpdocblocs and removing unneeded @return types

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5851 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-10-22 05:52:20 +00:00
parent 7bc3e307b7
commit 897825d596
91 changed files with 806 additions and 661 deletions

View file

@ -136,7 +136,7 @@
* from a plugin, e.g: plugin.MyView
*
* @param string $viewClass Name of the view class to load (camelized)
* @return boolean Success
* @return bool Success
*/
function loadView($viewClass) {
if (strpos($viewClass, '.') !== false) {
@ -175,7 +175,7 @@
* to load a model located inside a plugin folder.
*
* @param $name Name of model to load
* @return boolean Success
* @return bool Success
*/
function loadModel($name = null) {
if (!class_exists('Model')) {
@ -327,7 +327,7 @@
* Loads a controller and its helper libraries.
*
* @param string $name Name of controller
* @return boolean Success
* @return bool Success
*/
function loadController($name) {
if (!class_exists('AppController')) {
@ -425,7 +425,7 @@
*
* @param string $plugin Name of plugin
* @param string $controller Name of controller to load
* @return boolean Success
* @return bool Success
* @deprecated
*/
function loadPluginController($plugin, $controller) {
@ -471,7 +471,7 @@
* Loads a helper
*
* @param string $name Name of helper
* @return boolean Success
* @return bool Success
*/
function loadHelper($name) {
if (!class_exists('AppHelper')) {
@ -532,7 +532,7 @@
*
* @param string $plugin Name of plugin
* @param string $helper Name of helper to load
* @return boolean Success
* @return bool Success
* @deprecated
*/
function loadPluginHelper($plugin, $helper) {
@ -554,7 +554,7 @@
* Loads a component
*
* @param string $name Name of component
* @return boolean Success
* @return bool Success
*/
function loadComponent($name) {
if ($name === null) {
@ -606,7 +606,7 @@
*
* @param string $plugin Name of plugin
* @param string $helper Name of component to load
* @return boolean Success
* @return bool Success
* @deprecated
*/
function loadPluginComponent($plugin, $component) {
@ -626,7 +626,7 @@
* Loads a behavior
*
* @param string $name Name of behavior
* @return boolean Success
* @return bool Success
*/
function loadBehavior($name) {
if ($name === null) {
@ -684,7 +684,7 @@
* config('config1', 'config2');
* </code>
*
* @return boolean Success
* @return bool Success
*/
function config() {
$args = func_get_args();
@ -761,9 +761,9 @@
*
* Only runs if debug level is non-zero.
*
* @param boolean $var Variable to show debug information for.
* @param boolean $showHtml If set to true, the method prints the debug data in a screen-friendly way.
* @param boolean $showFrom If set to true, the method prints from where the function was called.
* @param bool $var Variable to show debug information for.
* @param bool $showHtml If set to true, the method prints the debug data in a screen-friendly way.
* @param bool $showFrom If set to true, the method prints from where the function was called.
*/
function debug($var = false, $showHtml = false, $showFrom = true) {
if (Configure::read() > 0) {
@ -799,7 +799,7 @@
* @param array $array Array to sort
* @param string $sortby Sort by this key
* @param string $order Sort order asc/desc (ascending or descending).
* @param integer $type Type of sorting to perform
* @param int $type Type of sorting to perform
* @return mixed Sorted array
*/
if (!function_exists('sortByKey')) {
@ -954,7 +954,7 @@
*
* @see debug()
* @param array $var Variable to print out
* @param boolean $showFrom If set to true, the method prints from where the function was called
* @param bool $showFrom If set to true, the method prints from where the function was called
*/
function pr($var) {
if (Configure::read() > 0) {
@ -1092,7 +1092,7 @@
*
* @param string $fileName File name.
* @param mixed $data String or array.
* @return boolean Success
* @return bool Success
*/
if (!function_exists('file_put_contents')) {
function file_put_contents($fileName, $data) {
@ -1255,7 +1255,7 @@
* Returns a translated string if one is found, or the submitted message if not found.
*
* @param string $singular Text to translate
* @param boolean $return Set to true to return translated string, or false to echo
* @param bool $return Set to true to return translated string, or false to echo
* @return mixed translated string if $return is false string will be echoed
*/
function __($singular, $return = false) {
@ -1278,8 +1278,8 @@
*
* @param string $singular Singular text to translate
* @param string $plural Plural text
* @param integer $count Count
* @param boolean $return true to return, false to echo
* @param int $count Count
* @param bool $return true to return, false to echo
* @return mixed plural form of translated string if $return is false string will be echoed
*/
function __n($singular, $plural, $count, $return = false) {
@ -1324,8 +1324,8 @@
* @param string $domain Domain
* @param string $singular Singular string to translate
* @param string $plural Plural
* @param integer $count Count
* @param boolean $return true to return, false to echo
* @param int $count Count
* @param bool $return true to return, false to echo
* @return plural form of translated string if $return is false string will be echoed
*/
function __dn($domain, $singular, $plural, $count, $return = false) {
@ -1358,8 +1358,8 @@
*
* @param string $domain Domain
* @param string $msg Message to translate
* @param integer $category Category
* @param boolean $return true to return, false to echo
* @param int $category Category
* @param bool $return true to return, false to echo
* @return translated string if $return is false string will be echoed
*/
function __dc($domain, $msg, $category, $return = false) {
@ -1395,9 +1395,9 @@
* @param string $domain Domain
* @param string $singular Singular string to translate
* @param string $plural Plural
* @param integer $count Count
* @param integer $category Category
* @param boolean $return true to return, false to echo
* @param int $count Count
* @param int $category Category
* @param bool $return true to return, false to echo
* @return plural form of translated string if $return is false string will be echoed
*/
function __dcn($domain, $singular, $plural, $count, $category, $return = false) {
@ -1426,7 +1426,7 @@
* LC_ALL 6
*
* @param string $msg String to translate
* @param integer $category Category
* @param int $category Category
* @param string $return true to return, false to echo
* @return translated string if $return is false string will be echoed
*/

View file

@ -111,7 +111,6 @@ class ShellDispatcher {
* @access public
*/
var $shellName = null;
/**
* Constructs this ShellDispatcher instance.
*
@ -120,7 +119,6 @@ class ShellDispatcher {
function ShellDispatcher($args = array()) {
$this->__construct($args);
}
/**
* Constructor
*
@ -198,7 +196,7 @@ class ShellDispatcher {
/**
* Initializes the environment and loads the Cake core.
*
* @return boolean Success.
* @return bool Success.
* @access private
*/
function __bootstrap() {
@ -379,7 +377,7 @@ class ShellDispatcher {
* Outputs to the stdout filehandle.
*
* @param string $string String to output.
* @param boolean $newline If true, the outputs gets an added newline.
* @param bool $newline If true, the outputs gets an added newline.
* @access public
*/
function stdout($string, $newline = true) {
@ -442,7 +440,7 @@ class ShellDispatcher {
/**
* Removes first argument and shifts other arguments up
*
* @return boolean False if there are no arguments
* @return bool False if there are no arguments
* @access public
*/
function shiftArgs() {

View file

@ -234,7 +234,7 @@ class ErrorHandler extends Object {
* Outputs to the stdout filehandle.
*
* @param string $string String to output.
* @param boolean $newline If true, the outputs gets an added newline.
* @param bool $newline If true, the outputs gets an added newline.
* @access public
*/
function stdout($string, $newline = true) {

View file

@ -368,7 +368,6 @@ class AclShell extends Shell {
$this->out("\n" . __("Done.", true), true);
}
/**
* Show help screen.
*
@ -454,7 +453,7 @@ class AclShell extends Shell {
*
* @param string $type Node type (ARO/ACO)
* @param int $id Node id
* @return boolean Success
* @return bool Success
* @access public
*/
function nodeExists() {

View file

@ -38,6 +38,7 @@ class ApiShell extends Shell {
* Map between short name for paths and real paths.
*
* @var array
* @access public
*/
var $paths = array();
/**

View file

@ -35,9 +35,18 @@
* @subpackage cake.cake.console.libs
*/
class BakeShell extends Shell {
/**
* Contains tasks to load and instantiate
*
* @var array
* @access public
*/
var $tasks = array('Project', 'DbConfig', 'Model', 'Controller', 'View');
/**
* Override main() to handle action
*
* @access public
*/
function main() {
if (!is_dir(CONFIGS)) {
@ -87,7 +96,7 @@ class BakeShell extends Shell {
/**
* Displays help contents
*
* @return void
* @access public
*/
function help() {
$this->out('CakePHP Bake:');

View file

@ -31,9 +31,32 @@
* @subpackage cake.cake.console.libs
*/
class ConsoleShell extends Shell {
/**
* Available binding types
*
* @var array
* @access public
*/
var $associations = array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany');
/**
* Chars that describe invalid commands
*
* @var array
* @access public
*/
var $badCommandChars = array('$', ';');
/**
* Available models
*
* @var array
* @access public
*/
var $models = array();
/**
* Override intialize of the Shell
*
* @access public
*/
function initialize() {
$this->models = @loadModels();
foreach ($this->models as $model) {
@ -48,9 +71,12 @@ class ConsoleShell extends Shell {
$this->out(" - {$model}");
}
}
/**
* Override main() to handle action
*
* @access public
*/
function main() {
while (true) {
$command = trim($this->in(''));
@ -101,7 +127,7 @@ class ConsoleShell extends Shell {
$association = $tmp[2];
$modelB = $tmp[3];
if ($this->isValidModel($modelA) && $this->isValidModel($modelB) && in_array($association, $this->associations)) {
if ($this->__isValidModel($modelA) && $this->__isValidModel($modelB) && in_array($association, $this->associations)) {
$this->{$modelA}->bindModel(array($association => array($modelB => array('className' => $modelB))), false);
$this->out("Created $association association between $modelA and $modelB");
} else {
@ -128,7 +154,7 @@ class ConsoleShell extends Shell {
}
}
if ($this->isValidModel($modelA) && $this->isValidModel($modelB) && in_array($association, $this->associations) && $validCurrentAssociation) {
if ($this->__isValidModel($modelA) && $this->__isValidModel($modelB) && in_array($association, $this->associations) && $validCurrentAssociation) {
$this->{$modelA}->unbindModel(array($association => array($modelB)));
$this->out("Removed $association association between $modelA and $modelB");
} else {
@ -143,7 +169,7 @@ class ConsoleShell extends Shell {
// Do we have a valid model?
list($modelToCheck, $tmp) = explode('->', $command);
if ($this->isValidModel($modelToCheck)) {
if ($this->__isValidModel($modelToCheck)) {
$findCommand = "\$data = \$this->$command;";
@eval($findCommand);
@ -195,7 +221,7 @@ class ConsoleShell extends Shell {
$command = str_replace($this->badCommandChars, "", $command);
list($modelToSave, $tmp) = explode("->", $command);
if ($this->isValidModel($modelToSave)) {
if ($this->__isValidModel($modelToSave)) {
// Extract the array of data we are trying to build
list($foo, $data) = explode("->save", $command);
$badChars = array("(", ")");
@ -209,7 +235,7 @@ class ConsoleShell extends Shell {
case (preg_match("/^(\w+) columns/", $command, $tmp) == true):
$modelToCheck = strip_tags(str_replace($this->badCommandChars, "", $tmp[1]));
if ($this->isValidModel($modelToCheck)) {
if ($this->__isValidModel($modelToCheck)) {
// Get the column info for this model
$fieldsCommand = "\$data = \$this->{$modelToCheck}->getColumnTypes();";
@eval($fieldsCommand);
@ -229,14 +255,15 @@ class ConsoleShell extends Shell {
}
}
}
function isValidModel($modelToCheck)
{
if (in_array($modelToCheck, $this->models)) {
return true;
} else {
return false;
}
/**
* Tells if the specified model is included in the list of available models
*
* @param string $modelToCheck
* @return bool true if is an available model, false otherwise
* @access private
*/
function __isValidModel($modelToCheck) {
return in_array($modelToCheck, $this->models);
}
}
?>

View file

@ -39,7 +39,6 @@ class SchemaShell extends Shell {
* Override initialize
*
* @access public
* @return void
*/
function initialize() {
$this->out('Cake Schema Shell');
@ -49,7 +48,6 @@ class SchemaShell extends Shell {
* Override startup
*
* @access public
* @return void
*/
function startup() {
$settings = am(array('path'=> CONFIGS .'sql'), $this->params);
@ -59,7 +57,6 @@ class SchemaShell extends Shell {
* Override main
*
* @access public
* @return void
*/
function main() {
$this->help();
@ -69,7 +66,6 @@ class SchemaShell extends Shell {
* path to read as second arg
*
* @access public
* @return void
*/
function view() {
$File = new File($this->Schema->path . DS .'schema.php');
@ -86,7 +82,6 @@ class SchemaShell extends Shell {
* accepts a connection as first arg or path to save as second arg
*
* @access public
* @return void
*/
function generate() {
$this->out('Generating Schema...');
@ -105,7 +100,6 @@ class SchemaShell extends Shell {
* or it will output sql
*
* @access public
* @return void
*/
function dump() {
$write = false;
@ -140,11 +134,9 @@ class SchemaShell extends Shell {
* Create database from Schema object
*
* @access public
* @return void
*/
function create() {
$Schema = $this->Schema->load();
$table = null;
$event = array_keys($Schema->tables);
if(isset($this->args[0])) {
@ -182,10 +174,8 @@ class SchemaShell extends Shell {
* Update database with Schema object
*
* @access public
* @return void
*/
function update() {
$this->out('Comparing Database to Schema...');
$Old = $this->Schema->read();
$Schema = $this->Schema->load();
@ -227,7 +217,7 @@ class SchemaShell extends Shell {
/**
* Displays help contents
*
* @return void
* @access public
*/
function help() {
$this->out('The Schema Shell generates a schema object from the database and updates the database from the schema.');

View file

@ -34,17 +34,18 @@ require_once CAKE . 'console' . DS . 'error.php';
* @subpackage cake.cake.console.libs
*/
class Shell extends Object {
/**
* ShellDispatcher object
* An instance of the ShellDispatcher object that loaded this script
*
* @var object An instance of the ShellDispatcher object that loaded this script
* @var object
* @access public
*/
var $Dispatch = null;
/**
* If true, the script will ask for permission to perform actions.
*
* @var boolean
* @access public
*/
var $interactive = true;
/**
@ -52,60 +53,70 @@ class Shell extends Object {
* or the app does not exist.
*
* @var object
* @access public
*/
var $dbConfig = null;
var $DbConfig = null;
/**
* Contains command switches parsed from the command line.
*
* @var array
* @access public
*/
var $params = array();
/**
* Contains arguments parsed from the command line.
*
* @var array
* @access public
*/
var $args = array();
/**
* The file name of the shell that was invoked.
*
* @var string
* @access public
*/
var $shell = null;
/**
* The class name of the shell that was invoked.
*
* @var string
* @access public
*/
var $className = null;
/**
* The command called if public methods are available.
*
* @var string
* @access public
*/
var $command = null;
/**
* The name of the shell in camelized.
*
* @var string
* @access public
*/
var $name = null;
/**
* Contains tasks to load and instantiate
*
* @var array
* @access public
*/
var $tasks = array();
/**
* Contains the loaded tasks
*
* @var array
* @access public
*/
var $taskNames = array();
/**
* Contains models to load and instantiate
*
* @var array
* @access public
*/
var $uses = array();
/**
@ -138,7 +149,7 @@ class Shell extends Object {
* acts as constructor for subclasses
* allows configuration of tasks prior to shell execution
*
* @return void
* @access public
*/
function initialize() {
$this->_loadModels();
@ -148,7 +159,7 @@ class Shell extends Object {
* allows for checking and configuring prior to command or main execution
* can be overriden in subclasses
*
* @return void
* @access public
*/
function startup() {
$this->_welcome();
@ -156,7 +167,7 @@ class Shell extends Object {
/**
* Displays a header for the shell
*
* @return void
* @access protected
*/
function _welcome() {
$this->out('App : '. APP_DIR);
@ -165,16 +176,15 @@ class Shell extends Object {
}
/**
* Loads database file and constructs DATABASE_CONFIG class
* makes $this->dbConfig available to subclasses
* makes $this->DbConfig available to subclasses
*
* @return bool
* @access protected
*/
function _loadDbConfig() {
if (config('database')) {
if (class_exists('DATABASE_CONFIG')) {
$this->dbConfig = new DATABASE_CONFIG();
return true;
}
if (config('database') && class_exists('DATABASE_CONFIG')) {
$this->DbConfig =& new DATABASE_CONFIG();
return true;
}
$this->err('Database config could not be loaded');
$this->out('Run \'bake\' to create the database configuration');
@ -187,9 +197,9 @@ class Shell extends Object {
* if var $uses is an array of models will load those models
*
* @return bool
* @access protected
*/
function _loadModels() {
if ($this->uses === null || $this->uses === false) {
return;
}
@ -230,6 +240,7 @@ class Shell extends Object {
* Loads tasks defined in var $tasks
*
* @return bool
* @access public
*/
function loadTasks() {
if ($this->tasks === null || $this->tasks === false) {
@ -297,6 +308,7 @@ class Shell extends Object {
* @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) {
$in = $this->Dispatch->getInput($prompt, $options, $default);
@ -322,7 +334,8 @@ class Shell extends Object {
* Outputs to the stdout filehandle.
*
* @param string $string String to output.
* @param boolean $newline If true, the outputs gets an added newline.
* @param bool $newline If true, the outputs gets an added newline.
* @access public
*/
function out($string, $newline = true) {
if(is_array($string)) {
@ -338,6 +351,7 @@ class Shell extends Object {
* Outputs to the stderr filehandle.
*
* @param string $string Error text to output.
* @access public
*/
function err($string) {
if(is_array($string)) {
@ -352,6 +366,8 @@ class Shell extends Object {
/**
* Outputs a series of minus characters to the standard output, acts as a visual separator.
*
* @param bool $newline If true, the outputs gets an added newline.
* @access public
*/
function hr($newline = false) {
if ($newline) {
@ -363,10 +379,11 @@ class Shell extends Object {
}
}
/**
* Displays a formatted error message
* Displays a formatted error message and exits the application
*
* @param unknown_type $title
* @param unknown_type $msg
* @param string $title Title of the error message
* @param string $msg Error message
* @access public
*/
function error($title, $msg) {
$out = "$title\n";
@ -378,8 +395,9 @@ class Shell extends Object {
/**
* Will check the number args matches otherwise throw an error
*
* @param unknown_type $expectedNum
* @param unknown_type $command
* @param int $expectedNum Expected number of paramters
* @param string $command Command
* @access protected
*/
function _checkArgs($expectedNum, $command = null) {
if (!$command) {
@ -390,11 +408,12 @@ class Shell extends Object {
}
}
/**
* Creates a file at given path.
* Creates a file at given path
*
* @param string $path Where to put the file.
* @param string $path Where to put the file.
* @param string $contents Content to put in the file.
* @return Success
* @return bool Success
* @access public
*/
function createFile ($path, $contents) {
$path = str_replace(DS . DS, DS, $path);
@ -426,6 +445,7 @@ class Shell extends Object {
/**
* Outputs usage text on the standard output. Implement it in subclasses.
*
* @access public
*/
function help() {
if ($this->command != null) {
@ -435,9 +455,10 @@ class Shell extends Object {
}
}
/**
* Action to create a Unit Test.
* Action to create a Unit Test
*
* @return Success
* @return bool Success
* @access protected
*/
function _checkUnitTest() {
if (is_dir(VENDORS.'simpletest') || is_dir(ROOT.DS.APP_DIR.DS.'vendors'.DS.'simpletest')) {
@ -452,19 +473,22 @@ class Shell extends Object {
return $result;
}
/**
* makes absolute file path easier to read
* Makes absolute file path easier to read
*
* @param string $file Absolute file path
* @return sting short path
* @access public
*/
function shortPath($file) {
$shortPath = str_replace(ROOT, null, $file);
$shortPath = str_replace('..'.DS, '', $shortPath);
return str_replace(DS.DS, DS, $shortPath);
return r(DS.DS, DS, $shortPath);
}
/**
* Checks for Configure::read('Routing.admin') and Forces user to input it if not enabled
* Checks for Configure::read('Routing.admin') and forces user to input it if not enabled
*
* @return the controller name
* @return string Admin route to use
* @access public
*/
function getAdmin() {
$admin = '';
@ -490,46 +514,51 @@ class Shell extends Object {
return $cakeAdmin;
}
/**
* creates the proper pluralize controller for the url
* Creates the proper controller path for the specified controller class name
*
* @param string $name
* @return string $name
* @param string $name Controller class name
* @return string Path to controller
* @access protected
*/
function _controllerPath($name) {
return low(Inflector::underscore($name));
}
/**
* creates the proper pluralize controller class name.
* Creates the proper controller plural name for the specified controller class name
*
* @param string $name
* @return string $name
* @param string $name Controller class name
* @return string Controller plural name
* @access protected
*/
function _controllerName($name) {
return Inflector::pluralize(Inflector::camelize($name));
}
/**
* creates the proper singular model name.
* Creates the proper controller camelized name (singularized) for the specified name
*
* @param string $name
* @return string $name
* @param string $name Name
* @return string Camelized and singularized controller name
* @access protected
*/
function _modelName($name) {
return Inflector::camelize(Inflector::singularize($name));
}
/**
* creates the proper singular model key for associations.
* Creates the proper singular model key for associations
*
* @param string $name
* @return string $name
* @param string $name Controller class name
* @return string Singular model key
* @access protected
*/
function _modelKey($name) {
return Inflector::underscore(Inflector::singularize($name)).'_id';
}
/**
* creates the proper model name from a foreign key.
* Creates the proper model name from a foreign key
*
* @param string $key
* @return string $name
* @param string $key Foreign key
* @return string Model name
* @access protected
*/
function _modelNameFromKey($key) {
$name = str_replace('_id', '',$key);
@ -540,33 +569,37 @@ class Shell extends Object {
*
* @param string $name
* @return string $name
* @access protected
*/
function _singularName($name) {
return Inflector::variable(Inflector::singularize($name));
}
/**
* creates the plural name for views.
* Creates the plural name for views
*
* @param string $name
* @return string $name
* @param string $name Name to use
* @return string Plural name for views
* @access protected
*/
function _pluralName($name) {
return Inflector::variable(Inflector::pluralize($name));
}
/**
* creates the singular human name used in views
* Creates the singular human name used in views
*
* @param string $name
* @return string $name
* @param string $name Controller name
* @return string Singular human name
* @access protected
*/
function _singularHumanName($name) {
return Inflector::humanize(Inflector::underscore(Inflector::singularize($name)));
}
/**
* creates the plural humna name used in views
* Creates the plural human name used in views
*
* @param string $name
* @return string $name
* @param string $name Controller name
* @return string Plural human name
* @access protected
*/
function _pluralHumanName($name) {
return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name)));

View file

@ -37,18 +37,19 @@ class ControllerTask extends Shell {
* Tasks to be loaded by this Task
*
* @var array
* @access public
*/
var $tasks = array('Project');
/**
* Override initialize
*
* @return void
* @access public
*/
function initialize() {}
/**
* Execution method always used for tasks
*
* @return void
* @access public
*/
function execute() {
if (empty($this->args)) {
@ -81,7 +82,7 @@ class ControllerTask extends Shell {
/**
* Interactive
*
* @return void
* @access private
*/
function __interactive() {
$this->interactive = false;
@ -96,11 +97,8 @@ class ControllerTask extends Shell {
$wannaDoAdmin = 'n';
$wannaUseScaffold = 'n';
$wannaDoScaffolding = 'y';
$controllerName = $this->getName();
$controllerPath = low(Inflector::underscore($controllerName));
$doItInteractive = $this->in("Would you like bake to build your controller interactively?\nWarning: Choosing no will overwrite {$controllerName} controller if it exist.", array('y','n'), 'y');
if (low($doItInteractive) == 'y' || low($doItInteractive) == 'yes') {
@ -156,9 +154,9 @@ class ControllerTask extends Shell {
}
if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') {
$actions = $this->__bakeActions($controllerName, null, $wannaUseSession);
$actions = $this->__bakeActions($controllerName, null, in_array(low($wannaUseSession), array('y', 'yes')));
if ($admin) {
$actions .= $this->__bakeActions($controllerName, $admin, $wannaUseSession);
$actions .= $this->__bakeActions($controllerName, $admin, in_array(low($wannaUseSession), array('y', 'yes')));
}
}
@ -226,8 +224,16 @@ class ControllerTask extends Shell {
}
}
}
function __bakeActions($controllerName, $admin = null, $wannaUseSession = 'y') {
/**
* Bake scaffold actions
*
* @param string $controllerName Controller name
* @param string $admin Admin route to use
* @param bool $wannaUseSession Set to true to use sessions, false otherwise
* @return string Baked actions
* @access private
*/
function __bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$currentModelName = $this->_modelName($controllerName);
if (!loadModel($currentModelName)) {
$this->out('You must have a model for this class to build scaffold methods. Please try again.');
@ -248,7 +254,7 @@ class ControllerTask extends Shell {
$actions .= "\n";
$actions .= "\tfunction {$admin}view(\$id = null) {\n";
$actions .= "\t\tif (!\$id) {\n";
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
if ($wannaUseSession) {
$actions .= "\t\t\t\$this->Session->setFlash('Invalid {$singularHumanName}.');\n";
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
} else {
@ -266,7 +272,7 @@ class ControllerTask extends Shell {
$actions .= "\t\t\t\$this->cleanUpFields();\n";
$actions .= "\t\t\t\$this->{$currentModelName}->create();\n";
$actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
if ($wannaUseSession) {
$actions .= "\t\t\t\t\$this->Session->setFlash('The ".$singularHumanName." has been saved');\n";
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
} else {
@ -274,7 +280,7 @@ class ControllerTask extends Shell {
$actions .= "\t\t\t\texit();\n";
}
$actions .= "\t\t\t} else {\n";
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
if ($wannaUseSession) {
$actions .= "\t\t\t\t\$this->Session->setFlash('The {$singularHumanName} could not be saved. Please, try again.');\n";
}
$actions .= "\t\t\t}\n";
@ -306,7 +312,7 @@ class ControllerTask extends Shell {
$compact = array();
$actions .= "\tfunction {$admin}edit(\$id = null) {\n";
$actions .= "\t\tif (!\$id && empty(\$this->data)) {\n";
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
if ($wannaUseSession) {
$actions .= "\t\t\t\$this->Session->setFlash('Invalid {$singularHumanName}');\n";
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
} else {
@ -317,7 +323,7 @@ class ControllerTask extends Shell {
$actions .= "\t\tif (!empty(\$this->data)) {\n";
$actions .= "\t\t\t\$this->cleanUpFields();\n";
$actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
if ($wannaUseSession) {
$actions .= "\t\t\t\t\$this->Session->setFlash('The ".$singularHumanName." has been saved');\n";
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
} else {
@ -325,7 +331,7 @@ class ControllerTask extends Shell {
$actions .= "\t\t\t\texit();\n";
}
$actions .= "\t\t\t} else {\n";
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
if ($wannaUseSession) {
$actions .= "\t\t\t\t\$this->Session->setFlash('The {$singularHumanName} could not be saved. Please, try again.');\n";
}
$actions .= "\t\t\t}\n";
@ -358,7 +364,7 @@ class ControllerTask extends Shell {
$actions .= "\n";
$actions .= "\tfunction {$admin}delete(\$id = null) {\n";
$actions .= "\t\tif (!\$id) {\n";
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
if ($wannaUseSession) {
$actions .= "\t\t\t\$this->Session->setFlash('Invalid id for {$singularHumanName}');\n";
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
} else {
@ -366,7 +372,7 @@ class ControllerTask extends Shell {
}
$actions .= "\t\t}\n";
$actions .= "\t\tif (\$this->{$currentModelName}->del(\$id)) {\n";
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
if ($wannaUseSession) {
$actions .= "\t\t\t\$this->Session->setFlash('".$singularHumanName." #'.\$id.' deleted');\n";
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
} else {
@ -380,13 +386,15 @@ class ControllerTask extends Shell {
/**
* Assembles and writes a Controller file.
* Assembles and writes a Controller file
*
* @param string $controllerName
* @param array $uses
* @param array $helpers
* @param array $components
* @param string $actions
* @param string $controllerName Controller name
* @param string $actions Actions to add, or set the whole controller to use $scaffold (set $actions to 'scaffold')
* @param array $helpers Helpers to use in controller
* @param array $components Components to use in controller
* @param array $uses Models to use in controller
* @return string Baked controller
* @access private
*/
function __bake($controllerName, $actions = '', $helpers = null, $components = null, $uses = null) {
$out = "<?php\n";
@ -396,7 +404,6 @@ class ControllerTask extends Shell {
if (low($actions) == 'scaffold') {
$out .= "\tvar \$scaffold;\n";
} else {
if (count($uses)) {
$out .= "\tvar \$uses = array('" . $this->_modelName($controllerName) . "', ";
@ -442,9 +449,11 @@ class ControllerTask extends Shell {
return $this->createFile($filename, $out);
}
/**
* Assembles and writes a unit test file.
* Assembles and writes a unit test file
*
* @param string $className
* @param string $className Controller class name
* @return string Baked test
* @access private
*/
function __bakeTest($className) {
$out = '<?php '."\n\n";
@ -471,11 +480,11 @@ class ControllerTask extends Shell {
return false;
}
/**
* outputs the a list of possible models or controllers from database
* Outputs and gets the list of possible models or controllers from database
*
* @param string $useDbConfig
* @param string $type = Models or Controllers
* @return output
* @param string $useDbConfig Database configuration name
* @return array Set of controllers
* @access public
*/
function listAll($useDbConfig = 'default') {
$db =& ConnectionManager::getDataSource($useDbConfig);
@ -504,12 +513,12 @@ class ControllerTask extends Shell {
/**
* Forces the user to specify the controller he wants to bake, and returns the selected controller name.
*
* @return the controller name
* @return string Controller name
* @access public
*/
function getName() {
$useDbConfig = 'default';
$controllers = $this->listAll($useDbConfig, 'Controllers');
$enteredController = '';
while ($enteredController == '') {
@ -533,7 +542,7 @@ class ControllerTask extends Shell {
/**
* Displays help contents
*
* @return void
* @access public
*/
function help() {
$this->hr();

View file

@ -36,16 +36,19 @@ if (!class_exists('File')) {
* @subpackage cake.cake.console.libs.tasks
*/
class DbConfigTask extends Shell {
/**
* Default configuration settings to use
*
* @var array
* @access private
*/
var $__defaultConfig = array('name' => 'default', 'driver'=> 'mysql', 'persistent'=> 'false', 'host'=> 'localhost',
'login'=> 'root', 'password'=> 'password', 'database'=> 'project_name',
'schema'=> null, 'prefix'=> null, 'encoding' => null, 'port' => null);
/**
* Execution method always used for tasks
*
* @return void
* @access public
*/
function execute() {
if (empty($this->args)) {
@ -53,12 +56,10 @@ class DbConfigTask extends Shell {
exit();
}
}
/**
* Interactive interface
*
* @access private
* @return void
*/
function __interactive() {
$this->out('Database Configuration:');
@ -171,11 +172,10 @@ class DbConfigTask extends Shell {
return true;
}
/**
* Output verification message
* and bake if it looks good
* Output verification message and bake if it looks good
*
* @return bool True if user says it looks good, false otherwise
* @access private
* @return bool
*/
function __verify($config) {
$config = am($this->__defaultConfig, $config);
@ -206,8 +206,9 @@ class DbConfigTask extends Shell {
/**
* Assembles and writes database.php
*
* @param array $configs Configuration settings to use
* @return bool Success
* @access public
* @return bool
*/
function bake($configs) {
if (!is_dir(CONFIGS)) {

View file

@ -60,27 +60,78 @@
* @subpackage cake.cake.console.libs
*/
class ExtractTask extends Shell{
/**
* Path to use when looking for strings
*
* @var string
* @access public
*/
var $path = null;
/**
* Files from where to extract
*
* @var array
* @access public
*/
var $files = array();
/**
* Filename where to deposit translations
*
* @var string
* @access private
*/
var $__filename = 'default';
/**
* True if all strings should be merged into one file
*
* @var boolean
* @access private
*/
var $__oneFile = true;
/**
* Current file being processed
*
* @var string
* @access private
*/
var $__file = null;
/**
* Extracted tokens
*
* @var array
* @access private
*/
var $__tokens = array();
/**
* Extracted strings
*
* @var array
* @access private
*/
var $__strings = array();
/**
* History of file versions
*
* @var array
* @access private
*/
var $__fileVersions = array();
/**
* Destination path
*
* @var string
* @access private
*/
var $__output = null;
/**
* Override initialize
*
* @return void
* @access public
*/
function initialize() {
if (isset($this->params['files']) && !is_array($this->params['files'])) {
$this->files = explode(',', $this->params['files']);
}
if (isset($this->params['path'])) {
$this->path = $this->params['path'];
} else {
@ -133,13 +184,14 @@ class ExtractTask extends Shell{
/**
* Override startup
*
* @return void
* @access public
*/
function startup() {}
function startup() {
}
/**
* Execution method always used for tasks
*
* @return void
* @access public
*/
function execute() {
$this->out('');
@ -168,6 +220,11 @@ class ExtractTask extends Shell{
}
$this->__extractTokens();
}
/**
* Show help options
*
* @access public
*/
function help() {
$this->out(__('CakePHP Language String Extraction:', true));
$this->hr();
@ -188,6 +245,11 @@ class ExtractTask extends Shell{
$this->out(__(' -debug: Perform self test.', true));
$this->out('');
}
/**
* Extract tokens out of all files to be processed
*
* @access private
*/
function __extractTokens() {
foreach ($this->files as $file) {
$this->__file = $file;
@ -230,9 +292,10 @@ class ExtractTask extends Shell{
/**
* Will parse __(), __c() functions
*
* @param string $functionname
* @param string $functionName Function name that indicates translatable string (e.g: '__')
* @access public
*/
function basic($functionname = '__') {
function basic($functionName = '__') {
$count = 0;
$tokenCount = count($this->__tokens);
@ -244,7 +307,7 @@ class ExtractTask extends Shell{
}
list($type, $string, $line) = $countToken;
if (($type == T_STRING) && ($string == $functionname) && ($parenthesis == '(')) {
if (($type == T_STRING) && ($string == $functionName) && ($parenthesis == '(')) {
if (in_array($right, array(')', ','))
&& (is_array($middle) && ($middle[0] == T_CONSTANT_ENCAPSED_STRING))) {
@ -255,7 +318,7 @@ class ExtractTask extends Shell{
$this->__strings[$this->__file][$this->__formatString($middle[1])][] = $line;
}
} else {
$this->__markerError($this->__file, $line, $functionname, $count);
$this->__markerError($this->__file, $line, $functionName, $count);
}
}
$count++;
@ -264,11 +327,12 @@ class ExtractTask extends Shell{
/**
* Will parse __d(), __dc(), __n(), __dn(), __dcn()
*
* @param string $functionname
* @param integer $shift
* @param boolean $plural
* @param string $functionName Function name that indicates translatable string (e.g: '__')
* @param int $shift Number of parameters to shift to find translateable string
* @param bool $plural Set to true if function supports plural format, false otherwise
* @access public
*/
function extended($functionname = '__d', $shift = 0, $plural = false) {
function extended($functionName = '__d', $shift = 0, $plural = false) {
$count = 0;
$tokenCount = count($this->__tokens);
@ -280,7 +344,7 @@ class ExtractTask extends Shell{
}
list($type, $string, $line) = $countToken;
if (($type == T_STRING) && ($string == $functionname) && ($firstParenthesis == '(')) {
if (($type == T_STRING) && ($string == $functionName) && ($firstParenthesis == '(')) {
$position = $count;
$depth = 0;
@ -340,12 +404,17 @@ class ExtractTask extends Shell{
}
}
} else {
$this->__markerError($this->__file, $line, $functionname, $count);
$this->__markerError($this->__file, $line, $functionName, $count);
}
}
$count++;
}
}
/**
* Build the translate template file contents out of obtained strings
*
* @access private
*/
function __buildFiles() {
$output = '';
foreach ($this->__strings as $str => $fileInfo) {
@ -403,6 +472,16 @@ class ExtractTask extends Shell{
$this->__store($filename, $output, $fileList);
}
}
/**
* Prepare a file to be stored
*
* @param string $file Filename
* @param string $input What to store
* @param array $fileList File list
* @param int $get Set to 1 to get files to store, false to set
* @return mixed If $get == 1, files to store, otherwise void
* @access private
*/
function __store($file = 0, $input = 0, $fileList = array(), $get = 0) {
static $storage = array();
@ -420,6 +499,11 @@ class ExtractTask extends Shell{
return $storage;
}
}
/**
* Write the files that need to be stored
*
* @access private
*/
function __writeFiles() {
$output = $this->__store(0, 0, array(), 1);
$output = $this->__mergeFiles($output);
@ -463,6 +547,13 @@ class ExtractTask extends Shell{
fclose($fp);
}
}
/**
* Merge output files
*
* @param array $output Output to merge
* @return array Merged output
* @access private
*/
function __mergeFiles($output) {
foreach ($output as $file => $content) {
if (count($content) <= 1 && $file != $this->__filename) {
@ -482,6 +573,12 @@ class ExtractTask extends Shell{
}
return $output;
}
/**
* Build the translation template header
*
* @return string Translation template header
* @access private
*/
function __writeHeader() {
$output = "# LANGUAGE translation of CakePHP Application\n";
$output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
@ -501,6 +598,13 @@ class ExtractTask extends Shell{
$output .= "\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n\n";
return $output;
}
/**
* Find the version number of a file looking for SVN commands
*
* @param string $code Source code of file
* @param string $file File
* @access private
*/
function __findVersion($code, $file) {
$header = '$Id' . ':';
if (preg_match('/\\' . $header . ' [\\w.]* ([\\d]*)/', $code, $versionInfo)) {
@ -508,6 +612,13 @@ class ExtractTask extends Shell{
$this->__fileVersions[$file] = $version;
}
}
/**
* Format a string to be added as a translateable string
*
* @param string $string String to format
* @return string Formatted string
* @access private
*/
function __formatString($string) {
$quote = substr($string, 0, 1);
$string = substr($string, 1, -1);
@ -518,6 +629,15 @@ class ExtractTask extends Shell{
}
return addcslashes($string, "\0..\37\\\"");
}
/**
* Indicate an invalid marker on a processed file
*
* @param string $file File where invalid marker resides
* @param int $line Line number
* @param string $marker Marker found
* @param int $count Count
* @access private
*/
function __markerError($file, $line, $marker, $count) {
$this->out("Invalid marker content in $file:$line\n* $marker(", true);
$count += 2;
@ -541,6 +661,13 @@ class ExtractTask extends Shell{
}
$this->out("\n", true);
}
/**
* Search the specified path for files that may contain translateable strings
*
* @param string $path Path (or set to null to use current)
* @return array Files
* @access private
*/
function __searchDirectory($path = null) {
if ($path === null) {
$path = $this->path .DS;

View file

@ -33,11 +33,10 @@
* @subpackage cake.cake.console.libs.tasks
*/
class ModelTask extends Shell {
/**
* Execution method always used for tasks
*
* @return void
* @access public
*/
function execute() {
if (empty($this->args)) {
@ -57,7 +56,6 @@ class ModelTask extends Shell {
* Handles interactive baking
*
* @access private
* @return void
*/
function __interactive() {
$this->hr();
@ -447,12 +445,13 @@ class ModelTask extends Shell {
/**
* Assembles and writes a Model file.
*
* @param string $name
* @param object $useDbConfig
* @param string $useTable
* @param string $primaryKey
* @param array $validate
* @param array $associations
* @param string $name Model name
* @param object $useDbConfig Database configuration setting to use
* @param string $useTable Table to use
* @param string $primaryKey Primary key to use
* @param array $validate Validation rules
* @param array $associations Model bindings
* @access private
*/
function __bake($name, $useDbConfig = 'default', $useTable = null, $primaryKey = 'id', $validate = array(), $associations = array()) {
$out = "<?php\n";
@ -570,10 +569,10 @@ class ModelTask extends Shell {
}
/**
* Assembles and writes a unit test file.
* Assembles and writes a unit test file
*
* @param string $type One of "model", and "controller".
* @param string $className
* @param string $className Model class name
* @access private
*/
function __bakeTest($className) {
$out = '<?php '."\n\n";
@ -599,13 +598,11 @@ class ModelTask extends Shell {
}
return false;
}
/**
* outputs the a list of possible models or controllers from database
*
* @param string $useDbConfig
* @param string $type = Models or Controllers
* @return output
* @param string $useDbConfig Database configuration name
* @access public
*/
function listAll($useDbConfig = 'default') {
$db =& ConnectionManager::getDataSource($useDbConfig);
@ -629,11 +626,11 @@ class ModelTask extends Shell {
$this->out($i + 1 . ". " . $this->_modelNames[$i]);
}
}
/**
* Forces the user to specify the model he wants to bake, and returns the selected model name.
*
* @return the model name
* @return string the model name
* @access public
*/
function getName($useDbConfig) {
$this->listAll($useDbConfig);
@ -661,7 +658,7 @@ class ModelTask extends Shell {
/**
* Displays help contents
*
* @return void
* @access public
*/
function help() {
$this->hr();

View file

@ -36,26 +36,26 @@ if (!class_exists('File')) {
* @subpackage cake.cake.console.libs.tasks
*/
class ProjectTask extends Shell {
/**
* Override
*
* @return void
* @access public
*/
function initialize() {}
function initialize() {
}
/**
* Override
*
* @return void
* @access public
*/
function startup() {}
function startup() {
}
/**
* Checks that given project path does not already exist, and
* finds the app directory in it. Then it calls __buildDirLayout() with that information.
*
* @return bool
* @param string $project Project path
* @access public
*/
function execute($project = null) {
if ($project === null) {
@ -117,14 +117,14 @@ class ProjectTask extends Shell {
$this->__buildDirLayout($project);
exit();
}
/**
* Looks for a skeleton template of a Cake application,
* and if not found asks the user for a path. When there is a path
* this method will make a deep copy of the skeleton to the project directory.
* A default home page will be added, and the tmp file storage will be chmod'ed to 0777.
*
* @param string $path
* @param string $path Project path
* @access private
*/
function __buildDirLayout($path) {
$skel = $this->params['skel'];
@ -161,7 +161,7 @@ class ProjectTask extends Shell {
$this->out(sprintf(__("Created: %s in %s", true), $app, $path));
$this->hr();
if ($this->createHome($path, $app)) {
if ($this->createHome($path)) {
$this->out('Welcome page created');
} else {
$this->out('The Welcome page was NOT created');
@ -206,18 +206,21 @@ class ProjectTask extends Shell {
/**
* Writes a file with a default home page to the project.
*
* @param string $dir
* @param string $app
* @param string $dir Path to project
* @return bool Success
* @access public
*/
function createHome($dir, $app) {
function createHome($dir) {
$path = $dir . 'views' . DS . 'pages' . DS;
include(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'views'.DS.'home.ctp');
return $this->createFile($path.'home.ctp', $output);
}
/**
* generates and writes 'Security.salt'
* Generates and writes 'Security.salt'
*
* @return bool
* @param string $path Project path
* @return bool Success
* @access public
*/
function securitySalt($path) {
$File =& new File($path . 'config' . DS . 'core.php');
@ -236,9 +239,11 @@ class ProjectTask extends Shell {
}
}
/**
* generates and writes CAKE_CORE_INCLUDE_PATH
* Generates and writes CAKE_CORE_INCLUDE_PATH
*
* @return bool
* @param string $path Project path
* @return bool Success
* @access public
*/
function corePath($path) {
if (dirname($path) !== CAKE_CORE_INCLUDE_PATH) {
@ -259,7 +264,9 @@ class ProjectTask extends Shell {
/**
* Enables Configure::read('Routing.admin') in /app/config/core.php
*
* @return bool
* @param string $name Name to use as admin routing
* @return bool Success
* @access public
*/
function cakeAdmin($name) {
$File =& new File(CONFIGS . 'core.php');

View file

@ -38,42 +38,48 @@ class ViewTask extends Shell {
* Tasks to be loaded by this Task
*
* @var array
* @access public
*/
var $tasks = array('Project', 'Controller');
/**
* name of the controller being used
* Name of the controller being used
*
* @var string
* @access public
*/
var $controllerName = null;
/**
* path to controller to put views
* Path to controller to put views
*
* @var string
* @access public
*/
var $controllerPath = null;
/**
* the template file to use
* The template file to use
*
* @var string
* @access public
*/
var $template = null;
/**
* Actions to use for scaffolding
*
* @var array
* @access public
*/
var $scaffoldActions = array('index', 'view', 'add', 'edit');
/**
* Override initialize
*
* @return void
* @access public
*/
function initialize() {}
function initialize() {
}
/**
* Execution method always used for tasks
*
* @return void
* @access public
*/
function execute() {
if (empty($this->args)) {
@ -131,7 +137,6 @@ class ViewTask extends Shell {
* Handles interactive baking
*
* @access private
* @return void
*/
function __interactive() {
$this->hr();
@ -211,8 +216,8 @@ class ViewTask extends Shell {
* 'singularHumanName', 'pluralHumanName', 'fields', 'foreignKeys',
* 'belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'
*
* @access private
* @return array Returns an variables to be made available to a view template
* @access private
*/
function __loadController() {
if (!$this->controllerName) {
@ -252,9 +257,10 @@ class ViewTask extends Shell {
/**
* Assembles and writes bakes the view file.
*
* @param string $action
* @param string $content
* @return bool
* @param string $action Action to bake
* @param string $content Content to write
* @return bool Success
* @access public
*/
function bake($action, $content = '') {
if ($content === true) {
@ -279,6 +285,7 @@ class ViewTask extends Shell {
* @param string $template file to use
* @param array $vars passed for use in templates
* @return string content from template
* @access public
*/
function getContent($template = null, $vars = null) {
if (!$template) {
@ -319,7 +326,7 @@ class ViewTask extends Shell {
/**
* Displays help contents
*
* @return void
* @access public
*/
function help() {
$this->hr();

View file

@ -39,23 +39,28 @@ class PagesController extends AppController{
* Controller name
*
* @var string
* @access public
*/
var $name = 'Pages';
/**
* Default helper
*
* @var array
* @access public
*/
var $helpers = array('Html');
/**
* This controller does not use a model
*
* @var array
* @access public
*/
var $uses = array();
/**
* Displays a view
*
* @param mixed What page to display
* @access public
*/
function display() {
if (!func_num_args()) {

View file

@ -113,7 +113,7 @@ class Dispatcher extends Object {
* @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
* @return bool Success
* @access public
*/
function dispatch($url = null, $additionalParams = array()) {
@ -255,7 +255,7 @@ class Dispatcher extends Object {
*
* @param object $controller Controller to invoke
* @param array $params Parameters with at least the 'action' to invoke
* @param boolean $missingAction Set to true if missing action should be rendered, false otherwise
* @param bool $missingAction Set to true if missing action should be rendered, false otherwise
* @return string Output as sent by controller
* @access protected
*/

View file

@ -136,7 +136,7 @@ class Cache extends Object {
*
* @param string $name Name of the engine (without 'Engine')
* @param array $settings Optional associative array of settings passed to the engine
* @return boolean True on success, false on failure
* @return bool True on success, false on failure
* @access public
*/
function engine($name = 'File', $settings = array()) {
@ -169,7 +169,7 @@ class Cache extends Object {
* @param mixed $value Data to be cached - anything except a resource
* @param mixed $duration Optional - string configuration name OR how long to cache the data, either in seconds or a
* string that can be parsed by the strtotime() function OR array('config' => 'default', 'duration' => '3600')
* @return boolean True if the data was successfully cached, false on failure
* @return bool True if the data was successfully cached, false on failure
* @access public
*/
function write($key, $value, $duration = null) {
@ -237,7 +237,7 @@ class Cache extends Object {
*
* @param string $key Identifier for the data
* @param string $config name of the configuration to use
* @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @return bool True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
function delete($key, $config = null) {
@ -260,9 +260,9 @@ class Cache extends Object {
/**
* Delete all keys from the cache
*
* @param boolean $check if true will check expiration, otherwise delete all
* @param bool $check if true will check expiration, otherwise delete all
* @param string $config name of the configuration to use
* @return boolean True if the cache was succesfully cleared, false otherwise
* @return bool True if the cache was succesfully cleared, false otherwise
* @access public
*/
function clear($check = false, $config = null) {
@ -282,7 +282,7 @@ class Cache extends Object {
*
* @param string $engine Name of the engine
* @param string $config Name of the configuration setting
* @return boolean
* @return bool
* @access public
*/
function isInitialized($engine = null) {
@ -335,7 +335,7 @@ class CacheEngine extends Object {
* Called automatically by the cache frontend
*
* @param array $params Associative array of parameters for the engine
* @return boolean True if the engine has been succesfully initialized, false if not
* @return bool True if the engine has been succesfully initialized, false if not
* @access public
*/
function init($settings = array()) {
@ -357,7 +357,7 @@ class CacheEngine extends Object {
* @param string $key Identifier for the data
* @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
* @return bool True if the data was succesfully cached, false on failure
* @access public
*/
function write($key, &$value, $duration) {
@ -377,7 +377,7 @@ class CacheEngine extends Object {
* Delete a key from the cache
*
* @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
* @return bool True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
function delete($key) {
@ -385,8 +385,8 @@ class CacheEngine extends Object {
/**
* Delete all keys from the cache
*
* @param boolean $check if true will check expiration, otherwise delete all
* @return boolean True if the cache was succesfully cleared, false otherwise
* @param bool $check if true will check expiration, otherwise delete all
* @return bool True if the cache was succesfully cleared, false otherwise
* @access public
*/
function clear($check) {

View file

@ -40,7 +40,7 @@ class APCEngine extends CacheEngine {
*
* @see var $__defaults
* @param array $setting array of setting for the engine
* @return boolean True if the engine has been successfully initialized, false if not
* @return bool True if the engine has been successfully initialized, false if not
* @access public
*/
function init($settings = array()) {
@ -53,7 +53,7 @@ class APCEngine extends CacheEngine {
* @param string $key Identifier for the data
* @param mixed $value Data to be cached
* @param int $duration How long to cache the data, in seconds
* @return boolean True if the data was succesfully cached, false on failure
* @return bool True if the data was succesfully cached, false on failure
* @access public
*/
function write($key, &$value, $duration) {
@ -73,7 +73,7 @@ class APCEngine extends CacheEngine {
* Delete a key from the cache
*
* @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
* @return bool True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
function delete($key) {
@ -82,7 +82,7 @@ class APCEngine extends CacheEngine {
/**
* Delete all keys from the cache
*
* @return boolean True if the cache was succesfully cleared, false otherwise
* @return bool True if the cache was succesfully cleared, false otherwise
* @access public
*/
function clear() {

View file

@ -66,7 +66,7 @@ class FileEngine extends CacheEngine {
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
*
* @param array $setting array of setting for the engine
* @return boolean True if the engine has been successfully initialized, false if not
* @return bool True if the engine has been successfully initialized, false if not
* @access public
*/
function init($settings = array()) {
@ -87,7 +87,7 @@ class FileEngine extends CacheEngine {
* Garbage collection
* Permanently remove all expired and deleted data
*
* @return boolean True if garbage collection was succesful, false on failure
* @return bool True if garbage collection was succesful, false on failure
* @access public
*/
function gc() {
@ -99,7 +99,7 @@ class FileEngine extends CacheEngine {
* @param string $key Identifier for the data
* @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
* @return bool True if the data was succesfully cached, false on failure
* @access public
*/
function write($key, &$data, $duration) {
@ -162,7 +162,7 @@ class FileEngine extends CacheEngine {
* Delete a key from the cache
*
* @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
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
function delete($key) {
@ -174,8 +174,8 @@ class FileEngine extends CacheEngine {
/**
* Delete all values from the cache
*
* @param boolean $check Optional - only delete expired cache items
* @return boolean True if the cache was succesfully cleared, false otherwise
* @param bool $check Optional - only delete expired cache items
* @return bool True if the cache was succesfully cleared, false otherwise
* @access public
*/
function clear($check) {

View file

@ -55,7 +55,7 @@ class MemcacheEngine extends CacheEngine {
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
*
* @param array $setting array of setting for the engine
* @return boolean True if the engine has been successfully initialized, false if not
* @return bool True if the engine has been successfully initialized, false if not
* @access public
*/
function init($settings = array()) {
@ -95,7 +95,7 @@ class MemcacheEngine extends CacheEngine {
* @param string $key Identifier for the data
* @param mixed $value Data to be cached
* @param int $duration How long to cache the data, in seconds
* @return boolean True if the data was succesfully cached, false on failure
* @return bool True if the data was succesfully cached, false on failure
* @access public
*/
function write($key, &$value, $duration) {
@ -115,7 +115,7 @@ class MemcacheEngine extends CacheEngine {
* Delete a key from the cache
*
* @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
* @return bool True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
function delete($key) {
@ -124,7 +124,7 @@ class MemcacheEngine extends CacheEngine {
/**
* Delete all keys from the cache
*
* @return boolean True if the cache was succesfully cleared, false otherwise
* @return bool True if the cache was succesfully cleared, false otherwise
* @access public
*/
function clear() {
@ -134,8 +134,8 @@ class MemcacheEngine extends CacheEngine {
* connects to a server in connection pool
*
* @param string $host host ip address or name
* @param integer $port
* @return boolean True if memcache server was connected
* @param int $port
* @return bool True if memcache server was connected
* @access public
*/
function connect($host, $port = 11211) {

View file

@ -55,8 +55,7 @@ class ModelEngine extends CacheEngine {
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
*
* @param array $setting array of setting for the engine
* @return boolean True if the engine has been successfully initialized, false if not
* @return boolean True if the engine has been succesfully initialized, false if not
* @return bool True if the engine has been successfully initialized, false if not
*/
function init($settings) {
parent::init($settings);
@ -84,7 +83,7 @@ class ModelEngine extends CacheEngine {
* @param string $key Identifier for the data
* @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
* @return bool True if the data was succesfully cached, false on failure
* @access public
*/
function write($key, &$data, $duration) {
@ -127,7 +126,7 @@ class ModelEngine extends CacheEngine {
* Delete a key from the cache
*
* @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
* @return bool True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
function delete($key) {
@ -136,7 +135,7 @@ class ModelEngine extends CacheEngine {
/**
* Delete all keys from the cache
*
* @return boolean True if the cache was succesfully cleared, false otherwise
* @return bool True if the cache was succesfully cleared, false otherwise
* @access public
*/
function clear() {

View file

@ -49,7 +49,7 @@ class XcacheEngine extends CacheEngine {
* To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array());
*
* @param array $setting array of setting for the engine
* @return boolean True if the engine has been successfully initialized, false if not
* @return bool True if the engine has been successfully initialized, false if not
* @access public
*/
function init($settings) {
@ -64,7 +64,7 @@ class XcacheEngine extends CacheEngine {
* @param string $key Identifier for the data
* @param mixed $value Data to be cached
* @param int $duration How long to cache the data, in seconds
* @return boolean True if the data was succesfully cached, false on failure
* @return bool True if the data was succesfully cached, false on failure
* @access public
*/
function write($key, &$value, $duration) {
@ -87,7 +87,7 @@ class XcacheEngine extends CacheEngine {
* Delete a key from the cache
*
* @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
* @return bool True if the value was succesfully deleted, false if it didn't exist or couldn't be removed
* @access public
*/
function delete($key) {
@ -96,7 +96,7 @@ class XcacheEngine extends CacheEngine {
/**
* Delete all keys from the cache
*
* @return boolean True if the cache was succesfully cleared, false otherwise
* @return bool True if the cache was succesfully cleared, false otherwise
* @access public
*/
function clear() {
@ -118,7 +118,7 @@ class XcacheEngine extends CacheEngine {
* This has to be done because xcache_clear_cache() needs to pass Basic Http Auth
* (see xcache.admin configuration settings)
*
* @param boolean Revert changes
* @param bool Revert changes
* @access protected
*/
function __auth($reverse = false) {

View file

@ -65,7 +65,7 @@ class CakeLog {
*
* @param string $type Type of log, becomes part of the log's filename
* @param string $msg Message to log
* @return boolean Success
* @return bool Success
* @access public
*/
function write($type, $msg) {

View file

@ -69,7 +69,7 @@ class ClassRegistry {
*
* @param string $key Key for the object in registry
* @param mixed $object Object to store
* @return boolean True if the object was written, false if $key already exists
* @return bool True if the object was written, false if $key already exists
* @access public
*/
function addObject($key, &$object) {
@ -98,7 +98,7 @@ class ClassRegistry {
* Returns true if given key is present in the ClassRegistry.
*
* @param string $key Key to look for
* @return boolean true if key exists in registry, false otherwise
* @return bool true if key exists in registry, false otherwise
* @access public
*/
function isKeySet($key) {

View file

@ -364,7 +364,7 @@ class Configure extends Object {
*
* @param string $content Content to write on file
* @param string $name Name to use for cache file
* @param boolean $write true if content should be written, false otherwise
* @param bool $write true if content should be written, false otherwise
* @access private
*/
function __writeConfig($content, $name, $write = true) {
@ -518,7 +518,7 @@ class Configure extends Object {
* If the alternative paths are set in this file
* they will be added to the paths vars
*
* @param boolean $boot Load application bootstrap (if true)
* @param bool $boot Load application bootstrap (if true)
* @access private
*/
function __loadBootstrap($boot) {

View file

@ -75,7 +75,7 @@ class AclComponent extends Object {
* @param string $aro
* @param string $aco
* @param string $action : default = *
* @return boolean
* @return bool
*/
function check($aro, $aco, $action = "*") {
return $this->_instance->check($aro, $aco, $action);
@ -86,7 +86,7 @@ class AclComponent extends Object {
* @param string $aro
* @param string $aco
* @param string $action : default = *
* @return boolean
* @return bool
*/
function allow($aro, $aco, $action = "*") {
return $this->_instance->allow($aro, $aco, $action);
@ -97,7 +97,7 @@ class AclComponent extends Object {
* @param string $aro
* @param string $aco
* @param string $action : default = *
* @return boolean
* @return bool
*/
function deny($aro, $aco, $action = "*") {
return $this->_instance->deny($aro, $aco, $action);
@ -105,7 +105,7 @@ class AclComponent extends Object {
/**
* Pass-thru function for ACL inherit instance.
*
* @return boolean
* @return bool
*/
function inherit($aro, $aco, $action = "*") {
return $this->_instance->inherit($aro, $aco, $action);
@ -116,7 +116,7 @@ class AclComponent extends Object {
* @param string $aro
* @param string $aco
* @param string $action : default = *
* @return boolean
* @return bool
*/
function grant($aro, $aco, $action = "*") {
return $this->_instance->grant($aro, $aco, $action);
@ -127,7 +127,7 @@ class AclComponent extends Object {
* @param string $aro
* @param string $aco
* @param string $action : default = *
* @return boolean
* @return bool
*/
function revoke($aro, $aco, $action = "*") {
return $this->_instance->revoke($aro, $aco, $action);
@ -136,7 +136,7 @@ class AclComponent extends Object {
* Sets the current ARO instance to object from getAro
*
* @param string $id
* @return boolean
* @return bool
*/
function setAro($id) {
return $this->Aro = $this->_instance->getAro($id);
@ -145,7 +145,7 @@ class AclComponent extends Object {
* Sets the current ACO instance to object from getAco
*
* @param string $id
* @return boolean
* @return bool
*/
function setAco($id) {
return $this->Aco = $this->_instance->getAco($id);
@ -229,7 +229,6 @@ class DB_ACL extends AclBase {
* Enter description here...
*
* @param object $component
* @return void
*/
function initialize(&$component) {
$component->Aro = $this->Aro;
@ -317,7 +316,7 @@ class DB_ACL extends AclBase {
/**
* Allow
*
* @return boolean
* @return bool
*/
function allow($aro, $aco, $actions = "*", $value = 1) {
$perms = $this->getAclLink($aro, $aco);
@ -367,7 +366,7 @@ class DB_ACL extends AclBase {
/**
* Deny
*
* @return boolean
* @return bool
*/
function deny($aro, $aco, $action = "*") {
return $this->allow($aro, $aco, $action, -1);
@ -375,7 +374,7 @@ class DB_ACL extends AclBase {
/**
* Inherit
*
* @return boolean
* @return bool
*/
function inherit($aro, $aco, $action = "*") {
return $this->allow($aro, $aco, $action, 0);
@ -383,7 +382,7 @@ class DB_ACL extends AclBase {
/**
* Allow alias
*
* @return boolean
* @return bool
*/
function grant($aro, $aco, $action = "*") {
return $this->allow($aro, $aco, $action);
@ -391,7 +390,7 @@ class DB_ACL extends AclBase {
/**
* Deny alias
*
* @return boolean
* @return bool
*/
function revoke($aro, $aco, $action = "*") {
return $this->deny($aro, $aco, $action);
@ -482,7 +481,7 @@ class INI_ACL extends AclBase {
*
* @param string $aro
* @param string $aco
* @return boolean
* @return bool
*/
function check($aro, $aco, $aco_action = null) {
if ($this->config == null) {

View file

@ -223,7 +223,6 @@ class AuthComponent extends Object {
*
* @access public
* @param object $controller A reference to the instantiating controller object
* @return void
*/
function initialize(&$controller) {
$this->params = $controller->params;
@ -257,7 +256,6 @@ class AuthComponent extends Object {
*
* @access public
* @param object $controller A reference to the instantiating controller object
* @return void
*/
function startup(&$controller) {
if (low($controller->name) == 'app' || (low($controller->name) == 'tests' && Configure::read() > 0)) {
@ -365,7 +363,6 @@ class AuthComponent extends Object {
*
* @access private
* @param object $controller A reference to the instantiating controller object
* @return void
*/
function __setDefaults() {
if (empty($this->userModel)) {
@ -398,7 +395,7 @@ class AuthComponent extends Object {
* @param string $type
* @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
* @return bool True if $user is authorized, otherwise false
*/
function isAuthorized($type = null, $object = null, $user = null) {
if (empty($user) && !$this->user()) {
@ -490,7 +487,6 @@ class AuthComponent extends Object {
* @param string $action Controller action name
* @param string $action Controller action name
* @param string ... etc.
* @return void
*/
function allow() {
$args = func_get_args();
@ -507,7 +503,6 @@ class AuthComponent extends Object {
* @param string $action Controller action name
* @param string $action Controller action name
* @param string ... etc.
* @return void
* @see AuthComponent::allow()
*/
function deny() {
@ -525,7 +520,6 @@ class AuthComponent extends Object {
*
* @param array $map
* @access public
* @return void
*/
function mapActions($map = array()) {
$crud = array('create', 'read', 'update', 'delete');
@ -549,7 +543,7 @@ class AuthComponent extends Object {
*
* @access public
* @param mixed $data User object
* @return boolean True on login success, false on failure
* @return bool True on login success, false on failure
*/
function login($data = null) {
$this->__setDefaults();
@ -636,7 +630,7 @@ class AuthComponent extends Object {
* valid forms of identifying users, see
* AuthComponent::identify().
* @see AuthComponent::identify()
* @return boolean True if the user validates, false otherwise.
* @return bool True if the user validates, false otherwise.
*/
function validate($object, $user = null, $action = null) {
if (empty($user)) {
@ -655,7 +649,7 @@ class AuthComponent extends Object {
* @param string $action Optional. The controller/action path to validate the
* user against. The current request action is used if
* none is specified.
* @return boolean ACO node path
* @return bool ACO node path
*/
function action($action = ':controller/:action') {
return r(
@ -803,7 +797,6 @@ class AuthComponent extends Object {
*
* @access public
* @param object $controller
* @return void
*/
function shutdown(&$controller) {
if ($this->_loggedIn) {

View file

@ -210,7 +210,7 @@ class CookieComponent extends Object {
*
* @param mixed $key
* @param mixed $value
* @param boolean $encrypt
* @param bool $encrypt
* @param string $expires
* @access public
*/
@ -358,7 +358,7 @@ class CookieComponent extends Object {
* CookieComponent::write(string, string, boolean, '5 Days');
*
* @param mixed $expires
* @return integer
* @return int
* @access private
*/
function __expire($expires = null) {

View file

@ -593,7 +593,7 @@ class EmailComponent extends Object{
* Enter description here...
*
* @param string $value
* @param boolean $message
* @param bool $message
* @return unknown
* @access private
*/
@ -610,7 +610,7 @@ class EmailComponent extends Object{
/**
* wrapper form php mail function
*
* @return boolean
* @return bool
* @access private
*/
function __mail() {
@ -622,7 +622,7 @@ class EmailComponent extends Object{
/**
* Sends out email via SMTP
*
* @return boolean
* @return bool
* @access private
*/
function __smtp() {
@ -692,8 +692,8 @@ class EmailComponent extends Object{
* Private method for sending data to SMTP connection
*
* @param string $data data to be sent to SMTP server
* @param boolean $check check for response from server
* @return boolean
* @param bool $check check for response from server
* @return bool
* @access private
*/
function __sendData($data, $check = true) {
@ -711,7 +711,7 @@ class EmailComponent extends Object{
/**
* SMTP authentication
*
* @return boolean
* @return bool
* @access private
*/
function __authenticate(){

View file

@ -133,7 +133,6 @@ class RequestHandlerComponent extends Object {
* HTTP_ACCEPT
*
* @access public
* @return void
*/
function __construct() {
$this->__acceptTypes = explode(',', env('HTTP_ACCEPT'));
@ -154,7 +153,6 @@ class RequestHandlerComponent extends Object {
* as the first item.
*
* @param object A reference to the controller
* @return void
* @see Router::parseExtensions()
*/
function initialize(&$controller) {
@ -184,7 +182,6 @@ class RequestHandlerComponent extends Object {
* to the $data property of the controller, which can then be saved to a model object.
*
* @param object A reference to the controller
* @return void
*/
function startup(&$controller) {
@ -216,7 +213,6 @@ class RequestHandlerComponent extends Object {
*
* @param object A reference to the controller
* @param mixed A string or array containing the redirect location
* @return void
*/
function beforeRedirect(&$controller, $url) {
if (!$this->isAjax()) {
@ -338,7 +334,6 @@ class RequestHandlerComponent extends Object {
* @param string $name The name of the Content-type, i.e. "html", "xml", "css"
* @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) {
@ -514,7 +509,6 @@ class RequestHandlerComponent extends Object {
*
* @param object $controller A reference to a controller object
* @param string $type
* @return void
* @access public
* @see RequestHandlerComponent::setContent()
* @see RequestHandlerComponent::respondAs()
@ -553,7 +547,7 @@ class RequestHandlerComponent extends Object {
* @param array $options If $type is a friendly type name that is associated with
* more than one type of content, $index is used to select
* which content-type to use.
* @return boolean Returns false if the friendly type name given in $type does
* @return bool Returns false if the friendly type name given in $type does
* not exist in the type map, or if the Content-type header has
* already been set by this method.
* @access public

View file

@ -143,7 +143,6 @@ class SecurityComponent extends Object {
* Sets the actions that require a POST request, or empty for all actions
*
* @access public
* @return void
*/
function requirePost() {
$this->requirePost = func_get_args();
@ -155,7 +154,6 @@ class SecurityComponent extends Object {
* Sets the actions that require a request that is SSL-secured, or empty for all actions
*
* @access public
* @return void
*/
function requireSecure() {
$this->requireSecure = func_get_args();
@ -167,7 +165,6 @@ class SecurityComponent extends Object {
* Sets the actions that require an authenticated request, or empty for all actions
*
* @access public
* @return void
*/
function requireAuth() {
$this->requireAuth = func_get_args();
@ -179,7 +176,6 @@ class SecurityComponent extends Object {
* Sets the actions that require an HTTP-authenticated request, or empty for all actions
*
* @access public
* @return void
*/
function requireLogin() {
$args = func_get_args();
@ -326,7 +322,7 @@ class SecurityComponent extends Object {
* Check if post is required
*
* @param object $controller
* @return boolean
* @return bool
* @access private
*/
function __postRequired(&$controller) {
@ -345,7 +341,7 @@ class SecurityComponent extends Object {
* Check if access requires secure connection
*
* @param object $controller
* @return boolean
* @return bool
* @access private
*/
function __secureRequired(&$controller) {
@ -364,7 +360,7 @@ class SecurityComponent extends Object {
* Check if authentication is required
*
* @param object $controller
* @return boolean
* @return bool
* @access private
*/
function __authRequired(&$controller) {
@ -398,7 +394,7 @@ class SecurityComponent extends Object {
* Check if login is required
*
* @param object $controller
* @return boolean
* @return bool
* @access private
*/
function __loginRequired(&$controller) {
@ -442,7 +438,7 @@ class SecurityComponent extends Object {
* Validate submited form
*
* @param object $controller
* @return boolean
* @return bool
* @access private
*/
function __validatePost(&$controller) {
@ -572,7 +568,7 @@ class SecurityComponent extends Object {
* Add authentication key for new form posts
*
* @param object $controller
* @return boolean
* @return bool
* @access private
*/
function __generateToken(&$controller) {

View file

@ -134,7 +134,7 @@ class SessionComponent extends CakeSession {
* In your controller: $this->Session->del('Controller.sessKey');
*
* @param string $name
* @return boolean, true is session variable is set and can be deleted, false is variable was not set.
* @return bool true is session variable is set and can be deleted, false is variable was not set.
*/
function del($name) {
if ($this->__active === true) {
@ -148,7 +148,7 @@ class SessionComponent extends CakeSession {
* In your controller: $this->Session->delete('Controller.sessKey');
*
* @param string $name
* @return boolean, true is session variable is set and can be deleted, false is variable was not set.
* @return bool, true is session variable is set and can be deleted, false is variable was not set.
* @access public
*/
function delete($name) {
@ -163,7 +163,7 @@ class SessionComponent extends CakeSession {
* In your controller: $this->Session->check('Controller.sessKey');
*
* @param string $name
* @return boolean true is session variable is set, false if not
* @return bool true is session variable is set, false if not
* @access public
*/
function check($name) {
@ -220,7 +220,7 @@ class SessionComponent extends CakeSession {
*
* In your controller: $this->Session->valid();
*
* @return boolean true is session is valid, false is session is invalid
* @return bool true is session is valid, false is session is invalid
* @access public
*/
function valid() {

View file

@ -411,8 +411,8 @@ class Controller extends Object {
*
* @param mixed $url A string or array-based URL pointing to another location
* within the app, or an absolute URL
* @param integer $status Optional HTTP status code
* @param boolean $exit If true, exit() will be called after the redirect
* @param int $status Optional HTTP status code
* @param bool $exit If true, exit() will be called after the redirect
* @access public
*/
function redirect($url, $status = null, $exit = false) {
@ -607,7 +607,7 @@ class Controller extends Object {
* @param string $action Action name to render
* @param string $layout Layout to use
* @param string $file File to use for rendering
* @return boolean Success
* @return bool Success
* @access public
*/
function render($action = null, $layout = null, $file = null) {
@ -667,7 +667,7 @@ class Controller extends Object {
* Gets the referring URL of this request
*
* @param string $default Default URL to use if HTTP_REFERER cannot be read from headers
* @param boolean $local If true, restrict referring URLs to local server
* @param bool $local If true, restrict referring URLs to local server
* @return string Referring URL
* @access public
*/
@ -905,7 +905,7 @@ class Controller extends Object {
* @param array $data POST'ed data organized by model and field
* @param mixed $op A string containing an SQL comparison operator, or an array matching operators to fields
* @param string $bool SQL boolean operator: AND, OR, XOR, etc.
* @param boolean $exclusive If true, and $op is an array, fields not included in $op will not be included in the returned conditions
* @param bool $exclusive If true, and $op is an array, fields not included in $op will not be included in the returned conditions
* @return array An array of model conditions
* @access public
*/
@ -1210,7 +1210,7 @@ class Controller extends Object {
* This method should be overridden in child classes.
*
* @param string $method name of method called example index, edit, etc.
* @return boolean Success
* @return bool Success
* @access protected
*/
function _beforeScaffold($method) {
@ -1220,7 +1220,7 @@ class Controller extends Object {
* This method should be overridden in child classes.
*
* @param string $method name of method called either edit or update.
* @return boolean Success
* @return bool Success
* @access protected
*/
function _afterScaffoldSave($method) {
@ -1230,7 +1230,7 @@ class Controller extends Object {
* This method should be overridden in child classes.
*
* @param string $method name of method called either edit or update.
* @return boolean Success
* @return bool Success
* @access protected
*/
function _afterScaffoldSaveError($method) {
@ -1242,7 +1242,7 @@ class Controller extends Object {
* Method MUST return true in child classes
*
* @param string $method name of method called example index, edit, etc.
* @return boolean Success
* @return bool Success
* @access protected
*/
function _scaffoldError($method) {

View file

@ -97,7 +97,7 @@ class Debugger extends Object {
* @param string $file File on which error occurred
* @param int $line Line that triggered the error
* @param array $context Context
* @return boolean true if error was handled
* @return bool true if error was handled
* @access public
*/
function handleError($code, $description, $file = null, $line = null, $context = null) {

View file

@ -81,7 +81,7 @@ class File extends Object {
* Constructor
*
* @param string $path Path to file
* @param boolean $create Create file if it does not exist (if true)
* @param bool $create Create file if it does not exist (if true)
* @param int $mode Mode to apply to the folder holding the file
* @access private
*/
@ -104,7 +104,6 @@ class File extends Object {
/**
* Closes the current file if it is opened
*
* @return void
* @access private
*/
function __destruct() {
@ -113,7 +112,7 @@ class File extends Object {
/**
* Creates the File.
*
* @return boolean Success
* @return bool Success
* @access public
*/
function create() {
@ -129,8 +128,8 @@ class File extends Object {
* Opens the current file with a given $mode
*
* @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
* @param bool $force If true then the file will be re-opened even if its already opened, otherwise it won't
* @return bool True on success, false on failure
* @access public
*/
function open($mode = 'r', $force = false) {
@ -153,7 +152,7 @@ class File extends Object {
*
* @param string $bytes where to start
* @param string $mode
* @param boolean $force If true then the file will be re-opened even if its already opened, otherwise it won't
* @param bool $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
*/
@ -186,7 +185,7 @@ class File extends Object {
* Sets or gets the offset for the currently opened file.
*
* @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
* @param int $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
*/
@ -206,7 +205,7 @@ class File extends Object {
* @param string $data Data to write to this File.
* @param string $mode Mode of writing. {@link http://php.net/fwrite See fwrite()}.
* @param string $force force the file to open
* @return boolean Success
* @return bool Success
* @access public
*/
function write($data, $mode = 'w', $force = false) {
@ -237,7 +236,7 @@ class File extends Object {
*
* @param string $data Data to write
* @param string $force force the file to open
* @return boolean Success
* @return bool Success
* @access public
*/
function append($data, $force = false) {
@ -246,7 +245,7 @@ class File extends Object {
/**
* Closes the current file if it is opened.
*
* @return boolean True if closing was successful or file was already closed, otherwise false
* @return bool True if closing was successful or file was already closed, otherwise false
* @access public
*/
function close() {
@ -258,7 +257,7 @@ class File extends Object {
/**
* Deletes the File.
*
* @return boolean Success
* @return bool Success
* @access public
*/
function delete() {
@ -360,7 +359,7 @@ class File extends Object {
/**
* Returns true if the File exists.
*
* @return boolean true if it exists, false otherwise
* @return bool true if it exists, false otherwise
* @access public
*/
function exists() {
@ -382,7 +381,7 @@ class File extends Object {
/**
* Returns the Filesize, either in bytes or in human-readable format.
*
* @param boolean $humanReadeble Data to write to this File.
* @param bool $humanReadeble Data to write to this File.
* @return string|int filesize as int or as a human-readable string
* @access public
*/
@ -395,7 +394,7 @@ class File extends Object {
/**
* Returns true if the File is writable.
*
* @return boolean true if its writable, false otherwise
* @return bool true if its writable, false otherwise
* @access public
*/
function writable() {
@ -404,7 +403,7 @@ class File extends Object {
/**
* Returns true if the File is executable.
*
* @return boolean true if its executable, false otherwise
* @return bool true if its executable, false otherwise
* @access public
*/
function executable() {
@ -413,7 +412,7 @@ class File extends Object {
/**
* Returns true if the File is readable.
*
* @return boolean true if file is readable, false otherwise
* @return bool true if file is readable, false otherwise
* @access public
*/
function readable() {

View file

@ -69,8 +69,8 @@ class Flay extends Object{
* Returns given text translated to HTML using the Flay syntax.
*
* @param string $text String to format
* @param boolean $bare Set this to only do <p> transforms and > to &gt;, no typography additions.
* @param boolean $allowHtml Set this to trim whitespace and disable all HTML
* @param bool $bare Set this to only do <p> transforms and > to &gt;, no typography additions.
* @param bool $allowHtml Set this to trim whitespace and disable all HTML
* @return string Formatted text
* @access public
*/
@ -198,7 +198,7 @@ class Flay extends Object{
*
* @param array $words Words to look for and markup
* @param string $string String to look in
* @param integer $max_snippets Max number of snippets to extract
* @param int $max_snippets Max number of snippets to extract
* @return string String with words marked
* @see colorMark
* @access public
@ -265,7 +265,7 @@ class Flay extends Object{
* Return a fragment of a text, up to $length characters long, with an ellipsis after it.
*
* @param string $text Text to be truncated.
* @param integer $length Max length of text.
* @param int $length Max length of text.
* @param string $ellipsis Sign to print after truncated text.
* @return string Fragment
* @access public

View file

@ -93,7 +93,7 @@ class Folder extends Object{
* Constructor.
*
* @param string $path Path to folder
* @param boolean $create Create folder if not found
* @param bool $create Create folder if not found
* @param mixed $mode Mode (CHMOD) to apply to created folder, false to ignore
*/
function __construct($path = false, $create = false, $mode = false) {
@ -139,7 +139,7 @@ class Folder extends Object{
* Returns an array of the contents of the current directory, or false on failure.
* The returned array holds two arrays: one of dirs and one of files.
*
* @param boolean $sort
* @param bool $sort
* @param mixed $exceptions either an array or boolean true will no grab dot files
* @return mixed Contents of current directory as an array, false on failure
* @access public
@ -239,7 +239,7 @@ class Folder extends Object{
* Returns true if given $path is a Windows path.
*
* @param string $path Path to check
* @return boolean true if windows path, false otherwise
* @return bool true if windows path, false otherwise
* @access public
* @static
*/
@ -253,7 +253,7 @@ class Folder extends Object{
* Returns true if given $path is an absolute path.
*
* @param string $path Path to check
* @return boolean
* @return bool
* @access public
* @static
*/
@ -265,7 +265,7 @@ class Folder extends Object{
* Returns true if given $path ends in a slash (i.e. is slash-terminated).
*
* @param string $path Path to check
* @return boolean true if path ends with slash, false otherwise
* @return bool true if path ends with slash, false otherwise
* @access public
* @static
*/
@ -332,7 +332,7 @@ class Folder extends Object{
/**
* Returns true if the File is in a given CakePath.
*
* @return boolean
* @return bool
* @access public
*/
function inCakePath($path = '') {
@ -343,7 +343,7 @@ class Folder extends Object{
/**
* Returns true if the File is in given path.
*
* @return boolean
* @return bool
* @access public
*/
function inPath($path = '', $reverse = false) {
@ -365,7 +365,7 @@ class Folder extends Object{
*
* @param string $pathname The directory structure to create
* @param int $mode octal value 0755
* @param boolean $recursive chmod recursively
* @param bool $recursive chmod recursively
* @param array $exceptions array of files, directories to skip
* @return bool Returns TRUE on success, FALSE on failure
* @access public
@ -535,7 +535,7 @@ class Folder extends Object{
* Recursively Remove directories if system allow.
*
* @param string $path Path of directory to delete
* @return boolean Success
* @return bool Success
* @access public
*/
function delete($path) {
@ -577,7 +577,7 @@ class Folder extends Object{
* Recursive directory copy.
*
* @param array $options (to, from, chmod, skip)
* @return boolean
* @return bool
* @access public
*/
function copy($options = array()) {
@ -649,7 +649,7 @@ class Folder extends Object{
* Recursive directory move.
*
* @param array $options (to, from, chmod, skip)
* @return boolean Success
* @return bool Success
* @access public
*/
function move($options) {

View file

@ -784,7 +784,7 @@ class HttpSocket extends CakeSocket {
/**
* Gets escape chars according to RFC 2616 (HTTP 1.1 specs).
*
* @param boolean $hex true to get them as HEX values, false otherwise
* @param bool $hex true to get them as HEX values, false otherwise
* @return array Escape chars
* @access private
*/
@ -808,8 +808,8 @@ class HttpSocket extends CakeSocket {
* Resets the state of this HttpSocket instance to it's initial state (before Object::__construct got executed) or does
* the same thing partially for the request and the response property only.
*
* @param boolean $full If set to false only HttpSocket::response and HttpSocket::request are reseted
* @return boolean True on success
* @param bool $full If set to false only HttpSocket::response and HttpSocket::request are reseted
* @return bool True on success
* @access public
*/
function reset($full = true) {

View file

@ -97,7 +97,7 @@ class I18n extends Object {
* @param string $plural Plural string (if any)
* @param string $domain Domain
* @param string $category Category
* @param integer $count Count
* @param int $count Count
* @param string $directory Directory that contains the file that is requesting translation
* @return string translated strings.
* @access public
@ -163,7 +163,7 @@ class I18n extends Object {
*
* @param string $type Type
* @param integrer $n Number
* @return integer plural match
* @return int plural match
* @access private
*/
function __pluralGuess(&$type, $n) {

View file

@ -382,7 +382,7 @@ class L10n extends Object {
/**
* Attempts to find the locale settings based on the HTTP_ACCEPT_LANGUAGE variable
*
* @return boolean Success
* @return bool Success
* @access private
*/
function __autoLanguage() {

View file

@ -51,7 +51,7 @@ class MagicDb extends Object {
* Reads a MagicDb from various formats
*
* @var $magicDb mixed Can be an array containing the db, a magic db as a string, or a filename pointing to a magic db in .db or magic.db.php format
* @return boolean Returns false if reading / validation failed or true on success.
* @return bool Returns false if reading / validation failed or true on success.
* @author Felix
**/
function read($magicDb = null) {
@ -137,7 +137,7 @@ class MagicDb extends Object {
* Returns true if the MagicDb instance or the passed $magicDb is valid
*
* @param mixed $magicDb A $magicDb string / array to validate (optional)
* @return boolean True if the $magicDb / instance db validates, false if not
* @return bool True if the $magicDb / instance db validates, false if not
* @access public
*/
function validates($magicDb = null) {

View file

@ -47,7 +47,6 @@ class AclBehavior extends ModelBehavior {
* Sets up the configuation for the model, and loads ACL models if they haven't been already
*
* @param mixed $config
* @return void
*/
function setup(&$model, $config = array()) {
if (is_string($config)) {
@ -83,8 +82,7 @@ class AclBehavior extends ModelBehavior {
/**
* Creates a new ARO/ACO node bound to this record
*
* @param boolean $created True if this is a new record
* @return void
* @param bool $created True if this is a new record
*/
function afterSave(&$model, $created) {
if ($created) {
@ -107,7 +105,6 @@ class AclBehavior extends ModelBehavior {
/**
* Destroys the ARO/ACO node bound to the deleted record
*
* @return void
*/
function afterDelete(&$model) {
$type = $this->__typeMaps[low($this->settings[$model->name]['type'])];

View file

@ -320,8 +320,8 @@ class TranslateBehavior extends ModelBehavior {
*
* @param object instance of model
* @param mixed string with field, or array(field1, field2=>AssocName, field3), or null for bind all original translations
* @param boolead $reset
* @return boolean
* @param bool $reset
* @return bool
*/
function bindTranslation(&$model, $fields = null, $reset = true) {
if (empty($fields)) {
@ -395,7 +395,7 @@ class TranslateBehavior extends ModelBehavior {
*
* @param object instance of model
* @param mixed string with field, or array(field1, field2=>AssocName, field3), or null for unbind all original translations
* @return boolean
* @return bool
*/
function unbindTranslation(&$model, $fields = null) {
if (empty($fields)) {

View file

@ -61,8 +61,8 @@ class TreeBehavior extends ModelBehavior {
* parameters to be saved.
*
* @param AppModel $model
* @param boolean $created indicates whether the node just saved was created or updated
* @return boolean true on success, false on failure
* @param bool $created indicates whether the node just saved was created or updated
* @return bool true on success, false on failure
*/
function afterSave(&$model, $created) {
extract($this->settings[$model->name]);
@ -84,7 +84,7 @@ class TreeBehavior extends ModelBehavior {
* Will delete the current node and all children using the deleteAll method and sync the table
*
* @param AppModel $model
* @return boolean true to continue, false to abort the delete
* @return bool true to continue, false to abort the delete
*/
function beforeDelete(&$model) {
extract($this->settings[$model->name]);
@ -118,7 +118,7 @@ class TreeBehavior extends ModelBehavior {
*
* @since 1.2
* @param AppModel $model
* @return boolean true to continue, false to abort the save
* @return bool true to continue, false to abort the save
*/
function beforeSave(&$model) {
extract($this->settings[$model->name]);
@ -182,7 +182,7 @@ class TreeBehavior extends ModelBehavior {
*
* @param AppModel $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
* @param bool $direct whether to count direct, or all, children
* @return int number of child nodes
* @access public
*/
@ -216,7 +216,7 @@ class TreeBehavior extends ModelBehavior {
*
* @param AppModel $model
* @param mixed $id The ID of the record to read
* @param boolean $direct whether to return only the direct, or all, children
* @param bool $direct whether to return only the direct, or all, children
* @param mixed $fields Either a single string of a field name, or an array of field names
* @param string $order SQL ORDER BY conditions (e.g. "price DESC" or "name ASC") defaults to the tree order
* @param int $limit SQL LIMIT clause, for calculating items per page.
@ -359,7 +359,7 @@ class TreeBehavior extends ModelBehavior {
* @param AppModel $model
* @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
* @return bool true on success, false on failure
* @access public
*/
function movedown(&$model, $id = null, $number = 1) {
@ -403,7 +403,7 @@ class TreeBehavior extends ModelBehavior {
* @param AppModel $model
* @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
* @return bool true on success, false on failure
* @access public
*/
function moveup(&$model, $id = null, $number = 1) {
@ -449,7 +449,7 @@ class TreeBehavior extends ModelBehavior {
* @todo Could be written to be faster, *maybe*. Ideally using a subquery and putting all the logic burden on the DB.
* @param AppModel $model
* @param string $mode parent or tree
* @return boolean true on success, false on failure
* @return bool true on success, false on failure
* @access public
*/
function recover(&$model, $mode = 'parent') {
@ -488,8 +488,8 @@ class TreeBehavior extends ModelBehavior {
*
* @param AppModel $model
* @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
* @param bool $delete whether to delete the node after reparenting children (if any)
* @return bool true on success, false on failure
* @access public
*/
function removefromtree(&$model, $id = null, $delete = false) {
@ -622,7 +622,7 @@ class TreeBehavior extends ModelBehavior {
*
* @param AppModel $model
* @param mixed $parentId
* @return boolean true on success, false on failure
* @return bool true on success, false on failure
* @access protected
*/
function _setParent(&$model, $parentId = null) {

View file

@ -144,7 +144,7 @@ class ConnectionManager extends Object {
*
* @param mixed $connName A string name of the connection, as defined in Connections config,
* or an array containing the file and class name of the object.
* @return boolean True on success, null on failure or false if the class is already loaded
* @return bool True on success, null on failure or false if the class is already loaded
*/
function loadDataSource($connName) {
$_this =& ConnectionManager::getInstance();

View file

@ -336,7 +336,7 @@ class DataSource extends Object {
* Returns true if the DataSource supports the given interface (method)
*
* @param string $interface The name of the interface (method)
* @return boolean True on success
* @return bool True on success
*/
function isInterfaceSupported($interface) {
$methods = get_class_methods(get_class($this));
@ -349,7 +349,6 @@ class DataSource extends Object {
* Sets the configuration for the DataSource
*
* @param array $config The configuration array
* @return void
*/
function setConfig($config) {
if (is_array($this->_baseConfig)) {
@ -364,7 +363,6 @@ class DataSource extends Object {
*
* @param string $object The name of the object (model) to cache
* @param mixed $data The description of the model, usually a string or array
* @return void
*/
function __cacheDescription($object, $data = null) {
if ($this->cacheSources === false) {

View file

@ -103,7 +103,7 @@ class DboAdodb extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
return $this->_adodb->Close();
@ -149,7 +149,7 @@ class DboAdodb extends DboSource {
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin(&$model) {
@ -165,7 +165,7 @@ class DboAdodb extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -180,7 +180,7 @@ class DboAdodb extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -306,7 +306,7 @@ class DboAdodb extends DboSource {
*
* @param string $data String to be prepared for use in an SQL statement
* @param string $column_type The type of the column into which this data will be inserted
* @param boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
* @param bool $safe Whether or not numeric data should be handled automagically if no column data is provided
* @return string Quoted and escaped data
*/
function value($data, $column = null, $safe = false) {

View file

@ -104,7 +104,7 @@ class DboDb2 extends DboSource {
/**
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @return bool True if the database could be connected, else false
*/
function connect() {
$config = $this->config;
@ -138,7 +138,7 @@ class DboDb2 extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
@db2_free_result($this->results);
@ -306,7 +306,7 @@ class DboDb2 extends DboSource {
* started successfully, otherwise false.
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin(&$model) {
@ -322,7 +322,7 @@ class DboDb2 extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -340,7 +340,7 @@ class DboDb2 extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/

View file

@ -112,7 +112,7 @@ class DboFirebird extends DboSource {
/**
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @return bool True if the database could be connected, else false
*/
function connect() {
$config = $this->config;
@ -125,7 +125,7 @@ class DboFirebird extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
$this->connected = false;
@ -241,7 +241,7 @@ class DboFirebird extends DboSource {
*
* @param string $data String to be prepared for use in an SQL statement
* @param string $column The column into which this data will be inserted
* @param boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
* @param bool $safe Whether or not numeric data should be handled automagically if no column data is provided
* @return string Quoted and escaped data
*/
function value($data, $column = null, $safe = false) {

View file

@ -97,7 +97,7 @@ class DboMssql extends DboSource {
* MS SQL DBO driver constructor; sets SQL Server error reporting defaults
*
* @param array $config Configuration data from app/config/databases.php
* @return boolean True if connected successfully, false on error
* @return bool True if connected successfully, false on error
*/
function __construct($config, $autoConnect = true) {
if ($autoConnect) {
@ -112,7 +112,7 @@ class DboMssql extends DboSource {
/**
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @return bool True if the database could be connected, else false
*/
function connect() {
$config = $this->config;
@ -145,7 +145,7 @@ class DboMssql extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
@mssql_free_result($this->results);
@ -221,7 +221,7 @@ class DboMssql extends DboSource {
*
* @param string $data String to be prepared for use in an SQL statement
* @param string $column The column into which this data will be inserted
* @param boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
* @param bool $safe Whether or not numeric data should be handled automagically if no column data is provided
* @return string Quoted and escaped data
*/
function value($data, $column = null, $safe = false) {
@ -291,7 +291,7 @@ class DboMssql extends DboSource {
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin(&$model) {
@ -307,7 +307,7 @@ class DboMssql extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -322,7 +322,7 @@ class DboMssql extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -551,7 +551,7 @@ class DboMssql extends DboSource {
* Returns false if no rows matched.
*
* @param string $sql SQL statement
* @param boolean $cache Enables returning/storing cached query results
* @param bool $cache Enables returning/storing cached query results
* @return array Array of resultset rows, or false if no rows matched
*/
function read(&$model, $queryData = array(), $recursive = null) {

View file

@ -89,7 +89,7 @@ class DboMysql extends DboSource {
/**
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @return bool True if the database could be connected, else false
*/
function connect() {
$config = $this->config;
@ -115,7 +115,7 @@ class DboMysql extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
@mysql_free_result($this->results);
@ -198,7 +198,7 @@ class DboMysql extends DboSource {
*
* @param string $data String to be prepared for use in an SQL statement
* @param string $column The column into which this data will be inserted
* @param boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
* @param bool $safe Whether or not numeric data should be handled automagically if no column data is provided
* @return string Quoted and escaped data
*/
function value($data, $column = null, $safe = false) {
@ -237,7 +237,7 @@ class DboMysql extends DboSource {
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin(&$model) {
@ -253,7 +253,7 @@ class DboMysql extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -268,7 +268,7 @@ class DboMysql extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -440,7 +440,6 @@ class DboMysql extends DboSource {
* Sets the database encoding
*
* @param string $enc Database encoding
* @return void
*/
function setEncoding($enc) {
return $this->_execute('SET NAMES ' . $enc) != false;

View file

@ -85,7 +85,7 @@ class DboMysqli extends DboSource {
/**
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @return bool True if the database could be connected, else false
*/
function connect() {
$config = $this->config;
@ -104,7 +104,7 @@ class DboMysqli extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
@mysqli_free_result($this->results);
@ -184,7 +184,7 @@ class DboMysqli extends DboSource {
*
* @param string $data String to be prepared for use in an SQL statement
* @param string $column The column into which this data will be inserted
* @param boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
* @param bool $safe Whether or not numeric data should be handled automagically if no column data is provided
* @return string Quoted and escaped data
*/
function value($data, $column = null, $safe = false) {
@ -223,7 +223,7 @@ class DboMysqli extends DboSource {
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin(&$model) {
@ -239,7 +239,7 @@ class DboMysqli extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -254,7 +254,7 @@ class DboMysqli extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -424,7 +424,6 @@ class DboMysqli extends DboSource {
* Sets the database encoding
*
* @param string $enc Database encoding
* @return void
*/
function setEncoding($enc) {
return $this->_execute('SET NAMES ' . $enc) != false;

View file

@ -94,7 +94,7 @@ class DboOdbc extends DboSource{
/**
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @return bool True if the database could be connected, else false
*/
function connect() {
$config = $this->config;
@ -113,7 +113,7 @@ class DboOdbc extends DboSource{
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
return @odbc_close($this->connection);
@ -261,7 +261,7 @@ class DboOdbc extends DboSource{
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin(&$model) {
@ -279,7 +279,7 @@ class DboOdbc extends DboSource{
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -298,7 +298,7 @@ class DboOdbc extends DboSource{
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/

View file

@ -133,7 +133,7 @@ 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
* @return bool True if the database could be connected, else false
* @access public
*/
function connect() {
@ -162,7 +162,7 @@ class DboOracle extends DboSource {
* Sets the encoding language of the session
*
* @param string $lang language constant
* @return boolean
* @return bool
*/
function setEncoding($lang) {
if (!$this->execute('ALTER SESSION SET NLS_LANGUAGE='.$lang)) {
@ -189,7 +189,7 @@ class DboOracle extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
* @access public
*/
function disconnect() {
@ -345,7 +345,7 @@ class DboOracle extends DboSource {
* Checks to see if a named sequence exists
*
* @param string $sequence
* @return boolean
* @return bool
* @access public
*/
function sequenceExists($sequence) {
@ -359,7 +359,7 @@ class DboOracle extends DboSource {
* Creates a database sequence
*
* @param string $sequence
* @return boolean
* @return bool
* @access public
*/
function createSequence($sequence) {
@ -455,7 +455,7 @@ class DboOracle extends DboSource {
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin() {
@ -466,7 +466,7 @@ class DboOracle extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -477,7 +477,7 @@ class DboOracle extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/

View file

@ -105,7 +105,7 @@ class DboPostgres extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
@pg_free_result($this->results);
@ -256,7 +256,7 @@ class DboPostgres extends DboSource {
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin(&$model) {
@ -273,7 +273,7 @@ class DboPostgres extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -289,7 +289,7 @@ class DboPostgres extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -542,7 +542,7 @@ class DboPostgres extends DboSource {
* Translates between PHP boolean values and PostgreSQL boolean values
*
* @param mixed $data Value to be translated
* @param boolean $quote True to quote value, false otherwise
* @param bool $quote True to quote value, false otherwise
* @return mixed Converted boolean value
*/
function boolean($data, $quote = true) {
@ -565,7 +565,7 @@ class DboPostgres extends DboSource {
* Sets the database encoding
*
* @param mixed $enc Database encoding
* @return boolean True on success, false on failure
* @return bool True on success, false on failure
*/
function setEncoding($enc) {
return pg_set_client_encoding($this->connection, $enc) == 0;

View file

@ -98,7 +98,7 @@ class DboSqlite extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
@sqlite_close($this->connection);
@ -205,7 +205,7 @@ class DboSqlite extends DboSource {
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin (&$model) {
@ -221,7 +221,7 @@ class DboSqlite extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -236,7 +236,7 @@ class DboSqlite extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/

View file

@ -87,7 +87,7 @@ class DboSybase extends DboSource {
/**
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @return bool True if the database could be connected, else false
*/
function connect() {
$config = $this->config;
@ -107,7 +107,7 @@ class DboSybase extends DboSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return bool True if the database could be disconnected, else false
*/
function disconnect() {
$this->connected = !@sybase_close($this->connection);
@ -184,7 +184,7 @@ class DboSybase extends DboSource {
*
* @param string $data String to be prepared for use in an SQL statement
* @param string $column The column into which this data will be inserted
* @param boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
* @param bool $safe Whether or not numeric data should be handled automagically if no column data is provided
* @return string Quoted and escaped data
*/
function value($data, $column = null, $safe = false) {
@ -217,7 +217,7 @@ class DboSybase extends DboSource {
* Begin a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions).
*/
function begin(&$model) {
@ -233,7 +233,7 @@ class DboSybase extends DboSource {
* Commit a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/
@ -248,7 +248,7 @@ class DboSybase extends DboSource {
* Rollback a transaction
*
* @param unknown_type $model
* @return boolean True on success, false on fail
* @return bool True on success, false on fail
* (i.e. if the database/model does not support transactions,
* or a transaction has not started).
*/

View file

@ -102,7 +102,7 @@ class DboSource extends DataSource {
* Reconnects to database server with optional new settings
*
* @param array $config An array defining the new configuration settings
* @return boolean True on success, false on failure
* @return bool True on success, false on failure
*/
function reconnect($config = null) {
$this->disconnect();
@ -284,7 +284,7 @@ class DboSource extends DataSource {
* Returns false if no rows matched.
*
* @param string $sql SQL statement
* @param boolean $cache Enables returning/storing cached query results
* @param bool $cache Enables returning/storing cached query results
* @return array Array of resultset rows, or false if no rows matched
*/
function fetchAll($sql, $cache = true, $modelName = null) {
@ -363,7 +363,7 @@ class DboSource extends DataSource {
/**
* Checks if it's connected to the database
*
* @return boolean True if the database is connected, else false
* @return bool True if the database is connected, else false
*/
function isConnected() {
return $this->connected;
@ -371,7 +371,7 @@ class DboSource extends DataSource {
/**
* Outputs the contents of the queries log.
*
* @param boolean $sorted
* @param bool $sorted
*/
function showLog($sorted = false) {
if ($sorted) {
@ -448,7 +448,7 @@ class DboSource extends DataSource {
* Gets full table name including prefix
*
* @param mixed $model
* @param boolean $quote
* @param bool $quote
* @return string Full quoted table name
*/
function fullTableName($model, $quote = true) {
@ -470,7 +470,7 @@ class DboSource extends DataSource {
* @param Model $model
* @param array $fields
* @param array $values
* @return boolean Success
* @return bool Success
*/
function create(&$model, $fields = null, $values = null) {
$fieldInsert = array();
@ -519,7 +519,7 @@ class DboSource extends DataSource {
*
* @param Model $model
* @param array $queryData
* @param integer $recursive Number of levels of association
* @param int $recursive Number of levels of association
* @return unknown
*/
function read(&$model, $queryData = array(), $recursive = null) {
@ -661,7 +661,7 @@ class DboSource extends DataSource {
* @param unknown_type $queryData
* @param unknown_type $external
* @param unknown_type $resultSet
* @param integer $recursive Number of levels of association
* @param int $recursive Number of levels of association
* @param array $stack
*/
function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, &$queryData, $external = false, &$resultSet, $recursive, $stack) {
@ -1284,7 +1284,7 @@ class DboSource extends DataSource {
*
* @param Model $model
* @param mixed $conditions
* @return boolean Success
* @return bool Success
*/
function delete(&$model, $conditions = null) {
$query = $this->defaultConditions($model, $conditions);
@ -1362,7 +1362,7 @@ class DboSource extends DataSource {
* @param Model $model
* @param string $alias Alias tablename
* @param mixed $fields
* @param boolean $quote If false, returns fields array unquoted
* @param bool $quote If false, returns fields array unquoted
* @return array
*/
function fields(&$model, $alias = null, $fields = array(), $quote = true) {
@ -1794,7 +1794,7 @@ class DboSource extends DataSource {
*
* @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
* @return bool True if the table has a matching record, else false
*/
function hasAny($model, $sql) {
$sql = $this->conditions($sql);

View file

@ -333,7 +333,7 @@ class Model extends Overloadable {
/**
* Constructor. Binds the Model's database table to the object.
*
* @param integer $id
* @param int $id
* @param string $table Name of database table to use.
* @param DataSource $ds DataSource connection object.
*/
@ -518,8 +518,7 @@ class Model extends Overloadable {
* to the originals defined in the model
*
* @param array $params
* @param boolean $permanent
* @return void
* @param bool $permanent
*/
function bind($model, $options, $permanent = true) {
if (!is_array($model)) {
@ -556,8 +555,8 @@ class Model extends Overloadable {
* to the originals defined in the model
*
* @param array $params
* @param boolean $reset
* @return boolean Always true
* @param bool $reset
* @return bool Always true
*/
function bindModel($params, $reset = true) {
@ -593,8 +592,8 @@ class Model extends Overloadable {
* </code>
*
* @param array $params
* @param boolean $reset
* @return boolean Always true
* @param bool $reset
* @return bool Always true
*/
function unbindModel($params, $reset = true) {
foreach ($params as $assoc => $models) {
@ -912,7 +911,7 @@ class Model extends Overloadable {
* Returns true if this Model has given field in its database table.
*
* @param string $name Name of field to look for
* @return boolean
* @return bool
*/
function hasField($name) {
if (is_array($name)) {
@ -1031,8 +1030,8 @@ class Model extends Overloadable {
*
* @param string $name Name of the table field
* @param mixed $value Value of the field
* @param boolean $validate Whether or not this model should validate before saving (defaults to false)
* @return boolean True on success save
* @param bool $validate Whether or not this model should validate before saving (defaults to false)
* @return bool True on success save
*/
function saveField($name, $value, $validate = false) {
return $this->save(array($this->name => array($name => $value)), $validate, array($name));
@ -1042,9 +1041,9 @@ class Model extends Overloadable {
* By default, validation occurs before save.
*
* @param array $data Data to save.
* @param boolean $validate If set, validation will be done before the save
* @param bool $validate If set, validation will be done before the save
* @param array $fieldList List of fields to allow to be written
* @return boolean success
* @return bool success
*/
function save($data = null, $validate = true, $fieldList = array()) {
$db =& ConnectionManager::getDataSource($this->useDbConfig);
@ -1242,7 +1241,7 @@ class Model extends Overloadable {
*
* @param mixed $conditions
* @param mixed $fields
* @return boolean True on success, false on failure
* @return bool True on success, false on failure
*/
function updateAll($fields, $conditions = true) {
$db =& ConnectionManager::getDataSource($this->useDbConfig);
@ -1253,7 +1252,7 @@ class Model extends Overloadable {
*
* @param mixed $id
* @see function del
* @return boolean True on success
* @return bool True on success
*/
function remove($id = null, $cascade = true) {
return $this->del($id, $cascade);
@ -1262,7 +1261,7 @@ class Model extends Overloadable {
* Removes record for given id. If no id is given, the current id is used. Returns true on success.
*
* @param mixed $id Id of record to delete
* @return boolean True on success
* @return bool True on success
*/
function del($id = null, $cascade = true) {
if (!empty($id)) {
@ -1305,7 +1304,7 @@ class Model extends Overloadable {
* Alias for del()
*
* @param mixed $id Id of record to delete
* @return boolean True on success
* @return bool True on success
*/
function delete($id = null, $cascade = true) {
return $this->del($id, $cascade);
@ -1372,7 +1371,7 @@ class Model extends Overloadable {
*
* @param mixed $conditions
* @param mixed $fields
* @return boolean True on success, false on failure
* @return bool True on success, false on failure
*/
function deleteAll($conditions, $cascade = true) {
if (empty($conditions)) {
@ -1395,8 +1394,8 @@ class Model extends Overloadable {
/**
* Returns true if a record with set id exists.
*
* @param boolean $reset if true will force database query
* @return boolean True if such a record exists
* @param bool $reset if true will force database query
* @return bool True if such a record exists
*/
function exists($reset = false) {
if ($this->getID() === false) {
@ -1411,7 +1410,7 @@ class Model extends Overloadable {
* Returns true if a record that meets given conditions exists
*
* @param array $conditions SQL conditions array
* @return boolean True if such a record exists
* @return bool True if such a record exists
*/
function hasAny($conditions = null) {
return ($this->find('count', array('conditions' => $conditions, 'recursive' => -1)) != false);
@ -1618,8 +1617,8 @@ class Model extends Overloadable {
* False if any fields passed match any (by default, all if $or = false) of their matching values.
*
* @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
* @param bool $or If false, all fields specified must match in order for a false return value
* @return bool False if any records matching any fields are found
*/
function isUnique($fields, $or = true) {
if (!is_array($fields)) {
@ -1730,7 +1729,7 @@ class Model extends Overloadable {
/**
* Returns true if all fields pass validation, otherwise false.
*
* @return boolean True if there are no errors
* @return bool True if there are no errors
*/
function validates($data = array()) {
if (!empty($data)) {
@ -1856,7 +1855,6 @@ class Model extends Overloadable {
*
* @param string $field The name of the field to invalidate
* @param mixed $value
* @return void
*/
function invalidate($field, $value = null) {
if (!is_array($this->validationErrors)) {
@ -2000,7 +1998,6 @@ class Model extends Overloadable {
* Sets the ID of the last record this Model inserted
*
* @param mixed $id
* @return void
*/
function setInsertID($id) {
$this->__insertID = $id;
@ -2027,7 +2024,7 @@ class Model extends Overloadable {
* Sets the DataSource to which this model is bound
*
* @param string $dataSource The name of the DataSource, as defined in Connections.php
* @return boolean True on success
* @return bool True on success
*/
function setDataSource($dataSource = null) {
if ($dataSource != null) {
@ -2094,7 +2091,7 @@ class Model extends Overloadable {
* Before find callback
*
* @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
* @return bool True if the operation should continue, false if it should abort
*/
function beforeFind($queryData) {
return true;
@ -2103,7 +2100,7 @@ class Model extends Overloadable {
* After find callback. Can be used to modify any results returned by find and findAll.
*
* @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)
* @param bool $primary Whether this model is being queried directly (vs. being queried as an association)
* @return mixed Result of the find operation
*/
function afterFind($results, $primary = false) {
@ -2112,7 +2109,7 @@ class Model extends Overloadable {
/**
* Before save callback
*
* @return boolean True if the operation should continue, false if it should abort
* @return bool True if the operation should continue, false if it should abort
*/
function beforeSave() {
return true;
@ -2120,15 +2117,14 @@ class Model extends Overloadable {
/**
* After save callback
*
* @param boolean $created True if this save created a new record
* @return void
* @param bool $created True if this save created a new record
*/
function afterSave($created) {
}
/**
* Before delete callback
*
* @return boolean True if the operation should continue, false if it should abort
* @return bool True if the operation should continue, false if it should abort
*/
function beforeDelete() {
return true;
@ -2136,7 +2132,6 @@ class Model extends Overloadable {
/**
* After delete callback
*
* @return void
*/
function afterDelete() {
}
@ -2151,7 +2146,6 @@ class Model extends Overloadable {
/**
* DataSource error callback
*
* @return void
*/
function onError() {
}
@ -2160,7 +2154,7 @@ class Model extends Overloadable {
*
* @param string $type If null this deletes cached views if Cache.check is true
* Will be used to allow deleting query cache also
* @return boolean true on delete
* @return bool true on delete
*/
function _clearCache($type = null) {
if ($type === null) {
@ -2193,7 +2187,6 @@ class Model extends Overloadable {
/**
* Called when unserializing a model
*
* @return void
*/
function __wakeup() {
}

View file

@ -100,7 +100,7 @@ class CakeSchema extends Object {
*
* @param array $events schema object properties
* @access public
* @return boolean
* @return bool
*/
function before($event = array()) {
return true;
@ -110,7 +110,6 @@ class CakeSchema extends Object {
*
* @param array $events schema object properties
* @access public
* @return void
*/
function after($event = array()) {
}

View file

@ -181,7 +181,7 @@ class Object {
*
* @param string $name name of the class to persist
* @param string $object the object to persist
* @return boolean Success
* @return bool Success
* @access protected
* @todo add examples to manual
*/

View file

@ -74,7 +74,7 @@ class Overloadable extends Object {
* @param string $method Method name
* @param array $params Parameters to send to method
* @param mixed $return Where to store return value from method
* @return boolean Success
* @return bool Success
* @access private
*/
function __call($method, $params, &$return) {
@ -126,7 +126,7 @@ class Overloadable2 extends Object {
* @param string $method Method name
* @param array $params Parameters to send to method
* @param mixed $return Where to store return value from method
* @return boolean Success
* @return bool Success
* @access private
*/
function __call($method, $params, &$return) {
@ -142,7 +142,7 @@ class Overloadable2 extends Object {
*
* @param mixed $name What to get
* @param mixed $value Where to store returned value
* @return boolean Success
* @return bool Success
* @access private
*/
function __get($name, &$value) {
@ -155,7 +155,7 @@ class Overloadable2 extends Object {
*
* @param mixed $name What to set
* @param mixed $value Value to set
* @return boolean Success
* @return bool Success
* @access private
*/
function __set($name, $value) {

View file

@ -89,7 +89,7 @@ class Overloadable2 extends Object {
*
* @param mixed $name What to get
* @param mixed $value Where to store returned value
* @return boolean Success
* @return bool Success
* @access private
*/
function __get($name) {
@ -101,7 +101,7 @@ class Overloadable2 extends Object {
*
* @param mixed $name What to set
* @param mixed $value Value to set
* @return boolean Success
* @return bool Success
* @access private
*/
function __set($name, $value) {

View file

@ -531,7 +531,7 @@ class Router extends Object {
/**
* Gets parameter information
*
* @param boolean $current Get current parameter (true)
* @param bool $current Get current parameter (true)
* @return array Parameter information
* @access public
* @static
@ -547,7 +547,7 @@ class Router extends Object {
* Gets URL parameter by name
*
* @param string $name Parameter name
* @param boolean $current Current parameter
* @param bool $current Current parameter
* @return string Parameter value
* @access public
* @static
@ -563,7 +563,7 @@ class Router extends Object {
/**
* Gets path information
*
* @param boolean $current Current parameter
* @param bool $current Current parameter
* @return array
* @access public
* @static
@ -592,7 +592,7 @@ class Router extends Object {
*
* @param $which A zero-based array index representing the route to move. For example,
* if 3 routes have been added, the last route would be 2.
* @return boolean Retuns false if no route exists at the position specified by $which.
* @return bool Retuns false if no route exists at the position specified by $which.
* @access public
* @static
*/
@ -622,7 +622,7 @@ class Router extends Object {
* or an array specifying any of the following: 'controller', 'action',
* and/or 'plugin', in addition to named arguments (keyed array elements),
* and standard URL arguments (indexed array elements)
* @param boolean $full If true, the full base URL will be prepended to the result
* @param bool $full If true, the full base URL will be prepended to the result
* @return string Full translated URL with base path.
* @access public
* @static

View file

@ -83,7 +83,7 @@ class Sanitize{
* Returns given string safe for display as HTML. Renders entities.
*
* @param string $string String from where to strip tags
* @param boolean $remove If true, the string is stripped of all HTML tags
* @param bool $remove If true, the string is stripped of all HTML tags
* @return string Sanitized string
* @access public
* @static

View file

@ -97,7 +97,7 @@ class Security extends Object {
* Validate authorization hash.
*
* @param string $authKey Authorization hash
* @return boolean Success
* @return bool Success
* @access public
* @static
*/
@ -149,7 +149,6 @@ class Security extends Object {
* Security::hash().
*
* @param string $hash Method to use (sha1/sha256/md5)
* @return void
* @access public
* @static
* @see Security::hash()

View file

@ -111,7 +111,7 @@ class CakeSession extends Object {
* Constructor.
*
* @param string $base The base path for the Session
* @param boolean $start Should session be started right now
* @param bool $start Should session be started right now
* @access public
*/
function __construct($base = null, $start = true) {
@ -160,7 +160,7 @@ class CakeSession extends Object {
* Returns true if given variable is set in session.
*
* @param string $name Variable name to check for
* @return boolean True if variable is there
* @return bool True if variable is there
* @access public
*/
function check($name) {
@ -199,7 +199,7 @@ class CakeSession extends Object {
* Removes a variable from session.
*
* @param string $name Session variable to remove
* @return boolean Success
* @return bool Success
* @access public
*/
function del($name) {
@ -262,7 +262,7 @@ class CakeSession extends Object {
/**
* Returns true if session is valid.
*
* @return boolean Success
* @return bool Success
* @access public
*/
function valid() {
@ -350,7 +350,7 @@ class CakeSession extends Object {
*
* @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
* @return bool True if the write was successful, false if the write failed
* @access public
*/
function write($name, $value) {
@ -590,7 +590,7 @@ class CakeSession extends Object {
/**
* Method called on open of a database session.
*
* @return boolean Success
* @return bool Success
* @access private
*/
function __open() {
@ -599,7 +599,7 @@ class CakeSession extends Object {
/**
* Method called on close of a database session.
*
* @return boolean Success
* @return bool Success
* @access private
*/
function __close() {
@ -636,7 +636,7 @@ class CakeSession extends Object {
*
* @param mixed $key The name of the var
* @param mixed $value The value of the var
* @return boolean Success
* @return bool Success
* @access private
*/
function __write($key, $value) {
@ -679,7 +679,7 @@ class CakeSession extends Object {
* Method called on the destruction of a database session.
*
* @param int $key Key that uniquely identifies session in database
* @return boolean Success
* @return bool Success
* @access private
*/
function __destroy($key) {
@ -692,7 +692,7 @@ class CakeSession extends Object {
* Helper function called on gc for database sessions.
*
* @param int $expires Timestamp (defaults to current time)
* @return boolean Success
* @return bool Success
* @access private
*/
function __gc($expires = null) {

View file

@ -109,7 +109,7 @@ class Set extends Object {
* Filters empty elements out of a route array, excluding '0'.
*
* @param mixed $var Either an array to filter, or value when in callback
* @param boolean $isArray Force to tell $var is an array when $var is empty
* @param bool $isArray Force to tell $var is an array when $var is empty
* @return mixed Either filtered array, or true/false when in callback
* @access public
*/
@ -253,7 +253,7 @@ class Set extends Object {
* Checks to see if all the values in the array are numeric
*
* @param array $array The array to check. If null, the value of the current Set object
* @return boolean true if values are numeric, false otherwise
* @return bool true if values are numeric, false otherwise
* @access public
*/
function numeric($array = null) {
@ -484,7 +484,7 @@ class Set extends Object {
*
* @param mixed $data Data to check on
* @param mixed $path A dot-separated string.
* @return boolean true if path is found, false otherwise
* @return bool true if path is found, false otherwise
* @access public
*/
function check($data, $path = null) {
@ -557,7 +557,7 @@ class Set extends Object {
*
* @param array $val1 First value
* @param array $val2 Second value
* @return boolean true if they are equal, false otherwise
* @return bool true if they are equal, false otherwise
* @access public
*/
function isEqual($val1, $val2 = null) {
@ -573,7 +573,7 @@ class Set extends Object {
*
* @param array $val1 First value
* @param array $val2 Second value
* @return boolean true if $val1 contains $val2, false otherwise
* @return bool true if $val1 contains $val2, false otherwise
* @access public
*/
function contains($val1, $val2 = null) {
@ -621,9 +621,9 @@ class Set extends Object {
* Normalizes a string or array list.
*
* @param mixed $list List to normalize
* @param boolean $assoc If true, $list will be converted to an associative array
* @param bool $assoc If true, $list will be converted to an associative array
* @param string $sep If $list is a string, it will be split into an array with $sep
* @param boolean $trim If true, separated strings will be trimmed
* @param bool $trim If true, separated strings will be trimmed
* @return array
* @access public
*/

View file

@ -106,7 +106,7 @@ class CakeSocket extends Object {
/**
* Connect the socket to the given host and port.
*
* @return boolean Success
* @return bool Success
* @access public
*/
function connect() {
@ -196,7 +196,7 @@ class CakeSocket extends Object {
* Write data to the socket.
*
* @param string $data The data to write to the socket
* @return boolean Success
* @return bool Success
* @access public
*/
function write($data) {
@ -233,7 +233,7 @@ class CakeSocket extends Object {
/**
* Abort socket operation.
*
* @return boolean Success
* @return bool Success
* @access public
*/
function abort() {
@ -241,7 +241,7 @@ class CakeSocket extends Object {
/**
* Disconnect the socket from the current connection.
*
* @return boolean Success
* @return bool Success
* @access public
*/
function disconnect() {

View file

@ -196,8 +196,8 @@ class String extends Object {
*
* @param multi-byte string $haystack
* @param multi-byte string $needle
* @param integer $offset
* @return integer or false
* @param int $offset
* @return int|boolean
* @access public
* @static
*/
@ -235,8 +235,8 @@ class String extends Object {
*
* @param multi-byte string $haystack
* @param multi-byte string $needle
* @param integer $offset
* @return integer or false
* @param int $offset
* @return int|boolean
* @access public
* @static
*/
@ -669,7 +669,7 @@ class String extends Object {
/**
* Find the related code folding values for $char
*
* @param integer $char decimal value of character
* @param int $char decimal value of character
* @param string $type
* @return array
* @access private

View file

@ -115,7 +115,7 @@ class Validation extends Object {
* array('check' => 'valueToCheck');
*
* @param mixed $check Value to check
* @return boolean Success
* @return bool Success
* @access public
*/
function alphaNumeric($check) {
@ -145,7 +145,7 @@ class Validation extends Object {
* @param string $check Value to check for length
* @param int $min Minimum value in range (inclusive)
* @param int $max Maximum value in range (inclusive)
* @return boolean Success
* @return bool Success
* @access public
*/
function between($check, $min, $max) {
@ -165,7 +165,7 @@ class Validation extends Object {
* array('check' => 'valueToCheck');
*
* @param mixed $check Value to check
* @return boolean Success
* @return bool Success
* @access public
*/
function blank($check) {
@ -191,9 +191,9 @@ class Validation extends Object {
* @param mixed $type 'all' may be passed as a sting, defaults to fast which checks format of most major credit cards
* if an array is used only the values of the array are checked.
* Example: array('amex', 'bankcard', 'maestro')
* @param boolean $deep set to true this will check the Luhn algorithm of the credit card.
* @param bool $deep set to true this will check the Luhn algorithm of the credit card.
* @param string $regex A custom regex can also be passed, this will be used instead of the defined regex values
* @return boolean Success
* @return bool Success
* @access public
* @see Validation::_luhn()
*/
@ -271,7 +271,7 @@ class Validation extends Object {
* is greater >, is less <, greater or equal >=
* less or equal <=, is less <, equal to ==, not equal !=
* @param int $check2 only needed if $check1 is a string
* @return boolean
* @return bool
* @access public
*/
function comparison($check1, $operator = null, $check2 = null) {
@ -331,7 +331,7 @@ class Validation extends Object {
* @param mixed $check When used as a string, $regex must also be a valid regular expression.
* 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
* @return bool Success
* @access public
*/
function custom($check, $regex = null) {
@ -361,7 +361,7 @@ class Validation extends Object {
* My December 2006 or Dec 2006
* my 12/2006 or 12/06 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
* @return bool Success
* @access public
*/
function date($check, $format = 'ymd', $regex = null) {
@ -403,10 +403,10 @@ class Validation extends Object {
* Checks that a value is a valid decimal. If $places is null, the $check is allowed to be a scientific float
* If no decimal point is found a false will be returned. Both the sign and exponent are optional.
*
* @param integer $check The value the test for decimal
* @param integer $places if set $check value must have exactly $places after the decimal point
* @param int $check The value the test for decimal
* @param int $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
* @return bool Success
* @access public
*/
function decimal($check, $places = null, $regex = null) {
@ -430,9 +430,9 @@ class Validation extends Object {
* Validates for an email address.
*
* @param string $check Value to check
* @param boolean $deep Perform a deeper validation (if true), by also checking availability of host
* @param bool $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
* @return bool Success
* @access public
*/
function email($check, $deep = false, $regex= null) {
@ -487,7 +487,7 @@ class Validation extends Object {
* Validation of an IPv4 address.
*
* @param string $check The string to test.
* @return boolean Success
* @return bool Success
* @access public
*/
function ip($check) {
@ -508,7 +508,7 @@ class Validation extends Object {
*
* @param string $check The string to test
* @param int $min The minimal string length
* @return boolean Success
* @return bool Success
* @access public
*/
function minLength($check, $min) {
@ -520,7 +520,7 @@ class Validation extends Object {
*
* @param string $check The string to test
* @param int $max The maximal string length
* @return boolean Success
* @return bool Success
* @access public
*/
function maxLength($check, $max) {
@ -532,7 +532,7 @@ class Validation extends Object {
*
* @param string $check Value to check
* @param string $symbolPosition Where symbol is located (left/right)
* @return boolean Success
* @return bool Success
* @access public
*/
function money($check, $symbolPosition = 'left') {
@ -582,7 +582,7 @@ class Validation extends Object {
* Checks if a value is numeric.
*
* @param string $check Value to check
* @return boolean Succcess
* @return bool Succcess
* @access public
*/
function numeric($check) {
@ -594,7 +594,7 @@ class Validation extends Object {
* @param mixed $check Value to check (string or array)
* @param string $regex Regular expression to use
* @param string $country Country code (defaults to 'all')
* @return boolean Success
* @return bool Success
* @access public
*/
function phone($check, $regex= null, $country = 'all') {
@ -621,7 +621,7 @@ class Validation extends Object {
* @param mixed $check Value to check
* @param string $regex Regular expression to use
* @param string $country Country to use for formatting
* @return boolean Success
* @return bool Success
* @access public
*/
function postal($check, $regex= null, $country = null) {
@ -654,7 +654,7 @@ class Validation extends Object {
* @param mixed $check Value to check
* @param string $regex Regular expression to use
* @param string $country Country
* @return boolean Success
* @return bool Success
* @access public
*/
function ssn($check, $regex = null, $country = null) {
@ -685,7 +685,7 @@ class Validation extends Object {
* Checks that a value is a valid URL.
*
* @param string $check Value to check
* @return boolean Success
* @return bool Success
* @access public
*/
function url($check) {
@ -711,7 +711,7 @@ class Validation extends Object {
/**
* Runs a regular expression match.
*
* @return boolean Success of match
* @return bool Success of match
* @access protected
*/
function _check() {
@ -753,7 +753,7 @@ class Validation extends Object {
* Luhn algorithm
*
* @see http://en.wikipedia.org/wiki/Luhn_algorithm
* @return boolean Success
* @return bool Success
* @access protected
*/
function _luhn() {

View file

@ -176,7 +176,7 @@ class Helper extends Overloadable {
* or an array specifying any of the following: 'controller', 'action',
* and/or 'plugin', in addition to named arguments (keyed array elements),
* and standard URL arguments (indexed array elements)
* @param boolean $full If true, the full base URL will be prepended to the result
* @param bool $full If true, the full base URL will be prepended to the result
* @return string Full translated URL with base path.
*/
function url($url = null, $full = false) {
@ -373,7 +373,7 @@ class Helper extends Overloadable {
*
* @param string $model Model name as string
* @param string $field Fieldname as string
* @return boolean True on errors.
* @return bool True on errors.
*/
function tagIsInvalid($model = null, $field = null) {
if ($model == null) {
@ -559,28 +559,24 @@ class Helper extends Overloadable {
/**
* Before render callback. Overridden in subclasses.
*
* @return void
*/
function beforeRender() {
}
/**
* After render callback. Overridden in subclasses.
*
* @return void
*/
function afterRender() {
}
/**
* Before layout callback. Overridden in subclasses.
*
* @return void
*/
function beforeLayout() {
}
/**
* After layout callback. Overridden in subclasses.
*
* @return void
*/
function afterLayout() {
}
@ -613,7 +609,6 @@ class Helper extends Overloadable {
/**
* Resets the vars used by Helper::clean() to null
*
* @return void
* @access private
*/
function __reset() {
@ -623,7 +618,6 @@ class Helper extends Overloadable {
/**
* Removes harmful content from output
*
* @return void
* @access private
*/
function __clean() {

View file

@ -161,7 +161,7 @@ class AjaxHelper extends AppHelper {
* @param string $href Href string "/products/view/12"
* @param array $options Options for JavaScript function
* @param string $confirm Confirmation message. Calls up a JavaScript confirm() message.
* @param boolean $escapeTitle Escaping the title string to HTML entities
* @param bool $escapeTitle Escaping the title string to HTML entities
*
* @return string HTML code for link to remote action
*/
@ -504,7 +504,7 @@ class AjaxHelper extends AppHelper {
/**
* Detects Ajax requests
*
* @return boolean True if the current request is a Prototype Ajax update call
* @return bool True if the current request is a Prototype Ajax update call
*/
function isAjax() {
return (isset($this->params['isAjax']) && $this->params['isAjax'] === true);

View file

@ -63,7 +63,7 @@ class CacheHelper extends AppHelper {
*
* @param string $file File to cache
* @param string $out output to cache
* @param boolean $cache
* @param bool $cache
* @return view ouput
*/
function cache($file, $out, $cache = false) {
@ -127,7 +127,7 @@ class CacheHelper extends AppHelper {
* Parse file searching for no cache tags
*
* @param string $file
* @param boolean $cache
* @param bool $cache
* @access private
*/
function __parseFile($file, $cache) {

View file

@ -294,7 +294,6 @@ class FormHelper extends AppHelper {
*
* @param string $model Model name
* @param array $options Options
* @return void
* @access private
*/
function __secure($model = null, $options = null) {
@ -1065,11 +1064,11 @@ class FormHelper extends AppHelper {
* Returns a SELECT element for years
*
* @param string $fieldName Prefix name for the SELECT element
* @param integer $minYear First year in sequence
* @param integer $maxYear Last year in sequence
* @param int $minYear First year in sequence
* @param int $maxYear Last year in sequence
* @param string $selected Option which is selected.
* @param array $attributes Attribute array for the select elements.
* @param boolean $showEmpty Show/hide the empty select option
* @param bool $showEmpty Show/hide the empty select option
* @return string
*/
function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array(), $showEmpty = true) {
@ -1097,7 +1096,7 @@ class FormHelper extends AppHelper {
*
* @param string $fieldName Prefix name for the SELECT element
* @param string $selected Option which is selected.
* @param boolean $showEmpty Show/hide the empty select option
* @param bool $showEmpty Show/hide the empty select option
* @return string
*/
function month($fieldName, $selected = null, $attributes = array(), $showEmpty = true) {
@ -1122,7 +1121,7 @@ class FormHelper extends AppHelper {
* Returns a SELECT element for hours.
*
* @param string $fieldName Prefix name for the SELECT element
* @param boolean $format24Hours True for 24 hours format
* @param bool $format24Hours True for 24 hours format
* @param string $selected Option which is selected.
* @param array $attributes List of HTML attributes
* @param mixed $showEmpty True to show an empty element, or a string to provide default empty element text
@ -1388,7 +1387,6 @@ class FormHelper extends AppHelper {
/**
* Generates option lists for common <select /> menus
*
* @return void
*/
function __generateOptions($name, $min = null, $max = null) {
if (!empty($this->options[$name])) {

View file

@ -298,7 +298,7 @@ class HtmlHelper extends AppHelper {
* @param mixed $path The name of a CSS style sheet in /app/webroot/css, or an array containing names of CSS stylesheets in that directory.
* @param string $rel Rel attribute. Defaults to "stylesheet".
* @param array $htmlAttributes Array of HTML attributes.
* @param boolean $inline If set to false, the generated tag appears in the head tag of the layout.
* @param bool $inline If set to false, the generated tag appears in the head tag of the layout.
* @return string CSS <link /> or <style /> tag, depending on the type of link.
*/
function css($path, $rel = null, $htmlAttributes = array(), $inline = true) {
@ -468,7 +468,7 @@ class HtmlHelper extends AppHelper {
* @param string $text String content that will appear inside the div element.
* If null, only a start tag will be printed
* @param array $attributes Additional HTML attributes of the DIV tag
* @param boolean $escape If true, $text will be HTML-escaped
* @param bool $escape If true, $text will be HTML-escaped
* @return string The formatted DIV element
*/
function div($class = null, $text = null, $attributes = array(), $escape = false) {
@ -491,7 +491,7 @@ class HtmlHelper extends AppHelper {
* @param string $class CSS class name of the p element.
* @param string $text String content that will appear inside the p element.
* @param array $attributes Additional HTML attributes of the P tag
* @param boolean $escape If true, $text will be HTML-escaped
* @param bool $escape If true, $text will be HTML-escaped
* @return string The formatted P element
*/
function para($class, $text, $attributes = array(), $escape = false) {

View file

@ -178,8 +178,8 @@ class JavascriptHelper extends AppHelper {
* @param string $object Object to be observed
* @param string $event event to observe
* @param string $observer function to call
* @param boolean $useCapture default true
* @return boolean true on success
* @param bool $useCapture default true
* @return bool true on success
*/
function event($object, $event, $observer = null, $useCapture = false) {
@ -221,8 +221,8 @@ class JavascriptHelper extends AppHelper {
/**
* Cache JavaScript events created with event()
*
* @param boolean $file If true, code will be written to a file
* @param boolean $all If true, all code written with JavascriptHelper will be sent to a file
* @param bool $file If true, code will be written to a file
* @param bool $all If true, all code written with JavascriptHelper will be sent to a file
* @return null
*/
function cacheEvents($file = false, $all = false) {
@ -233,7 +233,7 @@ class JavascriptHelper extends AppHelper {
/**
* Gets (and clears) the current JavaScript event cache
*
* @param boolean $clear
* @param bool $clear
* @return string
*/
function getCache($clear = true) {
@ -261,7 +261,7 @@ class JavascriptHelper extends AppHelper {
/**
* Write cached JavaScript events
*
* @param boolean $inline If true, returns JavaScript event code. Otherwise it is added to the
* @param bool $inline If true, returns JavaScript event code. Otherwise it is added to the
* output of $scripts_for_layout in the layout.
* @return string
*/
@ -320,11 +320,11 @@ class JavascriptHelper extends AppHelper {
* from an array
*
* @param array $data Data to be converted
* @param boolean $block Wraps return value in a <script/> block if true
* @param bool $block Wraps return value in a <script/> block if true
* @param string $prefix Prepends the string to the returned data
* @param string $postfix Appends the string to the returned data
* @param array $stringKeys A list of array keys to be treated as a string
* @param boolean $quoteKeys If false, treats $stringKey as a list of keys *not* to be quoted
* @param bool $quoteKeys If false, treats $stringKey as a list of keys *not* to be quoted
* @param string $q The type of quote to use
* @return string A JSON code block
*/

View file

@ -212,11 +212,11 @@ class JsHelper extends Overloadable2 {
* from an array
*
* @param array $data Data to be converted
* @param boolean $block Wraps return value in a <script/> block if true
* @param bool $block Wraps return value in a <script/> block if true
* @param string $prefix Prepends the string to the returned data
* @param string $postfix Appends the string to the returned data
* @param array $stringKeys A list of array keys to be treated as a string
* @param boolean $quoteKeys If false, treats $stringKey as a list of keys *not* to be quoted
* @param bool $quoteKeys If false, treats $stringKey as a list of keys *not* to be quoted
* @param string $q The type of quote to use
* @return string A JSON code block
*/

View file

@ -52,7 +52,7 @@ class NumberHelper extends AppHelper {
/**
* Returns a formatted-for-humans file size.
*
* @param integer $length Size in bytes
* @param int $length Size in bytes
* @return string Human readable size
* @static
*/
@ -78,7 +78,7 @@ class NumberHelper extends AppHelper {
* Formats a number into a percentage string.
*
* @param float $number A floating point number
* @param integer $precision The precision of the returned number
* @param int $precision The precision of the returned number
* @return string Percentage string
* @static
*/
@ -89,7 +89,7 @@ class NumberHelper extends AppHelper {
* Formats a number into a currnecy format.
*
* @param float $number A floating point number
* @param integer $options if int then places, if string then before, if (,.-) then use it
* @param int $options if int then places, if string then before, if (,.-) then use it
* or array with places and before keys
* @return string formatted number
* @static
@ -151,7 +151,7 @@ class NumberHelper extends AppHelper {
* Formats a number into a currency format.
*
* @param float $number A floating point number
* @param integer $precision The precision of the returned number
* @param int $precision The precision of the returned number
* @return string Percentage string
* @static
*/

View file

@ -87,7 +87,6 @@ class PaginatorHelper extends AppHelper {
*
* @param mixed $options Default options for pagination links. If a string is supplied - it
* is used as the DOM id element to update. See #options for list of keys.
* @return void
*/
function options($options = array()) {
if (is_string($options)) {
@ -305,8 +304,8 @@ class PaginatorHelper extends AppHelper {
/**
* Returns true if the given result set is not at the first page
*
* @param string $model Optional model name. Uses the default if none is specified.
* @return boolean True if the result set is not at the first page.
* @param string $model Optional model name. Uses the default if none is specified.
* @return bool True if the result set is not at the first page.
*/
function hasPrev($model = null) {
return $this->__hasPage($model, 'prev');
@ -314,8 +313,8 @@ class PaginatorHelper extends AppHelper {
/**
* Returns true if the given result set is not at the last page
*
* @param string $model Optional model name. Uses the default if none is specified.
* @return boolean True if the result set is not at the last page.
* @param string $model Optional model name. Uses the default if none is specified.
* @return bool True if the result set is not at the last page.
*/
function hasNext($model = null) {
return $this->__hasPage($model, 'next');
@ -325,7 +324,7 @@ class PaginatorHelper extends AppHelper {
*
* @param string $model Optional model name. Uses the default if none is specified.
* @param int $page The page number - if not set defaults to 1.
* @return boolean True if the given result set has the specified page number.
* @return bool True if the given result set has the specified page number.
*/
function hasPage($model = null, $page = 1) {
if (is_numeric($model)) {

View file

@ -94,7 +94,7 @@ class SessionHelper extends CakeSession {
* In your view: $session->check('Controller.sessKey');
*
* @param string $name
* @return boolean
* @return bool
* @access public
*/
function check($name) {
@ -153,7 +153,7 @@ class SessionHelper extends CakeSession {
/**
* Used to check is a session is valid in a view
*
* @return boolean
* @return bool
* @access public
*/
function valid() {
@ -165,7 +165,7 @@ class SessionHelper extends CakeSession {
* Override CakeSession::write().
* This method should not be used in a view
*
* @return boolean
* @return bool
* @access public
*/
function write() {

View file

@ -149,9 +149,9 @@ class TextHelper extends AppHelper {
* with the ending if the text is longer than length.
*
* @param string $text String to truncate.
* @param integer $length Length of returned string, including ellipsis.
* @param int $length Length of returned string, including ellipsis.
* @param string $ending Ending to be appended to the trimmed string.
* @param boolean $exact If false, $text will not be cut mid-word
* @param bool $exact If false, $text will not be cut mid-word
* @return string Trimmed string.
* @access public
*/
@ -186,7 +186,7 @@ class TextHelper extends AppHelper {
*
* @param string $text String to search the phrase in
* @param string $phrase Phrase that will be searched for
* @param integer $radius The amount of characters that will be returned on each side of the founded phrase
* @param int $radius The amount of characters that will be returned on each side of the founded phrase
* @param string $ending Ending that will be appended
* @return string Modified string
* @access public
@ -238,7 +238,7 @@ class TextHelper extends AppHelper {
* Text-to-html parser, similar to Textile or RedCloth, only with a little different syntax.
*
* @param string $text String to "flay"
* @param boolean $allowHtml Set to true if if html is allowed
* @param bool $allowHtml Set to true if if html is allowed
* @return string "Flayed" text
* @access public
* @todo Change this. We need a real Textile parser.

View file

@ -40,7 +40,7 @@ class TimeHelper extends AppHelper {
* Returns given string trimmed to given length, adding an ending (default: "..") if necessary.
*
* @param string $string String to trim
* @param integer $length Length of returned string, excluding ellipsis
* @param int $length Length of returned string, excluding ellipsis
* @param string $ending Ending to be appended after trimmed string
* @return string Trimmed string
*/
@ -136,7 +136,7 @@ class TimeHelper extends AppHelper {
* Returns true if given datetime string is today.
*
* @param string $date_string Datetime string or Unix timestamp
* @return boolean True if datetime string is today
* @return bool True if datetime string is today
*/
function isToday($date_string) {
$date = $this->fromString($date_string);
@ -146,7 +146,7 @@ class TimeHelper extends AppHelper {
/**
* Returns true if given datetime string is within this week
* @param string $date_string
* @return boolean True if datetime string is within current week
* @return bool True if datetime string is within current week
*/
function isThisWeek($date_string) {
$date = $this->fromString($date_string) + 86400;
@ -155,7 +155,7 @@ class TimeHelper extends AppHelper {
/**
* Returns true if given datetime string is within this month
* @param string $date_string
* @return boolean True if datetime string is within current month
* @return bool True if datetime string is within current month
*/
function isThisMonth($date_string) {
$date = $this->fromString($date_string);
@ -165,7 +165,7 @@ class TimeHelper extends AppHelper {
* Returns true if given datetime string is within current year.
*
* @param string $date_string Datetime string or Unix timestamp
* @return boolean True if datetime string is within current year
* @return bool True if datetime string is within current year
*/
function isThisYear($date_string) {
$date = $this->fromString($date_string);
@ -176,7 +176,7 @@ class TimeHelper extends AppHelper {
* Returns true if given datetime string was yesterday.
*
* @param string $date_string Datetime string or Unix timestamp
* @return boolean True if datetime string was yesterday
* @return bool True if datetime string was yesterday
*/
function wasYesterday($date_string) {
$date = $this->fromString($date_string);
@ -187,7 +187,7 @@ class TimeHelper extends AppHelper {
* Returns true if given datetime string is tomorrow.
*
* @param string $date_string Datetime string or Unix timestamp
* @return boolean True if datetime string was yesterday
* @return bool True if datetime string was yesterday
*/
function isTomorrow($date_string) {
$date = $this->fromString($date_string);
@ -327,7 +327,7 @@ class TimeHelper extends AppHelper {
*
* @param mixed $timeInterval the numeric value with space then time type. Example of valid types: 6 hours, 2 days, 1 minute.
* @param mixed $date_string the datestring or unix timestamp to compare
* @return boolean
* @return bool
*/
function wasWithinLast($timeInterval, $date_string) {
$date = $this->fromString($date_string);

View file

@ -96,7 +96,7 @@ class XmlHelper extends AppHelper {
*
* @param string $name The namespace name
* @param string $url The namespace URI; can be empty if in the default namespace map
* @return boolean False if no URL is specified, and the namespace does not exist
* @return bool False if no URL is specified, and the namespace does not exist
* default namespace map, otherwise true
*/
function addNs($name, $url = null) {
@ -118,7 +118,6 @@ class XmlHelper extends AppHelper {
* Removes a namespace added in addNs()
*
* @param string $name The namespace name or URI
* @return void
*/
function removeNs($name) {
if (in_array($name, array_keys($this->__namespaces))) {

View file

@ -524,7 +524,6 @@ class View extends Object {
*
* @param string $name
* @param string $content
* @return void
* @access public
*/
function addScript($name, $content = null) {
@ -869,7 +868,6 @@ class View extends Object {
*
* @param string $filename the cache file to include
* @param string $timeStart the page render start time
* @return void
*/
function renderCache($filename, $timeStart) {
ob_start();

View file

@ -314,7 +314,7 @@ class XMLNode extends Object {
/**
* Returns true if this structure has child nodes.
*
* @return boolean
* @return bool
* @access public
*/
function hasChildren() {
@ -398,7 +398,7 @@ class XMLNode extends Object {
* Debug method. Deletes the parent. Also deletes this node's children,
* if given the $recursive parameter.
*
* @param boolean $recursive Recursively delete elements.
* @param bool $recursive Recursively delete elements.
* @access private
*/
function __killParent($recursive = true) {
@ -520,7 +520,7 @@ class XML extends XMLNode {
* Initialize XML object from a given XML string. Returns false on error.
*
* @param string $in XML string to initialize with
* @return boolean Success
* @return bool Success
* @access public
*/
function load($in) {
@ -554,7 +554,7 @@ class XML extends XMLNode {
/**
* Parses and creates XML nodes from the __rawData property.
*
* @return boolean Success
* @return bool Success
* @access public
* @see load()
*/
@ -618,7 +618,7 @@ class XML extends XMLNode {
/**
* Returns a string representation of the XML object
*
* @param boolean $useHeader Whether to include the XML header with the document (defaults to true)
* @param bool $useHeader Whether to include the XML header with the document (defaults to true)
* @return string XML data
* @access public
*/

View file

@ -44,7 +44,6 @@ class MagicDbTest extends UnitTestCase {
/**
* Sets up a MagicDb class instance for testing
*
* @return void
* @access public
*/
function setUp() {
@ -54,7 +53,6 @@ class MagicDbTest extends UnitTestCase {
/**
* MagicDb::analyze should properly detect the file type and output additional info as requested.
*
* @return void
* @access public
*/
function testAnalyze() {
@ -71,7 +69,6 @@ class MagicDbTest extends UnitTestCase {
* MagicDb::read should properly read MagicDb databases from .php-/.db-files and plain data arguments passed in and return false if the file wasn't found or
* if the readed data did not validate.
*
* @return void
* @access public
*/
function testRead() {
@ -111,7 +108,6 @@ class MagicDbTest extends UnitTestCase {
/**
* MagicDb::toArray should either return the MagicDb::db property, or the parsed array data if a magic.db dump is passed in as the first argument
*
* @return void
* @access public
*/
function testToArray() {
@ -136,7 +132,6 @@ class MagicDbTest extends UnitTestCase {
/**
* The MagicDb::validates function should return if the array passed to it or the local db property contains a valid MagicDb record set
*
* @return void
* @access public
*/
function testValidates() {
@ -183,7 +178,6 @@ class MagicDbTestData extends Object {
* Returns the test data for a given key
*
* @param string $key
* @return void
* @access public
**/
function get($key) {

View file

@ -112,7 +112,6 @@ class DboMssqlTest extends UnitTestCase {
/**
* Sets up a Dbo class instance for testing
*
* @return void
* @access public
*/
function setUp() {
@ -126,7 +125,6 @@ class DboMssqlTest extends UnitTestCase {
/**
* Test Dbo value method
*
* @return void
* @access public
*/

View file

@ -111,7 +111,6 @@ class DboMysqlTest extends UnitTestCase {
/**
* Skip if cannot connect to mysql
*
* @return void
* @access public
*/
function skip() {
@ -124,7 +123,6 @@ class DboMysqlTest extends UnitTestCase {
/**
* Sets up a Dbo class instance for testing
*
* @return void
* @access public
*/
function setUp() {
@ -137,7 +135,6 @@ class DboMysqlTest extends UnitTestCase {
/**
* Sets up a Dbo class instance for testing
*
* @return void
* @access public
*/
function tearDown() {
@ -146,7 +143,6 @@ class DboMysqlTest extends UnitTestCase {
/**
* Test Dbo value method
*
* @return void
* @access public
*/
function testQuoting() {

View file

@ -111,7 +111,6 @@ class DboPostgresTest extends UnitTestCase {
/**
* Skip if cannot connect to postgres
*
* @return void
* @access public
*/
function skip() {
@ -125,7 +124,6 @@ class DboPostgresTest extends UnitTestCase {
/**
* Sets up a Dbo class instance for testing
*
* @return void
* @access public
*/
function setUp() {
@ -138,7 +136,6 @@ class DboPostgresTest extends UnitTestCase {
/**
* Sets up a Dbo class instance for testing
*
* @return void
* @access public
*/
function tearDown() {
@ -147,11 +144,9 @@ class DboPostgresTest extends UnitTestCase {
/**
* Test Dbo value method
*
* @return void
* @access public
*/
function testQuoting() {
$result = $this->Db->fields($this->model);
$expected = array(
'"PostgresTestModel"."id" AS "PostgresTestModel__id"',