Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Doing a general QA and Docblock

  • Loading branch information...
commit 97c5e7ca2283d711316e74a783a4c8469faed883 1 parent 53b8414
@Howard3 Howard3 authored
Showing with 136 additions and 171 deletions.
  1. +1 −1  analysis/Docblock.php
  2. +3 −1 analysis/Inspector.php
  3. +1 −1  analysis/Parser.php
  4. +0 −2  analysis/logger/adapter/Cache.php
  5. +0 −1  analysis/logger/adapter/File.php
  6. +1 −1  analysis/logger/adapter/FirePhp.php
  7. +2 −3 analysis/logger/adapter/Growl.php
  8. +0 −1  analysis/logger/adapter/Syslog.php
  9. +3 −5 console/Command.php
  10. +0 −1  console/Response.php
  11. +3 −4 console/command/Create.php
  12. +2 −2 console/command/Help.php
  13. +4 −4 console/command/Library.php
  14. +7 −7 console/command/create/Mock.php
  15. +1 −0  console/command/create/View.php
  16. +1 −2  console/command/g11n/Extract.php
  17. +1 −0  core/Adaptable.php
  18. +0 −1  core/Object.php
  19. +0 −2  data/Collection.php
  20. +4 −4 data/Model.php
  21. +5 −2 data/Source.php
  22. +4 −3 data/collection/RecordSet.php
  23. +3 −4 data/entity/Document.php
  24. +5 −6 data/model/Query.php
  25. +27 −28 data/source/Database.php
  26. +2 −3 data/source/Http.php
  27. +3 −4 data/source/MongoDb.php
  28. +0 −1  data/source/database/adapter/MySql.php
  29. +0 −1  data/source/database/adapter/Sqlite3.php
  30. +9 −11 data/source/http/adapter/CouchDb.php
  31. +0 −2  g11n/catalog/adapter/Code.php
  32. +0 −2  g11n/catalog/adapter/Gettext.php
  33. +0 −1  g11n/catalog/adapter/Php.php
  34. +0 −1  net/Socket.php
  35. +0 −1  net/http/Media.php
  36. +0 −1  net/http/Request.php
  37. +1 −2  net/http/Route.php
  38. +0 −2  net/http/Service.php
  39. +1 −1  net/socket/Curl.php
  40. +2 −4 storage/cache/adapter/Apc.php
  41. +0 −1  storage/cache/adapter/File.php
  42. +3 −4 storage/cache/adapter/Memcache.php
  43. +2 −3 storage/cache/adapter/Redis.php
  44. +3 −4 storage/cache/adapter/XCache.php
  45. +1 −2  storage/session/adapter/Cookie.php
  46. +0 −1  storage/session/adapter/Php.php
  47. +0 −1  storage/session/strategy/Hmac.php
  48. +5 −1 template/View.php
  49. +1 −1  template/view/Compiler.php
  50. +1 −3 template/view/Renderer.php
  51. +1 −1  template/view/adapter/File.php
  52. +4 −4 test/Group.php
  53. +1 −2  test/Report.php
  54. +11 −7 test/Unit.php
  55. +1 −0  tests/cases/util/StringTest.php
  56. +0 −2  tests/mocks/storage/cache/strategy/MockConfigurizer.php
  57. +1 −1  util/Collection.php
  58. +3 −3 util/String.php
  59. +1 −7 util/Validator.php
  60. +1 −0  util/collection/Filters.php
