This PR was merged into the 2.3 branch.
Discussion
----------
fixed the profiler when an uncalled listener throws an exception when instantiated
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10371
| License | MIT
| Doc PR | n/a
When the profiler gets the uncalled listeners, the current page is broken without a very clear message. That happens when a listener is a service that depends for instance on the request; creating this service throws an exception.
After this patch, if we cannot get the listeners, we give up and add a log message about the problem (the error message is an info as the problem is not really related to the toolbar but more about how things work).
Commits
-------
79540d4 fixed the profiler when an uncalled listener throws an exception when instantiated
This PR was merged into the 2.3 branch.
Discussion
----------
[Form] Fixed hashing of choice lists containing non-UTF-8 characters
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10409
| License | MIT
| Doc PR | -
Commits
-------
18dc9a7 Added test case for 4c6a2d15095c13b2a35751b2b2712b183be489c4
73d56f7 Fixed bug in ChoiceType triggering a warning when not using utf-8
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#10536).
Discussion
----------
Avoid levenshtein comparison when using ContainerBuilder.
[DependencyInjection] ContainerBuilder catches exceptions when a service isn't found by Container::get().
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
In the process of building the exception message, I saw over 13k calls to levenshtein() when profiling a Drupal request where there's no compiled container yet, this adds around 36ms+ to the request for the function calls themselves, more for the overall logic.
Made the levenshtein calls optional based on a property on the class, then ContainerBuilder can set that to false and skip the suggestions.
![lev-before](https://f.cloud.github.com/assets/116285/2525110/d6dd3a90-b4eb-11e3-934a-a3726e0f8f09.png)
![lev-after](https://f.cloud.github.com/assets/116285/2525114/dd2de0fc-b4eb-11e3-8df0-598cadf2286b.png)
Commits
-------
cc9cc37 Avoid levenshtein comparison when using ContainerBuilder.
* 2.4:
added missing unit test
fixed too greedy replacements
fixed protocol-relative URLs
added override power to server parameters provided on request method
made parsing controllers more robust
Fixed YamlFileLoader imports path
* 2.3:
added missing unit test
fixed too greedy replacements
fixed protocol-relative URLs
added override power to server parameters provided on request method
made parsing controllers more robust
Fixed YamlFileLoader imports path
Conflicts:
src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php
This PR was merged into the 2.3 branch.
Discussion
----------
[DependencyInjection] added missing unit test
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Added a unit test to ensure that #10536 won't break BC.
Commits
-------
47d1592 added missing unit test
This PR was merged into the 2.3 branch.
Discussion
----------
Fixed server values in BrowserKit
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #9527, #9762, #9821, #9901
| License | MIT
| Doc PR | n/a
Commits
-------
65b9810 fixed too greedy replacements
d9cf28d fixed protocol-relative URLs
289da16 added override power to server parameters provided on request method
This PR was squashed before being merged into the 2.5-dev branch (closes#9818).
Discussion
----------
[TwigBundle] Add command to list twig functions, filters, globals and tests
Sample output:
```
$ app/console twig:doc date
Functions
date(date = null, timezone = null)
Filters
date(format = null, timezone = null)
date_modify(modifier)
```
JSON output also available, could be helpful for IDEs.
Possible improvement would be to read the first line of the docblock of each method/function to show a bit more info.
Feedback welcome on the command's name. Not really convinced but too late to think of something better.
Credits to @gagarine for the great idea
Commits
-------
7d61154 Add command to list twig functions, filters, globals and tests
This PR was merged into the 2.3 branch.
Discussion
----------
[HttpKernel] made parsing controllers more robust
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10465
| License | MIT
| Doc PR | n/a
Under some circumstances (like passing an object without an __invoke method), the Controller resolver would lead to a PHP fatal. This PR fixes that, improved error messages, and refactored the unit tests.
Commits
-------
6dba229 made parsing controllers more robust
This PR was merged into the 2.5-dev branch.
Discussion
----------
[Validator] Improved ISBN validator
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #10386, #10387, #10542
| License | MIT
| Doc PR | symfony/symfony-docs/pull/3724
This is a new PR of #10542, now on master branch.
Todos:
- [x] Discuss and determine deprecation versions
- [x] Update docs
After following some discussion in the tickets mentioned above I have improved the ISBN validator, which has had some inconsistencies:
* Use a `type` which can be set to `isbn10` or `isbn13` or `null` (checks if value matches any type) instead of the current boolean `isbn10` and `isbn13` options which cause confusion (e.q. if both are true, does this mean the value must match any or both? You could think it's the latter, but that's actually impossible.).
* In the IBAN validator we recently agreed to be strict about upper- and lowercase handling (#10489). Therefore this should be also the case with the ISBN validator. Some ISBN10 numbers may end with an uppercase `X` (representing the check-digit 10), while a lowercase `x` is considered wrong (see [here](http://www.goodreads.com/topic/show/1253500-a-question-about-isbn-10-s---ending-in-x) and [here](http://en.wikipedia.org/wiki/Category:Pages_with_ISBN_errors)). I did not have access to the actual specifications as I have only found documentation which costs about $100 (e.q. [here](http://www.iso.org/iso/catalogue_detail?csnumber=36563)).
To avoid bc breaks I suggest to introduce deprecations for current constraint options. [In the documentation](http://symfony.com/doc/current/contributing/code/conventions.html#deprecations) I haven't found any information about which versions may introduce deprecations, so you might have to help me out here with hints on how to handle it correctly. I'll be happy to provide the code with the deprecated parts removed after that.
Commits
-------
ec42844 Improved ISBN validator
This PR was squashed before being merged into the 2.5-dev branch (closes#10457).
Discussion
----------
[Serializer] Unify usage of normalizer cache
| Q | A
| ------------- | ---
| Bug fix? | no (unless performance problems are considered bugs)
| New feature? | no
| BC breaks? | no (unless the exception structure should be simplified)
| Deprecations? | no
| Tests pass? | yes ( I had some test fails locally when running the whole suite, but not related to Serializer)
| Fixed tickets |
| License | MIT
| Doc PR |
Some clean-up of the Serialization class, which has methods to get the Normalizer/Denormalizer but then repeats that logic in normalizeObject()/denormalizeObject().
Took great care to keep the exception behavior exactly like it is now as the tests depend on it, but it's strange (the methods use different exception classes if no normalizer is found and the "no normalizer" LogicException only exists in normalizeObject/denomalizeObject. That could easily be simplified further, to the point where those functions could easily be merged into the calling methods, as it would just be a single line of code. There is also a duplicate call to $this->normalizeObject() in normalize() that just exists to throw the LogicException for Symfony\Component\Serializer\Tests\SerializerTest::testSerializeNoNormalizer. Other tests do not except that to be thrown there, though.
Also noticed that getNormalizer()/getDenormalizer() are documented as @inheritdocs, which is a lie as they are private. Added some basic docs there.
This is performance relevant, as not having the cache in the getter methods means all normalizers are checked again to verify if a normalizer supports the data.
Commits
-------
e7389aa Move normalizer cache to getNormalier()/getDenormalizer(), use those in normalizeObject()/denormalizeObject()
This PR was merged into the 2.3 branch.
Discussion
----------
[DependencyInjection] Fixed YamlFileLoader imports path
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10516
| License | MIT
| Doc PR | http://symfony.com/doc/current/book/service_container.html#importing-configuration-with-imports
YamlFileLoader used the resource name as the current directory during import, which can cause a failed import when using a relative path. Using the $path variable output from the locator is consistent with other loaders and fixes the bug.
Commits
-------
fd1d48b Fixed YamlFileLoader imports path
YamlFileLoader used the resource name as the current directory during import, which can cause a failed import when using a relative path. Using the $path variable output from the locator is consistent with other loaders and fixes the bug.
This PR was squashed before being merged into the 2.5-dev branch (closes#9140).
Discussion
----------
[Validator][Email] - Strict validation and soft dependency
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #1581, #4930
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/3469
TODO
---------
- [x] submit changes to the documentation
- [x] document the BC breaks
- [x] finish the code
- [x] gather feedback for my changes
In #1581 @bschussek suggested to pass the strict_email config to `Validator\EmailValidator::__construct($strict)`, I did not put it there yet since the constraint can receive that configuration each time the constraint is used despite the fact of the global configuration. This could lead to some logic in the constructor and I wanted first to integrate the strict validator.
BC Break
--------------
I'm not sure of this, but as a soft dependency is added and now some emails that where valid before no longer are I thought it is.
Commits
-------
3368630#1581 - Strict in Email constraint and use of Egulias\EmailValidator
* 2.4:
Check headers sent before sending PHP response
Fix issue symfony/symfony#10345 '[FrameworkBundle][Console] container:debug --parameter="" not working anymore'
Fixed ACE domain checks on UrlValidator (#10031)
handle array root element
This PR was merged into the 2.3 branch.
Discussion
----------
[Debug] Check headers sent before sending PHP response
If the response contents has been sent before an error occurs, PHP triggers the warning "Cannot modify header information - headers already sent".
This change ensure that the useful error message is echoed, while it's impossible to change the HTTP status code and headers.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
97591c1 Check headers sent before sending PHP response
If the response contents has been sent before an error occurs, PHP
triggers the warning "Cannot modify header information - headers already sent"
This change ensure that the error message is echoed, while it's impossible
to change the HTTP status code and headers.
This PR was merged into the 2.5-dev branch.
Discussion
----------
[HttpKernel] [Exception] Add UnprocessableEntityHttpException to HttpKernel Exceptions
Add UnprocessableEntityHttpException, as this would have been useful as few times now.
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
304cbe9 Add UnprocessableEntityHttpException to HttpKernel Exceptions
This PR was merged into the 2.4 branch.
Discussion
----------
[FrameworkBundle][Console] Fix issue #10345 container:debug --parameter="" not working anymore
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes*
| Fixed tickets | #10345
| License | MIT
| Doc PR | N/A
## TODO
- [x] Fix issue #10345
- [ ] Create unit test for `describeContainerParameter`
Commits
-------
b278aa4 Fix issue symfony/symfony#10345 '[FrameworkBundle][Console] container:debug --parameter="" not working anymore'