[Yaml] Normalize exceptions

This commit is contained in:
Romain Neutron 2012-08-30 21:54:08 +02:00
parent b0f5f2e7f2
commit f2e4802565
4 changed files with 27 additions and 4 deletions

View File

@ -18,6 +18,6 @@ namespace Symfony\Component\Yaml\Exception;
*
* @api
*/
class DumpException extends \RuntimeException implements ExceptionInterface
class DumpException extends RuntimeException
{
}

View File

@ -18,7 +18,7 @@ namespace Symfony\Component\Yaml\Exception;
*
* @api
*/
class ParseException extends \RuntimeException implements ExceptionInterface
class ParseException extends RuntimeException
{
private $parsedFile;
private $parsedLine;

View File

@ -0,0 +1,23 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Yaml\Exception;
/**
* Exception class thrown when an error occurs during parsing.
*
* @author Romain Neutron <imprec@gmail.com>
*
* @api
*/
class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}

View File

@ -130,7 +130,7 @@ class Unescaper
*
* @return string The string with the new encoding
*
* @throws \RuntimeException if no suitable encoding function is found (iconv or mbstring)
* @throws RuntimeException if no suitable encoding function is found (iconv or mbstring)
*/
private function convertEncoding($value, $to, $from)
{
@ -140,6 +140,6 @@ class Unescaper
return iconv($from, $to, $value);
}
throw new \RuntimeException('No suitable convert encoding function (install the iconv or mbstring extension).');
throw new RuntimeException('No suitable convert encoding function (install the iconv or mbstring extension).');
}
}