Skip to content

Commit 0f832de

Browse files
committed
Clean up MongoDB\BSON method protos
1 parent 1ac1746 commit 0f832de

File tree

7 files changed

+49
-42
lines changed

7 files changed

+49
-42
lines changed

src/BSON/Binary.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ static bool php_phongo_binary_init_from_hash(php_phongo_binary_t *intern, HashTa
8686
return false;
8787
}
8888

89-
/* {{{ proto BSON\Binary Binary::__construct(string $data, int $type)
90-
Construct a new BSON Binary type */
89+
/* {{{ proto void Binary::__construct(string $data, int $type)
90+
Construct a new BSON binary type */
9191
PHP_METHOD(Binary, __construct)
9292
{
9393
php_phongo_binary_t *intern;
@@ -110,7 +110,7 @@ PHP_METHOD(Binary, __construct)
110110
}
111111
/* }}} */
112112

113-
/* {{{ proto Binary::__set_state(array $properties)
113+
/* {{{ proto void Binary::__set_state(array $properties)
114114
*/
115115
PHP_METHOD(Binary, __set_state)
116116
{
@@ -131,7 +131,7 @@ PHP_METHOD(Binary, __set_state)
131131
}
132132
/* }}} */
133133

134-
/* {{{ proto Binary::__wakeup()
134+
/* {{{ proto void Binary::__wakeup()
135135
*/
136136
PHP_METHOD(Binary, __wakeup)
137137
{
@@ -150,7 +150,7 @@ PHP_METHOD(Binary, __wakeup)
150150
/* }}} */
151151

152152
/* {{{ proto string Binary::getData()
153-
*/
153+
*/
154154
PHP_METHOD(Binary, getData)
155155
{
156156
php_phongo_binary_t *intern;
@@ -165,8 +165,9 @@ PHP_METHOD(Binary, getData)
165165
PHONGO_RETURN_STRINGL(intern->data, intern->data_len);
166166
}
167167
/* }}} */
168+
168169
/* {{{ proto integer Binary::getType()
169-
*/
170+
*/
170171
PHP_METHOD(Binary, getType)
171172
{
172173
php_phongo_binary_t *intern;
@@ -200,9 +201,10 @@ ZEND_END_ARG_INFO();
200201
static zend_function_entry php_phongo_binary_me[] = {
201202
PHP_ME(Binary, __construct, ai_Binary___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
202203
PHP_ME(Binary, __set_state, ai_Binary___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
204+
PHP_ME(Binary, __toString, ai_Binary_void, ZEND_ACC_PUBLIC)
205+
PHP_ME(Binary, __wakeup, ai_Binary_void, ZEND_ACC_PUBLIC)
203206
PHP_ME(Binary, getData, ai_Binary_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
204207
PHP_ME(Binary, getType, ai_Binary_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
205-
PHP_ME(Binary, __wakeup, ai_Binary_void, ZEND_ACC_PUBLIC)
206208
PHP_FE_END
207209
};
208210

src/BSON/Decimal128.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static bool php_phongo_decimal128_init_from_hash(php_phongo_decimal128_t *intern
8282
return false;
8383
}
8484

85-
/* {{{ proto BSON\Decimal128 Decimal128::__construct(string $value)
85+
/* {{{ proto void Decimal128::__construct(string $value)
8686
Construct a new BSON Decimal128 type */
8787
PHP_METHOD(Decimal128, __construct)
8888
{
@@ -105,7 +105,7 @@ PHP_METHOD(Decimal128, __construct)
105105
}
106106
/* }}} */
107107

108-
/* {{{ proto Decimal128::__set_state(array $properties)
108+
/* {{{ proto void Decimal128::__set_state(array $properties)
109109
*/
110110
PHP_METHOD(Decimal128, __set_state)
111111
{
@@ -126,8 +126,8 @@ PHP_METHOD(Decimal128, __set_state)
126126
}
127127
/* }}} */
128128

129-
/* {{{ proto void Decimal128::__toString()
130-
*/
129+
/* {{{ proto string Decimal128::__toString()
130+
*/
131131
PHP_METHOD(Decimal128, __toString)
132132
{
133133
php_phongo_decimal128_t *intern;
@@ -145,7 +145,7 @@ PHP_METHOD(Decimal128, __toString)
145145
}
146146
/* }}} */
147147

148-
/* {{{ proto Decimal128::__wakeup()
148+
/* {{{ proto void Decimal128::__wakeup()
149149
*/
150150
PHP_METHOD(Decimal128, __wakeup)
151151
{

src/BSON/Javascript.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ static bool php_phongo_javascript_init_from_hash(php_phongo_javascript_t *intern
9999
return false;
100100
}
101101

102-
/* {{{ proto BSON\Javascript Javascript::__construct(string $code[, array|object $scope])
103-
* The string is JavaScript code. The document is a mapping from identifiers to values, representing the scope in which the string should be evaluated
104-
* NOTE: eJSON does not support this type :( */
102+
/* {{{ proto void Javascript::__construct(string $code[, array|object $scope])
103+
Construct a new BSON Javascript type. The scope is a document mapping
104+
identifiers and values, representing the scope in which the code string will
105+
be evaluated. Note that this type cannot be represented as Extended JSON. */
105106
PHP_METHOD(Javascript, __construct)
106107
{
107108
php_phongo_javascript_t *intern;
@@ -124,7 +125,7 @@ PHP_METHOD(Javascript, __construct)
124125
}
125126
/* }}} */
126127

127-
/* {{{ proto Javascript::__set_state(array $properties)
128+
/* {{{ proto void Javascript::__set_state(array $properties)
128129
*/
129130
PHP_METHOD(Javascript, __set_state)
130131
{
@@ -145,7 +146,7 @@ PHP_METHOD(Javascript, __set_state)
145146
}
146147
/* }}} */
147148

148-
/* {{{ proto Javascript::__wakeup()
149+
/* {{{ proto void Javascript::__wakeup()
149150
*/
150151
PHP_METHOD(Javascript, __wakeup)
151152
{

src/BSON/ObjectID.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ static bool php_phongo_objectid_init_from_hash(php_phongo_objectid_t *intern, Ha
107107
return false;
108108
}
109109

110-
/* {{{ proto BSON\ObjectID ObjectID::__construct(string $id)
111-
Constructs a new Object ID, optionally from a string */
110+
/* {{{ proto void ObjectID::__construct([string $id])
111+
Constructs a new BSON ObjectID type, optionally from a hex string. */
112112
PHP_METHOD(ObjectID, __construct)
113113
{
114114
php_phongo_objectid_t *intern;
@@ -155,7 +155,7 @@ PHP_METHOD(ObjectID, __set_state)
155155
}
156156
/* }}} */
157157

158-
/* {{{ proto void ObjectID::__toString()
158+
/* {{{ proto string ObjectID::__toString()
159159
*/
160160
PHP_METHOD(ObjectID, __toString)
161161
{

src/BSON/Regex.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ static bool php_phongo_regex_init_from_hash(php_phongo_regex_t *intern, HashTabl
9292
return false;
9393
}
9494

95-
/* {{{ proto BSON\Regex Regex::__construct(string $pattern, string $flags)
96-
Constructs a new regular expression. */
95+
/* {{{ proto void Regex::__construct(string $pattern, string $flags)
96+
Constructs a new BSON regular expression type. */
9797
PHP_METHOD(Regex, __construct)
9898
{
9999
php_phongo_regex_t *intern;
@@ -116,8 +116,9 @@ PHP_METHOD(Regex, __construct)
116116
php_phongo_regex_init(intern, pattern, pattern_len, flags, flags_len TSRMLS_CC);
117117
}
118118
/* }}} */
119-
/* {{{ proto void Regex::getPattern()
120-
*/
119+
120+
/* {{{ proto string Regex::getPattern()
121+
*/
121122
PHP_METHOD(Regex, getPattern)
122123
{
123124
php_phongo_regex_t *intern;
@@ -133,8 +134,9 @@ PHP_METHOD(Regex, getPattern)
133134
PHONGO_RETURN_STRINGL(intern->pattern, intern->pattern_len);
134135
}
135136
/* }}} */
136-
/* {{{ proto void Regex::getFlags()
137-
*/
137+
138+
/* {{{ proto string Regex::getFlags()
139+
*/
138140
PHP_METHOD(Regex, getFlags)
139141
{
140142
php_phongo_regex_t *intern;
@@ -151,7 +153,7 @@ PHP_METHOD(Regex, getFlags)
151153
}
152154
/* }}} */
153155

154-
/* {{{ proto Regex::__set_state(array $properties)
156+
/* {{{ proto void Regex::__set_state(array $properties)
155157
*/
156158
PHP_METHOD(Regex, __set_state)
157159
{
@@ -172,8 +174,8 @@ PHP_METHOD(Regex, __set_state)
172174
}
173175
/* }}} */
174176

175-
/* {{{ proto void Regex::__toString()
176-
*/
177+
/* {{{ proto string Regex::__toString()
178+
Returns a string in the form: /pattern/flags */
177179
PHP_METHOD(Regex, __toString)
178180
{
179181
php_phongo_regex_t *intern;
@@ -194,7 +196,7 @@ PHP_METHOD(Regex, __toString)
194196
}
195197
/* }}} */
196198

197-
/* {{{ proto Regex::__wakeup()
199+
/* {{{ proto void Regex::__wakeup()
198200
*/
199201
PHP_METHOD(Regex, __wakeup)
200202
{

src/BSON/Timestamp.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ static bool php_phongo_timestamp_init_from_hash(php_phongo_timestamp_t *intern,
9191
return false;
9292
}
9393

94-
/* {{{ proto BSON\Timestamp Timestamp::__construct(integer $increment, int $timestamp)
95-
Construct a new BSON Timestamp (4bytes increment, 4bytes timestamp) */
94+
/* {{{ proto void Timestamp::__construct(integer $increment, int $timestamp)
95+
Construct a new BSON timestamp type, which consists of a 4-byte increment and
96+
4-byte timestamp. */
9697
PHP_METHOD(Timestamp, __construct)
9798
{
9899
php_phongo_timestamp_t *intern;
@@ -114,7 +115,7 @@ PHP_METHOD(Timestamp, __construct)
114115
}
115116
/* }}} */
116117

117-
/* {{{ proto Timestamp::__set_state(array $properties)
118+
/* {{{ proto void Timestamp::__set_state(array $properties)
118119
*/
119120
PHP_METHOD(Timestamp, __set_state)
120121
{
@@ -136,7 +137,7 @@ PHP_METHOD(Timestamp, __set_state)
136137
/* }}} */
137138

138139
/* {{{ proto string Timestamp::__toString()
139-
Returns [increment:timestamp] */
140+
Returns a string in the form: [increment:timestamp] */
140141
PHP_METHOD(Timestamp, __toString)
141142
{
142143
php_phongo_timestamp_t *intern;
@@ -156,7 +157,7 @@ PHP_METHOD(Timestamp, __toString)
156157
}
157158
/* }}} */
158159

159-
/* {{{ proto Timestamp::__wakeup()
160+
/* {{{ proto void Timestamp::__wakeup()
160161
*/
161162
PHP_METHOD(Timestamp, __wakeup)
162163
{

src/BSON/UTCDateTime.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ static bool php_phongo_utcdatetime_init_from_date(php_phongo_utcdatetime_t *inte
154154
return true;
155155
}
156156

157-
/* {{{ proto BSON\UTCDateTime UTCDateTime::__construct([integer|DateTimeInterface $milliseconds = null])
158-
Construct a new UTCDateTime */
157+
/* {{{ proto void UTCDateTime::__construct([integer|DateTimeInterface $milliseconds = null])
158+
Construct a new BSON UTCDateTime type from either the current time,
159+
milliseconds since the epoch, or a DateTimeInterface object. */
159160
PHP_METHOD(UTCDateTime, __construct)
160161
{
161162
php_phongo_utcdatetime_t *intern;
@@ -214,7 +215,7 @@ PHP_METHOD(UTCDateTime, __construct)
214215
}
215216
/* }}} */
216217

217-
/* {{{ proto UTCDateTime::__set_state(array $properties)
218+
/* {{{ proto void UTCDateTime::__set_state(array $properties)
218219
*/
219220
PHP_METHOD(UTCDateTime, __set_state)
220221
{
@@ -236,7 +237,7 @@ PHP_METHOD(UTCDateTime, __set_state)
236237
/* }}} */
237238

238239
/* {{{ proto string UTCDateTime::__toString()
239-
Returns the string representation of the UTCDateTime */
240+
Returns the UTCDateTime's milliseconds as a string */
240241
PHP_METHOD(UTCDateTime, __toString)
241242
{
242243
php_phongo_utcdatetime_t *intern;
@@ -256,7 +257,7 @@ PHP_METHOD(UTCDateTime, __toString)
256257
}
257258
/* }}} */
258259

259-
/* {{{ proto UTCDateTime::__wakeup()
260+
/* {{{ proto void UTCDateTime::__wakeup()
260261
*/
261262
PHP_METHOD(UTCDateTime, __wakeup)
262263
{
@@ -274,8 +275,8 @@ PHP_METHOD(UTCDateTime, __wakeup)
274275
}
275276
/* }}} */
276277

277-
/* {{{ proto string UTCDateTime::toDateTime()
278-
Returns DateTime object representing this UTCDateTime */
278+
/* {{{ proto DateTime UTCDateTime::toDateTime()
279+
Returns a DateTime object representing this UTCDateTime */
279280
PHP_METHOD(UTCDateTime, toDateTime)
280281
{
281282
php_phongo_utcdatetime_t *intern;

0 commit comments

Comments
 (0)