Skip to content

Commit

Permalink
minor #22913 [Yaml] Deprecate tags using colon (GuilhemN)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 3.4 branch (closes #22913).

Discussion
----------

[Yaml] Deprecate tags using colon

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Using a colon in a tag doesn't look like yaml and causes trouble (see symfony/symfony#22878), so I propose to just deprecate these tags in favor of more consistent tags.

```yml
- !php/const:PHP_INT_MAX
- !php/object:O:30:"Symfony\Component\Yaml\Tests\A":1:{s:1:"a";s:3:"foo";}
```
would become
```yml
- !php/const PHP_INT_MAX
- !php/object O:30:"Symfony\Component\Yaml\Tests\A":1:{s:1:"a";s:3:"foo";}
```

Commits
-------

9815af3 [Yaml] Deprecate tags using colon
  • Loading branch information
xabbuh committed Aug 4, 2017
2 parents 5b9a29f + 1f8902e commit 673d592
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tests/Fixtures/yaml/services2.yml
Expand Up @@ -5,7 +5,7 @@ parameters:
- false
- 0
- 1000.3
- !php/const:PHP_INT_MAX
- !php/const PHP_INT_MAX
bar: foo
escape: '@@escapeme'
foo_bar: '@foo_bar'
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -20,7 +20,7 @@
"psr/container": "^1.0"
},
"require-dev": {
"symfony/yaml": "~3.3|~4.0",
"symfony/yaml": "~3.4|~4.0",
"symfony/config": "~3.3|~4.0",
"symfony/expression-language": "~2.8|~3.0|~4.0"
},
Expand All @@ -35,7 +35,7 @@
"symfony/config": "<3.3.1",
"symfony/finder": "<3.3",
"symfony/proxy-manager-bridge": "<3.4",
"symfony/yaml": "<3.3"
"symfony/yaml": "<3.4"
},
"provide": {
"psr/container-implementation": "1.0"
Expand Down

0 comments on commit 673d592

Please sign in to comment.