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\View\Exceptions;
13:
14: use Chromabits\Nucleus\Exceptions\CoreException;
15: use Chromabits\Nucleus\Meditation\SpecResult;
16: use Exception;
17:
18: /**
19: * Class InvalidAttributesException.
20: *
21: * @author Eduardo Trujillo <ed@chromabits.com>
22: * @package Chromabits\Nucleus\View\Exceptions
23: */
24: class InvalidAttributesException extends CoreException
25: {
26: /**
27: * @var SpecResult
28: */
29: protected $specResult;
30:
31: /**
32: * Construct the exception.
33: *
34: * @param SpecResult $checkableResult
35: * @param string $message [optional] The Exception message to throw.
36: * @param int $code [optional] The Exception code.
37: * @param Exception $previous [optional] The previous exception used for
38: * the exception chaining.
39: */
40: public function __construct(
41: SpecResult $checkableResult,
42: $message = 'Invalid attributes were provided.',
43: $code = 0,
44: Exception $previous = null
45: ) {
46: parent::__construct(
47: $message,
48: $code,
49: $previous
50: );
51:
52: $this->specResult = $checkableResult;
53: }
54:
55: /**
56: * Get the spec result for attributes.
57: *
58: * @return SpecResult
59: */
60: public function getSpecResult()
61: {
62: return $this->specResult;
63: }
64: }
65: