Skip to content

Commit

Permalink
[Yaml][Parser] throw an exception if not readable
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Jan 13, 2012
1 parent 02a12b2 commit efce640
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Symfony/Component/Yaml/Yaml.php
Expand Up @@ -47,7 +47,14 @@ static public function parse($input)
$file = '';

// if input is a file, process it
if (strpos($input, "\n") === false && is_file($input) && is_readable($input)) {
if (strpos($input, "\n") === false && is_file($input)) {
if (false === is_readable($input)) {
throw new \InvalidArgumentException(sprintf(
'The service file "%s" is not readable.',
$input
));
}

$file = $input;

ob_start();
Expand Down

0 comments on commit efce640

Please sign in to comment.