This PR was squashed before being merged into the 4.1-dev branch (closes#25732).
Discussion
----------
[Console] Add option to automatically run suggested command if there is only 1 alternative
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
When mistyping a console command, you get an error giving suggested commands.
If there is only 1 alternative suggestion, this PR will give you the option to run that command instead. This makes it easier to run the correct command without having to re-type/copy-paste/update the previous run command
![console](https://user-images.githubusercontent.com/144858/34724377-4b46c726-f556-11e7-94a3-a9d7c9d75e74.gif)
Commits
-------
83d52f02f9 [Console] Add option to automatically run suggested command if there is only 1 alternative
This PR was merged into the 3.4 branch.
Discussion
----------
Document the container.autowiring.strict_mode option
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony-docs/issues/8561
| License | MIT
| Doc PR | no
Hello,
Let me know for any misunderstanding from my part or rewording
Commits
-------
11383773bf Document the container.autowiring.strict_mode option
This PR was merged into the 3.4 branch.
Discussion
----------
fix custom radios/inputs for checkbox/radio type
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? |
| Fixed tickets | #25715
| License | MIT
| Doc PR |
Hey, I tried new changes in bootstrap 4 layout. Unfortunatelly custom-radios/checkboxes seems to work only for ChoiceType/EntityType but not for CheckboxType/RadioType. I added changes which I belive fix this issue.
Commits
-------
dd6d1dd119 fix custom radios/inputs for checkbox/radio type
This PR was squashed before being merged into the 4.1-dev branch (closes#26085).
Discussion
----------
Deprecate bundle:controller:action and service:method notation
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #25910
| License | MIT
| Doc PR |
The `a::b` notation had some awkward limitations. It supported `MyControllerClass::method` where `MyControllerClass` is either plain class or a service with the same name but the class must exists. This meant it did NOT support `my_service_controller_id::method` because the `class_exists` check would fail at the wrong point in time. But it did support services where class name == id, i.e. the new auto registration based psr naming. This made it very confusing.
I enhanced the `a::b` notation to be very straight forward:
- if `a` exists as a service then use `a` as a service
- otherwise try to use `a` as a class, i.e. `new $a()`
- otherwise check if a::b is a static method (only relevant when the class is abstract or has private contructor). this was potentially supported when using array controller syntax. it now works the same when using the `::` string syntax, like in php itself. since it only happens when nothing else works, it does not have any performance impact.
The old `a:b` syntax is deprecated and just forwards to `a::b` now internally, just as bundle:controller:action.
In general I was able to refactor the logic quite a bit because it always goes through `instantiateController` now.
Spotting deprecated usages is very easy as all outdated routing configs will trigger a deprecation with the DelegatingLoader and it will be normalized in the dumped routes. So you don't get a deprecation again in the ControllerResolver. But if the controller does not come from routing, e.g. twigs render controller function, then it will still be triggered there.
- [x] deprecate `a🅱️c`
- [x] deprecate `a:b`
- [x] update existing references to `a::b`
- [x] fix tests
- [x] fix/add support for static controllers
- [x] add support for closures as controllers
- [x] update Symfony\Component\Routing\Loader\ObjectRouteLoader
- [x] deprecate \Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser but we still need to use it in several places for BC.
- [x] add changelog/upgrade
- [x] update controller.service_arguments logic for double colon controller syntax
Commits
-------
f8a609cdbd Deprecate bundle:controller:action and service:method notation
This PR was merged into the 2.7 branch.
Discussion
----------
Another PR template tweak
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
<!--
- Bug fixes must be submitted against the lowest branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Replace this comment by a description of what your PR is solving.
-->
Commits
-------
c338d85514 Another PR template tweak
This PR was merged into the 4.1-dev branch.
Discussion
----------
[MonologBridge] Allow to change level format in ConsoleFormatter
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I want to use this format `%datetime% <comment>[%level_name%]</comment> %start_tag%%message%%end_tag%`, but ConsoleFormatter formats in a way message looks like this:
![screenshot from 2018-02-19 01-54-21](https://user-images.githubusercontent.com/496233/36359102-d6c20e4c-1517-11e8-9988-8a49efc4cacb.png)
As you see, unnecessary padding looks like anomaly here and there is currently no way to remove it without making own formatter.
This option allows me to replace default padding format with `%s`.
Commits
-------
fbd257c25d [MonologBridge] Allow to change level format
This PR was merged into the 4.1-dev branch.
Discussion
----------
[Lock] Add a TTL to refresh lock
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | see LockInterface's comment
| Tests pass? | yes
| Fixed tickets | NA
| License | MIT
| Doc PR | NA
Using remote locks in long processes needs to defines a fined grain refresh TTL. For instance, when looping over a long list of jobs we can extends the live of the lock by few seconds before processing each item.
But when the the jobs is splitted and each part to take the same time, we can not define the best TTL
Exemple
```
$lock->acquire();
$this->2minutesJob();
$lock->refresh();
$this->5minutesJob();
$lock->refresh();
$this->1minutesJob();
```
The purpose of this PR is to be able to override the default TTL
```
$lock->acquire();
$lock->refresh(120);
$this->2minutesJob();
$lock->refresh(300);
$this->5minutesJob();
$lock->refresh(60);
$this->1minutesJob();
```
Commits
-------
3b1f3286d8 Add a TTL to refresh lock
This PR was merged into the 2.8 branch.
Discussion
----------
[PropertyInfo] ReflectionExtractor: give a chance to other extractors if no properties
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass? | yes
| Fixed tickets | #25803 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | n/a
For instance when using `__call()`, see #25803.
<!--
- Bug fixes must be submitted against the lowest branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Replace this comment by a description of what your PR is solving.
-->
Commits
-------
270147b04f [PropertyInfo] ReflectionExtractor: give a chance to other extractors if no properties
This PR was squashed before being merged into the 4.1-dev branch (closes#26108).
Discussion
----------
[Serializer] Add a MaxDepth handler
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass? | yes
| Fixed tickets | api-platform/core#1130, api-platform/core#1528, api-platform/core#1528 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | todo <!--highly recommended for new features-->
Sometimes, instead of just stopping the serialization process when the configured max depth is reached, it can be interesting to let the user return something (like returning the identifier of the entity to stop manually the serialization process).
This PR also makes the max depth handling more similar to circular references handling (that already has the possibility to set a handler).
Commits
-------
ed975c764b [Serializer] Add a MaxDepth handler
This PR was merged into the 3.4 branch.
Discussion
----------
Add support for URL-like DSNs for the PdoSessionHandler
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #25186
| License | MIT
| Doc PR |
This allows migrating away from the deprecated DbalSessionHandler when DBAL was used for its ability to be configured through a URL (which is what is provided on Heroku and some other PaaS).
I know that this is technically a new feature (and so may target master instead), but we currently have no way to configure a database session storage on Heroku in 4.0 (and in 3.4, it requires using a deprecated class).
I decided to add support for the URL-like configuration directly rather than adding support for passing a DBAL connection, to minimize the code changes.
I also left out the support for OCI in this feature, as the PDO DSN for the Oracle driver is totally crazy (it has nothing in common with other drivers). If someone wants to use a Oracle DB, they should pass the PDO DSN directly instead of a URL.
Differences with the URL handling in Doctrine DBAL:
- schemeless URLs are not supported (DBAL allows configuring the driver separately in case you don't have it in the URL)
- the query string is ignored (DBAL allows to use the query string to configure any supported DBAL params, which are driver-specific. Just use a DSN directly if you need them. PaaS are unlikely to provide such params anyway and they are the main motivation for this PR)
Commits
-------
14c35ad13c Add support for URL-like DSNs for the PdoSessionHandler
This PR was merged into the 4.1-dev branch.
Discussion
----------
Make deprecation notices less verbose
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
I think there is no need to say that deprecated features will be removed in the next major version. That makes messages more verbose for no real reasons.
Commits
-------
0c6ec3fec0 made deprecation notices less verbose
This PR was merged into the 2.7 branch.
Discussion
----------
[WebProfilerBundle] add a way to limit ajax request
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass? | yes
| Fixed tickets | #22688
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
I need to add the doc entry and the reproducer to test that everything is ok.
Commits
-------
9ff86d6181 [WebProfilerBundle] limit ajax request to 100 and remove the last one
This PR was merged into the 4.1-dev branch.
Discussion
----------
[BrowserKit] add a way to switch to ajax for one request
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20306
| License | MIT
| Doc PR | will do
Follow the work on #20306.
/cc @fabpot is it the right implementation ?
Commits
-------
a10eae7d9e [BrowserKit] add a way to switch to ajax for one request
This PR was merged into the 4.0 branch.
Discussion
----------
removed version in @final @internal for version < 4.0
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
On 4.0+, I think we can removed the "since version 3.x" from `@final` and `@internal` annotations. I've kept them for things that reference version 4.x.
Commits
-------
ed27b12d2c removed version in @final @internal for version < 4.0
This PR was merged into the 4.1-dev branch.
Discussion
----------
[PropertyInfo] Added support for extracting type from constructor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
adcb25ec01 [PropertyInfo] Added support for extracting type from constructor
* 4.0:
[Bridge/Twig] fix composer.json
bug #26086 [FrameworkBundle] Fix using annotation_reader in compiler pass to inject configured cache provider
[WebProfilerBundle] Fix anchor CSS
[HttpKernel] Send new session cookie from AbstractTestSessionListener after session invalidation
[WebProfilerBundle] Tweak default route name
updated StopwatchEvent phpdoc due to the additional of optional float precision introduced in 0db8d7fb6a
Retro-fit proxy code to make it deterministic for older proxy manager implementations
[Serializer] remove unneeded php doc line
Yaml parser regression with comments and non-strings
Fixed broken tests
[TwigBridge] Apply some changes to support Bootstrap4-stable
* 3.4:
[Bridge/Twig] fix composer.json
bug #26086 [FrameworkBundle] Fix using annotation_reader in compiler pass to inject configured cache provider
[WebProfilerBundle] Fix anchor CSS
[HttpKernel] Send new session cookie from AbstractTestSessionListener after session invalidation
[WebProfilerBundle] Tweak default route name
updated StopwatchEvent phpdoc due to the additional of optional float precision introduced in 0db8d7fb6a
Retro-fit proxy code to make it deterministic for older proxy manager implementations
Yaml parser regression with comments and non-strings
Fix undiscoverablility of SymfonyTestsListenerForV7
Fixed broken tests
[TwigBridge] Apply some changes to support Bootstrap4-stable
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] Fix using annotation_reader in compiler pass to inject configured cache provider
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26086
| License | MIT
| Doc PR | -
The compilation pass of AddAnnotationsCachedReaderPass relies on already removed definition `annotations.cached_reader` due to an alias to `annotation_reader`.
Since the definition is being removed because of alias, configured annotation cache provider is not injected and will default back to ArrayCache.
This PR replaces the use of `annotations.cached_reader` to `annotation_reader` to complete the injection of configured cache provider.
Commits
-------
dfd93da bug #26086 [FrameworkBundle] Fix using annotation_reader in compiler pass to inject configured cache provider
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpKernel] Send new session cookie from AbstractTestSessionListener after session invalidation
When we call `\Symfony\Component\HttpFoundation\Session\Session::invalidate` the session will be emptied and given a new ID, however, since it is empty this `AbstractTestSessionListener` will not send a new cookie to the user, so the user is not caught up to the latest session ID and will re-generate a session with the old session ID on a new visit.
Thus, we the sessionID has changed during a request we must always send a new cookie with the new sessionID, even though the session is empty.
This behaviour is also what is shown in production (non-test) mode.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
Commits
-------
98f5d53 [HttpKernel] Send new session cookie from AbstractTestSessionListener after session invalidation
This PR was merged into the 3.4 branch.
Discussion
----------
[Stopwatch] updated phpdoc due to the addition of optional float precision
| Q | A
| ------------- | ---
| Branch? | 3.4/4.0
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/26204
| License | MIT
| Doc PR | -
Commits
-------
8278a47 updated StopwatchEvent phpdoc due to the additional of optional float precision introduced in 0db8d7fb6a
This PR was squashed before being merged into the 3.4 branch (closes#26230).
Discussion
----------
[WebProfilerBundle] Fix anchor CSS
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes/no
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
Empty source lines overlap in `/_profiler/open?file=x`. AFAIK it's a regression after #23296, but it's the first time i noticed so maybe it's related to a chrome change in between. No real CSS expert.. but this seems to fix it.
Before:
![image](https://user-images.githubusercontent.com/1047696/36377240-ba3f897a-1576-11e8-8660-8b04a6f7bd76.png)
After:
![image](https://user-images.githubusercontent.com/1047696/36377574-f99bd73a-1577-11e8-913c-d4287d5115a2.png)
I can confirm both chrome and firefox render as shown in the after screenshot. Firefox worked before as well, chrome not.
cc @ogizanagi
Commits
-------
ee45992 [WebProfilerBundle] Fix anchor CSS
* 2.7:
Clean calls to http_build_query()
[HttpFoundation] Fix missing "throw" in JsonResponse
Improve the documentation of
Suppress warning from sapi_windows_vt100_support on stream other than STDIO
removed extra-verbose comments
Fixes#26136: Avoid emitting warning in hasParameterOption()
Added a README entry to the PR template
[HttpFoundation] Add x-zip-compressed to MimeTypeExtensionGuesser.
[DI] Add null check for removeChild
This PR was merged into the 4.1-dev branch.
Discussion
----------
[Process] Allow writing portable "prepared" command lines
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #23778
| License | MIT
| Doc PR | symfony/symfony-docs#9295
This give the opportunity to create process commands that allow to changes only the values instead of changing the code.
Commits
-------
d1e4f489d1 [Process] Allow writing portable "prepared" command lines
This PR was merged into the 4.1-dev branch.
Discussion
----------
[Serializer] add a constructor arguement to return csv always as collection
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass? | yes
| Fixed tickets | #21616
| License | MIT
| Doc PR | TODO create a doc PR for the 3 ways of getting csv collection, or a single
Coding in the train again ;).
![img_9980](https://user-images.githubusercontent.com/3451634/33417042-f13063e4-d59f-11e7-8f30-143da768b1d7.JPG)
This is to be able to add a new behaviour to the csv encoder when passing the alwaysAsCollection context key, this will return a collection even if there is only one element.
Commits
-------
d19d05dc5d [Serializer] add a context key to return csv always as collection