Skip to content

Commit adb338e

Browse files
committed
IMAP: Declare IMAPConnection class as final (stub+test)
Updates the `IMAPConnection` class stub to make sure it has the `final` flag, and adds a test to verify it.
1 parent a011650 commit adb338e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ext/imap/php_imap.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/** @generate-function-entries */
4-
class IMAPConnection {
4+
final class IMAPConnection {
55

66
}
77

ext/imap/tests/imap_final.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
Check that IMAPConnection is declared final
3+
--SKIPIF--
4+
<?php
5+
extension_loaded('imap') or die('skip imap extension not available in this build');
6+
--FILE--
7+
<?php
8+
9+
class T extends IMAPConnection {}
10+
--EXPECTF--
11+
Fatal error: Class T may not inherit from final class (IMAPConnection) in %s on line %d

0 commit comments

Comments
 (0)