1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
6: * @package Nette
7: */
8:
9:
10:
11: /**
12: * The exception that is thrown when the value of an argument is
13: * outside the allowable range of values as defined by the invoked method.
14: * @package Nette
15: */
16: class ArgumentOutOfRangeException extends InvalidArgumentException
17: {
18: }
19:
20:
21: /**
22: * The exception that is thrown when a method call is invalid for the object's
23: * current state, method has been invoked at an illegal or inappropriate time.
24: * @package Nette
25: */
26: class InvalidStateException extends RuntimeException
27: {
28: public function __construct($message = '', $code = 0, Exception $previous = NULL)
29: {
30: if (PHP_VERSION_ID < 50300) {
31: $this->previous = $previous;
32: parent::__construct($message, $code);
33: } else {
34: parent::__construct($message, $code, $previous);
35: }
36: }
37: }
38:
39:
40: /**
41: * The exception that is thrown when a requested method or operation is not implemented.
42: * @package Nette
43: */
44: class NotImplementedException extends LogicException
45: {
46: }
47:
48:
49: /**
50: * The exception that is thrown when an invoked method is not supported. For scenarios where
51: * it is sometimes possible to perform the requested operation, see InvalidStateException.
52: * @package Nette
53: */
54: class NotSupportedException extends LogicException
55: {
56: }
57:
58:
59: /**
60: * The exception that is thrown when a requested method or operation is deprecated.
61: * @package Nette
62: */
63: class DeprecatedException extends NotSupportedException
64: {
65: }
66:
67:
68: /**
69: * The exception that is thrown when accessing a class member (property or method) fails.
70: * @package Nette
71: */
72: class MemberAccessException extends LogicException
73: {
74: }
75:
76:
77: /**
78: * The exception that is thrown when an I/O error occurs.
79: * @package Nette
80: */
81: class IOException extends RuntimeException
82: {
83: }
84:
85:
86: /**
87: * The exception that is thrown when accessing a file that does not exist on disk.
88: * @package Nette
89: */
90: class FileNotFoundException extends IOException
91: {
92: }
93:
94:
95: /**
96: * The exception that is thrown when part of a file or directory cannot be found.
97: * @package Nette
98: */
99: class DirectoryNotFoundException extends IOException
100: {
101: }
102:
103:
104: /**
105: * The exception that is thrown when static class is instantiated.
106: * @package Nette
107: */
108: class StaticClassException extends LogicException
109: {
110: }
111:
112:
113: /**
114: * The exception that indicates errors that can not be recovered from. Execution of
115: * the script should be halted.
116: * @package Nette
117: */
118: class FatalErrorException extends Exception // ErrorException is corrupted in PHP < 5.3
119: {
120: private $severity;
121:
122: public function __construct($message, $code, $severity, $file, $line, $context, Exception $previous = NULL)
123: {
124: if (PHP_VERSION_ID < 50300) {
125: $this->previous = $previous;
126: parent::__construct($message, $code);
127: } else {
128: parent::__construct($message, $code, $previous);
129: }
130: $this->severity = $severity;
131: $this->file = $file;
132: $this->line = $line;
133: $this->context = $context;
134: }
135:
136: public function getSeverity()
137: {
138: return $this->severity;
139: }
140:
141: }
142: