Merge branch 'master' into 2.6

This commit is contained in:
mark_story 2014-05-29 21:46:16 -04:00
commit 7e8d378502
38 changed files with 189 additions and 102 deletions

View file

@ -18,7 +18,7 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/ */
/* /**
* *
* Using the Schema command line utility * Using the Schema command line utility
* cake schema run create DbAcl * cake schema run create DbAcl
@ -26,10 +26,22 @@
*/ */
class DbAclSchema extends CakeSchema { class DbAclSchema extends CakeSchema {
/**
* Before event.
*
* @param array $event The event data.
* @return boolean success
*/
public function before($event = array()) { public function before($event = array()) {
return true; return true;
} }
/**
* After event.
*
* @param array $event The event data.
* @return void
*/
public function after($event = array()) { public function after($event = array()) {
} }

View file

@ -77,7 +77,7 @@ class CommandListShell extends AppShell {
/** /**
* Output text. * Output text.
* *
* @param array $shellList * @param array $shellList The shell list.
* @return void * @return void
*/ */
protected function _asText($shellList) { protected function _asText($shellList) {
@ -95,7 +95,7 @@ class CommandListShell extends AppShell {
/** /**
* Output as XML * Output as XML
* *
* @param array $shellList * @param array $shellList The shell list.
* @return void * @return void
*/ */
protected function _asXml($shellList) { protected function _asXml($shellList) {

View file

@ -144,7 +144,7 @@ class CompletionShell extends AppShell {
/** /**
* Emit results as a string, space delimited * Emit results as a string, space delimited
* *
* @param array $options * @param array $options The options to output
* @return void * @return void
*/ */
protected function _output($options = array()) { protected function _output($options = array()) {

View file

@ -193,7 +193,7 @@ class ConsoleShell extends AppShell {
/** /**
* Override main() to handle action * Override main() to handle action
* *
* @param string $command * @param string $command The command to run.
* @return void * @return void
*/ */
public function main($command = null) { public function main($command = null) {
@ -218,7 +218,7 @@ class ConsoleShell extends AppShell {
/** /**
* Determine the method to process the current command * Determine the method to process the current command
* *
* @param string $command * @param string $command The command to run.
* @return string or false * @return string or false
*/ */
protected function _method($command) { protected function _method($command) {
@ -256,7 +256,7 @@ class ConsoleShell extends AppShell {
/** /**
* Bind an association * Bind an association
* *
* @param mixed $command * @param mixed $command The command to run.
* @return void * @return void
*/ */
protected function _bind($command) { protected function _bind($command) {
@ -283,7 +283,7 @@ class ConsoleShell extends AppShell {
/** /**
* Unbind an association * Unbind an association
* *
* @param mixed $command * @param mixed $command The command to run.
* @return void * @return void
*/ */
protected function _unbind($command) { protected function _unbind($command) {
@ -320,7 +320,7 @@ class ConsoleShell extends AppShell {
/** /**
* Perform a find * Perform a find
* *
* @param mixed $command * @param mixed $command The command to run.
* @return void * @return void
*/ */
protected function _find($command) { protected function _find($command) {
@ -382,7 +382,7 @@ class ConsoleShell extends AppShell {
/** /**
* Save a record * Save a record
* *
* @param mixed $command * @param mixed $command The command to run.
* @return void * @return void
*/ */
protected function _save($command) { protected function _save($command) {
@ -406,7 +406,7 @@ class ConsoleShell extends AppShell {
/** /**
* Show the columns for a model * Show the columns for a model
* *
* @param mixed $command * @param mixed $command The command to run.
* @return void * @return void
*/ */
protected function _columns($command) { protected function _columns($command) {
@ -455,7 +455,7 @@ class ConsoleShell extends AppShell {
/** /**
* Parse an array URL and show the equivalent URL as a string * Parse an array URL and show the equivalent URL as a string
* *
* @param mixed $command * @param mixed $command The command to run.
* @return void * @return void
*/ */
protected function _routeToString($command) { protected function _routeToString($command) {
@ -471,7 +471,7 @@ class ConsoleShell extends AppShell {
/** /**
* Parse a string URL and show as an array * Parse a string URL and show as an array
* *
* @param mixed $command * @param mixed $command The command to run.
* @return void * @return void
*/ */
protected function _routeToArray($command) { protected function _routeToArray($command) {
@ -483,7 +483,7 @@ class ConsoleShell extends AppShell {
/** /**
* Tells if the specified model is included in the list of available models * Tells if the specified model is included in the list of available models
* *
* @param string $modelToCheck * @param string $modelToCheck The model to check.
* @return boolean true if is an available model, false otherwise * @return boolean true if is an available model, false otherwise
*/ */
protected function _isValidModel($modelToCheck) { protected function _isValidModel($modelToCheck) {

View file

@ -311,8 +311,8 @@ class SchemaShell extends AppShell {
* Create database from Schema object * Create database from Schema object
* Should be called via the run method * Should be called via the run method
* *
* @param CakeSchema $Schema * @param CakeSchema $Schema The schema instance to create.
* @param string $table * @param string $table The table name.
* @return void * @return void
*/ */
protected function _create(CakeSchema $Schema, $table = null) { protected function _create(CakeSchema $Schema, $table = null) {
@ -362,8 +362,8 @@ class SchemaShell extends AppShell {
* Update database with Schema object * Update database with Schema object
* Should be called via the run method * Should be called via the run method
* *
* @param CakeSchema $Schema * @param CakeSchema &$Schema The schema instance
* @param string $table * @param string $table The table name.
* @return void * @return void
*/ */
protected function _update(&$Schema, $table = null) { protected function _update(&$Schema, $table = null) {
@ -417,9 +417,9 @@ class SchemaShell extends AppShell {
/** /**
* Runs sql from _create() or _update() * Runs sql from _create() or _update()
* *
* @param array $contents * @param array $contents The contents to execute.
* @param string $event * @param string $event The event to fire
* @param CakeSchema $Schema * @param CakeSchema $Schema The schema instance.
* @return void * @return void
*/ */
protected function _run($contents, $event, CakeSchema $Schema) { protected function _run($contents, $event, CakeSchema $Schema) {

View file

@ -53,9 +53,9 @@ class CommandTask extends AppShell {
/** /**
* Scan the provided paths for shells, and append them into $shellList * Scan the provided paths for shells, and append them into $shellList
* *
* @param string $type * @param string $type The type of object.
* @param array $shells * @param array $shells The shell name.
* @param array $shellList * @param array &$shellList List of shells.
* @return void * @return void
*/ */
protected function _appendShells($type, $shells, &$shellList) { protected function _appendShells($type, $shells, &$shellList) {
@ -90,7 +90,7 @@ class CommandTask extends AppShell {
/** /**
* Return a list of subcommands for a given command * Return a list of subcommands for a given command
* *
* @param string $commandName * @param string $commandName The command you want subcommands from.
* @return array * @return array
*/ */
public function subCommands($commandName) { public function subCommands($commandName) {
@ -127,7 +127,7 @@ class CommandTask extends AppShell {
/** /**
* Get Shell instance for the given command * Get Shell instance for the given command
* *
* @param mixed $commandName * @param mixed $commandName The command you want.
* @return mixed * @return mixed
*/ */
public function getShell($commandName) { public function getShell($commandName) {
@ -157,7 +157,7 @@ class CommandTask extends AppShell {
/** /**
* Get Shell instance for the given command * Get Shell instance for the given command
* *
* @param mixed $commandName * @param mixed $commandName The command to get options for.
* @return array * @return array
*/ */
public function options($commandName) { public function options($commandName) {

View file

@ -224,10 +224,10 @@ class ControllerTask extends BakeTask {
/** /**
* Confirm a to be baked controller with the user * Confirm a to be baked controller with the user
* *
* @param string $controllerName * @param string $controllerName The name of the controller.
* @param string $useDynamicScaffold * @param string $useDynamicScaffold Whether or not to use dynamic scaffolds.
* @param array $helpers * @param array $helpers The list of helpers to include.
* @param array $components * @param array $components The list of components to include.
* @return void * @return void
*/ */
public function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) { public function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {

View file

@ -199,7 +199,7 @@ class DbConfigTask extends AppShell {
/** /**
* Output verification message and bake if it looks good * Output verification message and bake if it looks good
* *
* @param array $config * @param array $config The config data.
* @return boolean True if user says it looks good, false otherwise * @return boolean True if user says it looks good, false otherwise
*/ */
protected function _verify($config) { protected function _verify($config) {

View file

@ -242,10 +242,10 @@ class ExtractTask extends AppShell {
* *
* Takes care of duplicate translations * Takes care of duplicate translations
* *
* @param string $category * @param string $category The category
* @param string $domain * @param string $domain The domain
* @param string $msgid * @param string $msgid The message string
* @param array $details * @param array $details The file and line references
* @return void * @return void
*/ */
protected function _addTranslation($category, $domain, $msgid, $details = array()) { protected function _addTranslation($category, $domain, $msgid, $details = array()) {
@ -582,10 +582,10 @@ class ExtractTask extends AppShell {
/** /**
* Prepare a file to be stored * Prepare a file to be stored
* *
* @param string $category * @param string $category The category
* @param string $domain * @param string $domain The domain
* @param string $header * @param string $header The header content.
* @param string $sentence * @param string $sentence The sentence to store.
* @return void * @return void
*/ */
protected function _store($category, $domain, $header, $sentence) { protected function _store($category, $domain, $header, $sentence) {
@ -678,7 +678,7 @@ class ExtractTask extends AppShell {
/** /**
* Get the strings from the position forward * Get the strings from the position forward
* *
* @param integer $position Actual position on tokens array * @param integer &$position Actual position on tokens array
* @param integer $target Number of strings to extract * @param integer $target Number of strings to extract
* @return array Strings extracted * @return array Strings extracted
*/ */

View file

@ -316,7 +316,7 @@ class FixtureTask extends BakeTask {
* Generate String representation of Records * Generate String representation of Records
* *
* @param array $tableInfo Table schema array * @param array $tableInfo Table schema array
* @param integer $recordCount * @param integer $recordCount The number of records to generate.
* @return array Array of records to use in the fixture. * @return array Array of records to use in the fixture.
*/ */
protected function _generateRecords($tableInfo, $recordCount = 1) { protected function _generateRecords($tableInfo, $recordCount = 1) {

View file

@ -401,7 +401,7 @@ class ModelTask extends BakeTask {
* *
* @param string $fieldName Name of field to be validated. * @param string $fieldName Name of field to be validated.
* @param array $metaData metadata for field * @param array $metaData metadata for field
* @param string $primaryKey * @param string $primaryKey The primary key field.
* @return array Array of validation for the field. * @return array Array of validation for the field.
*/ */
public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { public function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
@ -510,7 +510,7 @@ class ModelTask extends BakeTask {
/** /**
* Handles associations * Handles associations
* *
* @param Model $model * @param Model $model The model object
* @return array Associations * @return array Associations
*/ */
public function doAssociations($model) { public function doAssociations($model) {
@ -562,7 +562,7 @@ class ModelTask extends BakeTask {
/** /**
* Handles behaviors * Handles behaviors
* *
* @param Model $model * @param Model $model The model object.
* @return array Behaviors * @return array Behaviors
*/ */
public function doActsAs($model) { public function doActsAs($model) {

View file

@ -73,7 +73,7 @@ class PluginTask extends AppShell {
/** /**
* Interactive interface * Interactive interface
* *
* @param string $plugin * @param string $plugin The plugin name.
* @return void * @return void
*/ */
protected function _interactive($plugin = null) { protected function _interactive($plugin = null) {
@ -184,7 +184,7 @@ class PluginTask extends AppShell {
/** /**
* find and change $this->path to the user selection * find and change $this->path to the user selection
* *
* @param array $pathOptions * @param array $pathOptions The list of paths to look in.
* @return void * @return void
*/ */
public function findPath($pathOptions) { public function findPath($pathOptions) {

View file

@ -102,7 +102,7 @@ class TestTask extends BakeTask {
/** /**
* Handles interactive baking * Handles interactive baking
* *
* @param string $type * @param string $type The type of object to bake a test for.
* @return string|boolean * @return string|boolean
*/ */
protected function _interactive($type = null) { protected function _interactive($type = null) {

View file

@ -298,7 +298,7 @@ class ViewTask extends BakeTask {
* Bake a view file for each of the supplied actions * Bake a view file for each of the supplied actions
* *
* @param array $actions Array of actions to make files for. * @param array $actions Array of actions to make files for.
* @param array $vars * @param array $vars The template variables.
* @return void * @return void
*/ */
public function bakeActions($actions, $vars) { public function bakeActions($actions, $vars) {
@ -454,7 +454,7 @@ class ViewTask extends BakeTask {
/** /**
* Returns associations for controllers models. * Returns associations for controllers models.
* *
* @param Model $model * @param Model $model The Model instance.
* @return array $associations * @return array $associations
*/ */
protected function _associations(Model $model) { protected function _associations(Model $model) {

View file

@ -334,9 +334,9 @@ class TestShell extends Shell {
/** /**
* Find the test case for the passed file. The file could itself be a test. * Find the test case for the passed file. The file could itself be a test.
* *
* @param string $file * @param string $file The file to map.
* @param string $category * @param string $category The test file category.
* @param boolean $throwOnMissingFile * @param boolean $throwOnMissingFile Whether or not to throw an exception.
* @return array array(type, case) * @return array array(type, case)
* @throws Exception * @throws Exception
*/ */
@ -411,7 +411,7 @@ class TestShell extends Shell {
/** /**
* For the given file, what category of test is it? returns app, core or the name of the plugin * For the given file, what category of test is it? returns app, core or the name of the plugin
* *
* @param string $file * @param string $file The file to map.
* @return string * @return string
*/ */
protected function _mapFileToCategory($file) { protected function _mapFileToCategory($file) {

View file

@ -554,6 +554,7 @@ class UpgradeShell extends AppShell {
/** /**
* Replace cakeError with built-in exceptions. * Replace cakeError with built-in exceptions.
* NOTE: this ignores calls where you've passed your own secondary parameters to cakeError(). * NOTE: this ignores calls where you've passed your own secondary parameters to cakeError().
*
* @return void * @return void
*/ */
public function exceptions() { public function exceptions() {
@ -661,7 +662,7 @@ class UpgradeShell extends AppShell {
* Find all php files in the folder (honoring recursive) and determine where CakePHP expects the file to be * Find all php files in the folder (honoring recursive) and determine where CakePHP expects the file to be
* If the file is not exactly where CakePHP expects it - move it. * If the file is not exactly where CakePHP expects it - move it.
* *
* @param string $path * @param string $path The path to move files in.
* @param array $options array(recursive, checkFolder) * @param array $options array(recursive, checkFolder)
* @return void * @return void
*/ */
@ -763,7 +764,7 @@ class UpgradeShell extends AppShell {
/** /**
* Searches the paths and finds files based on extension. * Searches the paths and finds files based on extension.
* *
* @param string $extensions * @param string $extensions The extensions to include. Defaults to none.
* @return void * @return void
*/ */
protected function _findFiles($extensions = '') { protected function _findFiles($extensions = '') {

View file

@ -132,7 +132,7 @@ class ConsoleInputArgument {
/** /**
* Check that $value is a valid choice for this argument. * Check that $value is a valid choice for this argument.
* *
* @param string $value * @param string $value The choice to validate.
* @return boolean * @return boolean
* @throws ConsoleException * @throws ConsoleException
*/ */

View file

@ -177,7 +177,7 @@ class ConsoleInputOption {
/** /**
* Check that a value is a valid choice for this option. * Check that a value is a valid choice for this option.
* *
* @param string $value * @param string $value The choice to validate.
* @return boolean * @return boolean
* @throws ConsoleException * @throws ConsoleException
*/ */

View file

@ -203,7 +203,7 @@ class ConsoleOutput {
/** /**
* Replace tags with color codes. * Replace tags with color codes.
* *
* @param array $matches. * @param array $matches An array of matches to replace.
* @return string * @return string
*/ */
protected function _replaceTags($matches) { protected function _replaceTags($matches) {

View file

@ -159,7 +159,7 @@ class HelpFormatter {
/** /**
* Iterate over a collection and find the longest named thing. * Iterate over a collection and find the longest named thing.
* *
* @param array $collection * @param array $collection The collection to find a max length of.
* @return integer * @return integer
*/ */
protected function _getMaxLength($collection) { protected function _getMaxLength($collection) {

View file

@ -262,7 +262,7 @@ class Shell extends Object {
/** /**
* Lazy loads models using the loadModel() method if declared in $uses * Lazy loads models using the loadModel() method if declared in $uses
* *
* @param string $name * @param string $name The name of the model to look for.
* @return void * @return void
*/ */
public function __isset($name) { public function __isset($name) {
@ -454,7 +454,7 @@ class Shell extends Object {
/** /**
* Display the help in the correct format * Display the help in the correct format
* *
* @param string $command * @param string $command The command to get help for.
* @return void * @return void
*/ */
protected function _displayHelp($command) { protected function _displayHelp($command) {
@ -485,7 +485,7 @@ class Shell extends Object {
/** /**
* Overload get for lazy building of tasks * Overload get for lazy building of tasks
* *
* @param string $name * @param string $name The property name to access.
* @return Shell Object of Task * @return Shell Object of Task
*/ */
public function __get($name) { public function __get($name) {
@ -860,7 +860,7 @@ class Shell extends Object {
/** /**
* creates the singular name for use in views. * creates the singular name for use in views.
* *
* @param string $name * @param string $name The plural underscored value.
* @return string $name * @return string $name
*/ */
protected function _singularName($name) { protected function _singularName($name) {

View file

@ -317,7 +317,7 @@ class ShellDispatcher {
/** /**
* Parses out the paths from from the argv * Parses out the paths from from the argv
* *
* @param array $args * @param array $args The argv to parse.
* @return void * @return void
*/ */
protected function _parsePaths($args) { protected function _parsePaths($args) {

View file

@ -43,7 +43,7 @@ class TaskCollection extends ObjectCollection {
/** /**
* Constructor * Constructor
* *
* @param Shell $Shell * @param Shell $Shell The shell this task collection is attached to.
*/ */
public function __construct(Shell $Shell) { public function __construct(Shell $Shell) {
$this->_Shell = $Shell; $this->_Shell = $Shell;

View file

@ -17,13 +17,28 @@
*/ */
class DbAclSchema extends CakeSchema { class DbAclSchema extends CakeSchema {
/**
* Before event.
*
* @param array $event The event data.
* @return boolean success
*/
public function before($event = array()) { public function before($event = array()) {
return true; return true;
} }
/**
* After event.
*
* @param array $event The event data.
* @return void
*/
public function after($event = array()) { public function after($event = array()) {
} }
/**
* ACO - Access Control Object - Something that is wanted
*/
public $acos = array( public $acos = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
@ -35,6 +50,9 @@ class DbAclSchema extends CakeSchema {
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
); );
/**
* ARO - Access Request Object - Something that wants something
*/
public $aros = array( public $aros = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
@ -46,6 +64,10 @@ class DbAclSchema extends CakeSchema {
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
); );
/**
* Used by the Cake::Model:Permission class.
* Checks if the given $aro has access to action $action in $aco.
*/
public $aros_acos = array( public $aros_acos = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'), 'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),

View file

@ -19,15 +19,37 @@
*/ */
class I18nSchema extends CakeSchema { class I18nSchema extends CakeSchema {
/**
* The name property
*
* @var string
*/
public $name = 'i18n'; public $name = 'i18n';
/**
* Before event.
*
* @param array $event The event data.
* @return boolean success
*/
public function before($event = array()) { public function before($event = array()) {
return true; return true;
} }
/**
* After event.
*
* @param array $event The event data.
* @return void
*/
public function after($event = array()) { public function after($event = array()) {
} }
/**
* The i18n table property
*
* @var array
*/
public $i18n = array( public $i18n = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'), 'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),

View file

@ -9,7 +9,7 @@
* @since CakePHP(tm) v 0.2.9 * @since CakePHP(tm) v 0.2.9
*/ */
/* /**
* *
* Using the Schema command line utility * Using the Schema command line utility
* cake schema run create Sessions * cake schema run create Sessions
@ -17,15 +17,37 @@
*/ */
class SessionsSchema extends CakeSchema { class SessionsSchema extends CakeSchema {
/**
* Name property
*
* @var string
*/
public $name = 'Sessions'; public $name = 'Sessions';
/**
* Before event.
*
* @param array $event The event data.
* @return bool Success
*/
public function before($event = array()) { public function before($event = array()) {
return true; return true;
} }
/**
* After event.
*
* @param array $event The event data.
* @return void
*/
public function after($event = array()) { public function after($event = array()) {
} }
/**
* cake_sessions table definition
*
* @var array
*/
public $cake_sessions = array( public $cake_sessions = array(
'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'), 'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
'data' => array('type' => 'text', 'null' => true, 'default' => null), 'data' => array('type' => 'text', 'null' => true, 'default' => null),

View file

@ -31,7 +31,6 @@ class PagesController extends AppController {
/** /**
* Displays a view * Displays a view
* *
* @param mixed What page to display
* @return void * @return void
* @throws NotFoundException When the view file could not be found * @throws NotFoundException When the view file could not be found
* or MissingViewException in debug mode. * or MissingViewException in debug mode.

View file

@ -18,6 +18,11 @@
class AllTestsTest extends CakeTestSuite { class AllTestsTest extends CakeTestSuite {
/**
* Get the suite object.
*
* @return CakeTestSuite Suite class instance.
*/
public static function suite() { public static function suite() {
$suite = new CakeTestSuite('All application tests'); $suite = new CakeTestSuite('All application tests');
$suite->addTestDirectoryRecursive(TESTS . 'Case'); $suite->addTestDirectoryRecursive(TESTS . 'Case');

View file

@ -243,7 +243,7 @@ class CakeNumber {
* - `decimals` - Decimal separator symbol ie. '.' * - `decimals` - Decimal separator symbol ie. '.'
* *
* @param float $value A floating point number * @param float $value A floating point number
* @param array $options * @param array $options Options list.
* @return string formatted delta * @return string formatted delta
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::formatDelta * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::formatDelta
*/ */
@ -258,10 +258,10 @@ class CakeNumber {
/** /**
* Alternative number_format() to accommodate multibyte decimals and thousands < PHP 5.4 * Alternative number_format() to accommodate multibyte decimals and thousands < PHP 5.4
* *
* @param float $value * @param float $value Value to format.
* @param integer $places * @param integer $places Decimal places to use.
* @param string $decimals * @param string $decimals Decimal position string.
* @param string $thousands * @param string $thousands Thousands separator string.
* @return string * @return string
*/ */
protected static function _numberFormat($value, $places = 0, $decimals = '.', $thousands = ',') { protected static function _numberFormat($value, $places = 0, $decimals = '.', $thousands = ',') {
@ -315,10 +315,10 @@ class CakeNumber {
* By default all currencies contain utf-8 symbols and don't need this changed. If you require * By default all currencies contain utf-8 symbols and don't need this changed. If you require
* non HTML encoded symbols you will need to update the settings with the correct bytes. * non HTML encoded symbols you will need to update the settings with the correct bytes.
* *
* @param float $value * @param float $value Value to format.
* @param string $currency Shortcut to default options. Valid values are * @param string $currency Shortcut to default options. Valid values are
* 'USD', 'EUR', 'GBP', otherwise set at least 'before' and 'after' options. * 'USD', 'EUR', 'GBP', otherwise set at least 'before' and 'after' options.
* @param array $options * @param array $options Options list.
* @return string Number formatted as a currency. * @return string Number formatted as a currency.
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::currency * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::currency
*/ */

View file

@ -86,6 +86,7 @@ class ClassRegistry {
* array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry') * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry')
* ); * );
* }}} * }}}
*
* @param string|array $class as a string or a single key => value array instance will be created, * @param string|array $class as a string or a single key => value array instance will be created,
* stored in the registry and returned. * stored in the registry and returned.
* @param boolean $strict if set to true it will return false if the class was not found instead * @param boolean $strict if set to true it will return false if the class was not found instead
@ -303,8 +304,8 @@ class ClassRegistry {
/** /**
* Checks to see if $alias is a duplicate $class Object * Checks to see if $alias is a duplicate $class Object
* *
* @param string $alias * @param string $alias Alias to check.
* @param string $class * @param string $class Class name.
* @return boolean * @return boolean
*/ */
protected function &_duplicate($alias, $class) { protected function &_duplicate($alias, $class) {

View file

@ -148,7 +148,7 @@ class Debugger {
/** /**
* Returns a reference to the Debugger singleton object instance. * Returns a reference to the Debugger singleton object instance.
* *
* @param string $class * @param string $class Debugger class name.
* @return object * @return object
*/ */
public static function getInstance($class = null) { public static function getInstance($class = null) {
@ -167,7 +167,6 @@ class Debugger {
/** /**
* Recursively formats and outputs the contents of the supplied variable. * Recursively formats and outputs the contents of the supplied variable.
* *
*
* @param mixed $var the variable to dump * @param mixed $var the variable to dump
* @param int $depth The depth to output to. Defaults to 3. * @param int $depth The depth to output to. Defaults to 3.
* @return void * @return void
@ -724,7 +723,7 @@ class Debugger {
/** /**
* Takes a processed array of data from an error and displays it in the chosen format. * Takes a processed array of data from an error and displays it in the chosen format.
* *
* @param string $data * @param string $data Data to output.
* @return void * @return void
*/ */
public function outputError($data) { public function outputError($data) {

View file

@ -202,7 +202,7 @@ class File {
* all other platforms will use "\n" * all other platforms will use "\n"
* *
* @param string $data Data to prepare for writing. * @param string $data Data to prepare for writing.
* @param boolean $forceWindows * @param boolean $forceWindows If true forces usage Windows newline string.
* @return string The with converted line endings. * @return string The with converted line endings.
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::prepare * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::prepare
*/ */

View file

@ -671,7 +671,7 @@ class Hash {
/** /**
* Checks to see if all the values in the array are numeric * Checks to see if all the values in the array are numeric
* *
* @param array $array The array to check. * @param array $data The array to check.
* @return boolean true if values are numeric, false otherwise * @return boolean true if values are numeric, false otherwise
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::numeric * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::numeric
*/ */
@ -689,7 +689,7 @@ class Hash {
* If you have an un-even or heterogenous array, consider using Hash::maxDimensions() * If you have an un-even or heterogenous array, consider using Hash::maxDimensions()
* to get the dimensions of the array. * to get the dimensions of the array.
* *
* @param array $array Array to count dimensions on * @param array $data Array to count dimensions on
* @return integer The number of dimensions in $data * @return integer The number of dimensions in $data
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::dimensions * @link http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::dimensions
*/ */

View file

@ -521,7 +521,7 @@ class Inflector {
/** /**
* Returns camelBacked version of an underscored string. * Returns camelBacked version of an underscored string.
* *
* @param string $string * @param string $string String to convert.
* @return string in variable form * @return string in variable form
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/inflector.html#Inflector::variable * @link http://book.cakephp.org/2.0/en/core-utility-libraries/inflector.html#Inflector::variable
*/ */

View file

@ -82,8 +82,7 @@ abstract class ObjectCollection {
* Any non-null value will modify the parameter index indicated. * Any non-null value will modify the parameter index indicated.
* Defaults to false. * Defaults to false.
* *
* * @param string|CakeEvent $callback Method to fire on all the objects. Its assumed all the objects implement
* @param string $callback|CakeEvent Method to fire on all the objects. Its assumed all the objects implement
* the method you are calling. If an instance of CakeEvent is provided, then then Event name will parsed to * the method you are calling. If an instance of CakeEvent is provided, then then Event name will parsed to
* get the callback name. This is done by getting the last word after any dot in the event name * get the callback name. This is done by getting the last word after any dot in the event name
* (eg. `Model.afterSave` event will trigger the `afterSave` callback) * (eg. `Model.afterSave` event will trigger the `afterSave` callback)
@ -172,7 +171,7 @@ abstract class ObjectCollection {
* Enables callbacks on an object or array of objects * Enables callbacks on an object or array of objects
* *
* @param string|array $name CamelCased name of the object(s) to enable (string or array) * @param string|array $name CamelCased name of the object(s) to enable (string or array)
* @param boolean Prioritize enabled list after enabling object(s) * @param boolean $prioritize Prioritize enabled list after enabling object(s)
* @return void * @return void
*/ */
public function enable($name, $prioritize = true) { public function enable($name, $prioritize = true) {
@ -213,7 +212,7 @@ abstract class ObjectCollection {
* @param string|array $name CamelCased name of the object(s) to enable (string or array) * @param string|array $name CamelCased name of the object(s) to enable (string or array)
* If string the second param $priority is used else it should be an associative array * If string the second param $priority is used else it should be an associative array
* with keys as object names and values as priorities to set. * with keys as object names and values as priorities to set.
* @param integer|null Integer priority to set or null for default * @param integer|null $priority Integer priority to set or null for default
* @return void * @return void
*/ */
public function setPriority($name, $priority = null) { public function setPriority($name, $priority = null) {

View file

@ -277,7 +277,12 @@ class Security {
$salt = vsprintf('$2a$%02d$%s', array(self::$hashCost, $salt)); $salt = vsprintf('$2a$%02d$%s', array(self::$hashCost, $salt));
} }
if ($salt === true || strpos($salt, '$2a$') !== 0 || strlen($salt) < 29) { $invalidCipher = (
strpos($salt, '$2y$') !== 0 &&
strpos($salt, '$2x$') !== 0 &&
strpos($salt, '$2a$') !== 0
);
if ($salt === true || $invalidCipher || strlen($salt) < 29) {
trigger_error(__d( trigger_error(__d(
'cake_dev', 'cake_dev',
'Invalid salt: %s for %s Please visit http://www.php.net/crypt and read the appropriate section for building %s salts.', 'Invalid salt: %s for %s Please visit http://www.php.net/crypt and read the appropriate section for building %s salts.',
@ -324,7 +329,7 @@ class Security {
/** /**
* Check the encryption key for proper length. * Check the encryption key for proper length.
* *
* @param string $key * @param string $key Key to check.
* @param string $method The method the key is being checked for. * @param string $method The method the key is being checked for.
* @return void * @return void
* @throws CakeException When key length is not 256 bit/32 bytes * @throws CakeException When key length is not 256 bit/32 bytes

View file

@ -412,8 +412,8 @@ class Validation {
* - true => Any number of decimal places greater than 0, or a float|double. The '.' is required. * - true => Any number of decimal places greater than 0, or a float|double. The '.' is required.
* - 1..N => Exactly that many number of decimal places. The '.' is required. * - 1..N => Exactly that many number of decimal places. The '.' is required.
* *
* @param float $check The value the test for decimal * @param float $check The value the test for decimal.
* @param integer $places * @param integer $places Decimal places.
* @param string $regex If a custom regular expression is used, this is the only validation that will occur. * @param string $regex If a custom regular expression is used, this is the only validation that will occur.
* @return boolean Success * @return boolean Success
*/ */
@ -914,8 +914,8 @@ class Validation {
/** /**
* Luhn algorithm * Luhn algorithm
* *
* @param string|array $check * @param string|array $check Value to check.
* @param boolean $deep * @param boolean $deep If true performs deep check.
* @return boolean Success * @return boolean Success
* @see http://en.wikipedia.org/wiki/Luhn_algorithm * @see http://en.wikipedia.org/wiki/Luhn_algorithm
*/ */
@ -947,7 +947,7 @@ class Validation {
/** /**
* Checks the mime type of a file. * Checks the mime type of a file.
* *
* @param string|array $check * @param string|array $check Value to check.
* @param array|string $mimeTypes Array of mime types or regex pattern to check. * @param array|string $mimeTypes Array of mime types or regex pattern to check.
* @return boolean Success * @return boolean Success
* @throws CakeException when mime type can not be determined. * @throws CakeException when mime type can not be determined.
@ -977,9 +977,9 @@ class Validation {
/** /**
* Checks the filesize * Checks the filesize
* *
* @param string|array $check * @param string|array $check Value to check.
* @param integer|string $size Size in bytes or human readable string like '5MB' * @param string $operator See `Validation::comparison()`.
* @param string $operator See `Validation::comparison()` * @param integer|string $size Size in bytes or human readable string like '5MB'.
* @return boolean Success * @return boolean Success
*/ */
public static function fileSize($check, $operator = null, $size = null) { public static function fileSize($check, $operator = null, $size = null) {
@ -998,7 +998,7 @@ class Validation {
/** /**
* Checking for upload errors * Checking for upload errors
* *
* @param string|array $check * @param string|array $check Value to check.
* @return boolean * @return boolean
* @see http://www.php.net/manual/en/features.file-upload.errors.php * @see http://www.php.net/manual/en/features.file-upload.errors.php
*/ */

View file

@ -228,7 +228,7 @@ class Xml {
* *
* @param DOMDocument $dom Handler to DOMDocument * @param DOMDocument $dom Handler to DOMDocument
* @param DOMElement $node Handler to DOMElement (child) * @param DOMElement $node Handler to DOMElement (child)
* @param array $data Array of data to append to the $node. * @param array &$data Array of data to append to the $node.
* @param string $format Either 'attribute' or 'tags'. This determines where nested keys go. * @param string $format Either 'attribute' or 'tags'. This determines where nested keys go.
* @return void * @return void
* @throws XmlException * @throws XmlException
@ -348,7 +348,7 @@ class Xml {
* Recursive method to toArray * Recursive method to toArray
* *
* @param SimpleXMLElement $xml SimpleXMLElement object * @param SimpleXMLElement $xml SimpleXMLElement object
* @param array $parentData Parent array with data * @param array &$parentData Parent array with data
* @param string $ns Namespace of current child * @param string $ns Namespace of current child
* @param array $namespaces List of namespaces in XML * @param array $namespaces List of namespaces in XML
* @return void * @return void