13
13
*
14
14
* SPL - Standard PHP Library
15
15
*
16
+ * SPL is a collection of interfaces and classes that are meant to solve
17
+ * standard problems.
18
+ *
19
+ * A nice article about it can be found
20
+ * <a href="http://www.sitepoint.com/article/php5-standard-library/1">here</a>.
21
+ *
16
22
* You can download this documentation as a chm file
17
23
* <a href="http://php.net/~helly/php/ext/spl/spl.chm">here</a>.
18
24
*
19
25
* (c) Marcus Boerger, 2003 - 2004
20
26
*/
21
27
22
- /** \defgroup SPL Internal classes
28
+ /** @defgroup ZendEngine Zend engine classes
29
+ *
30
+ * The classes and interfaces in this group are contained in the c-code of
31
+ * PHP's Zend engine.
32
+ */
33
+
34
+ /** @defgroup SPL Internal classes
23
35
*
24
36
* The classes and interfaces in this group are contained in the c-code of
25
37
* ext/SPL.
26
38
*/
27
39
28
- /** \ defgroup Examples Example classes
40
+ /** @ defgroup Examples Example classes
29
41
*
30
42
* The classes and interfaces in this group are contained as PHP code in the
31
43
* examples subdirectory of ext/SPL. Sooner or later they will be moved to
32
44
* c-code.
33
45
*/
34
46
35
- /** \ingroup SPL
47
+ /** @ingroup ZendEngine
48
+ * @brief Basic Exception class.
49
+ */
50
+ class Exception
51
+ {
52
+ /** The exception message */
53
+ protected $ message ;
54
+
55
+ /** The string represenations as generated during construction */
56
+ private $ string ;
57
+
58
+ /** The code passed to the constructor */
59
+ protected $ code ;
60
+
61
+ /** The file name where the exception was instantiated */
62
+ protected $ file ;
63
+
64
+ /** The line number where the exception was instantiated */
65
+ protected $ line ;
66
+
67
+ /** The stack trace */
68
+ private $ trace ;
69
+
70
+ /** Prevent clone
71
+ */
72
+ final private function __clone ();
73
+
74
+ /**
75
+ */
76
+ public function __construct ($ message , $ code );
77
+
78
+ /** @return the message passed to the constructor
79
+ */
80
+ final public function getMessage ();
81
+
82
+ /** @return the code passed to the constructor
83
+ */
84
+ final public function getCode ();
85
+
86
+ /** @return the name of the file where the exception was thrown
87
+ */
88
+ final public function getFile ();
89
+
90
+ /** @return the line number where the exception was thrown
91
+ */
92
+ final public function getLine ();
93
+
94
+ /** @return the stack trace as array
95
+ */
96
+ final public function getTrace ();
97
+
98
+ /** @return the stack trace as string
99
+ */
100
+ final public function getTraceAsString ();
101
+
102
+ /** @return string represenation of exception
103
+ */
104
+ public function __toString ();
105
+ }
106
+
107
+ /** @ingroup SPL
108
+ * @brief Exception that represents error in the program logic.
109
+ *
110
+ * This kind of exceptions should directly leed to a fix in your code.
111
+ */
112
+ class LogicException extends Exception
113
+ {
114
+ }
115
+
116
+ /** @ingroup SPL
117
+ * @brief Exception that denotes a value not in the valid domain was used.
118
+ *
119
+ * This kind of exception should be used to inform about domain erors in
120
+ * mathematical sense.
121
+ */
122
+ class DomainException extends LogicException
123
+ {
124
+ }
125
+
126
+ /** @ingroup SPL
127
+ * @brief Exception that denotes invalid arguments were passed.
128
+ */
129
+ class InvalidArgumentException extends LogicException
130
+ {
131
+ }
132
+
133
+ /** @ingroup SPL
134
+ * @brief Exception thrown when a parameter exceeds the allowed length.
135
+ *
136
+ * This can be used for strings length, array size, file size, number of
137
+ * elements read from an Iterator and so on.
138
+ */
139
+ class LengthException extends LogicException
140
+ {
141
+ }
142
+
143
+ /** @ingroup SPL
144
+ * @brief Exception thrown when an illegal index was requested.
145
+ *
146
+ * This represents errors that should be detected at compile time.
147
+ *
148
+ * @see OutOfBoundsException
149
+ */
150
+ class OutOfRangeException extends LogicException
151
+ {
152
+ }
153
+
154
+ /** @ingroup SPL
155
+ * @brief Exception thrown for errors that are only detectable at runtime.
156
+ */
157
+ class RuntimeException extends Exception
158
+ {
159
+ }
160
+
161
+ /** @ingroup SPL
162
+ * @brief Exception thrown when an illegal index was requested.
163
+ *
164
+ * This represents errors that cannot be detected at compile time.
165
+ *
166
+ * @see OutOfRangeException
167
+ */
168
+ class OutOfBoundsException extends LogicException
169
+ {
170
+ }
171
+
172
+ /** @ingroup SPL
173
+ * @brief Exception thrown to indicate arithmetic/buffer overflow.
174
+ */
175
+ class OverflowException extends RuntimeException
176
+ {
177
+ }
178
+
179
+ /** @ingroup SPL
180
+ * @brief Exception thrown to indicate range errors during program execution.
181
+ *
182
+ * Normally this means there was an arithmetic error other than under/overflow.
183
+ */
184
+ class RangeException extends RuntimeException
185
+ {
186
+ }
187
+
188
+ /** @ingroup SPL
189
+ * @brief Exception Exception thrown to indicate arithmetic/buffer underflow.
190
+ */
191
+ class UnderflowException extends RuntimeException
192
+ {
193
+ }
194
+
195
+ /** \ingroup ZendEngine
36
196
* \brief Interface to override array access of objects.
37
197
*/
38
198
interface ArrayAccess
@@ -57,7 +217,7 @@ function offsetUnset($offset);
57
217
function offsetExists ($ offset );
58
218
}
59
219
60
- /** \ingroup SPL
220
+ /** \ingroup ZendEngine
61
221
* \brief Interface to detect a class is traversable using foreach.
62
222
*
63
223
* Abstract base interface that cannot be implemented alone. Instead it
@@ -75,7 +235,7 @@ interface Traversable
75
235
{
76
236
}
77
237
78
- /** \ingroup SPL
238
+ /** \ingroup ZendEngine
79
239
* \brief Interface to create an external Iterator.
80
240
*
81
241
* \note This is an engine internal interface.
@@ -87,7 +247,7 @@ interface IteratorAggregate extends Traversable
87
247
function getIterator ();
88
248
}
89
249
90
- /** \ingroup SPL
250
+ /** \ingroup ZendEngine
91
251
* \brief Basic iterator
92
252
*
93
253
* Interface for external iterators or objects that can be iterated
0 commit comments