-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml] Parse error when comment on another indent level #16065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
has been reverted |
I tried to reproduce it in a regression test along with the changes that were reverted, but it didn't failed :/ So I tried with the exact code you gave: public function testCommentAtTheRootIndent()
{
$this->assertSame(array(
'services' => array(
'app.handler.session_idle' => array(
'class' => 'AppBundle\\Handler\\SessionIdleHandler',
'arguments' => array(
0 => '@session',
1 => '@security.token_storage',
2 => '@router',
3 => '%session_max_idle_time%',
),
'tags' => array(
0 => array(
'name' => 'kernel.event_listener',
'event' => 'kernel.request',
'method' => 'onKernelRequest',
),
),
),
),
), Yaml::parse(<<<EOF
services:
# Session Handler (Inactivity Logout)
app.handler.session_idle:
class: AppBundle\Handler\SessionIdleHandler
arguments: ["@session", "@security.token_storage", "@router", %session_max_idle_time%]
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
EOF
));
} but doesn't fail either :/ Any hint ? |
Ok let me try with a more complete version, the thing is the problem is caused when you have several definition and a comment back on root level in between like so : services:
# Custom Services
app.service.client:
class: AppBundle\Service\ClientService
arguments:
container: "@service_container"
# Validator
app.validator.sort_code_validator:
class: AppBundle\Validator\Constraints\SortCodeValidator
arguments:
bv: "@app.service.bankval"
tags:
- { name: validator.constraint_validator, alias: sort_validator } |
Ok, I can confirm this regression. I'll submit a PR to introduce the regression test. Thanks ! |
This PR was merged into the 2.3 branch. Discussion ---------- [Yaml] Add regression test for comments indents | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This is related to #16065, #15857 and #15860 (last one has been reverted due to this regression) Commits ------- 7b9d519 [Yaml] Add regression test for comments indents
New merge commit 2ff0f97
(from parent commit 150f52f and issue #15860 )
just cause an error on Yaml file with different comment level.
This file will throw an exception :
but this one is not (note the comment position):
I think the error is caused especially if you put a comment between two entries, but you keep the comment on root level
Is it a changes in Yaml syntax ?
The text was updated successfully, but these errors were encountered: