8000 [2.1][Component][Yaml] fix 4022 by gajdaw · Pull Request #4126 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[2.1][Component][Yaml] fix 4022 #4126

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

Merged
merged 1 commit into from
May 8, 2012
Merged

[2.1][Component][Yaml] fix 4022 #4126

merged 1 commit into from
May 8, 2012

Conversation

gajdaw
Copy link
Contributor
@gajdaw gajdaw commented Apr 26, 2012

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: Build Status
Fixes the following tickets: #4121, #4022, #4135
Todo:

if (
$this->getCurrentLineIndentation() == $currentIndentation
&&
preg_match('/^- .*/', $this->currentLine)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matching .* makes no sense because it could simply be removed without any impact.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We only need to check, that string begins with a dash followed by a space. This is now done with strpos().

@stof
Copy link
Member
stof commented Apr 27, 2012

Why is it marked as [2.2] if it is a bugfix ?

@fabpot ping

@gajdaw
Copy link
Contributor Author
gajdaw commented Apr 27, 2012

The title should be [2.1] - now it is correct.

I marked it 2.0 and PR was for 2.0 originally.

Fabien suggested that it should go to master branch: #4121 (comment)

$unindentedEmbedBlock = true;
}

if (!$this->isCurrentLineEmpty() && 0 == $newIndent && !$unindentedEmbedBlock) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 0 ===

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Changed.

@fabpot
Copy link
Member
fabpot commented May 7, 2012

That does not work when you have something after the unindented collection:

collection:
    key:
    - a
    - b
    - c
foo: bar

@gajdaw
Copy link
Contributor Author
gajdaw commented May 7, 2012

@fabpot Last commit contains test with your yaml:

collection:
    key:
    - a
    - b
    - c
foo: bar

Everything seems fine. Can you give me a hint: what do you mean, when you say "That does not work"?

@fabpot
Copy link
Member
fabpot commented May 7, 2012

Sorry, the failing test is the following:

test: Key/value after unindented collection
brief: >
    Key/value after unindented collection
yaml: |
    collection:
        key:
        - a
        - b
        - c
        foo: bar
php: |
    array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar'))

@gajdaw
Copy link
Contributor Author
gajdaw commented May 7, 2012

@fabpot Last commit passed your test.

@fabpot
Copy link
Member
fabpot commented May 7, 2012

Can you squash your commits? Thanks.

}

$ret = false;
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line breaks after ( and before )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the condition is as long as:

if ($this->getCurrentLineIndentation() == $currentIndentation && $this->isStringUnIndentedCollectionItem($this->currentLine)) {

multiline notation is much easier to read. Should I change it into one long line?

@travisbot
Copy link

This pull request fails (merged 20891c58 into 919604a).

@gajdaw
Copy link
Contributor Author
gajdaw commented May 8, 2012

Done.

@travisbot
Copy link

This pull request passes (merged 80a2a92 into 898ff4e).

fabpot added a commit that referenced this pull request May 8, 2012
Commits
-------

80a2a92 [2.1][Component][Yaml] fix 4022

Discussion
----------

[2.1][Component][Yaml] fix 4022

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/gajdaw/symfony.png?branch=2_1_component_yaml_fix_4022)](http://travis-ci.org/gajdaw/symfony)
Fixes the following tickets: #4121, #4022, #4135
Todo:

---------------------------------------------------------------------------

by stof at 2012-04-27T13:03:15Z

Why is it marked as ``[2.2]`` if it is a bugfix ?

@fabpot ping

---------------------------------------------------------------------------

by gajdaw at 2012-04-27T14:42:21Z

The title should be [2.1] - now it is correct.

I marked it 2.0 and PR was for 2.0 originally.

Fabien suggested that it should go to master branch: #4121 (comment)

---------------------------------------------------------------------------

by fabpot at 2012-05-07T09:17:31Z

That does not work when you have something after the unindented collection:

    collection:
        key:
        - a
        - b
        - c
    foo: bar

---------------------------------------------------------------------------

by gajdaw at 2012-05-07T11:11:30Z

@fabpot Last commit contains test with your yaml:

    collection:
        key:
        - a
        - b
        - c
    foo: bar

Everything seems fine. Can you give me a hint: what do you mean, when you say "That does not work"?

---------------------------------------------------------------------------

by fabpot at 2012-05-07T12:36:19Z

Sorry, the failing test is the following:

    test: Key/value after unindented collection
    brief: >
        Key/value after unindented collection
    yaml: |
        collection:
            key:
            - a
            - b
            - c
            foo: bar
    php: |
        array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar'))

---------------------------------------------------------------------------

by gajdaw at 2012-05-07T15:48:26Z

@fabpot Last commit passed your test.

---------------------------------------------------------------------------

by fabpot at 2012-05-07T17:28:21Z

Can you squash your commits? Thanks.

---------------------------------------------------------------------------

by travisbot at 2012-05-08T05:32:58Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1273487) (merged 20891c58 into 919604a).

---------------------------------------------------------------------------

by gajdaw at 2012-05-08T05:36:51Z

Done.

---------------------------------------------------------------------------

by travisbot at 2012-05-08T07:23:47Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1274162) (merged 80a2a92 into 898ff4e).
@fabpot fabpot merged commit 80a2a92 into symfony:master May 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0