Skip to content

Commit

Permalink
Fix API doc errors in ORM/
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 8, 2014
1 parent 061b5d6 commit a1defb4
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 67 deletions.
26 changes: 13 additions & 13 deletions src/ORM/Association.php
Expand Up @@ -286,7 +286,7 @@ public function foreignKey($key = null) {
*
* If no parameters are passed the current setting is returned.
*
* @param bool $dependent
* @param bool $dependent Set the dependent mode. Use null to read the current state.
* @return bool
*/
public function dependent($dependent = null) {
Expand Down Expand Up @@ -326,7 +326,7 @@ public function joinType($type = null) {
* in the source table record.
* If no arguments are passed, the currently configured type is returned.
*
* @param string $name
* @param string $name The name of the association property. Use null to read the current value.
* @return string
*/
public function property($name = null) {
Expand All @@ -346,7 +346,7 @@ public function property($name = null) {
* rendering any changes to this setting void.
* If no arguments are passed, the currently configured strategy is returned.
*
* @param string $name
* @param string $name The strategy type. Use null to read the current value.
* @return string
* @throws \InvalidArgumentException When an invalid strategy is provided.
*/
Expand Down Expand Up @@ -446,11 +446,11 @@ public function attachTo(Query $query, array $options = []) {
* Correctly nests a result row associated values into the correct array keys inside the
* source results.
*
* @param array $row
* @param array $row The row to transform
* @param string $nestKey The array key under which the results for this association
* should be found
* should be found
* @param bool $joined Whether or not the row is a result of a direct join
* with this association
* with this association
* @return array
*/
public function transformRow($row, $nestKey, $joined) {
Expand All @@ -468,9 +468,9 @@ public function transformRow($row, $nestKey, $joined) {
* with the default empty value according to whether the association was
* joined or fetched externally.
*
* @param array $row
* @param array $row The row to set a default on.
* @param bool $joined Whether or not the row is a result of a direct join
* with this association
* with this association
* @return array
*/
public function defaultRowValue($row, $joined) {
Expand All @@ -487,8 +487,8 @@ public function defaultRowValue($row, $joined) {
* configuration
*
* @param string|array $type the type of query to perform, if an array is passed,
* it will be interpreted as the `$options` parameter
* @param array $options
* it will be interpreted as the `$options` parameter
* @param array $options The options to for the find
* @see \Cake\ORM\Table::find()
* @return \Cake\ORM\Query
*/
Expand Down Expand Up @@ -693,7 +693,7 @@ public function __isset($property) {
* Proxies method calls to the target table.
*
* @param string $method name of the method to be invoked
* @param array $args List of arguments passed to the function
* @param array $argument List of arguments passed to the function
* @return mixed
* @throws \BadMethodCallException
*/
Expand Down Expand Up @@ -735,7 +735,7 @@ public abstract function type();
* - strategy: The name of strategy to use for finding target table records
* - nestKey: The array key under which results will be found when transforming the row
*
* @param array $options
* @param array $options The options for eager loading.
* @return \Closure
*/
public abstract function eagerLoader(array $options);
Expand Down Expand Up @@ -767,7 +767,7 @@ public abstract function isOwningSide(Table $side);
* the saving operation to the target table.
*
* @param \Cake\ORM\Entity $entity the data to be saved
* @param array|\ArrayObject $options
* @param array|\ArrayObject $options The options for saving associated data.
* @return bool|Entity false if $entity could not be saved, otherwise it returns
* the saved entity
* @see Table::save()
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/Association/BelongsTo.php
Expand Up @@ -67,7 +67,7 @@ public function cascadeDelete(Entity $entity, array $options = []) {
* in the source table record.
* If no arguments are passed, currently configured type is returned.
*
* @param string $name
* @param string $name The property name, use null to read the current property.
* @return string
*/
public function property($name = null) {
Expand Down
22 changes: 12 additions & 10 deletions src/ORM/Association/BelongsToMany.php
Expand Up @@ -411,7 +411,7 @@ public function saveAssociated(Entity $entity, array $options = []) {
*
* @param \Cake\ORM\Entity $parentEntity the source entity containing the target
* entities to be saved.
* @param array|\Traversable list of entities to persist in target table and to
* @param array|\Traversable $entities list of entities to persist in target table and to
* link to the parent entity
* @param array $options list of options accepted by Table::save()
* @throws \InvalidArgumentException if the property representing the association
Expand Down Expand Up @@ -777,12 +777,12 @@ protected function _diffLinks($existing, $jointEntities, $targetEntities) {
/**
* Throws an exception should any of the passed entities is not persisted.
*
* @throws \InvalidArgumentException
* @param \Cake\ORM\Entity $sourceEntity the row belonging to the `source` side
* of this association
* of this association
* @param array $targetEntities list of entities belonging to the `target` side
* of this association
* of this association
* @return bool
* @throws \InvalidArgumentException
*/
protected function _checkPersistenceStatus($sourceEntity, array $targetEntities) {
if ($sourceEntity->isNew() !== false) {
Expand All @@ -804,10 +804,12 @@ protected function _checkPersistenceStatus($sourceEntity, array $targetEntities)
* Returns the list of joint entities that exist between the source entity
* and each of the passed target entities
*
* @param \Cake\ORM\Entity $sourceEntity
* @param array $targetEntities
* @param \Cake\ORM\Entity $sourceEntity The row belonging to the source side
* of this association.
* @param array $targetEntities The rows belonging to the target side of this
* association.
* @throws \InvalidArgumentException if any of the entities is lacking a primary
* key value
* key value
* @return array
*/
protected function _collectJointEntities($sourceEntity, $targetEntities) {
Expand Down Expand Up @@ -859,7 +861,7 @@ protected function _collectJointEntities($sourceEntity, $targetEntities) {
* Appends any conditions required to load the relevant set of records in the
* target table query given a filter key and some filtering values.
*
* @param \Cake\ORM\Query target table's query
* @param \Cake\ORM\Query $query target table's query
* @param string $key the fields that should be used for filtering
* @param mixed $filter the value that should be used to match for $key
* @return \Cake\ORM\Query
Expand All @@ -875,7 +877,7 @@ protected function _addFilteringCondition($query, $key, $filter) {
* Generates a string used as a table field that contains the values upon
* which the filter should be applied
*
* @param array $options
* @param array $options the options to use for getting the link field.
* @return string
*/
protected function _linkField($options) {
Expand Down Expand Up @@ -914,7 +916,7 @@ protected function _junctionAssociationName() {
* If no arguments are passed the current configured name is returned. A default
* name based of the associated tables will be generated if none found.
*
* @param string $name
* @param string $name The name of the junction table.
* @return string
*/
protected function _junctionTableName($name = null) {
Expand Down
1 change: 1 addition & 0 deletions src/ORM/Association/ExternalAssociationTrait.php
Expand Up @@ -66,6 +66,7 @@ public function foreignKey($key = null) {
/**
* Sets the sort order in which target records should be returned.
* If no arguments are passed the currently configured value is returned
*
* @param mixed $sort A find() compatible order clause
* @return mixed
*/
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/Association/HasOne.php
Expand Up @@ -62,7 +62,7 @@ public function foreignKey($key = null) {
* in the source table record.
* If no arguments are passed, currently configured type is returned.
*
* @param string $name
* @param string $name The name of the property. Pass null to read the current value.
* @return string
*/
public function property($name = null) {
Expand Down
4 changes: 2 additions & 2 deletions src/ORM/Association/SelectableAssociationTrait.php
Expand Up @@ -25,7 +25,7 @@ trait SelectableAssociationTrait {
* Returns true if the eager loading process will require a set of parent table's
* primary keys in order to use them as a filter in the finder query.
*
* @param array $options
* @param array $options The options containing the strategy to be used.
* @return bool true if a list of keys will be required
*/
public function requiresKeys(array $options = []) {
Expand Down Expand Up @@ -145,7 +145,7 @@ protected function _addFilteringCondition($query, $key, $filter) {
* Generates a string used as a table field that contains the values upon
* which the filter should be applied
*
* @param array $options
* @param array $options The options for getting the link field.
* @return string|array
*/
protected abstract function _linkField($options);
Expand Down
5 changes: 3 additions & 2 deletions src/ORM/BehaviorRegistry.php
Expand Up @@ -55,7 +55,7 @@ class BehaviorRegistry extends ObjectRegistry {
/**
* Constructor
*
* @param \Cake\ORM\Table $table
* @param \Cake\ORM\Table $table The table this registry is attached to
*/
public function __construct(Table $table) {
$this->_table = $table;
Expand All @@ -81,6 +81,7 @@ protected function _resolveClassName($class) {
*
* @param string $class The classname that is missing.
* @param string $plugin The plugin the behavior is missing in.
* @return void
* @throws \Cake\ORM\Error\MissingBehaviorException
*/
protected function _throwMissingClassError($class, $plugin) {
Expand Down Expand Up @@ -120,7 +121,7 @@ protected function _create($class, $alias, $config) {
* Methods starting with `_` will be ignored, as will methods
* declared on Cake\ORM\Behavior
*
* @param \Cake\ORM\Behavior $instance
* @param \Cake\ORM\Behavior $instance The behavior to get methods from.
* @param string $class The classname that is missing.
* @param string $alias The alias of the object.
* @return void
Expand Down
6 changes: 3 additions & 3 deletions src/ORM/EagerLoader.php
Expand Up @@ -439,7 +439,7 @@ public function loadExternal($query, $statement) {
*
* @param array $external the list of external associations to be loaded
* @param \Cake\ORM\Query $query The query from which the results where generated
* @param BufferedStatement $statement
* @param BufferedStatement $statement The statement to work on
* @return array
*/
protected function _collectKeys($external, $query, $statement) {
Expand Down Expand Up @@ -477,8 +477,8 @@ protected function _collectKeys($external, $query, $statement) {
* Helper function used to iterate an statement and extract the columns
* defined in $collectKeys
*
* @param \Cake\Database\StatementInterface $statement
* @param array $collectKeys
* @param \Cake\Database\StatementInterface $statement The statement to read from.
* @param array $collectKeys The keys to collect
* @return array
*/
protected function _groupKeys($statement, $collectKeys) {
Expand Down
6 changes: 3 additions & 3 deletions src/ORM/EntityValidator.php
Expand Up @@ -34,7 +34,7 @@ class EntityValidator {
/**
* Constructor.
*
* @param \Cake\ORM\Table $table
* @param \Cake\ORM\Table $table The table this validator is for
*/
public function __construct(Table $table) {
$this->_table = $table;
Expand Down Expand Up @@ -130,8 +130,8 @@ public function many(array $entities, $options = []) {
* If not empty it will construct a default validation object or get one with
* the name passed in the key
*
* @param \Cake\ORM\Entity The entity to validate
* @param \ArrayObject|array $options
* @param \Cake\ORM\Entity $entity The entity to validate
* @param \ArrayObject|array $options The option for processing validation
* @return bool true if the entity is valid, false otherwise
*/
protected function _processValidation($entity, $options) {
Expand Down
12 changes: 6 additions & 6 deletions src/ORM/Marshaller.php
Expand Up @@ -53,7 +53,7 @@ class Marshaller {
/**
* Constructor.
*
* @param \Cake\ORM\Table $table
* @param \Cake\ORM\Table $table The table this marshaller is for.
* @param bool $safe Whether or not this marshaller is in safe mode
*/
public function __construct(Table $table, $safe = false) {
Expand Down Expand Up @@ -128,7 +128,7 @@ public function one(array $data, array $include = []) {
/**
* Create a new sub-marshaller and marshal the associated data.
*
* @param \Cake\ORM\Association $assoc
* @param \Cake\ORM\Association $assoc The association to marshall
* @param array $value The data to hydrate
* @param array $include The associations to include.
* @return mixed
Expand Down Expand Up @@ -327,8 +327,8 @@ public function mergeMany($entities, array $data, array $include = []) {
/**
* Creates a new sub-marshaller and merges the associated data.
*
* @param \Cake\Datasource\EntityInterface $original
* @param \Cake\ORM\Association $assoc
* @param \Cake\Datasource\EntityInterface $original The original entity
* @param \Cake\ORM\Association $assoc The association to merge
* @param array $value The data to hydrate
* @param array $include The associations to include.
* @return mixed
Expand All @@ -354,8 +354,8 @@ protected function _mergeAssociation($original, $assoc, $value, $include) {
* Creates a new sub-marshaller and merges the associated data for a BelongstoMany
* association.
*
* @param \Cake\Datasource\EntityInterface $original
* @param \Cake\ORM\Association $assoc
* @param \Cake\Datasource\EntityInterface $original The original entity
* @param \Cake\ORM\Association $assoc The association to marshall
* @param array $value The data to hydrate
* @param array $include The associations to include.
* @return mixed
Expand Down
17 changes: 9 additions & 8 deletions src/ORM/Query.php
Expand Up @@ -99,8 +99,8 @@ class Query extends DatabaseQuery {
/**
* Constuctor
*
* @param \Cake\Database\Connection $connection
* @param \Cake\ORM\Table $table
* @param \Cake\Database\Connection $connection The connection object
* @param \Cake\ORM\Table $table The table this query is starting on
*/
public function __construct($connection, $table) {
parent::__construct($connection);
Expand All @@ -119,7 +119,7 @@ public function __construct($connection, $table) {
*
* This method returns the same query object for chaining.
*
* @param \Cake\ORM\Table $table
* @param \Cake\ORM\Table $table The table to pull types from
* @return $this
*/
public function addDefaultTypes(Table $table) {
Expand All @@ -139,7 +139,8 @@ public function addDefaultTypes(Table $table) {
* and storing containments. If called with no arguments, it will return the
* currently configured instance.
*
* @param \Cake\ORM\EagerLoader $instance
* @param \Cake\ORM\EagerLoader $instance The eager loader to use. Pass null
* to get the current eagerloader.
* @return \Cake\ORM\EagerLoader|$this
*/
public function eagerLoader(EagerLoader $instance = null) {
Expand Down Expand Up @@ -346,7 +347,7 @@ public function bufferResults($enable = null) {
* If the field is already aliased, then it will not be changed.
* If no $alias is passed, the default table for this query will be used.
*
* @param string $field
* @param string $field The field to alias
* @param string $alias the alias used to prefix the field
* @return array
*/
Expand Down Expand Up @@ -374,8 +375,8 @@ public function aliasField($field, $alias = null) {
* Runs `aliasfield()` for each field in the provided list and returns
* the result under a single array.
*
* @param array $fields
* @param string $defaultAlias
* @param array $fields The fields to alias
* @param string $defaultAlias The default alias
* @return array
*/
public function aliasFields($fields, $defaultAlias = null) {
Expand Down Expand Up @@ -507,7 +508,7 @@ public function count() {
* The callback will receive as first argument a clone of this query and not this
* query itself.
*
* @param callable $counter
* @param callable $counter The counter value
* @return $this
*/
public function counter($counter) {
Expand Down
7 changes: 4 additions & 3 deletions src/ORM/ResultSet.php
Expand Up @@ -122,7 +122,7 @@ class ResultSet implements Countable, Iterator, Serializable, JsonSerializable {
* Constructor
*
* @param \Cake\ORM\Query $query Query from where results come
* @param \Cake\Database\StatementInterface $statement
* @param \Cake\Database\StatementInterface $statement The statement to fetch from
*/
public function __construct($query, $statement) {
$repository = $query->repository();
Expand Down Expand Up @@ -241,6 +241,7 @@ public function serialize() {
* Part of Serializable interface.
*
* @param string $serialized Serialized object
* @return void
*/
public function unserialize($serialized) {
$this->_results = unserialize($serialized);
Expand Down Expand Up @@ -431,8 +432,8 @@ protected function _groupResult($row) {
* Casts all values from a row brought from a table to the correct
* PHP type.
*
* @param Table $table
* @param array $values
* @param Table $table The table object
* @param array $values The values to cast
* @return array
*/
protected function _castValues($table, $values) {
Expand Down

0 comments on commit a1defb4

Please sign in to comment.