Skip to content

Commit

Permalink
Add missing docblocks, clean up existing docblocks
Browse files Browse the repository at this point in the history
bcrowe committed Oct 21, 2014
1 parent 11e1c5c commit d256c49
Showing 6 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/League/Monga/Database.php
Original file line number Diff line number Diff line change
@@ -219,7 +219,7 @@ public function executeCode($code, array $arguments = array())
*
* @param array $command command array
* @param array $options command options
* @param array result
* @param array result
*/
public function command(array $command, array $options = array())
{
8 changes: 4 additions & 4 deletions src/League/Monga/Query/Aggregation.php
Original file line number Diff line number Diff line change
@@ -84,8 +84,8 @@ public function unwind($field)
/**
* Add a skip operation to the pipeline
*
* @param int $amount amount to skip
* @object object $this
* @param int $amount amount to skip
* @return object $this
*/
public function skip($amount)
{
@@ -97,8 +97,8 @@ public function skip($amount)
/**
* Add a limit operation to the pipeline
*
* @param int $amount limit
* @object object $this
* @param int $amount limit
* @return object $this
*/
public function limit($amount)
{
2 changes: 1 addition & 1 deletion src/League/Monga/Query/Group.php
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ class Group extends Computer
/**
* Set the group field
*
* @param mixed group field or hash
* @param mixed group field or hash
* @return object $this
*/
public function by($index)
8 changes: 4 additions & 4 deletions src/League/Monga/Query/Indexes.php
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ class Indexes
/**
* Cnstructor, sets collection
*
* @param object MongoCollection
* @param object MongoCollection
*/
public function __construct(MongoCollection $collection)
{
@@ -39,7 +39,7 @@ public function getCollection()
/**
* Inject a collection
*
* @param object MongoCollection
* @param object MongoCollection
* @return object $this
*/
public function setCollection(MongoCollection $collection)
@@ -83,7 +83,7 @@ public function geo($field, $options = array())
* Prepate an index, allowing more expressive syntax.
*
* @param object $index index
* @return object prepared index
* @return object $index prepared index
*/
protected function prepareIndex($index)
{
@@ -123,7 +123,7 @@ public function drop($index)
/**
* Drop all the indexes for the current collection.
*
* return object $this
* @return object $this
*/
public function dropAll()
{
20 changes: 20 additions & 0 deletions src/League/Monga/Query/Projection.php
Original file line number Diff line number Diff line change
@@ -14,20 +14,40 @@

class Projection extends Computer
{

/**
* Specifies a field to be included
*
* @param string $field The field to include
* @return object $this
*/
public function select($field)
{
$this->fields[$field] = 1;

return $this;
}

/**
* Specifies a field to be suppressed
*
* @param string $field The field to suppress
* @return object $this
*/
public function exclude($field)
{
$this->fields[$field] = -1;

return $this;
}

/**
* Sets an alias for a field.
*
* @param string $field The field's name
* @param string $alias The field's alias
* @return object $this
*/
public function alias($field, $alias)
{
$this->fields[$alias] = $this->prepareField($field);
11 changes: 6 additions & 5 deletions src/League/Monga/Query/Where.php
Original file line number Diff line number Diff line change
@@ -25,14 +25,15 @@ class Where extends Builder

/**
* Replaces the where statement. The statement
* will be reformatted to match allow further
* will be reformatted to match, allowing further
* chaining by Monga.
*
*
* @param array $where An array of where conditions
* @return object $this
*/
public function setWhere(array $where)
{
// When to statement is empty set the
// When the statement is empty set the
// where property to null to prevent
// empty statement errors.
if (empty($where)) {
@@ -1040,8 +1041,8 @@ public function getWhere()
/**
* Resolves a string data type to its integer counterpart
*
* @param string|int $type data type
* @return
* @param string|int $type data type
* @return int The data type's integer
*/
public function resolveType($type)
{

0 comments on commit d256c49

Please sign in to comment.