Skip to content

Commit dacf3bc

Browse files
committed
Merge pull request #3 from bjori/docblocks
Improve docblocks
2 parents 74a9aac + 19fb9bf commit dacf3bc

File tree

9 files changed

+63
-17
lines changed

9 files changed

+63
-17
lines changed

docs/api/MongoDB/Command/CommandCursor.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use MongoDB\Cursor;
66
use MongoDB\CursorId;
7+
use Mongodb\Server;
78

89
/**
910
* Cursor implementation that may be constructed from values found in a
@@ -34,37 +35,42 @@ public function __construct(Server $server, CursorId $cursorId, array $firstBatc
3435
$this->firstBatch = $firstBatch;
3536
}
3637

37-
// Iterator methods...
38-
3938
/**
40-
* @return Cursor::getId()
39+
* @return CursorId
4140
*/
4241
public function getId()
4342
{
4443
return $this->cursorId;
4544
}
4645

4746
/**
48-
* @see Cursor::getServer()
47+
* @return Server Server from which the cursor originated
4948
*/
5049
public function getServer()
5150
{
5251
return $this->server;
5352
}
5453

5554
/**
56-
* @see Cursor::isDead()
55+
* @return boolean Whether the cursor is exhausted and has no more results
5756
*/
5857
public function isDead()
5958
{
6059
// Return whether the cursor is exhausted and has no more results
6160
}
6261

6362
/**
64-
* @see \MongoDB\Cursor::setBatchSize()
63+
* @param integer $batchSize
6564
*/
6665
public function setBatchSize($batchSize)
6766
{
6867
$this->batchSize = (integer) $batchSize;
6968
}
69+
70+
/* Cursor is an iterator */
71+
public function current() {}
72+
public function next() {}
73+
public function key() {}
74+
public function valid() {}
75+
public function rewind() {}
7076
}

docs/api/MongoDB/CursorId.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class CursorId
1313
// $id is an internal uint64_t value instead of a class property
1414

1515
/**
16-
* @param integer|string $id
16+
* @param string $id
1717
*/
1818
public function __construct($id)
1919
{

docs/api/MongoDB/Manager.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
final class Manager
2626
{
2727
/**
28+
* Constructs a new Manager
29+
*
2830
* @param string $uri Connection URI
2931
* @param array $options Connection options (e.g. auth, socket timeouts)
3032
* @param array $driverOptions Driver options (e.g. stream contexts)
@@ -35,6 +37,8 @@ public function __construct($uri, array $options = array(), array $driverOptions
3537
}
3638

3739
/**
40+
* Creates new Manager from a list of servers
41+
*
3842
* @param Server[] $servers
3943
* @return Manager
4044
*/
@@ -50,6 +54,8 @@ static public function createFromServers(array $servers)
5054
}
5155

5256
/**
57+
* Execute a command
58+
*
5359
* @param string $db
5460
* @param Command $command
5561
* @param ReadPreference $readPreference
@@ -72,6 +78,8 @@ public function executeCommand($db, Command $command, ReadPreference $readPrefer
7278
}
7379

7480
/**
81+
* Execute a Query
82+
*
7583
* @param string $namespace
7684
* @param Query $query
7785
* @param ReadPreference $readPreference
@@ -92,6 +100,8 @@ public function executeQuery($namespace, Query $query, ReadPreference $readPrefe
92100
}
93101

94102
/**
103+
* Executes a write operation batch (e.g. insert, update, delete)
104+
*
95105
* @param string $namespace
96106
* @param WriteBatch $batch
97107
* @param array $writeOptions Ordering and write concern options (default: {"ordered": true, "w": 1})

docs/api/MongoDB/Query/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ final class Query
3131
* @param array|object $query Query document
3232
* @param array|object $selector Selector document
3333
* @param integer $flags Query flags
34-
* @param integer $limit Limit
3534
* @param integer $skip Skip
35+
* @param integer $limit Limit
3636
*/
3737
public function __construct($query, $selector, $flags, $skip, $limit)
3838
{

docs/api/MongoDB/Query/QueryCursor.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use MongoDB\Cursor;
66
use MongoDB\CursorId;
7+
use Mongodb\Server;
78

89
/**
910
* Cursor implementation that is returned after executing a Query.
@@ -21,6 +22,8 @@ final class QueryCursor implements Cursor
2122
private $cursorId;
2223

2324
/**
25+
* Construct a new QueryCursor
26+
*
2427
* @param Server $server
2528
* @param CursorId $cursorId
2629
*/
@@ -30,37 +33,42 @@ public function __construct(Server $server, CursorId $cursorId)
3033
$this->cursorId = $cursorId;
3134
}
3235

33-
// Iterator methods...
34-
3536
/**
36-
* @see Cursor::getId()
37+
* @return CursorId
3738
*/
3839
public function getId()
3940
{
4041
return $this->cursorId;
4142
}
4243

4344
/**
44-
* @see Cursor::getServer()
45+
* @return Server Server from which the cursor originated
4546
*/
4647
public function getServer()
4748
{
4849
return $this->server;
4950
}
5051

5152
/**
52-
* @see Cursor::isDead()
53+
* @return boolean Whether the cursor is exhausted and has no more results
5354
*/
5455
public function isDead()
5556
{
5657
// Return whether the cursor is exhausted and has no more results
5758
}
5859

5960
/**
60-
* @see Cursor::setBatchSize()
61+
* @param integer $batchSize
6162
*/
6263
public function setBatchSize($batchSize)
6364
{
6465
$this->batchSize = (integer) $batchSize;
6566
}
67+
68+
/* Cursor is an iterator */
69+
public function current() {}
70+
public function next() {}
71+
public function key() {}
72+
public function valid() {}
73+
public function rewind() {}
6674
}

docs/api/MongoDB/Write/DeleteBatch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class DeleteBatch implements WriteBatch
1010
private $documents;
1111

1212
/**
13-
* @see WriteBatch::add()
13+
* @param array|object $document Operation/document to add to the batch
1414
*/
1515
public function add($document)
1616
{

docs/api/MongoDB/Write/InsertBatch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class InsertBatch implements WriteBatch
1010
private $documents;
1111

1212
/**
13-
* @see WriteBatch::add()
13+
* @param array|object $document Operation/document to add to the batch
1414
*/
1515
public function add($document)
1616
{

docs/api/MongoDB/Write/UpdateBatch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class UpdateBatch implements WriteBatch
1010
private $documents;
1111

1212
/**
13-
* @see WriteBatch::add()
13+
* @param array|object $document Operation/document to add to the batch
1414
*/
1515
public function add($document)
1616
{

docs/bootstrap.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
include "api/MongoDB/Cursor.php";
3+
include "api/MongoDB/CursorId.php";
4+
include "api/MongoDB/Manager.php";
5+
include "api/MongoDB/ReadPreference.php";
6+
include "api/MongoDB/Server.php";
7+
include "api/MongoDB/Query/Query.php";
8+
include "api/MongoDB/Query/QueryCursor.php";
9+
include "api/MongoDB/Command/Command.php";
10+
include "api/MongoDB/Command/CommandCursor.php";
11+
include "api/MongoDB/Command/CommandResult.php";
12+
include "api/MongoDB/Write/WriteBatch.php";
13+
include "api/MongoDB/Write/WriteResult.php";
14+
include "api/MongoDB/Write/DeleteBatch.php";
15+
include "api/MongoDB/Write/DeleteResult.php";
16+
include "api/MongoDB/Write/GeneratedId.php";
17+
include "api/MongoDB/Write/InsertBatch.php";
18+
include "api/MongoDB/Write/InsertResult.php";
19+
include "api/MongoDB/Write/UpdateBatch.php";
20+
include "api/MongoDB/Write/UpdateResult.php";
21+
include "api/MongoDB/Write/WriteConcernError.php";
22+
include "api/MongoDB/Write/WriteError.php";

0 commit comments

Comments
 (0)