Browse Source

Fix API doc errors in Datasource/

mark_story 11 years ago
parent
commit
244aa061ff

+ 1 - 2
src/Datasource/ConnectionManager.php

@@ -52,12 +52,11 @@ class ConnectionManager {
  *
  * The connection will not be constructed until it is first used.
  *
- * @see \Cake\Core\StaticConfigTrait::config()
- *
  * @param string|array $key The name of the connection config, or an array of multiple configs.
  * @param array $config An array of name => config data for adapter.
  * @return mixed null when adding configuration and an array of configuration data when reading.
  * @throws \Cake\Error\Exception When trying to modify an existing config.
+ * @see \Cake\Core\StaticConfigTrait::config()
  */
 	public static function config($key, $config = null) {
 		if (is_array($config)) {

+ 8 - 8
src/Datasource/EntityInterface.php

@@ -49,7 +49,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable {
  * Returns whether this entity contains a property named $property
  * regardless of if it is empty.
  *
- * @param string $property
+ * @param string $property The property to check.
  * @return bool
  */
 	public function has($property);
@@ -57,7 +57,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable {
 /**
  * Removes a property or list of properties from this entity
  *
- * @param string|array $property
+ * @param string|array $property The property to unset.
  * @return \Cake\ORM\
  */
 	public function unsetProperty($property);
@@ -68,7 +68,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable {
  * If the properties argument is null, the currently hidden properties
  * will be returned. Otherwise the hidden properties will be set.
  *
- * @param null|array Either an array of properties to hide or null to get properties
+ * @param null|array $properties Either an array of properties to hide or null to get properties
  * @return array|\Cake\DataSource\EntityInterface
  */
 	public function hiddenProperties($properties = null);
@@ -79,7 +79,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable {
  * If the properties argument is null, the currently virtual properties
  * will be returned. Otherwise the virtual properties will be set.
  *
- * @param null|array Either an array of properties to treat as virtual or null to get properties
+ * @param null|array $properties Either an array of properties to treat as virtual or null to get properties
  * @return array|\Cake\DataSource\EntityInterface
  */
 	public function virtualProperties($properties = null);
@@ -118,7 +118,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable {
  * dirty property in the entity
  *
  * @param string $property the field to set or check status for
- * @param null|bool true means the property was changed, false means
+ * @param null|bool $isDirty true means the property was changed, false means
  * it was not changed and null will make the function return current state
  * for that property
  * @return bool whether the property was changed or not
@@ -157,7 +157,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable {
  * This function returns true if there were no validation errors or false
  * otherwise.
  *
- * @param \Cake\Validation\Validator $validator
+ * @param \Cake\Validation\Validator $validator The validator to use when validating the entity.
  * @return bool
  */
 	public function validate(Validator $validator);
@@ -171,7 +171,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable {
  * When used as a setter, this method will return this entity instance for method
  * chaining.
  *
- * @param string|array $field
+ * @param string|array $field The field to get errors for.
  * @param string|array $errors The errors to be set for $field
  * @return array|\Cake\Datasource\EntityInterface
  */
@@ -184,7 +184,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable {
  * `$entity->accessible('*', true)`  means that any property not specified already
  * will be accessible by default.
  *
- * @param string|array single or list of properties to change its accessibility
+ * @param string|array $property Either a single or list of properties to change its accessibility.
  * @param bool $set true marks the property as accessible, false will
  * mark it as protected.
  * @return \Cake\Datasource\EntityInterface|bool

+ 17 - 17
src/Datasource/EntityTrait.php

@@ -129,9 +129,9 @@ trait EntityTrait {
  * Returns whether this entity contains a property named $property
  * regardless of if it is empty.
  *
- * @see \Cake\ORM\Entity::has()
- * @param string $property
+ * @param string $property The property to check.
  * @return bool
+ * @see \Cake\ORM\Entity::has()
  */
 	public function __isset($property) {
 		return $this->has($property);
@@ -140,7 +140,7 @@ trait EntityTrait {
 /**
  * Removes a property from this entity
  *
- * @param string $property
+ * @param string $property The property to unset
  * @return void
  */
 	public function __unset($property) {
@@ -273,7 +273,7 @@ trait EntityTrait {
  *		$entity->has('last_name'); // false
  * }}}
  *
- * @param string $property
+ * @param string $property The property to check.
  * @return bool
  */
 	public function has($property) {
@@ -289,8 +289,8 @@ trait EntityTrait {
  *
  * ``$entity->unsetProperty(['name', 'last_name']);``
  *
- * @param string|array $property
- * @return \Cake\ORM\
+ * @param string|array $property The property to unset.
+ * @return \Cake\DataSource\EntityInterface
  */
 	public function unsetProperty($property) {
 		$property = (array)$property;
@@ -307,7 +307,7 @@ trait EntityTrait {
  * If the properties argument is null, the currently hidden properties
  * will be returned. Otherwise the hidden properties will be set.
  *
- * @param null|array Either an array of properties to hide or null to get properties
+ * @param null|array $properties Either an array of properties to hide or null to get properties
  * @return array|\Cake\DataSource\EntityInterface
  */
 	public function hiddenProperties($properties = null) {
@@ -324,7 +324,7 @@ trait EntityTrait {
  * If the properties argument is null, the currently virtual properties
  * will be returned. Otherwise the virtual properties will be set.
  *
- * @param null|array Either an array of properties to treat as virtual or null to get properties
+ * @param null|array $properties Either an array of properties to treat as virtual or null to get properties
  * @return array|\Cake\DataSource\EntityInterface
  */
 	public function virtualProperties($properties = null) {
@@ -389,7 +389,7 @@ trait EntityTrait {
 /**
  * Implements isset($entity);
  *
- * @param mixed $offset
+ * @param mixed $offset The offset to check.
  * @return bool Success
  */
 	public function offsetExists($offset) {
@@ -399,7 +399,7 @@ trait EntityTrait {
 /**
  * Implements $entity[$offset];
  *
- * @param mixed $offset
+ * @param mixed $offset The offset to get.
  * @return mixed
  */
 	public function &offsetGet($offset) {
@@ -409,8 +409,8 @@ trait EntityTrait {
 /**
  * Implements $entity[$offset] = $value;
  *
- * @param mixed $offset
- * @param mixed $value
+ * @param mixed $offset The offset to set.
+ * @param mixed $value The value to set.
  * @return void
  */
 	public function offsetSet($offset, $value) {
@@ -420,7 +420,7 @@ trait EntityTrait {
 /**
  * Implements unset($result[$offset);
  *
- * @param mixed $offset
+ * @param mixed $offset The offset to remove.
  * @return void
  */
 	public function offsetUnset($offset) {
@@ -467,7 +467,7 @@ trait EntityTrait {
  * dirty property in the entity
  *
  * @param string $property the field to set or check status for
- * @param null|bool true means the property was changed, false means
+ * @param null|bool $isDirty true means the property was changed, false means
  * it was not changed and null will make the function return current state
  * for that property
  * @return bool whether the property was changed or not
@@ -531,7 +531,7 @@ trait EntityTrait {
  * This function returns true if there were no validation errors or false
  * otherwise.
  *
- * @param \Cake\Validation\Validator $validator
+ * @param \Cake\Validation\Validator $validator The validator to use when validating the entity.
  * @return bool
  */
 	public function validate(Validator $validator) {
@@ -567,7 +567,7 @@ trait EntityTrait {
  * When used as a setter, this method will return this entity instance for method
  * chaining.
  *
- * @param string|array $field
+ * @param string|array $field The field to get errors for, or the array of errors to set.
  * @param string|array $errors The errors to be set for $field
  * @return array|\Cake\Datasource\EntityInterface
  */
@@ -653,7 +653,7 @@ trait EntityTrait {
  * $entity->accessible('id'); // Returns whether it can be set or not
  * }}}
  *
- * @param string|array single or list of properties to change its accessibility
+ * @param string|array $property single or list of properties to change its accessibility
  * @param bool $set true marks the property as accessible, false will
  * mark it as protected.
  * @return \Cake\Datasource\EntityInterface|bool

+ 5 - 5
src/Datasource/QueryCacher.php

@@ -31,8 +31,8 @@ class QueryCacher {
 /**
  * Constructor.
  *
- * @param string|\Closure $key
- * @param string|CacheEngine $config
+ * @param string|\Closure $key The key or function to generate a key.
+ * @param string|CacheEngine $config The cache config name or cache engine instance.
  * @throws RuntimeException
  */
 	public function __construct($key, $config) {
@@ -67,7 +67,7 @@ class QueryCacher {
  * Store the result set into the cache.
  *
  * @param object $query The query the cache read is for.
- * @param \Traversable The result set to store.
+ * @param \Traversable $results The result set to store.
  * @return void
  */
 	public function store($query, Traversable $results) {
@@ -79,9 +79,9 @@ class QueryCacher {
 /**
  * Get/generate the cache key.
  *
- * @param object $query
+ * @param object $query The query to generate a key for.
  * @return string
- * @throws RuntimeException
+ * @throws \RuntimeException
  */
 	protected function _resolveKey($query) {
 		if (is_string($this->_key)) {

+ 11 - 11
src/Datasource/QueryTrait.php

@@ -178,7 +178,7 @@ trait QueryTrait {
  * Sets the query instance to be the eager loaded query. If no argument is
  * passed, the current configured query `_eagerLoaded` value is returned.
  *
- * @param bool $value
+ * @param bool $value Whether or not to eager load.
  * @return \Cake\ORM\Query
  */
 	public function eagerLoaded($value = null) {
@@ -248,9 +248,9 @@ trait QueryTrait {
  * If the third argument is set to true, it will erase previous map reducers
  * and replace it with the arguments passed.
  *
- * @param callable $mapper
- * @param callable $reducer
- * @param bool $overwrite
+ * @param callable $mapper The mapper callable.
+ * @param callable $reducer The reducing function.
+ * @param bool $overwrite Set to true to overwrite existing map + reduce functions.
  * @return \Cake\Datasource\QueryTrait|array
  * @see \Cake\Collection\Iterator\MapReduce for details on how to use emit data to the map reducer.
  */
@@ -288,20 +288,20 @@ trait QueryTrait {
  * {{{
  * //Return all results from the table indexed by id
  * $query->select(['id', 'name'])->formatResults(function($results, $query) {
- *	return $results->indexBy('id');
+ *   return $results->indexBy('id');
  * });
  *
  * //Add a new column to the ResultSet
  * $query->select(['name', 'birth_date'])->formatResults(function($results, $query) {
- *	return $results->map(function($row) {
- *		$row['age'] = $row['birth_date']->diff(new DateTime)->y;
- *		return $row;
- *	});
+ *   return $results->map(function($row) {
+ *     $row['age'] = $row['birth_date']->diff(new DateTime)->y;
+ *     return $row;
+ *   });
  * });
  * }}}
  *
- * @param callable $formatter
- * @param bool|int $mode
+ * @param callable $formatter The formatting callable.
+ * @param bool|int $mode Whether or not to overwrite, append or prepend the formatter.
  * @return \Cake\Datasource\QueryTrait|array
  */
 	public function formatResults(callable $formatter = null, $mode = 0) {

+ 2 - 2
src/Datasource/RepositoryInterface.php

@@ -113,8 +113,8 @@ interface RepositoryInterface {
  * returns the same entity after a successful save or false in case
  * of any error.
  *
- * @param \Cake\Datasource\EntityInterface the entity to be saved
- * @param array|\ArrayAccess $options
+ * @param \Cake\Datasource\EntityInterface $entity the entity to be saved
+ * @param array|\ArrayAccess $options The options to use when saving.
  * @return \Cake\Datasource\EntityInterface|bool
  */
 	public function save(EntityInterface $entity, $options = []);

+ 1 - 0
src/Datasource/ResultSetDecorator.php

@@ -57,6 +57,7 @@ class ResultSetDecorator extends Collection implements Countable, Serializable,
  * Part of Serializable interface.
  *
  * @param string $serialized Serialized object
+ * @return void
  */
 	public function unserialize($serialized) {
 		parent::__construct(unserialize($serialized));