1: <?php
2:
3: /**
4: * Copyright 2015, Eduardo Trujillo
5: *
6: * For the full copyright and license information, please view the LICENSE
7: * file that was distributed with this source code.
8: *
9: * This file is part of the Nucleus package
10: */
11:
12: namespace Chromabits\Nucleus\Exceptions;
13:
14: use Exception;
15:
16: /**
17: * Class LackOfCoffeeException.
18: *
19: * We all have that day. This should be thrown when a programmer error or
20: * mistake is detected.
21: *
22: * @author Eduardo Trujillo <ed@chromabits.com>
23: * @package Chromabits\Nucleus\Exceptions
24: */
25: class LackOfCoffeeException extends CoreException
26: {
27: const DEFAULT_PREFIX = '(╯°□°)╯︵ ┻━┻';
28:
29: /**
30: * Construct an instance of a LackOfCoffeeException.
31: *
32: * @param string $message
33: * @param int $code
34: * @param Exception|null $previous
35: */
36: public function __construct(
37: $message = '',
38: $code = 0,
39: Exception $previous = null
40: ) {
41: if ($message == '') {
42: $message = static::DEFAULT_PREFIX . ' Coffee time!';
43: } else {
44: $message = static::DEFAULT_PREFIX . ' ' . $message;
45: }
46:
47: parent::__construct($message, $code, $previous);
48: }
49: }
50: