瀏覽代碼

removed usage of \Exception as PHPUnit won't allow to catch them anymore in the next major version

Fabien Potencier 14 年之前
父節點
當前提交
6a7359389d

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php

@@ -56,7 +56,7 @@ EOT
                                           ->getAllClassNames();
                                           ->getAllClassNames();
 
 
         if (!$entityClassNames) {
         if (!$entityClassNames) {
-            throw new \Exception(
+            throw new \LogicException(
                 'You do not have any mapped Doctrine ORM entities for any of your bundles. '.
                 'You do not have any mapped Doctrine ORM entities for any of your bundles. '.
                 'Create a class inside the Entity namespace of any of your bundles and provide '.
                 'Create a class inside the Entity namespace of any of your bundles and provide '.
                 'mapping information for it with Annotations directly in the classes doc blocks '.
                 'mapping information for it with Annotations directly in the classes doc blocks '.

+ 1 - 1
src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php

@@ -275,7 +275,7 @@ class MainConfiguration implements ConfigurationInterface
                         }
                         }
 
 
                         if (!preg_match('#'.$firewall['pattern'].'#', $firewall[$k]['check_path'])) {
                         if (!preg_match('#'.$firewall['pattern'].'#', $firewall[$k]['check_path'])) {
-                            throw new \Exception(sprintf('The check_path "%s" for login method "%s" is not matched by the firewall pattern "%s".', $firewall[$k]['check_path'], $k, $firewall['pattern']));
+                            throw new \LogicException(sprintf('The check_path "%s" for login method "%s" is not matched by the firewall pattern "%s".', $firewall[$k]['check_path'], $k, $firewall['pattern']));
                         }
                         }
                     }
                     }
 
 

+ 1 - 1
src/Symfony/Component/Console/Helper/DialogHelper.php

@@ -36,7 +36,7 @@ class DialogHelper extends Helper
         $output->write($question);
         $output->write($question);
 
 
         if (false === $ret = stream_get_line(null === $this->inputStream ? STDIN : $this->inputStream, 4096, "\n")) {
         if (false === $ret = stream_get_line(null === $this->inputStream ? STDIN : $this->inputStream, 4096, "\n")) {
-            throw new \Exception('Aborted');
+            throw new \RuntimeException('Aborted');
         }
         }
         $ret = trim($ret);
         $ret = trim($ret);
 
 

+ 2 - 2
src/Symfony/Component/Translation/Loader/XliffFileLoader.php

@@ -53,7 +53,7 @@ class XliffFileLoader implements LoaderInterface
         $dom = new \DOMDocument();
         $dom = new \DOMDocument();
         $current = libxml_use_internal_errors(true);
         $current = libxml_use_internal_errors(true);
         if (!@$dom->load($file, LIBXML_COMPACT)) {
         if (!@$dom->load($file, LIBXML_COMPACT)) {
-            throw new \Exception(implode("\n", $this->getXmlErrors()));
+            throw new \RuntimeException(implode("\n", $this->getXmlErrors()));
         }
         }
 
 
         $location = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd';
         $location = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd';
@@ -73,7 +73,7 @@ class XliffFileLoader implements LoaderInterface
         $source = str_replace('http://www.w3.org/2001/xml.xsd', $location, $source);
         $source = str_replace('http://www.w3.org/2001/xml.xsd', $location, $source);
 
 
         if (!@$dom->schemaValidateSource($source)) {
         if (!@$dom->schemaValidateSource($source)) {
-            throw new \Exception(implode("\n", $this->getXmlErrors()));
+            throw new \RuntimeException(implode("\n", $this->getXmlErrors()));
         }
         }
         $dom->validateOnParse = true;
         $dom->validateOnParse = true;
         $dom->normalizeDocument();
         $dom->normalizeDocument();