4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Serializer\Exception;
15 * ExtraAttributesException.
17 * @author Julien DIDIER <julien@didier.io>
19 class ExtraAttributesException extends RuntimeException
21 private $extraAttributes;
23 public function __construct(array $extraAttributes, \Exception $previous = null)
25 $msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes));
27 $this->extraAttributes = $extraAttributes;
29 parent::__construct($msg, 0, $previous);
33 * Get the extra attributes that are not allowed.
37 public function getExtraAttributes()
39 return $this->extraAttributes;