|
3 | 3 | #![allow(clippy::unwrap_used)]
|
4 | 4 |
|
5 | 5 | use crate::ffi::{
|
6 |
| - zend_ce_argument_count_error, zend_ce_arithmetic_error, zend_ce_compile_error, |
7 |
| - zend_ce_division_by_zero_error, zend_ce_error_exception, zend_ce_exception, |
8 |
| - zend_ce_parse_error, zend_ce_throwable, zend_ce_type_error, zend_ce_unhandled_match_error, |
9 |
| - zend_ce_value_error, zend_standard_class_def, |
| 6 | + zend_ce_aggregate, zend_ce_argument_count_error, zend_ce_arithmetic_error, zend_ce_arrayaccess, |
| 7 | + zend_ce_compile_error, zend_ce_countable, zend_ce_division_by_zero_error, |
| 8 | + zend_ce_error_exception, zend_ce_exception, zend_ce_iterator, zend_ce_parse_error, |
| 9 | + zend_ce_serializable, zend_ce_stringable, zend_ce_throwable, zend_ce_traversable, |
| 10 | + zend_ce_type_error, zend_ce_unhandled_match_error, zend_ce_value_error, |
| 11 | + zend_standard_class_def, |
10 | 12 | };
|
11 | 13 |
|
12 | 14 | use super::ClassEntry;
|
13 | 15 |
|
14 |
| -/// Returns the base `stdClass` class. |
| 16 | +/// Returns the base [`stdClass`](https://www.php.net/manual/en/class.stdclass.php) class. |
15 | 17 | pub fn stdclass() -> &'static ClassEntry {
|
16 | 18 | unsafe { zend_standard_class_def.as_ref() }.unwrap()
|
17 | 19 | }
|
18 | 20 |
|
19 |
| -/// Returns the base `Throwable` class. |
| 21 | +/// Returns the base [`Throwable`](https://www.php.net/manual/en/class.throwable.php) class. |
20 | 22 | pub fn throwable() -> &'static ClassEntry {
|
21 | 23 | unsafe { zend_ce_throwable.as_ref() }.unwrap()
|
22 | 24 | }
|
23 | 25 |
|
24 |
| -/// Returns the base `Exception` class. |
| 26 | +/// Returns the base [`Exception`](https://www.php.net/manual/en/class.exception.php) class. |
25 | 27 | pub fn exception() -> &'static ClassEntry {
|
26 | 28 | unsafe { zend_ce_exception.as_ref() }.unwrap()
|
27 | 29 | }
|
28 | 30 |
|
29 |
| -/// Returns the base `ErrorException` class. |
| 31 | +/// Returns the base [`ErrorException`](https://www.php.net/manual/en/class.errorexception.php) class. |
30 | 32 | pub fn error_exception() -> &'static ClassEntry {
|
31 | 33 | unsafe { zend_ce_error_exception.as_ref() }.unwrap()
|
32 | 34 | }
|
33 | 35 |
|
34 |
| -/// Returns the base `CompileError` class. |
| 36 | +/// Returns the base [`CompileError`](https://www.php.net/manual/en/class.compileerror.php) class. |
35 | 37 | pub fn compile_error() -> &'static ClassEntry {
|
36 | 38 | unsafe { zend_ce_compile_error.as_ref() }.unwrap()
|
37 | 39 | }
|
38 | 40 |
|
39 |
| -/// Returns the base `ParseError` class. |
| 41 | +/// Returns the base [`ParseError`](https://www.php.net/manual/en/class.parseerror.php) class. |
40 | 42 | pub fn parse_error() -> &'static ClassEntry {
|
41 | 43 | unsafe { zend_ce_parse_error.as_ref() }.unwrap()
|
42 | 44 | }
|
43 | 45 |
|
44 |
| -/// Returns the base `TypeError` class. |
| 46 | +/// Returns the base [`TypeError`](https://www.php.net/manual/en/class.typeerror.php) class. |
45 | 47 | pub fn type_error() -> &'static ClassEntry {
|
46 | 48 | unsafe { zend_ce_type_error.as_ref() }.unwrap()
|
47 | 49 | }
|
48 | 50 |
|
49 |
| -/// Returns the base `ArgumentCountError` class. |
| 51 | +/// Returns the base [`ArgumentCountError`](https://www.php.net/manual/en/class.argumentcounterror.php) class. |
50 | 52 | pub fn argument_count_error() -> &'static ClassEntry {
|
51 | 53 | unsafe { zend_ce_argument_count_error.as_ref() }.unwrap()
|
52 | 54 | }
|
53 | 55 |
|
54 |
| -/// Returns the base `ValueError` class. |
| 56 | +/// Returns the base [`ValueError`](https://www.php.net/manual/en/class.valueerror.php) class. |
55 | 57 | pub fn value_error() -> &'static ClassEntry {
|
56 | 58 | unsafe { zend_ce_value_error.as_ref() }.unwrap()
|
57 | 59 | }
|
58 | 60 |
|
59 |
| -/// Returns the base `ArithmeticError` class. |
| 61 | +/// Returns the base [`ArithmeticError`](https://www.php.net/manual/en/class.arithmeticerror.php) class. |
60 | 62 | pub fn arithmetic_error() -> &'static ClassEntry {
|
61 | 63 | unsafe { zend_ce_arithmetic_error.as_ref() }.unwrap()
|
62 | 64 | }
|
63 | 65 |
|
64 |
| -/// Returns the base `DivisionByZeroError` class. |
| 66 | +/// Returns the base [`DivisionByZeroError`](https://www.php.net/manual/en/class.divisionbyzeroerror.php) class. |
65 | 67 | pub fn division_by_zero_error() -> &'static ClassEntry {
|
66 | 68 | unsafe { zend_ce_division_by_zero_error.as_ref() }.unwrap()
|
67 | 69 | }
|
68 | 70 |
|
69 |
| -/// Returns the base `UnhandledMatchError` class. |
| 71 | +/// Returns the base [`UnhandledMatchError`](https://www.php.net/manual/en/class.unhandledmatcherror.php) class. |
70 | 72 | pub fn unhandled_match_error() -> &'static ClassEntry {
|
71 | 73 | unsafe { zend_ce_unhandled_match_error.as_ref() }.unwrap()
|
72 | 74 | }
|
| 75 | + |
| 76 | +/// Returns the [`Traversable`](https://www.php.net/manual/en/class.traversable.php) interface. |
| 77 | +pub fn traversable() -> &'static ClassEntry { |
| 78 | + unsafe { zend_ce_traversable.as_ref() }.unwrap() |
| 79 | +} |
| 80 | + |
| 81 | +/// Returns the [`IteratorAggregate`](https://www.php.net/manual/en/class.iteratoraggregate.php) interface. |
| 82 | +pub fn aggregate() -> &'static ClassEntry { |
| 83 | + unsafe { zend_ce_aggregate.as_ref() }.unwrap() |
| 84 | +} |
| 85 | + |
| 86 | +/// Returns the [`Iterator`](https://www.php.net/manual/en/class.iterator.php) interface. |
| 87 | +pub fn iterator() -> &'static ClassEntry { |
| 88 | + unsafe { zend_ce_iterator.as_ref() }.unwrap() |
| 89 | +} |
| 90 | + |
| 91 | +/// Returns the [`ArrayAccess`](https://www.php.net/manual/en/class.arrayaccess.php) interface. |
| 92 | +pub fn arrayaccess() -> &'static ClassEntry { |
| 93 | + unsafe { zend_ce_arrayaccess.as_ref() }.unwrap() |
| 94 | +} |
| 95 | + |
| 96 | +/// Returns the [`Serializable`](https://www.php.net/manual/en/class.serializable.php) interface. |
| 97 | +pub fn serializable() -> &'static ClassEntry { |
| 98 | + unsafe { zend_ce_serializable.as_ref() }.unwrap() |
| 99 | +} |
| 100 | + |
| 101 | +/// Returns the [`Countable`](https://www.php.net/manual/en/class.countable.php) interface. |
| 102 | +pub fn countable() -> &'static ClassEntry { |
| 103 | + unsafe { zend_ce_countable.as_ref() }.unwrap() |
| 104 | +} |
| 105 | + |
| 106 | +/// Returns the [`Stringable`](https://www.php.net/manual/en/class.stringable.php) interface. |
| 107 | +pub fn stringable() -> &'static ClassEntry { |
| 108 | + unsafe { zend_ce_stringable.as_ref() }.unwrap() |
| 109 | +} |
0 commit comments