Chris@14: Chris@14: * Chris@14: * For the full copyright and license information, please view the LICENSE Chris@14: * file that was distributed with this source code. Chris@14: */ Chris@14: Chris@14: namespace Symfony\Component\Serializer\Exception; Chris@14: Chris@14: /** Chris@14: * ExtraAttributesException. Chris@14: * Chris@14: * @author Julien DIDIER Chris@14: */ Chris@14: class ExtraAttributesException extends RuntimeException Chris@14: { Chris@14: private $extraAttributes; Chris@14: Chris@14: public function __construct(array $extraAttributes, \Exception $previous = null) Chris@14: { Chris@14: $msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes)); Chris@14: Chris@14: $this->extraAttributes = $extraAttributes; Chris@14: Chris@14: parent::__construct($msg, 0, $previous); Chris@14: } Chris@14: Chris@14: /** Chris@14: * Get the extra attributes that are not allowed. Chris@14: * Chris@14: * @return array Chris@14: */ Chris@14: public function getExtraAttributes() Chris@14: { Chris@14: return $this->extraAttributes; Chris@14: } Chris@14: }