Skip to content

Commit

Permalink
Fix docblock/function signature mismatches (parameter name typos, wro…
Browse files Browse the repository at this point in the history
…ng parameter types, missing parameter tags, invalid/wrong/missing return types, missing/unnecessary leading backslashes for namespaces, etc...)
  • Loading branch information
ndm2 committed Feb 22, 2014
1 parent 3077199 commit 29caa95
Show file tree
Hide file tree
Showing 88 changed files with 171 additions and 136 deletions.
2 changes: 1 addition & 1 deletion src/Cache/CacheEngine.php
Expand Up @@ -148,7 +148,7 @@ abstract public function clear($check);
* to decide whether actually delete the keys or just simulate it to achieve
* the same result.
*
* @param string $groups name of the group to be cleared
* @param string $group name of the group to be cleared
* @return boolean
*/
public function clearGroup($group) {
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/CollectionTrait.php
Expand Up @@ -665,7 +665,7 @@ public function append($items) {
* or a function returning the indexing key out of the provided element
* @param callable|string $valuePath the column name path to use as the array value
* or a function returning the value out of the provided element
* @param callable|string $valuePath the column name path to use as the parent
* @param callable|string $groupPath the column name path to use as the parent
* grouping key or a function returning the key out of the provided element
* @return \Cake\Collection\Collection
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Collection/Iterator/SortIterator.php
Expand Up @@ -87,11 +87,11 @@ class SortIterator extends SplHeap {
* @param integer $type the type of comparison to perform, either SORT_STRING
* SORT_NUMERIC or SORT_NATURAL
*/
public function __construct($items, $c, $dir = SORT_DESC, $type = SORT_NUMERIC) {
public function __construct($items, $callback, $dir = SORT_DESC, $type = SORT_NUMERIC) {
$this->_items = $items;
$this->_dir = $dir;
$this->_type = $type;
$this->_callback = $this->_propertyExtractor($c);
$this->_callback = $this->_propertyExtractor($callback);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/Configure/Engine/IniConfig.php
Expand Up @@ -186,17 +186,17 @@ public function dump($key, $data) {
* @param mixed $value to export.
* @return string String value for ini file.
*/
protected function _value($val) {
if ($val === null) {
protected function _value($value) {
if ($value === null) {
return 'null';
}
if ($val === true) {
if ($value === true) {
return 'true';
}
if ($val === false) {
if ($value === false) {
return 'false';
}
return (string)$val;
return (string)$value;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ConsoleInputArgument.php
Expand Up @@ -154,8 +154,8 @@ public function validChoice($value) {
/**
* Append this arguments XML representation to the passed in SimpleXml object.
*
* @param SimpleXmlElement $parent The parent element.
* @return SimpleXmlElement The parent with this argument appended.
* @param \SimpleXmlElement $parent The parent element.
* @return \SimpleXmlElement The parent with this argument appended.
*/
public function xml(\SimpleXmlElement $parent) {
$option = $parent->addChild('argument');
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ConsoleInputOption.php
Expand Up @@ -199,8 +199,8 @@ public function validChoice($value) {
/**
* Append the option's xml into the parent.
*
* @param SimpleXmlElement $parent The parent element.
* @return SimpleXmlElement The parent with this option appended.
* @param \SimpleXmlElement $parent The parent element.
* @return \SimpleXmlElement The parent with this option appended.
*/
public function xml(\SimpleXmlElement $parent) {
$option = $parent->addChild('option');
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ConsoleInputSubcommand.php
Expand Up @@ -107,8 +107,8 @@ public function parser() {
/**
* Append this subcommand to the Parent element
*
* @param SimpleXmlElement $parent The parent element.
* @return SimpleXmlElement The parent with this subcommand appended.
* @param \SimpleXmlElement $parent The parent element.
* @return \SimpleXmlElement The parent with this subcommand appended.
*/
public function xml(\SimpleXmlElement $parent) {
$command = $parent->addChild('command');
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Component/Acl/AclInterface.php
Expand Up @@ -66,7 +66,7 @@ public function inherit($aro, $aco, $action = "*");
/**
* Initialization method for the Acl implementation
*
* @param AclComponent $component
* @param Component $component
* @return void
*/
public function initialize(Component $component);
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Component/Acl/IniAcl.php
Expand Up @@ -45,7 +45,7 @@ class IniAcl extends Object implements AclInterface {
/**
* Initialize method
*
* @param AclBase $component
* @param Component $component
* @return void
*/
public function initialize(Component $component) {
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Component/Acl/PhpAcl.php
Expand Up @@ -82,7 +82,7 @@ public function __construct() {
/**
* Initialize method
*
* @param AclComponent $Component Component instance
* @param Component $Component Component instance
* @return void
*/
public function initialize(Component $Component) {
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Component/Auth/BaseAuthorize.php
Expand Up @@ -72,7 +72,7 @@ abstract class BaseAuthorize {
* Constructor
*
* @param ComponentRegistry $registry The controller for this request.
* @param string $settings An array of settings. This class does not use any settings.
* @param array $settings An array of settings. This class does not use any settings.
*/
public function __construct(ComponentRegistry $registry, $settings = array()) {
$this->_registry = $registry;
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Component/Auth/BasicAuthenticate.php
Expand Up @@ -77,8 +77,8 @@ public function getUser(Request $request) {
/**
* Handles an unauthenticated access attempt by sending appropriate login headers
*
* @param CakeRequest $request A request object.
* @param CakeResponse $response A response object.
* @param Request $request A request object.
* @param Response $response A response object.
* @return void
* @throws \Cake\Error\UnauthorizedException
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Component/Auth/CrudAuthorize.php
Expand Up @@ -39,7 +39,7 @@ class CrudAuthorize extends BaseAuthorize {
* Sets up additional actionMap values that match the configured `Routing.prefixes`.
*
* @param ComponentRegistry $registry The component registry from the controller.
* @param string $settings An array of settings. This class does not use any settings.
* @param array $settings An array of settings. This class does not use any settings.
*/
public function __construct(ComponentRegistry $registry, $settings = array()) {
parent::__construct($registry, $settings);
Expand Down
6 changes: 3 additions & 3 deletions src/Controller/Component/CookieComponent.php
Expand Up @@ -308,10 +308,10 @@ public function read($key = null) {
}

/**
* Returns true if given variable is set in cookie.
* Returns true if given key is set in the cookie.
*
* @param string $var Variable name to check for
* @return boolean True if variable is there
* @param string $key Key to check for
* @return boolean True if the key exists
*/
public function check($key = null) {
if (empty($key)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Core/App.php
Expand Up @@ -72,7 +72,7 @@ class App {
* application/plugin, otherwise try to load from the CakePHP core
*
* @param string $class Classname
* @param strign $type Type of class
* @param string $type Type of class
* @param string $suffix Classname suffix
* @return boolean|string False if the class is not found or namespaced classname
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Expression/Comparison.php
Expand Up @@ -54,10 +54,10 @@ class Comparison extends QueryExpression {
* @param string $type the type name used to cast the value
* @param string $conjunction the operator used for comparing field and value
*/
public function __construct($field, $value, $type, $conjuntion) {
public function __construct($field, $value, $type, $conjunction) {
$this->field($field);
$this->value($value);
$this->type($conjuntion);
$this->type($conjunction);

if (is_string($type)) {
$this->_type = $type;
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/IdentifierExpression.php
Expand Up @@ -74,7 +74,7 @@ public function sql(ValueBinder $generator) {
* This method is a no-op, this is a leaf type of expression,
* hence there is nothing to traverse
*
* @param callable $visitor
* @param callable $callable
* @return void
*/
public function traverse(callable $callable) {
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Expression/QueryExpression.php
Expand Up @@ -242,7 +242,7 @@ public function notLike($field, $value, $type = null) {
* "field IN (value1, value2)".
*
* @param string $field database field to be compared against value
* @param array $value the value to be bound to $field for comparison
* @param array $values the value to be bound to $field for comparison
* @param string $type the type name for $value as configured using the Type map.
* @return QueryExpression
*/
Expand All @@ -258,7 +258,7 @@ public function in($field, $values, $type = null) {
* "field NOT IN (value1, value2)".
*
* @param string $field database field to be compared against value
* @param array $value the value to be bound to $field for comparison
* @param array $values the value to be bound to $field for comparison
* @param string $type the type name for $value as configured using the Type map.
* @return QueryExpression
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Expression/TupleComparison.php
Expand Up @@ -33,8 +33,8 @@ class TupleComparison extends Comparison {
* one type per position in the value array in needed
* @param string $conjunction the operator used for comparing field and value
*/
public function __construct($fields, $values, $types = [], $conjuntion = '=') {
parent::__construct($fields, $values, $types, $conjuntion);
public function __construct($fields, $values, $types = [], $conjunction = '=') {
parent::__construct($fields, $values, $types, $conjunction);
$this->_type = (array)$types;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/ValuesExpression.php
Expand Up @@ -110,7 +110,7 @@ public function columns($cols = null) {
* Sets the values to be inserted. If no params are passed, then it returns
* the currently stored values
*
* @param array $cols arrays with values to be inserted
* @param array $values arrays with values to be inserted
* @return array|ValuesExpression
*/
public function values($values = null) {
Expand Down
4 changes: 2 additions & 2 deletions src/Database/FunctionsBuilder.php
Expand Up @@ -141,8 +141,8 @@ public function coalesce($args, $types = []) {
* @param array $types list of types to bind to the arguments
* @return FunctionExpression
*/
public function dateDiff($dates, $types = []) {
return $this->_build('DATEDIFF', $dates, $types);
public function dateDiff($args, $types = []) {
return $this->_build('DATEDIFF', $args, $types);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Database/Query.php
Expand Up @@ -1129,13 +1129,13 @@ public function orHaving($conditions, $types = []) {
* @param integer $num The page number you want.
* @return Query
*/
public function page($page) {
public function page($num) {
$limit = $this->clause('limit');
if ($limit === null) {
$limit = 25;
$this->limit($limit);
}
$this->offset(($page - 1) * $limit);
$this->offset(($num - 1) * $limit);
return $this;
}

Expand Down Expand Up @@ -1304,7 +1304,7 @@ protected function _buildValuesPart($parts, $generator) {
* Helper function used to covert ExpressionInterface objects inside an array
* into their string representation
*
* @param array $expression list of strings and ExpressionInterface objects
* @param array $expressions list of strings and ExpressionInterface objects
* @param \Cake\Database\ValueBinder $generator the placeholder generator to be used in expressions
* @return array
*/
Expand Down Expand Up @@ -1673,7 +1673,7 @@ public function defaultTypes(array $types = null) {
* will create as many placeholders as values are in it. For example "string[]"
* will create several placeholders of type string.
*
* @param string|integer $token placeholder to be replaced with quoted version
* @param string|integer $param placeholder to be replaced with quoted version
* of $value
* @param mixed $value the value to be bound
* @param string|integer $type the mapped type name, used for casting when sending
Expand Down
2 changes: 1 addition & 1 deletion src/Database/ValueBinder.php
Expand Up @@ -40,7 +40,7 @@ class ValueBinder {
/**
* Associates a query placeholder to a value and a type
*
* @param string|integer $token placeholder to be replaced with quoted version
* @param string|integer $param placeholder to be replaced with quoted version
* of $value
* @param mixed $value the value to be bound
* @param string|integer $type the mapped type name, used for casting when sending
Expand Down
2 changes: 1 addition & 1 deletion src/Error/BadRequestException.php
Expand Up @@ -27,7 +27,7 @@ class BadRequestException extends HttpException {
* Constructor
*
* @param string $message If no message is given 'Bad Request' will be the message
* @param string $code Status code, defaults to 400
* @param integer $code Status code, defaults to 400
*/
public function __construct($message = null, $code = 400) {
if (empty($message)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Error/Exception.php
Expand Up @@ -47,7 +47,7 @@ class Exception extends BaseException {
*
* @param string|array $message Either the string of the error message, or an array of attributes
* that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
* @param string $code The code of the error, is also the HTTP status code for the error.
* @param integer $code The code of the error, is also the HTTP status code for the error.
*/
public function __construct($message, $code = 500) {
if (is_array($message)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Error/ForbiddenException.php
Expand Up @@ -27,7 +27,7 @@ class ForbiddenException extends HttpException {
* Constructor
*
* @param string $message If no message is given 'Forbidden' will be the message
* @param string $code Status code, defaults to 403
* @param integer $code Status code, defaults to 403
*/
public function __construct($message = null, $code = 403) {
if (empty($message)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Error/InternalErrorException.php
Expand Up @@ -27,7 +27,7 @@ class InternalErrorException extends HttpException {
* Constructor
*
* @param string $message If no message is given 'Internal Server Error' will be the message
* @param string $code Status code, defaults to 500
* @param integer $code Status code, defaults to 500
*/
public function __construct($message = null, $code = 500) {
if (empty($message)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Error/MethodNotAllowedException.php
Expand Up @@ -27,7 +27,7 @@ class MethodNotAllowedException extends HttpException {
* Constructor
*
* @param string $message If no message is given 'Method Not Allowed' will be the message
* @param string $code Status code, defaults to 405
* @param integer $code Status code, defaults to 405
*/
public function __construct($message = null, $code = 405) {
if (empty($message)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Error/NotFoundException.php
Expand Up @@ -27,7 +27,7 @@ class NotFoundException extends HttpException {
* Constructor
*
* @param string $message If no message is given 'Not Found' will be the message
* @param string $code Status code, defaults to 404
* @param integer $code Status code, defaults to 404
*/
public function __construct($message = null, $code = 404) {
if (empty($message)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Error/PrivateActionException.php
Expand Up @@ -33,7 +33,7 @@ class PrivateActionException extends Exception {
*
* @param string $message Excception message
* @param integer $code Exception code
* @param \Exception $previous Previous exception
* @param Exception $previous Previous exception
*/
public function __construct($message, $code = 404, Exception $previous = null) {
parent::__construct($message, $code, $previous);
Expand Down
2 changes: 1 addition & 1 deletion src/Error/UnauthorizedException.php
Expand Up @@ -27,7 +27,7 @@ class UnauthorizedException extends HttpException {
* Constructor
*
* @param string $message If no message is given 'Unauthorized' will be the message
* @param string $code Status code, defaults to 401
* @param integer $code Status code, defaults to 401
*/
public function __construct($message = null, $code = 401) {
if (empty($message)) {
Expand Down
2 changes: 1 addition & 1 deletion src/I18n/I18n.php
Expand Up @@ -138,7 +138,7 @@ public static function getInstance() {
* @param string $plural Plural string (if any)
* @param string $domain Domain The domain of the translation. Domains are often used by plugin translations.
* If null, the default domain will be used.
* @param string $category Category The integer value of the category to use.
* @param integer $category Category The integer value of the category to use.
* @param integer $count Count Count is used with $plural to choose the correct plural form.
* @param string $language Language to translate string to.
* If null it checks for language in session followed by Config.language configuration variable.
Expand Down
2 changes: 1 addition & 1 deletion src/Log/Engine/FileLog.php
Expand Up @@ -75,7 +75,7 @@ class FileLog extends BaseLog {
* - `mask` A mask is applied when log files are created. Left empty no chmod
* is made.
*
* @param array $options Options for the FileLog, see above.
* @param array $config Options for the FileLog, see above.
*/
public function __construct($config = array()) {
$config = Hash::merge($this->_defaults, $config);
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Http/Auth/Basic.php
Expand Up @@ -41,8 +41,8 @@ public function authentication(Request $request, $credentials) {
/**
* Proxy Authentication
*
* @param HttpSocket $http
* @param array $proxyInfo
* @param Request $request
* @param array $credentials
* @return void
* @see http://www.ietf.org/rfc/rfc2617.txt
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Http/Auth/Oauth.php
Expand Up @@ -33,7 +33,7 @@ class Oauth {
* Add headers for Oauth authorization.
*
* @param Request $request
* @param array $options
* @param array $credentials
* @return void
* @throws \Cake\Error\Exception On invalid signature types.
*/
Expand Down Expand Up @@ -228,7 +228,7 @@ protected function _normalizedParams($request, $oauthValues) {
/**
* Builds the Oauth Authorization header value.
*
* @param array $values The oauth_* values to build
* @param array $data The oauth_* values to build
* @return string
*/
protected function _buildAuth($data) {
Expand Down

0 comments on commit 29caa95

Please sign in to comment.