[Yaml] Normalize exceptions
This commit is contained in:
parent
b0f5f2e7f2
commit
f2e4802565
@ -18,6 +18,6 @@ namespace Symfony\Component\Yaml\Exception;
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class DumpException extends \RuntimeException implements ExceptionInterface
|
||||
class DumpException extends RuntimeException
|
||||
{
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace Symfony\Component\Yaml\Exception;
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ParseException extends \RuntimeException implements ExceptionInterface
|
||||
class ParseException extends RuntimeException
|
||||
{
|
||||
private $parsedFile;
|
||||
private $parsedLine;
|
||||
|
23
src/Symfony/Component/Yaml/Exception/RuntimeException.php
Normal file
23
src/Symfony/Component/Yaml/Exception/RuntimeException.php
Normal 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
|
||||
{
|
||||
}
|
@ -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).');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user