1: <?php
2:
3: namespace Chromabits\Nucleus\View\Exceptions;
4:
5: use Chromabits\Nucleus\Exceptions\CoreException;
6: use Chromabits\Nucleus\Meditation\TypeHound;
7: use Exception;
8:
9: /**
10: * Class NodeRenderingException
11: *
12: * @author Eduardo Trujillo <ed@chromabits.com>
13: * @package Chromabits\Nucleus\View\Exceptions
14: */
15: class NodeRenderingException extends CoreException
16: {
17: /**
18: * @var mixed
19: */
20: protected $content;
21:
22: /**
23: * Construct an instance of a NodeRenderingException.
24: *
25: * @param mixed $content
26: * @param int $code
27: * @param Exception|null $previous
28: */
29: public function __construct($content, $code = 0, Exception $previous = null)
30: {
31: parent::__construct(
32: vsprintf(
33: 'Unknown content type: %s. Node cannot be rendered.',
34: [
35: TypeHound::fetch($content),
36: ]
37: ),
38: $code,
39: $previous
40: );
41:
42: $this->content = $content;
43: }
44:
45: /**
46: * @return mixed
47: */
48: public function getContent()
49: {
50: return $this->content;
51: }
52: }
53: