From c40db35c9190ba481eedc789d503348e51c44520 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 14 Dec 2012 14:04:54 +0100 Subject: [PATCH] [Translation] removed some code that is not done anywhere else in Symfony --- .../Translation/MessageCatalogue.php | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/Symfony/Component/Translation/MessageCatalogue.php b/src/Symfony/Component/Translation/MessageCatalogue.php index 42a90df880..6cfcf22ecc 100644 --- a/src/Symfony/Component/Translation/MessageCatalogue.php +++ b/src/Symfony/Component/Translation/MessageCatalogue.php @@ -245,12 +245,6 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf return $this->metadata; } - if (!is_string($domain)) { - throw new \InvalidArgumentException("Domain should be an string."); - } - if (!is_string($key)) { - throw new \InvalidArgumentException("Key should be an string."); - } if (isset($this->metadata[$domain])) { if (!empty($key)) { if (isset($this->metadata[$domain][$key])) { @@ -267,12 +261,6 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf */ public function setMetadata($key, $value, $domain = 'messages') { - if (!is_string($key)) { - throw new \InvalidArgumentException("Key should be an string."); - } - if (!isset($this->metadata[$domain])) { - $this->metadata[$domain] = array(); - } $this->metadata[$domain][$key] = $value; } @@ -284,15 +272,11 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf if (empty($domain)) { $this->metadata = array(); } - if (!is_string($domain)) { - throw new \InvalidArgumentException("Domain should be an string."); - } + if (empty($key)) { unset($this->metadata[$domain]); } - if (!is_string($key)) { - throw new \InvalidArgumentException("Key should be an string."); - } + unset($this->metadata[$domain][$key]); }