1: <?php
2: /**
3: * This file is part of the Autarky package.
4: *
5: * (c) Andreas Lutro <anlutro@gmail.com>
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: namespace Autarky\Errors;
12:
13: /**
14: * The framework's error handler that takes care of caught and uncaught
15: * exceptions as well as fatal PHP errors.
16: */
17: interface ErrorHandlerManagerInterface extends ErrorHandlerInterface
18: {
19: /**
20: * Set whether exceptions should be handled or rethrown.
21: *
22: * @param bool $toggle
23: */
24: public function setRethrow($toggle);
25:
26: /**
27: * Append a handler to the list of handlers.
28: *
29: * @param callable|ErrorHandlerInterface $handler
30: *
31: * @return void
32: */
33: public function appendHandler($handler);
34:
35: /**
36: * Prepend a handler to the list of handlers.
37: *
38: * @param callable|ErrorHandlerInterface $handler
39: *
40: * @return void
41: */
42: public function prependHandler($handler);
43:
44: /**
45: * Set the default handler that will be called if no other handlers are
46: * available.
47: *
48: * @param ErrorHandlerInterface $handler
49: */
50: public function setDefaultHandler(ErrorHandlerInterface $handler);
51:
52: /**
53: * Register the error handler to handle uncaught exceptions and errors.
54: *
55: * @return void
56: */
57: public function register();
58: }
59: