minor #12927 Fixed deprecation version (WouterJ)

This PR was merged into the 2.7 branch.

Discussion
----------

Fixed deprecation version

Passing a file to `Yaml::parse()` is deprecated since 2.2 if I understand http://symfony.com/blog/security-release-symfony-2-0-22-and-2-1-7-released correctly.

| Q   | A
| --- | ---
| Fixed tickets | -
| License | MIT

Commits
-------

5f13343 Fixed deprecation version
This commit is contained in:
Fabien Potencier 2014-12-11 15:47:49 +01:00
commit 480819f939

View File

@ -46,7 +46,7 @@ class Yaml
*
* @throws ParseException If the YAML is not valid
*
* @deprecated The ability to pass file names to Yaml::parse() was deprecated in 2.7 and will be removed in 3.0. Please, pass the contents of the file instead.
* @deprecated The ability to pass file names to Yaml::parse() was deprecated in 2.2 and will be removed in 3.0. Please, pass the contents of the file instead.
*
* @api
*/
@ -55,7 +55,7 @@ class Yaml
// if input is a file, process it
$file = '';
if (strpos($input, "\n") === false && is_file($input)) {
trigger_error('The ability to pass file names to Yaml::parse() was deprecated in 2.7 and will be removed in 3.0. Please, pass the contents of the file instead.', E_USER_DEPRECATED);
trigger_error('The ability to pass file names to Yaml::parse() was deprecated in 2.2 and will be removed in 3.0. Please, pass the contents of the file instead.', E_USER_DEPRECATED);
if (false === is_readable($input)) {
throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input));