View
2  analysis/Docblock.php
@@ -93,7 +93,7 @@ public static function tags($string) {
}
/**
- * Parses `@param` docblock tags to separate out the parameter type from the description.
+ * Parses `param` docblock tags to separate out the parameter type from the description.
*
* @param array $params An array of `@param` tags, as parsed from the `tags()` method.
* @return array Returns an array where each key is a parameter name, and each value is an
View
4 analysis/Inspector.php
@@ -224,6 +224,7 @@ function($str) { return preg_quote($str, '/'); },
* - `'ranges'`: Returns a two-dimensional array where each key is a method name,
* and each value is an array of line numbers which are contained in the method.
* @param array $options
+ * @return mixed array|null|object
*/
public static function methods($class, $format = null, array $options = array()) {
$defaults = array('methods' => array(), 'group' => true, 'self' => true);
@@ -281,6 +282,7 @@ public static function methods($class, $format = null, array $options = array())
* @param array $options Set of options:
* -'self': If true (default), only returns properties defined in `$class`,
* excluding properties from inherited classes.
+ * @return mixed object lithium\analysis\Inspector._items.map|null
*/
public static function properties($class, array $options = array()) {
$defaults = array('properties' => array(), 'self' => true);
@@ -523,7 +525,7 @@ protected static function _items($class, $method, $options) {
* Helper method to determine if a class applies to a list of modifiers.
*
* @param string $inspector ReflectionClass instance.
- * @param string $list List of modifiers to test.
+ * @param array|string $list List of modifiers to test.
* @return boolean Test result.
*/
protected static function _modifiers($inspector, $list = array()) {
View
2  analysis/Parser.php
@@ -22,7 +22,7 @@ class Parser extends \lithium\core\StaticObject {
* present in the string, only the first is returned.
*
* @param string $string String of PHP code to get the token name of, i.e. `'=>'` or `'static'`.
- * @param string $options
+ * @param array $options
* @return mixed
*/
public static function token($string, array $options = array()) {
View
2  analysis/logger/adapter/Cache.php
@@ -45,9 +45,7 @@ class Cache extends \lithium\core\Object {
/**
* Class constructor
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
View
1  analysis/logger/adapter/File.php
@@ -49,7 +49,6 @@ class File extends \lithium\core\Object {
* - `'format'` _string_: A `String::insert()`-compatible string that specifies how
* the log message should be formatted. The default format is
* `"{:timestamp} {:message}\n"`.
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
View
2  analysis/logger/adapter/FirePhp.php
@@ -175,7 +175,7 @@ protected function _write($message) {
/**
* Generates a string representation of the type and message, suitable for FirePHP.
*
- * @param string $priority Represents the message priority.
+ * @param string $type Represents the message priority.
* @param string $message Contains the actual message to store.
* @return array Returns the encoded string representations of the priority and message, in the
* `'key'` and `'content'` keys, respectively.
View
5 analysis/logger/adapter/Growl.php
@@ -97,7 +97,6 @@ class Growl extends \lithium\core\Object {
* `Logger::write()`.
* - `'notification'` _array_: A list of message types you wish to register with
* Growl to be able to send. Defaults to `array('Errors', 'Messages')`.
- * @return void
*/
public function __construct(array $config = array()) {
$name = basename(LITHIUM_APP_PATH);
@@ -109,7 +108,7 @@ public function __construct(array $config = array()) {
'protocol' => 'udp',
'title' => Inflector::humanize($name),
'notifications' => array('Errors', 'Messages'),
- 'registered' => false,
+ 'registered' => false
);
parent::__construct($config + $defaults);
}
@@ -117,7 +116,7 @@ public function __construct(array $config = array()) {
/**
* Writes `$message` to a new Growl notification.
*
- * @param string $priority The `Logger`-based priority of the message. This value is mapped to
+ * @param string $type The `Logger`-based priority of the message. This value is mapped to
* a Growl-specific priority value if possible.
* @param string $message Message to be shown.
* @param array $options Any options that are passed to the `notify()` method. See the
View
1  analysis/logger/adapter/Syslog.php
@@ -53,7 +53,6 @@ class Syslog extends \lithium\core\Object {
* - `'facility'` _integer_: A flag specifying the program to use to log the
* messages. See the `openlog()` documentation for more information. Defaults to
* `LOG_USER`.
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array('identity' => false, 'options' => LOG_ODELAY, 'facility' => LOG_USER);
View
8 console/Command.php
@@ -58,9 +58,7 @@ class Command extends \lithium\core\Object {
/**
* Constructor.
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array('request' => null, 'response' => array(), 'classes' => $this->_classes);
@@ -178,10 +176,10 @@ public function error($error = null, $options = array('nl' => 1)) {
* result is part of `$options['choices']`.
*
* @param string $prompt
- * @param string $options
- * @return string
+ * @param array $options
+ * @return string|boolean
*/
- public function in($prompt = null, $options = array()) {
+ public function in($prompt = null, array $options = array()) {
$defaults = array('choices' => null, 'default' => null, 'quit' => 'q');
$options += $defaults;
$choices = null;
View
1  console/Response.php
@@ -49,7 +49,6 @@ class Response extends \lithium\core\Object {
* - request object lithium\console\Request
* - output stream
* _ error stream
- * @return void
*/
public function __construct($config = array()) {
$defaults = array('output' => null, 'error' => null);
View
7 console/command/Create.php
@@ -85,8 +85,7 @@ public function run($command = null) {
* Execute the given sub-command for the current request.
*
* @param string $command The sub-command name. example: Model, Controller, Test
- * @param string $params
- * @return void
+ * @return boolean
*/
protected function _execute($command) {
try {
@@ -220,8 +219,8 @@ protected function _instance($name, array $config = array()) {
/**
* Save a template with the current params. Writes file to `Create::$path`.
*
- * @param string $params
- * @return boolean
+ * @param array $params
+ * @return boolean|string
*/
protected function _save(array $params = array()) {
$defaults = array('namespace' => null, 'class' => null);
View
4 console/command/Help.php
@@ -309,8 +309,8 @@ protected function _renderDescription($info) {
* Add left padding for prettier display.
*
* @param string $message the text to render.
- * @param string $level the level of indentation.
- * @return void
+ * @param integer|string $level the level of indentation.
+ * @return string
*/
protected function _pad($message, $level = 1) {
$padding = str_repeat(' ', $level * 4);
View
8 console/command/Library.php
@@ -135,8 +135,9 @@ protected function _init() {
*
* @param string $key (server)
* @param string $value value of key
- * @param string $options [optional]
- * @return void
+ * @param boolean|string $options [optional]
+ * @return bool|int|array array _settings when $key and $value aren't set and
+ * int bytes written when content is written or bool false on failure
*/
public function config($key = null, $value = null, $options = true) {
if (empty($key) || empty($value)) {
@@ -520,8 +521,7 @@ public function push($name = null) {
/**
* Update installed plugins. For plugins, runs update commands specified in Formula.
*
- * @param string $name
- * @return boolean
+ * @todo implement
*/
public function update() {
$this->error('Please implement me');
View
14 console/command/create/Mock.php
@@ -19,13 +19,13 @@
*/
class Mock extends \lithium\console\command\Create {
- /**
- * Get the namespace for the mock.
- *
- * @param string $request
- * @param string $options
- * @return string
- */
+ /**
+ * Get the namespace for the mock.
+ *
+ * @param string $request
+ * @param array|string $options
+ * @return string
+ */
protected function _namespace($request, $options = array()) {
$request->params['command'] = $request->action;
return parent::_namespace($request, array('prepend' => 'tests.mocks.'));
View
1  console/command/create/View.php
@@ -24,6 +24,7 @@ class View extends \lithium\console\command\Create {
* Override the save method to handle view specific params.
*
* @param array $params
+ * @return mixed
*/
protected function _save(array $params = array()) {
$params['path'] = Inflector::underscore($this->request->action);
View
3  console/command/g11n/Extract.php
@@ -59,8 +59,7 @@ public function run() {
/**
* Extracts translatable strings from multiple files.
*
- * @param array $files Absolute paths to files.
- * @return array
+ * @return array|boolean
*/
protected function _extract() {
$message[] = 'A `Catalog` class configuration with an adapter that is capable of';
View
1  core/Adaptable.php
@@ -207,6 +207,7 @@ public static function enabled($name) {
* @param string $class The fully-namespaced class name of the adapter to instantiate.
* @param array $config The configuration array to be passed to the adapter instance. See the
* `$config` parameter of `Object::__construct()`.
+ * @return lithium\core\Adaptable._filter|adapter class
* @filter This method can be filtered.
*/
protected static function _initAdapter($class, array $config) {
View
1  core/Object.php
@@ -84,7 +84,6 @@ class Object {
* - `'init'` _boolean_: Controls constructor behavior for calling the `_init()`
* method. If `false`, the method is not called, otherwise it is. Defaults to
* `true`.
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array('init' => true);
View
2  data/Collection.php
@@ -98,9 +98,7 @@
/**
* Class constructor
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array('data' => array(), 'model' => null);
View
8 data/Model.php
@@ -269,7 +269,7 @@ class Model extends \lithium\core\StaticObject {
'order' => null,
'limit' => null,
'page' => null,
- 'with' => array(),
+ 'with' => array()
);
/**
@@ -298,7 +298,6 @@ class Model extends \lithium\core\StaticObject {
* Sets default connection options and connects default finders.
*
* @param array $options
- * @return void
* @todo Merge in inherited config from AppModel and other parent classes.
*/
public static function __init() {
@@ -415,7 +414,7 @@ public static function __callStatic($method, $params) {
*
* @param string $type The find type, which is looked up in `Model::$_finders`. By default it
* accepts `all`, `first`, `list` and `count`,
- * @param string $options Options for the query. By default, accepts:
+ * @param array $options Options for the query. By default, accepts:
* - `conditions`: The conditional query elements, e.g.
* `'conditions' => array('published' => true)`
* - `fields`: The fields that should be retrieved. When set to `null`, defaults to
@@ -423,7 +422,7 @@ public static function __callStatic($method, $params) {
* - `order`: The order in which the data will be returned, e.g. `'order' => 'ASC'`.
* - `limit`: The maximum number of records to return.
* - `page`: For pagination of data.
- * @return void
+ * @return mixed
* @filter This method can be filtered.
*/
public static function find($type, array $options = array()) {
@@ -1084,6 +1083,7 @@ protected static function _findFilters() {
/**
* @deprecated
* @see lithium\data\Model::connection()
+ * @return connection object
*/
protected static function &_connection() {
return static::connection();
View
7 data/Source.php
@@ -142,7 +142,7 @@ public function name($name) {
* Returns a list of objects (sources) that models can bind to, i.e. a list of tables in the
* case of a database, or REST collections, in the case of a web service.
*
- * @param string $model The fully-name-spaced class name of the object making the request.
+ * @param string $class The fully-name-spaced class name of the object making the request.
* @return array Returns an array of objects to which models can connect.
*/
abstract public function sources($class = null);
@@ -163,7 +163,10 @@ public function name($name) {
/**
* Defines or modifies the default settings of a relationship between two models.
- *
+ * @param $class the primary model of the relationship
+ * @param $type the type of the relationship (hasMany, hasOne, belongsTo)
+ * @param $name the name of the relationship
+ * @param array $options relationship options
* @return array Returns an array containing the configuration for a model relationship.
*/
abstract public function relationship($class, $type, $name, array $options = array());
View
7 data/collection/RecordSet.php
@@ -151,7 +151,7 @@ public function rewind() {
/**
* Returns the currently pointed to record in the set.
*
- * @return `Record`
+ * @return object `Record`
*/
public function current() {
return $this->_data[$this->_pointer];
@@ -230,7 +230,8 @@ public function to($format, array $options = array()) {
if (!(is_scalar(current($this->_index)) && $options['indexed'])) {
break;
}
- $result = ($this->_index && $result) ? array_combine($this->_index, $result) : array();
+ $indexAndResult = ($this->_index && $result);
+ $result = $indexAndResult ? array_combine($this->_index, $result) : array();
break;
default:
$result = parent::to($format, $options);
@@ -288,7 +289,7 @@ protected function _populate($data = null, $key = null) {
$record = is_object($data) ? $data : $this->_mapRecord($data);
$key = $model::key($record);
- if(!$key) {
+ if (!$key) {
$key = count($this->_data);
}
View
7 data/entity/Document.php
@@ -340,7 +340,6 @@ public function offsetSet($offset, $value) {
*
* @param mixed $offset String or integer indicating the offset or the name of a field in an
* individual document.
- * @param mixed $value The value to assign to the field.
* @return boolean Returns `true` if `$offset` is a field in the document, otherwise `false`.
*/
public function offsetExists($offset) {
@@ -433,8 +432,8 @@ public function next() {
* non-numeric.
*
* @param string $field The name of the field to be incrememnted.
- * @param string $value The value to increment the field by. Defaults to `1` if this parameter
- * is not specified.
+ * @param integer|string $value The value to increment the field by. Defaults to `1` if this
+ * parameter is not specified.
* @return integer Returns the current value of `$field`, based on the value retrieved from the
* data source when the entity was loaded, plus any increments applied. Note that it
* may not reflect the most current value in the persistent backend data source.
@@ -454,4 +453,4 @@ public function increment($field, $value = 1) {
}
}
-?>
+?>
View
11 data/model/Query.php
@@ -76,9 +76,7 @@ class Query extends \lithium\core\Object {
* This means that any information may be passed into the constructor may be used by the backend
* data source executing the query (or ignored, if support is not implemented). This is useful
* if, for example, you wish to extend a core data source and implement custom fucntionality.
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
@@ -397,7 +395,8 @@ public function join($name = null, $join = null) {
/**
* Convert the query's properties to the data sources' syntax and return it as an array.
*
- * @param object $dataSource Instance of the data source to use for conversion.
+ * @param \lithium\data\Source $dataSource Instance of the data source to use
+ * for conversion.
* @param array $options Options to use when exporting the data.
* @return array Returns an array containing a data source-specific representation of a query.
*/
@@ -498,10 +497,10 @@ public function alias($alias = null) {
* Gets or sets a custom query field which does not have an accessor method.
*
* @param string $method Query part.
- * @param string $params Query parameters.
+ * @param array $params Query parameters.
* @return mixed Returns the value as set in the `Query` object's constructor.
*/
- public function __call($method, $params = array()) {
+ public function __call($method, array $params = array()) {
if ($params) {
$this->_config[$method] = current($params);
return $this;
@@ -592,4 +591,4 @@ protected function _fromRelationship($rel) {
}
}
-?>
+?>
View
55 data/source/Database.php
@@ -11,7 +11,6 @@
use lithium\util\String;
use lithium\util\Inflector;
use InvalidArgumentException;
-use lithium\data\model\Query;
/**
* The `Database` class provides the base-level abstraction for SQL-oriented relational databases.
@@ -120,7 +119,7 @@
* Get the last insert id from the database.
* Abstract. Must be defined by child class.
*
- * @param lithium\data\model\Query $context The given query.
+ * @param $query lithium\data\model\Query $context The given query.
* @return void
*/
abstract protected function _insertId($query);
@@ -242,7 +241,7 @@ public function create($query, array $options = array()) {
* Reads records from a database using a `lithium\data\model\Query` object or raw SQL string.
*
* @param string|object $query `lithium\data\model\Query` object or SQL string.
- * @param string $options If `$query` is a raw string, contains the values that will be escaped
+ * @param array $options If `$query` is a raw string, contains the values that will be escaped
* and quoted. Other options:
* - `'return'` _string_: switch return between `'array'`, `'item'`, or
* `'resource'` _string_: Defaults to `'item'`.
@@ -277,7 +276,7 @@ public function read($query, array $options = array()) {
case 'array':
$columns = $args['schema'] ?: $self->schema($query, $result);
$records = array();
- if(is_array(reset($columns))) {
+ if (is_array(reset($columns))) {
$columns = reset($columns);
}
while ($data = $result->next()) {
@@ -290,7 +289,7 @@ public function read($query, array $options = array()) {
return $records;
case 'item':
return $self->item($query->model(), array(), compact('query', 'result') + array(
- 'class' => 'set',
+ 'class' => 'set'
));
}
});
@@ -372,10 +371,10 @@ public function calculation($type, $query, array $options = array()) {
/**
* Defines or modifies the default settings of a relationship between two models.
*
- * @param string $class
- * @param string $type
- * @param string $name
- * @param array $config
+ * @param string $class the primary model of the relationship
+ * @param string $type the type of the relationship (hasMany, hasOne, belongsTo)
+ * @param string $name the name of the relationship
+ * @param array $config relationship options
* @return array Returns an array containing the configuration for a model relationship.
*/
public function relationship($class, $type, $name, array $config = array()) {
@@ -444,9 +443,9 @@ public function schema($query, $resource = null, $context = null) {
return array($modelName => array_keys($model::schema()));
}
- if(!$fields && $joins) {
+ if (!$fields && $joins) {
$return = array($modelName => array_keys($model::schema()));
- foreach($joins as $join) {
+ foreach ($joins as $join) {
$model = $join->model();
$return[$join->alias()] = array_keys($model::schema());
}
@@ -455,7 +454,7 @@ public function schema($query, $resource = null, $context = null) {
$relations = array_keys((array) $query->relationships());
$schema = $model::schema();
- $pregDotMatch = '/^(' . implode('|', array_merge($relations, array($modelName))). ')\./';
+ $pregDotMatch = '/^(' . implode('|', array_merge($relations, array($modelName))) . ')\./';
$forJoin = ($modelName != $query->alias());
foreach ($fields as $scope => $field) {
switch (true) {
@@ -476,14 +475,14 @@ public function schema($query, $resource = null, $context = null) {
continue;
case in_array($scope, $relations) && is_array($field):
$join = isset($joins[$scope]) ? $joins[$scope] : null;
- if($join) {
+ if ($join) {
$relSchema = $this->schema($query, $join->model(), $join);
$result[$scope] = reset($relSchema);
}
break;
case is_numeric($scope) && in_array($field, $relations):
$join = isset($joins[$field]) ? $joins[$field] : null;
- if(!$join) {
+ if (!$join) {
continue;
}
$scope = $join->model();
@@ -491,9 +490,9 @@ public function schema($query, $resource = null, $context = null) {
break;
}
}
- if(!$forJoin) {
+ if (!$forJoin) {
$sortOrder = array_flip(array_merge(array($modelName),$relations));
- uksort($result, function($a, $b) use($sortOrder) {
+ uksort($result, function($a, $b) use ($sortOrder) {
return $sortOrder[$a] - $sortOrder[$b];
});
}
@@ -614,12 +613,12 @@ public function fields($fields, $context) {
$groupFields = function($item, $key) use (&$toMerge, &$keys, $modelNames, &$context) {
$name = current($keys);
next($keys);
- switch(true) {
+ switch (true) {
case is_array($item):
$toMerge[$name] = $item;
continue;
case in_array($item, $modelNames):
- if($item == reset($modelNames)) {
+ if ($item == reset($modelNames)) {
$schema = $context->schema();
} else {
$joins = $context->joins();
@@ -643,25 +642,25 @@ public function fields($fields, $context) {
};
array_walk($fields, $groupFields);
$fields = $toMerge;
- if(count($modelNames) > 1) {
+ if (count($modelNames) > 1) {
$sortOrder = array_flip($modelNames);
- uksort($fields, function($a, $b) use($sortOrder) {
+ uksort($fields, function($a, $b) use ($sortOrder) {
return $sortOrder[$a] - $sortOrder[$b];
});
}
$mapFields = function() use($fields, $modelNames) {
$return = array();
- foreach($fields as $key => $items) {
- if(!is_array($items)) {
+ foreach ($fields as $key => $items) {
+ if (!is_array($items)) {
$return[$key] = $items;
continue;
}
- if(is_numeric($key)) {
+ if (is_numeric($key)) {
$key = reset($modelNames);
}
$pointer = &$return[$key];
- foreach($items as $field) {
- if(stripos($field, ' as ') !== false) {
+ foreach ($items as $field) {
+ if (stripos($field, ' as ') !== false) {
list($real, $as) = explode(' as ', str_replace(' AS ', ' as ', $field));
$pointer[] = trim($as);
continue;
@@ -674,8 +673,8 @@ public function fields($fields, $context) {
$context->map($mapFields());
$toMerge = array();
- foreach($fields as $scope => $items) {
- foreach($items as $field) {
+ foreach ($fields as $scope => $items) {
+ foreach ($items as $field) {
if (!is_numeric($scope)) {
$toMerge[] = $scope . '.' . $field;
continue;
@@ -865,7 +864,7 @@ protected function _operator($key, $value, array $schema = array(), array $optio
$key = $this->name($key);
$values = array();
- if(!is_object($value)) {
+ if (!is_object($value)) {
foreach ((array) $value as $val) {
$values[] = $this->value($val, $schema);
}
View
5 data/source/Http.php
@@ -63,7 +63,6 @@ class Http extends \lithium\data\Source {
* Constructor
*
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
@@ -167,8 +166,8 @@ public function sources($class = null) {
* Describe data source.
*
* @param string $entity
- * @param string $meta
- * @return void
+ * @param array $meta
+ * @return array - returns an empty array
*/
public function describe($entity, array $meta = array()) {
return array();
View
7 data/source/MongoDb.php
@@ -140,7 +140,6 @@ class MongoDb extends \lithium\data\Source {
*
* Typically, these parameters are set in `Connections::add()`, when adding the adapter to the
* list of active connections.
- * @return object The adapter instance.
*/
public function __construct(array $config = array()) {
$defaults = array(
@@ -361,7 +360,7 @@ public function schema($query, $resource = null, $context = null) {
* Create new document
*
* @param string $query
- * @param string $options
+ * @param array $options
* @return boolean
* @filter
*/
@@ -439,7 +438,7 @@ protected function _saveFile($data) {
* Read from document
*
* @param string $query
- * @param string $options
+ * @param array $options
* @return object
* @filter
*/
@@ -538,7 +537,7 @@ public function update($query, array $options = array()) {
* Delete document
*
* @param string $query
- * @param string $options
+ * @param array $options
* @return boolean
* @filter
*/
View
1  data/source/database/adapter/MySql.php
@@ -80,7 +80,6 @@ class MySql extends \lithium\data\source\Database {
*
* Typically, these parameters are set in `Connections::add()`, when adding the adapter to the
* list of active connections.
- * @return The adapter instance.
*/
public function __construct(array $config = array()) {
$defaults = array('host' => 'localhost:3306', 'encoding' => null);
View
1  data/source/database/adapter/Sqlite3.php
@@ -84,7 +84,6 @@ class Sqlite3 extends \lithium\data\source\Database {
*
* Typically, these parameters are set in `Connections::add()`, when adding the adapter to the
* list of active connections.
- * @return The adapter instance.
*/
public function __construct(array $config = array()) {
$defaults = array(
View
20 data/source/http/adapter/CouchDb.php
@@ -51,9 +51,7 @@ class CouchDb extends \lithium\data\source\Http {
/**
* Constructor.
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array('port' => 5984, 'version' => 1);
@@ -108,7 +106,7 @@ public function configureClass($class) {
* Magic for passing methods to http service.
*
* @param string $method
- * @param string $params
+ * @param array $params
* @return void
*/
public function __call($method, $params = array()) {
@@ -128,8 +126,9 @@ public function sources($class = null) {
/**
* Describe database, create if it does not exist.
*
+ * @throws ConfigException
* @param string $entity
- * @param string $meta
+ * @param array $meta
* @return void
*/
public function describe($entity, array $meta = array()) {
@@ -173,7 +172,7 @@ public function name($name) {
* Create new document.
*
* @param string $query
- * @param string $options
+ * @param array $options
* @return boolean
* @filter
*/
@@ -210,7 +209,7 @@ public function create($query, array $options = array()) {
* Read from document.
*
* @param string $query
- * @param string $options
+ * @param array $options
* @return object
* @filter
*/
@@ -258,7 +257,7 @@ public function read($query, array $options = array()) {
* Update document.
*
* @param string $query
- * @param string $options
+ * @param array $options
* @return boolean
* @filter
*/
@@ -300,7 +299,7 @@ public function update($query, array $options = array()) {
* Delete document.
*
* @param string $query
- * @param string $options
+ * @param array $options
* @return boolean
* @filter
*/
@@ -493,9 +492,8 @@ public static function enabled($feature = null) {
/**
* Formats a CouchDb result set into a standard result to be passed to item.
*
- * @param string $data data returned from query
- * @param string $options
- * @return void
+ * @param array $data data returned from query
+ * @return array
*/
protected function _format(array $data) {
if (isset($data['_id'])) {
View
2  g11n/catalog/adapter/Code.php
@@ -32,7 +32,6 @@ class Code extends \lithium\g11n\catalog\Adapter {
* @param array $config Available configuration options are:
* - `'path'`: The path to the directory holding the data.
* - `'scope'`: Scope to use.
- * @return object
*/
public function __construct(array $config = array()) {
$defaults = array('path' => null, 'scope' => null);
@@ -66,7 +65,6 @@ public function read($category, $locale, $scope) {
return null;
}
$path = $this->_config['path'];
- $data = array();
switch ($category) {
case 'messageTemplate':
View
2  g11n/catalog/adapter/Gettext.php
@@ -78,7 +78,6 @@ class Gettext extends \lithium\g11n\catalog\Adapter {
*
* @param array $config Available configuration options are:
* - `'path'`: The path to the directory holding the data.
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array('path' => null);
@@ -417,7 +416,6 @@ protected function _compilePo($stream, array $data) {
*
* @param resource $stream
* @param array $data
- * @param array $meta
* @return boolean Success.
*/
protected function _compilePot($stream, array $data) {
View
1  g11n/catalog/adapter/Php.php
@@ -57,7 +57,6 @@ class Php extends \lithium\g11n\catalog\Adapter {
*
* @param array $config Available configuration options are:
* - `'path'`: The path to the directory holding the data.
- * @return object
*/
public function __construct(array $config = array()) {
$defaults = array('path' => null);
View
1  net/Socket.php
@@ -49,7 +49,6 @@
* - `'password'`: Password for a login (defaults to `''`).
* - `'port'`: Host port (defaults to `80`).
* - `'timeout'`: Seconds after opening the socket times out (defaults to `30`).
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
View
1  net/http/Media.php
@@ -626,7 +626,6 @@ public static function view($handler, $data, &$response = null, array $options =
* @param mixed $data Arbitrary data you wish to encode. Note that some encoders can only handle
* arrays or objects.
* @param object $response A reference to the `Response` object for this dispatch cycle.
- * @param array $options Handler-specific options.
* @return mixed Returns the result of `$data`, encoded with the encoding configuration
* specified by `$type`, the result of which is usually a string.
* @filter
View
1  net/http/Request.php
@@ -59,7 +59,6 @@ class Request extends \lithium\net\http\Message {
* - auth: the Authorization method (Basic|Digest)
* - username: the username for auth
* - password: the password for auth
- * @return object
*/
public function __construct(array $config = array()) {
$defaults = array(
View
3  net/http/Route.php
@@ -232,7 +232,7 @@ public function parse($request) {
* Matches a set of parameters against the route, and returns a URL string if the route matches
* the parameters, or false if it does not match.
*
- * @param string $options
+ * @param array $options
* @param string $context
* @return mixed
*/
@@ -345,7 +345,6 @@ public function export() {
* Compiles URL templates into regular expression patterns for matching against request URLs,
* and extracts template parameters into match-parameter arrays.
*
- * @param array $options
* @return void
*/
public function compile() {
View
2  net/http/Service.php
@@ -60,9 +60,7 @@ class Service extends \lithium\core\Object {
/**
* Initializes a new `Service` instance with the default HTTP request settings and
* transport- and format-handling classes.
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
View
2  net/socket/Curl.php
@@ -95,7 +95,7 @@ public function close() {
/**
* EOF is unimplemented for this socket adapter
- *
+ * @return null
*/
public function eof() {
return null;
View
6 storage/cache/adapter/Apc.php
@@ -41,9 +41,7 @@ class Apc extends \lithium\core\Object {
/**
* Class constructor
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
@@ -121,7 +119,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement
* @param integer $offset Offset to decrement - defaults to 1.
- * @return closure Function returning item's new value on successful decrement, `false` otherwise
+ * @return closure Function returning item's new value on successful decrement, else `false`
*/
public function decrement($key, $offset = 1) {
return function($self, $params) use ($offset) {
@@ -138,7 +136,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment
* @param integer $offset Offset to increment - defaults to 1.
- * @return closure Function returning item's new value on successful increment, `false` otherwise
+ * @return closure Function returning item's new value on successful increment, else `false`
*/
public function increment($key, $offset = 1) {
return function($self, $params) use ($offset) {
View
1  storage/cache/adapter/File.php
@@ -49,7 +49,6 @@ class File extends \lithium\core\Object {
* - 'path' : Path where cached entries live `LITHIUM_APP_PATH . '/resources/tmp/cache'`.
* - 'expiry' : Default expiry time used if none is explicitly set when calling
* `Cache::write()`.
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
View
7 storage/cache/adapter/Memcache.php
@@ -78,12 +78,11 @@ class Memcache extends \lithium\core\Object {
* is otherwise set. See the `$expiry` parameter of `Memcache::write()`.
* - `'host'` _mixed_: Specifies one or more Memcache servers to connect to, with
* optional server selection weights. See above for example values.
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
'expiry' => '+1 hour',
- 'host' => '127.0.0.1',
+ 'host' => '127.0.0.1'
);
parent::__construct(Set::merge($defaults, $config));
}
@@ -219,7 +218,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement
* @param integer $offset Offset to decrement - defaults to 1.
- * @return closure Function returning item's new value on successful decrement, `false` otherwise
+ * @return closure Function returning item's new value on successful decrement, else `false`
*/
public function decrement($key, $offset = 1) {
$connection =& $this->connection;
@@ -238,7 +237,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment
* @param integer $offset Offset to increment - defaults to 1.
- * @return closure Function returning item's new value on successful increment, `false` otherwise
+ * @return closure Function returning item's new value on successful increment, else `false`
*/
public function increment($key, $offset = 1) {
$connection =& $this->connection;
View
5 storage/cache/adapter/Redis.php
@@ -75,7 +75,6 @@ class Redis extends \lithium\core\Object {
* connection when attempting to connect to the Redis server. If `true`, it will
* attempt to reuse an existing connection when connecting, and the connection will
* not close when the request is terminated. Defaults to `false`.
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
@@ -192,7 +191,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement
* @param integer $offset Offset to decrement - defaults to 1.
- * @return closure Function returning item's new value on successful decrement, `false` otherwise
+ * @return closure Function returning item's new value on successful decrement, else `false`
*/
public function decrement($key, $offset = 1) {
$connection =& $this->connection;
@@ -211,7 +210,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment
* @param integer $offset Offset to increment - defaults to 1.
- * @return closure Function returning item's new value on successful increment, `false` otherwise
+ * @return closure Function returning item's new value on successful increment, else `false`
*/
public function increment($key, $offset = 1) {
$connection =& $this->connection;
View
7 storage/cache/adapter/XCache.php
@@ -47,9 +47,7 @@ class XCache extends \lithium\core\Object {
/**
* Class constructor
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array('prefix' => '', 'expiry' => '+1 hour');
@@ -106,7 +104,7 @@ public function delete($key) {
*
* @param string $key Key of numeric cache item to decrement
* @param integer $offset Offset to decrement - defaults to 1.
- * @return closure Function returning item's new value on successful decrement, `false` otherwise
+ * @return closure Function returning item's new value on successful decrement, else `false`
*/
public function decrement($key, $offset = 1) {
return function($self, $params) use ($offset) {
@@ -122,7 +120,7 @@ public function decrement($key, $offset = 1) {
*
* @param string $key Key of numeric cache item to increment
* @param integer $offset Offset to increment - defaults to 1.
- * @return closure Function returning item's new value on successful increment, `false` otherwise
+ * @return closure Function returning item's new value on successful increment, else `false`
*/
public function increment($key, $offset = 1) {
return function($self, $params) use ($offset) {
@@ -181,6 +179,7 @@ public function clear() {
* if the userspace cache is available.
*
* return boolean True if enabled, false otherwise
+ * @return boolean
*/
public static function enabled() {
return extension_loaded('xcache');
View
3  storage/session/adapter/Cookie.php
@@ -39,7 +39,6 @@ class Cookie extends \lithium\core\Object {
* Takes care of setting appropriate configurations for this object.
*
* @param array $config Optional configuration parameters.
- * @return void
*/
public function __construct(array $config = array()) {
parent::__construct($config + $this->_defaults);
@@ -70,7 +69,7 @@ public function key() {
/**
* Determines if cookies are enabled.
*
- * return boolean True
+ * @return boolean True
* @todo Implement
*/
public function isEnabled() {
View
1  storage/session/adapter/Php.php
@@ -38,7 +38,6 @@ class Php extends \lithium\core\Object {
*
* @param array $config Unified constructor configuration parameters. You can set
* the `session.*` PHP ini settings here as key/value pairs.
- * @return void
*/
public function __construct(array $config = array()) {
parent::__construct($config + $this->_defaults);
View
1  storage/session/strategy/Hmac.php
@@ -52,7 +52,6 @@ class Hmac extends \lithium\core\Object {
*
* @param array $config Configuration array. Will throw an exception if the 'secret'
* configuration key is not set.
- * @return void
*/
public function __construct(array $config = array()) {
if (!isset($config['secret'])) {
View
6 template/View.php
@@ -195,7 +195,6 @@ class View extends \lithium\core\Object {
* controller. Defaults to `'File'`.
* - `request`: The request object to be made available in the view. Defaults to `null`.
* - `vars`: Defaults to `array()`.
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
@@ -289,6 +288,11 @@ protected function _conditions($step, $params, $data, $options) {
/**
* @filter
+ * @param array $step
+ * @param array $params
+ * @param array $data associative array for template data.
+ * @param array $options
+ * @return _renderer.render
*/
protected function _step(array $step, array $params, array &$data, array &$options = array()) {
$step += array('path' => null, 'capture' => null);
View
2  template/view/Compiler.php
@@ -44,7 +44,7 @@ class Compiler extends \lithium\core\StaticObject {
* Compiles a template and writes it to a cache file, which is used for inclusion.
*
* @param string $file The full path to the template that will be compiled.
- * @param string $options Options for compilation include:
+ * @param array $options Options for compilation include:
* - `path`: Path where the compiled template should be written.
* - `fallback`: Boolean indicating that if the compilation failed for some
* reason (e.g. `path` is not writable), that the compiled template
View
4 template/view/Renderer.php
@@ -137,7 +137,7 @@
* Abstract. Must be added to subclasses.
*
* @param string $template
- * @param string $data
+ * @param array|string $data
* @param array $options
* @return void
*/
@@ -155,9 +155,7 @@
* - `response`: The `Response` object associated with this renderer.
* - `context`: An array of the current rendering context data, including `content`,
* `title`, `scripts`, `head` and `styles`.
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
$defaults = array(
View
2  template/view/adapter/File.php
@@ -88,7 +88,7 @@ public function __construct(array $config = array()) {
* Renders content from a template file provided by `template()`.
*
* @param string $template
- * @param string $data
+ * @param array|string $data
* @param array $options
* @return string
*/
View
8 test/Group.php
@@ -52,7 +52,7 @@ protected function _init() {
/**
* Get all test cases. By default, does not include function or integration tests.
*
- * @param string $options
+ * @param array $options
* @return array
*/
public static function all(array $options = array()) {
@@ -68,7 +68,7 @@ public static function all(array $options = array()) {
* Add a tests to the group.
*
* @param string $test The test to be added.
- * @param string $options Method options. Currently not used in this method.
+ * @param array $options Method options. Currently not used in this method.
* @return array Updated list of tests contained within this collection.
*/
public function add($test = null, array $options = array()) {
@@ -96,8 +96,8 @@ public function add($test = null, array $options = array()) {
/**
* Get the collection of tests
*
- * @param string $params
- * @param string $options
+ * @param string|array $params
+ * @param array $options
* @return lithium\util\Collection
*/
public function tests($params = array(), array $options = array()) {
View
3  test/Report.php
@@ -211,8 +211,7 @@ function($value) { return is_array($value) ? count($value) : $value; }, $stats
* Renders the test output (e.g. layouts and filter templates)
*
* @param string $template name of the template (eg: layout)
- * @param string $data array from `_data()` method
- * @param array $options Array of options (e.g. rendering type)
+ * @param string|array $data array from `_data()` method
* @return string
* @filter
*/
View
18 test/Unit.php
@@ -116,8 +116,9 @@ public function skip() {}
* otherwise processing continues as normal.
* For other methods, only the remainder of the method is skipped, when the condition is met.
*
+ * @throws Exception
* @param boolean $condition
- * @param string $message Message to pass if the condition is met.
+ * @param string|boolean $message Message to pass if the condition is met.
* @return mixed
*/
public function skipIf($condition, $message = false) {
@@ -194,9 +195,9 @@ public function run(array $options = array()) {
* General assert method used by others for common output.
*
* @param boolean $expression
- * @param string $message The message to output. If the message is not a string, then it will be
- * converted to '{:message}'. Use '{:message}' in the string and it will use the `$data`
- * to format the message with `String::insert()`.
+ * @param string|boolean $message The message to output. If the message is not a string,
+ * then it will be converted to '{:message}'. Use '{:message}' in the string and it
+ * will use the `$data` to format the message with `String::insert()`.
* @param array $data
* @return void
*/
@@ -239,7 +240,7 @@ public function assert($expression, $message = false, $data = array()) {
*
* @param mixed $expected
* @param mixed $result
- * @param string $message
+ * @param string|boolean $message
*/
public function assertEqual($expected, $result, $message = false) {
$data = ($expected != $result) ? $this->_compare('equal', $expected, $result) : null;
@@ -251,7 +252,7 @@ public function assertEqual($expected, $result, $message = false) {
*
* @param mixed $expected
* @param mixed $result
- * @param string $message
+ * @param string|boolean $message
*/
public function assertNotEqual($expected, $result, $message = false) {
$this->assert($result != $expected, $message, compact('expected', 'result'));
@@ -262,7 +263,7 @@ public function assertNotEqual($expected, $result, $message = false) {
*
* @param mixed $expected
* @param mixed $result
- * @param string $message
+ * @param string|boolean $message
*/
public function assertIdentical($expected, $result, $message = false) {
$data = ($expected !== $result) ? $this->_compare('identical', $expected, $result) : null;
@@ -386,6 +387,7 @@ public function assertPattern($expected, $result, $message = '{:message}') {
*
* @param string $string An HTML/XHTML/XML string
* @param array $expected An array, see above
+ * @return boolean|void
* @access public
*/
function assertTags($string, $expected) {
@@ -522,6 +524,7 @@ function assertTags($string, $expected) {
*
* @param array $expected
* @param array $headers When empty, value of `headers_list()` is used.
+ * @return boolean|void
*/
public function assertCookie($expected, $headers = null) {
$matched = $this->_cookieMatch($expected, $headers);
@@ -546,6 +549,7 @@ public function assertCookie($expected, $headers = null) {
*
* @param array $expected
* @param array $headers When empty, value of `headers_list()` is used.
+ * @return boolean|void
*/
public function assertNoCookie($expected, $headers = null) {
$matched = $this->_cookieMatch($expected, $headers);
View
1  tests/cases/util/StringTest.php
@@ -390,6 +390,7 @@ public function testRandom64Generator() {
/**
* Tests hash generation using `String::hash()`.
+ * @return string
*/
public function testHash() {
$salt = 'Salt and pepper';
View
2  tests/mocks/storage/cache/strategy/MockConfigurizer.php
@@ -18,9 +18,7 @@ class MockConfigurizer extends \lithium\core\Object {
/**
* Constructor.
- *
* @param array $config
- * @return void
*/
public function __construct(array $config = array()) {
static::$parameters = $config;
View
2  util/Collection.php
@@ -236,7 +236,7 @@ public function __call($method, $parameters = array()) {
* @see lithium\util\Collection::$_formats
* @param string $format By default the only supported value is `'array'`. However, additional
* format handlers can be registered using the `formats()` method.
- * @param $options Options for converting this collection:
+ * @param array $options Options for converting this collection:
* - `'internal'` _boolean_: Indicates whether the current internal representation of the
* collection should be exported. Defaults to `false`, which uses the standard iterator
* interfaces. This is useful for exporting record sets, where records are lazy-loaded,
View
6 util/String.php
@@ -198,9 +198,9 @@ public static function hash($string, array $options = array()) {
* }}}
*
* @param string $str A string containing variable place-holders.
- * @param string $data A key, value array where each key stands for a place-holder variable
+ * @param array $data A key, value array where each key stands for a place-holder variable
* name to be replaced with value.
- * @param string $options Available options are:
+ * @param array $options Available options are:
* - `'after'`: The character or string after the name of the variable place-holder
* (defaults to `null`).
* - `'before'`: The character or string in front of the name of the variable
@@ -288,7 +288,7 @@ public static function insert($str, array $data, array $options = array()) {
* and unneeded mark-up around place-holders that did not get replaced by `Set::insert()`.
*
* @param string $str The string to clean.
- * @param string $options Available options are:
+ * @param array $options Available options are:
* - `'after'`: characters marking the end of targeted substring.
* - `'andText'`: (defaults to `true`).
* - `'before'`: characters marking the start of targeted substring.
View
8 util/Validator.php
@@ -542,7 +542,7 @@ public static function add($name, $rule = null, array $options = array()) {
* @param string $rule
* @param mixed $value
* @param string $format
- * @param string $options
+ * @param array $options
* @return boolean Returns `true` or `false` indicating whether the validation rule check
* succeeded or failed.
* @filter
@@ -589,12 +589,6 @@ public static function rules($name = null) {
* and an array specifying which formats within the rule to use.
*
* @param array $rules All available rules.
- * @param array $formats The list of rules to check against.
- * @param mixed $value The value to perform validation on.
- * @param array $options Validation options to be passed to rules defined as closures.
- * - `'all'` _boolean_: Whether all rule formats should be validated against. If
- * `true`, only return successfully if _all_ formats validate, otherwise, returns
- * `true` if _any_ validates.
* @return closure Function returning boolean `true` if validation succeeded, `false` otherwise.
*/
protected static function _checkFormats($rules) {
View
1  util/collection/Filters.php
@@ -138,6 +138,7 @@ public static function apply($class, $method, $filter) {
* @see lithium\util\collection\Filters::apply()
* @param string $class Fully-namespaced class name.
* @param string $method Method name.
+ * @return boolean
*/
public static function hasApplied($class, $method) {
return isset(static::$_lazyFilters[$class][$method]);
Please sign in to comment.
Something went wrong with that request. Please try again.