Request panel#56
Closed
henrikbjorn wants to merge 1 commit intofabpot:masterfrom
henrikbjorn:request_panel
Closed
Conversation
…ekst to its profiler panel menu item
Author
|
I made a mistake in my branchs. http://github.com/fabpot/symfony/pull/57 holds another improvement aswell. |
fabpot
added a commit
that referenced
this pull request
Mar 2, 2016
…eference arguments in collection arguments (ogizanagi)
This PR was merged into the 3.1-dev branch.
Discussion
----------
[DependencyInjection] Properly ignore invalid reference arguments in collection arguments
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
With this new feature, the following configuration:
```xml
<service id="baz" class="Baz"/>
<service id="foo" class="Foo">
<argument type="collection">
<argument type="service" id="bar" on-invalid="ignore" />
<argument type="service" id="baz" />
<argument type="service" id="moo" on-invalid="null" />
</argument>
<argument type="service" id="bar" on-invalid="ignore" />
<argument type="service" id="baz" />
<argument type="service" id="moo" on-invalid="null" />
<call method="foo">
<argument type="service" id="bar" on-invalid="ignore" />
</call>
<call method="fooCollection">
<argument type="collection">
<argument type="service" id="bar" on-invalid="ignore" />
<argument type="service" id="baz" />
<argument type="service" id="moo" on-invalid="null" />
</argument>
</call>
</service>
```
will result into the following `Definition`:
```php
Definition {#64 ▼
-class: "Foo"
// […]
-calls: array:1 [▼
0 => array:2 [▼
0 => "fooCollection"
1 => array:1 [▼
0 => array:2 [▼
0 => Reference {#59 ▼
-id: "baz"
-invalidBehavior: 1
}
1 => null
]
]
]
]
// […]
#arguments: array:4 [▼
0 => array:2 [▼
0 => Reference {#63 ▼
-id: "baz"
-invalidBehavior: 1
}
1 => null
]
1 => null
2 => Reference {#56 ▼
-id: "baz"
-invalidBehavior: 1
}
3 => null
]
}
```
Invalid references are ignored instead of replaced by `null` when they are part of a collection argument.
If the collection argument is part of a method call and contains an invalid reference, the method call is kept, but the invalid reference removed.
The behavior stays the same as before for non-collection arguments.
:christmas_tree:
Commits
-------
cfc4879 [DependencyInjection] Properly ignore invalid reference arguments in collection arguments
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getSessionAttributes() returns an array not an object so getRawValue will fail.
Also added MongoDB to its webprofiler menu item so it is not just an icon.