symfony/symfony — pull request #11721 by bezhermoso (2014-08-20 18:28:59+00:00)
Title: [Yaml] Ability to supress file content parsing.

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | I don't think so
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | _TODO_

This is in relation to a question I posted here: https://github.com/symfony/symfony/issues/11720

I'll just repeat it here, I guess:

Currently `Yaml#parse` would check if the first parameter is a file and would parse the contents if it is readable.

I understand that this behavior is deprecated and for a good reason, and will actually be removed in `3.0`.

My question is: would it be acceptable to add a fourth parameter to the current API (maybe as far back as `2.3`) to suppress this behavior?

```php
public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false, $checkFile = true)
{
```

Would this pose a BC problem? My belief is that it won't introduce any, but I have no extensive experience in maintaining open-source code-base and there might be areas that I could've thought considering thus I could be wrong. I just might have missed something really obvious, which happens. FWIW, all test-cases pass.