Sfoglia il codice sorgente

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

Fabien Potencier 14 anni fa
parent
commit
6a7359389d

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

@@ -56,7 +56,7 @@ EOT
                                           ->getAllClassNames();
 
         if (!$entityClassNames) {
-            throw new \Exception(
+            throw new \LogicException(
                 '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 '.
                 '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'])) {
-                            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);
 
         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);
 

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

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