Skip to content

Commit c27c466

Browse files
committed
Merge pull request #225
2 parents fe3c8c6 + 2fa57d7 commit c27c466

File tree

13 files changed

+149
-14
lines changed

13 files changed

+149
-14
lines changed

src/BSON/Binary.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ ZEND_END_ARG_INFO();
120120

121121

122122
static zend_function_entry php_phongo_binary_me[] = {
123-
PHP_ME(Binary, __construct, ai_Binary___construct, ZEND_ACC_PUBLIC)
124-
PHP_ME(Binary, getData, ai_Binary_getData, ZEND_ACC_PUBLIC)
125-
PHP_ME(Binary, getType, ai_Binary_getType, ZEND_ACC_PUBLIC)
123+
PHP_ME(Binary, __construct, ai_Binary___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
124+
PHP_ME(Binary, getData, ai_Binary_getData, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
125+
PHP_ME(Binary, getType, ai_Binary_getType, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
126126
PHP_ME(Manager, __wakeUp, NULL, ZEND_ACC_PUBLIC)
127127
PHP_FE_END
128128
};

src/BSON/ObjectID.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ ZEND_END_ARG_INFO();
113113

114114

115115
static zend_function_entry php_phongo_objectid_me[] = {
116-
PHP_ME(ObjectID, __construct, ai_ObjectID___construct, ZEND_ACC_PUBLIC)
117-
PHP_ME(ObjectID, __toString, ai_ObjectID___toString, ZEND_ACC_PUBLIC)
116+
PHP_ME(ObjectID, __construct, ai_ObjectID___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
117+
PHP_ME(ObjectID, __toString, ai_ObjectID___toString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
118118
PHP_ME(Manager, __wakeUp, NULL, ZEND_ACC_PUBLIC)
119119
PHP_FE_END
120120
};

src/BSON/Regex.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ ZEND_END_ARG_INFO();
149149

150150

151151
static zend_function_entry php_phongo_regex_me[] = {
152-
PHP_ME(Regex, __construct, ai_Regex___construct, ZEND_ACC_PUBLIC)
153-
PHP_ME(Regex, getPattern, ai_Regex_getPattern, ZEND_ACC_PUBLIC)
154-
PHP_ME(Regex, getFlags, ai_Regex_getFlags, ZEND_ACC_PUBLIC)
155-
PHP_ME(Regex, __toString, ai_Regex___toString, ZEND_ACC_PUBLIC)
152+
PHP_ME(Regex, __construct, ai_Regex___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
153+
PHP_ME(Regex, getPattern, ai_Regex_getPattern, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
154+
PHP_ME(Regex, getFlags, ai_Regex_getFlags, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
155+
PHP_ME(Regex, __toString, ai_Regex___toString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
156156
PHP_ME(Manager, __wakeUp, NULL, ZEND_ACC_PUBLIC)
157157
PHP_FE_END
158158
};

src/MongoDB/BulkWrite.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,11 @@ ZEND_END_ARG_INFO();
257257

258258

259259
static zend_function_entry php_phongo_bulkwrite_me[] = {
260-
PHP_ME(BulkWrite, __construct, ai_BulkWrite___construct, ZEND_ACC_PUBLIC)
261-
PHP_ME(BulkWrite, insert, ai_BulkWrite_insert, ZEND_ACC_PUBLIC)
262-
PHP_ME(BulkWrite, update, ai_BulkWrite_update, ZEND_ACC_PUBLIC)
263-
PHP_ME(BulkWrite, delete, ai_BulkWrite_delete, ZEND_ACC_PUBLIC)
264-
PHP_ME(BulkWrite, count, ai_BulkWrite_count, ZEND_ACC_PUBLIC)
260+
PHP_ME(BulkWrite, __construct, ai_BulkWrite___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
261+
PHP_ME(BulkWrite, insert, ai_BulkWrite_insert, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
262+
PHP_ME(BulkWrite, update, ai_BulkWrite_update, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
263+
PHP_ME(BulkWrite, delete, ai_BulkWrite_delete, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
264+
PHP_ME(BulkWrite, count, ai_BulkWrite_count, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
265265
PHP_ME(Manager, __wakeUp, NULL, ZEND_ACC_PUBLIC)
266266
PHP_FE_END
267267
};

tests/bulk/bulkwrite_error-001.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\BulkWrite cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyBulkWrite extends MongoDB\Driver\BulkWrite {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyBulkWrite may not inherit from final class (MongoDB\Driver\BulkWrite) in %s on line %d

tests/cursor/cursor_error-001.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\Cursor cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyCursor extends MongoDB\Driver\Cursor {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyCursor may not inherit from final class (MongoDB\Driver\Cursor) in %s on line %d
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\CursorId cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyCursorId extends MongoDB\Driver\CursorId {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyCursorId may not inherit from final class (MongoDB\Driver\CursorId) in %s on line %d

tests/manager/manager_error-001.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\Query cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyQuery extends MongoDB\Driver\Query {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyQuery may not inherit from final class (MongoDB\Driver\Query) in %s on line %d

tests/query/query_error-001.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\Query cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyQuery extends MongoDB\Driver\Query {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyQuery may not inherit from final class (MongoDB\Driver\Query) in %s on line %d
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\ReadConcern cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyReadConcern extends MongoDB\Driver\ReadConcern {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyReadConcern may not inherit from final class (MongoDB\Driver\ReadConcern) in %s on line %d
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\ReadPreference cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyReadPreference extends MongoDB\Driver\ReadPreference {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyReadPreference may not inherit from final class (MongoDB\Driver\ReadPreference) in %s on line %d

tests/server/server_error-001.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\Server cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyServer extends MongoDB\Driver\Server {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyServer may not inherit from final class (MongoDB\Driver\Server) in %s on line %d
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
MongoDB\Driver\WriteConcern cannot be extended
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"?>
5+
--FILE--
6+
<?php
7+
require_once __DIR__ . "/../utils/basic.inc";
8+
9+
class MyWriteConcern extends MongoDB\Driver\WriteConcern {}
10+
11+
?>
12+
===DONE===
13+
<?php exit(0); ?>
14+
--EXPECTF--
15+
Fatal error: Class MyWriteConcern may not inherit from final class (MongoDB\Driver\WriteConcern) in %s on line %d

0 commit comments

Comments
 (0)