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\Meditation\Exceptions;
13:
14: use Chromabits\Nucleus\Exceptions\CoreException;
15: use Exception;
16:
17: /**
18: * Class UnknownTypeException.
19: *
20: * Thrown when a type is unknown.
21: *
22: * @author Eduardo Trujillo <ed@chromabits.com>
23: * @package Chromabits\Nucleus\Meditation\Exceptions
24: */
25: class UnknownTypeException extends CoreException
26: {
27: /**
28: * (PHP 5 >= 5.1.0)<br/>
29: * Construct the exception. Note: The message is NOT binary safe.
30: *
31: * @link http://php.net/manual/en/exception.construct.php
32: *
33: * @param string $typeName The name of the type that is unknown.
34: * @param int $code [optional] The Exception code.
35: * @param Exception $previous [optional] The previous exception used for
36: * the exception chaining.
37: */
38: public function __construct(
39: $typeName,
40: $code = 0,
41: Exception $previous = null
42: ) {
43: parent::__construct(
44: sprintf('The type %s is unknown.', $typeName),
45: $code,
46: $previous
47: );
48: }
49: }
50: