Skip to content

Commit 149ddc4

Browse files
committed
Clean up MongoDB\Driver method protos
1 parent 0f832de commit 149ddc4

File tree

11 files changed

+74
-32
lines changed

11 files changed

+74
-32
lines changed

src/MongoDB/BulkWrite.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ PHONGO_API zend_class_entry *php_phongo_bulkwrite_ce;
4949

5050
zend_object_handlers php_phongo_handler_bulkwrite;
5151

52-
/* {{{ proto MongoDB\Driver\BulkWrite BulkWrite::__construct([array $options = array()])
52+
/* {{{ proto void BulkWrite::__construct([array $options = array()])
5353
Constructs a new BulkWrite */
5454
PHP_METHOD(BulkWrite, __construct)
5555
{
@@ -85,8 +85,9 @@ PHP_METHOD(BulkWrite, __construct)
8585
}
8686
}
8787
/* }}} */
88+
8889
/* {{{ proto mixed BulkWrite::insert(array|object $document)
89-
Adds an insert operation to the bulk */
90+
Adds an insert operation to the BulkWrite */
9091
PHP_METHOD(BulkWrite, insert)
9192
{
9293
php_phongo_bulkwrite_t *intern;
@@ -129,8 +130,9 @@ PHP_METHOD(BulkWrite, insert)
129130
}
130131
}
131132
/* }}} */
133+
132134
/* {{{ proto void BulkWrite::update(array|object $query, array|object $newObj[, array $updateOptions = array()])
133-
Adds an update operation to bulk */
135+
Adds an update operation to the BulkWrite */
134136
PHP_METHOD(BulkWrite, update)
135137
{
136138
php_phongo_bulkwrite_t *intern;
@@ -188,8 +190,9 @@ PHP_METHOD(BulkWrite, update)
188190
bson_clear(&bupdate);
189191
}
190192
/* }}} */
193+
191194
/* {{{ proto void BulkWrite::delete(array|object $query[, array $deleteOptions = array()])
192-
Adds a delete operation to the bulk */
195+
Adds a delete operation to the BulkWrite */
193196
PHP_METHOD(BulkWrite, delete)
194197
{
195198
php_phongo_bulkwrite_t *intern;
@@ -220,8 +223,9 @@ PHP_METHOD(BulkWrite, delete)
220223
bson_clear(&bson);
221224
}
222225
/* }}} */
226+
223227
/* {{{ proto integer BulkWrite::count()
224-
Returns the number of operations that have been added to the bulk */
228+
Returns the number of operations that have been added to the BulkWrite */
225229
PHP_METHOD(BulkWrite, count)
226230
{
227231
php_phongo_bulkwrite_t *intern;

src/MongoDB/Command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PHONGO_API zend_class_entry *php_phongo_command_ce;
4646

4747
zend_object_handlers php_phongo_handler_command;
4848

49-
/* {{{ proto MongoDB\Driver\Command Command::__construct(array|object $document)
49+
/* {{{ proto void Command::__construct(array|object $document)
5050
Constructs a new Command */
5151
PHP_METHOD(Command, __construct)
5252
{

src/MongoDB/Manager.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ PHONGO_API zend_class_entry *php_phongo_manager_ce;
4949

5050
zend_object_handlers php_phongo_handler_manager;
5151

52-
/* {{{ proto MongoDB\Driver\Manager Manager::__construct([string $uri = "mongodb://localhost:27017/"[, array $options = array()[, array $driverOptions = array()]]])
52+
/* {{{ proto void Manager::__construct([string $uri = "mongodb://localhost:27017/"[, array $options = array()[, array $driverOptions = array()]]])
5353
Constructs a new Manager */
5454
PHP_METHOD(Manager, __construct)
5555
{
@@ -80,8 +80,9 @@ PHP_METHOD(Manager, __construct)
8080
bson_destroy(&bson_options);
8181
}
8282
/* }}} */
83+
8384
/* {{{ proto MongoDB\Driver\Cursor Manager::executeCommand(string $db, MongoDB\Driver\Command $command[, MongoDB\Driver\ReadPreference $readPreference = null])
84-
Execute a command */
85+
Execute a Command */
8586
PHP_METHOD(Manager, executeCommand)
8687
{
8788
char *db;
@@ -98,6 +99,7 @@ PHP_METHOD(Manager, executeCommand)
9899
phongo_execute_command(getThis(), db, command, readPreference, -1, return_value, return_value_used TSRMLS_CC);
99100
}
100101
/* }}} */
102+
101103
/* {{{ proto MongoDB\Driver\Cursor Manager::executeQuery(string $namespace, MongoDB\Driver\Query $query[, MongoDB\Driver\ReadPreference $readPreference = null])
102104
Execute a Query */
103105
PHP_METHOD(Manager, executeQuery)
@@ -116,8 +118,9 @@ PHP_METHOD(Manager, executeQuery)
116118
phongo_execute_query(getThis(), namespace, query, readPreference, -1, return_value, return_value_used TSRMLS_CC);
117119
}
118120
/* }}} */
121+
119122
/* {{{ proto MongoDB\Driver\WriteResult Manager::executeBulkWrite(string $namespace, MongoDB\Driver\BulkWrite $zbulk[, MongoDB\Driver\WriteConcern $writeConcern = null])
120-
Executes a write operation bulk (e.g. insert, update, delete) */
123+
Executes a BulkWrite (i.e. any number of insert, update, and delete ops) */
121124
PHP_METHOD(Manager, executeBulkWrite)
122125
{
123126
char *namespace;
@@ -177,6 +180,7 @@ PHP_METHOD(Manager, getReadPreference)
177180
}
178181
}
179182
/* }}} */
183+
180184
/* {{{ proto MongoDB\Driver\Server[] Manager::getServers()
181185
Returns the Servers associated with this Manager */
182186
PHP_METHOD(Manager, getServers)
@@ -214,6 +218,7 @@ PHP_METHOD(Manager, getServers)
214218
mongoc_server_descriptions_destroy_all(sds, n);
215219
}
216220
/* }}} */
221+
217222
/* {{{ proto MongoDB\Driver\WriteConcern Manager::getWriteConcern()
218223
Returns the WriteConcern associated with this Manager */
219224
PHP_METHOD(Manager, getWriteConcern)
@@ -233,8 +238,9 @@ PHP_METHOD(Manager, getWriteConcern)
233238
}
234239
}
235240
/* }}} */
241+
236242
/* {{{ proto MongoDB\Driver\Server Manager::selectServers(MongoDB\Driver\ReadPreference $readPreference)
237-
Returns a suitable Server for the given $readPreference */
243+
Returns a suitable Server for the given ReadPreference */
238244
PHP_METHOD(Manager, selectServer)
239245
{
240246
php_phongo_manager_t *intern;
@@ -266,8 +272,9 @@ PHP_METHOD(Manager, selectServer)
266272
}
267273
}
268274
/* }}} */
275+
269276
/* {{{ proto void MongoDB\Driver\Manager::__wakeUp()
270-
* Throws MongoDB\Driver\RuntimeException as it cannot be serialized */
277+
Throws MongoDB\Driver\RuntimeException (serialization is not supported) */
271278
PHP_METHOD(Manager, __wakeUp)
272279
{
273280
SUPPRESS_UNUSED_WARNING(return_value_ptr) SUPPRESS_UNUSED_WARNING(return_value_used) SUPPRESS_UNUSED_WARNING(return_value) SUPPRESS_UNUSED_WARNING(this_ptr)

src/MongoDB/Query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ PHONGO_API zend_class_entry *php_phongo_query_ce;
5050

5151
zend_object_handlers php_phongo_handler_query;
5252

53-
/* {{{ proto MongoDB\Driver\Query Query::__construct(array|object $filter[, array $options = array()])
53+
/* {{{ proto void Query::__construct(array|object $filter[, array $options = array()])
5454
Constructs a new Query */
5555
PHP_METHOD(Query, __construct)
5656
{

src/MongoDB/ReadConcern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PHONGO_API zend_class_entry *php_phongo_readconcern_ce;
4646

4747
zend_object_handlers php_phongo_handler_readconcern;
4848

49-
/* {{{ proto MongoDB\Driver\ReadConcern ReadConcern::__construct([string $level])
49+
/* {{{ proto void ReadConcern::__construct([string $level])
5050
Constructs a new ReadConcern */
5151
PHP_METHOD(ReadConcern, __construct)
5252
{

src/MongoDB/ReadPreference.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PHONGO_API zend_class_entry *php_phongo_readpreference_ce;
4646

4747
zend_object_handlers php_phongo_handler_readpreference;
4848

49-
/* {{{ proto MongoDB\Driver\ReadPreference ReadPreference::__construct(integer $mode[, array $tagSets = array()])
49+
/* {{{ proto void ReadPreference::__construct(integer $mode[, array $tagSets = array()])
5050
Constructs a new ReadPreference */
5151
PHP_METHOD(ReadPreference, __construct)
5252
{

src/MongoDB/Server.c

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,18 @@ PHONGO_API zend_class_entry *php_phongo_server_ce;
4848
zend_object_handlers php_phongo_handler_server;
4949

5050

51-
/* {{{ proto MongoDB\Driver\Server Server::__construct()
52-
Throws exception -- can only be created internally */
51+
/* {{{ proto void Server::__construct()
52+
Throws MongoDB\Driver\RuntimeException (can only be created internally) */
5353
PHP_METHOD(Server, __construct)
5454
{
5555
SUPPRESS_UNUSED_WARNING(return_value) SUPPRESS_UNUSED_WARNING(return_value_used) SUPPRESS_UNUSED_WARNING(return_value_ptr) (void)ZEND_NUM_ARGS(); (void)getThis();
5656

5757
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Accessing private constructor");
5858
}
5959
/* }}} */
60+
6061
/* {{{ proto MongoDB\Driver\Cursor Server::executeCommand(string $db, MongoDB\Driver\Command $command[, MongoDB\Driver\ReadPreference $readPreference = null]))
61-
Executes a command on this server */
62+
Executes a Command on this Server */
6263
PHP_METHOD(Server, executeCommand)
6364
{
6465
php_phongo_server_t *intern;
@@ -83,8 +84,9 @@ PHP_METHOD(Server, executeCommand)
8384
#endif
8485
}
8586
/* }}} */
87+
8688
/* {{{ proto MongoDB\Driver\Cursor Server::executeQuery(string $namespace, MongoDB\Driver\Query $query[, MongoDB\Driver\ReadPreference $readPreference = null]))
87-
Executes a Query */
89+
Executes a Query on this Server */
8890
PHP_METHOD(Server, executeQuery)
8991
{
9092
php_phongo_server_t *intern;
@@ -109,8 +111,10 @@ PHP_METHOD(Server, executeQuery)
109111
#endif
110112
}
111113
/* }}} */
114+
112115
/* {{{ proto MongoDB\Driver\WriteResult Server::executeBulkWrite(string $namespace, MongoDB\Driver\BulkWrite $zbulk[, MongoDB\Driver\WriteConcern $writeConcern = null])
113-
Executes a write operation bulk (e.g. insert, update, delete) */
116+
Executes a BulkWrite (i.e. any number of insert, update, and delete ops) on
117+
this Server */
114118
PHP_METHOD(Server, executeBulkWrite)
115119
{
116120
php_phongo_server_t *intern;
@@ -138,8 +142,9 @@ PHP_METHOD(Server, executeBulkWrite)
138142
#endif
139143
}
140144
/* }}} */
145+
141146
/* {{{ proto string Server::getHost()
142-
Returns the hostname used to connect to this Server */
147+
Returns the hostname for this Server */
143148
PHP_METHOD(Server, getHost)
144149
{
145150
php_phongo_server_t *intern;
@@ -161,8 +166,9 @@ PHP_METHOD(Server, getHost)
161166
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
162167
}
163168
/* }}} */
169+
164170
/* {{{ proto array Server::getTags()
165-
Returns the currently configured tags for this node */
171+
Returns the currently configured tags for this Server */
166172
PHP_METHOD(Server, getTags)
167173
{
168174
php_phongo_server_t *intern;
@@ -208,8 +214,9 @@ PHP_METHOD(Server, getTags)
208214
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
209215
}
210216
/* }}} */
217+
211218
/* {{{ proto array Server::getInfo()
212-
Returns the last isMaster() result document */
219+
Returns the last isMaster result document for this Server */
213220
PHP_METHOD(Server, getInfo)
214221
{
215222
php_phongo_server_t *intern;
@@ -244,8 +251,9 @@ PHP_METHOD(Server, getInfo)
244251
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
245252
}
246253
/* }}} */
254+
247255
/* {{{ proto integer Server::getLatency()
248-
Returns the last messured latency */
256+
Returns the last messured latency for this Server */
249257
PHP_METHOD(Server, getLatency)
250258
{
251259
php_phongo_server_t *intern;
@@ -268,8 +276,9 @@ PHP_METHOD(Server, getLatency)
268276
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
269277
}
270278
/* }}} */
279+
271280
/* {{{ proto integer Server::getPort()
272-
Returns the port used to create this Server */
281+
Returns the port for this Server */
273282
PHP_METHOD(Server, getPort)
274283
{
275284
php_phongo_server_t *intern;
@@ -292,6 +301,7 @@ PHP_METHOD(Server, getPort)
292301
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
293302
}
294303
/* }}} */
304+
295305
/* {{{ proto integer Server::getType()
296306
Returns the node type of this Server */
297307
PHP_METHOD(Server, getType)
@@ -316,8 +326,9 @@ PHP_METHOD(Server, getType)
316326
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
317327
}
318328
/* }}} */
329+
319330
/* {{{ proto bool Server::isPrimary()
320-
Checks if this is a special "Primary" member of a RepilcaSet */
331+
Returns whether this Server is a primary member of a replica set */
321332
PHP_METHOD(Server, isPrimary)
322333
{
323334
php_phongo_server_t *intern;
@@ -340,8 +351,9 @@ PHP_METHOD(Server, isPrimary)
340351
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
341352
}
342353
/* }}} */
354+
343355
/* {{{ proto bool Server::isSecondary()
344-
Checks if this is a special "Secondary" member of a RepilcaSet */
356+
Returns whether this Server is a secondary member of a replica set */
345357
PHP_METHOD(Server, isSecondary)
346358
{
347359
php_phongo_server_t *intern;
@@ -364,8 +376,9 @@ PHP_METHOD(Server, isSecondary)
364376
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
365377
}
366378
/* }}} */
379+
367380
/* {{{ proto bool Server::isArbiter()
368-
Checks if this is a special "Arbiter" member of a RepilcaSet */
381+
Returns whether this Server is an arbiter member of a replica set */
369382
PHP_METHOD(Server, isArbiter)
370383
{
371384
php_phongo_server_t *intern;
@@ -388,8 +401,9 @@ PHP_METHOD(Server, isArbiter)
388401
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
389402
}
390403
/* }}} */
404+
391405
/* {{{ proto bool Server::isHidden()
392-
Checks if this is a special "hidden" member of a RepilcaSet */
406+
Returns whether this Server is a hidden member of a replica set */
393407
PHP_METHOD(Server, isHidden)
394408
{
395409
php_phongo_server_t *intern;
@@ -414,8 +428,9 @@ PHP_METHOD(Server, isHidden)
414428
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "Failed to get server description");
415429
}
416430
/* }}} */
431+
417432
/* {{{ proto bool Server::isPassive()
418-
Checks if this is a special passive node member of a ReplicaSet */
433+
Returns whether this Server is a passive member of a replica set */
419434
PHP_METHOD(Server, isPassive)
420435
{
421436
php_phongo_server_t *intern;

src/MongoDB/WriteConcern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PHONGO_API zend_class_entry *php_phongo_writeconcern_ce;
4646

4747
zend_object_handlers php_phongo_handler_writeconcern;
4848

49-
/* {{{ proto MongoDB\Driver\WriteConcern WriteConcern::__construct(integer|string $w[, integer $wtimeout[, boolean $journal]])
49+
/* {{{ proto void WriteConcern::__construct(integer|string $w[, integer $wtimeout[, boolean $journal]])
5050
Constructs a new WriteConcern */
5151
PHP_METHOD(WriteConcern, __construct)
5252
{

src/MongoDB/WriteConcernError.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ PHP_METHOD(WriteConcernError, getCode)
6363
RETURN_LONG(intern->code);
6464
}
6565
/* }}} */
66+
6667
/* {{{ proto mixed WriteConcernError::getInfo()
6768
Returns additional metadata for the error */
6869
PHP_METHOD(WriteConcernError, getInfo)
@@ -86,6 +87,7 @@ PHP_METHOD(WriteConcernError, getInfo)
8687
}
8788
}
8889
/* }}} */
90+
8991
/* {{{ proto string WriteConcernError::getMessage()
9092
Returns the actual error message from the server */
9193
PHP_METHOD(WriteConcernError, getMessage)

src/MongoDB/WriteError.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ PHP_METHOD(WriteError, getCode)
6363
RETURN_LONG(intern->code);
6464
}
6565
/* }}} */
66+
6667
/* {{{ proto integer WriteError::getIndex()
67-
Returns the Bulk index where this WriteError occurred in */
68+
Returns the index of the operation in the BulkWrite to which this WriteError
69+
corresponds. */
6870
PHP_METHOD(WriteError, getIndex)
6971
{
7072
php_phongo_writeerror_t *intern;
@@ -80,6 +82,7 @@ PHP_METHOD(WriteError, getIndex)
8082
RETURN_LONG(intern->index);
8183
}
8284
/* }}} */
85+
8386
/* {{{ proto string WriteError::getMessage()
8487
Returns the actual error message from the server */
8588
PHP_METHOD(WriteError, getMessage)
@@ -97,6 +100,7 @@ PHP_METHOD(WriteError, getMessage)
97100
PHONGO_RETURN_STRING(intern->message);
98101
}
99102
/* }}} */
103+
100104
/* {{{ proto mixed WriteError::getInfo()
101105
Returns additional metadata for the error */
102106
PHP_METHOD(WriteError, getInfo)

0 commit comments

Comments
 (0)