* use legacy group when using the deprecated `hinclude_default_template`
templating config option
* conflict with DependencyInjection 4.2 in the HttpKernel component to
be able to rely on five values being retrieved from the values of the
`BoundArgument` class
* let the TwigBundle conflict with versions of FrameworkBundle that do
not ship the `url_helper` service
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] for Psr18HttpClient configuration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
No need for autowiring actually here.
Commits
-------
bf89907dce [FrameworkBundle] for Psr18HttpClient configuration
* 4.2:
[serializer] validate that the specified callbacks and max_depth_handler are actually callable
[Serializer] Respect ignored attributes in cache key of normalizer
fix resetting the COLUMN environment variable
Fix TestRunner compatibility to PhpUnit 8
Fix dark themed componnents
prevent mixup of the object to populate
This PR was squashed before being merged into the 4.3-dev branch (closes#30959).
Discussion
----------
[FrameworkBundle] [TwigBundle] Move the hinclude key away from templating
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30874 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | to do when pr is validated.
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- 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.
-->
Maybe I shouldn't move directly the config key from templating to the other, but since the templating component has been deprecated we may change this directly without deprecating that key alone, WDYT ?
Commits
-------
4f39339fec [FrameworkBundle] [TwigBundle] Move the hinclude key away from templating
This PR was squashed before being merged into the 4.3-dev branch (closes#30973).
Discussion
----------
[WebProfiler] Fix Javascript error when using custom stopwatch categories
Fixes#30745
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30745
| License | MIT
Made the getter do lazy creation so it can dynamically adapt to whatever it's given.
Commits
-------
e991472a76 [WebProfiler] Fix Javascript error when using custom stopwatch categories
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] Add Argon2idPasswordEncoder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #28093
| License | MIT
| Doc PR | TODO
Currently we have a `Argon2iPasswordEncoder` that may hash passwords using `argon2id` instead of `argon2i` (platform-dependent) which is not good.
This deprecates producing/validating `argon2id` hashed passwords using the `Argon2iPasswordEncoder`, and adds a `Argon2idPasswordEncoder` able to produce/validate `argon2id` hashed passwords only.
#EUFOSSA
Commits
-------
0c82173b24 [Security] Add Argon2idPasswordEncoder
* 4.2:
fix tests
fix PHPUnit 4.8 compatibility
[Debug] Fixed error handling when an error is already handled when another error is already handled (5)
sync validator translations
* 4.2:
fix translating file validation error message
[Validator] Add missing Hungarian translations
Improving deprecation message of the Twig templates directory src/Resources/views
[3.4] [Validator] Add missing french validation translations.
[Validator] Only traverse arrays that are cascaded into
Handle case where no translations were found
[Validator] Translate unique collection message to Hungarian
fix tests
Run test in separate process
Use a class name that does not actually exist
[Profiler] Fix dark theme elements color
fix horizontal spacing of inlined Bootstrap forms
[Translator] Warm up the translations cache in dev
turn failed file uploads into form errors
* 3.4:
fix translating file validation error message
[Validator] Add missing Hungarian translations
[3.4] [Validator] Add missing french validation translations.
[Validator] Only traverse arrays that are cascaded into
Handle case where no translations were found
[Validator] Translate unique collection message to Hungarian
fix tests
Run test in separate process
Use a class name that does not actually exist
fix horizontal spacing of inlined Bootstrap forms
[Translator] Warm up the translations cache in dev
turn failed file uploads into form errors
This PR was squashed before being merged into the 4.3-dev branch (closes#30862).
Discussion
----------
[Routing] UrlHelper to get absolute URL for a path
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | todo
I noticed that I need to generate absolute urls quite often. For example when normalizing uploads in API. I found Twig's `absolute_url()` really helpful, but obviously `Symfony\Bridge\Twig\Extension\HttpFoundationExtension` cannot be used as a normalizer's argument service.
In this PR I propose to extract `HttpFoundationExtension::generateAbsoluteUrl` and `HttpFoundationExtension::generateRelativePath` to separate interfaces which could be used on their own. Although this could be just a final class helper, I thought that we might leave a possibility for decoration here. That's why I created interfaces.
- [x] Split `HttpFoundationExtension` into two interfaces
- [x] Deprecate `HttpFoundationExtension::generateAbsoluteUrl` and `HttpFoundationExtension::generateRelativePath`
- [x] Add service definitions
- [x] Fix tests
- [ ] Add docs
Commits
-------
388d8f548c [Routing] UrlHelper to get absolute URL for a path
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] drop not needed "constant" type argument
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
#FOSSHackathons #EUFOSSA
Commits
-------
faf629386e drop not needed "constant" type argument
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] fix search in debug autowiring
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30493 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR |
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- 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.
-->
Taking #30522 and finishing it with @nicolas-grekas comments.
Is the sentence ok ?
Commits
-------
fec4beaffc fix debug:autowiringcommand
This PR was squashed before being merged into the 4.3-dev branch (closes#28937).
Discussion
----------
Improve Translator caching
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27600
| License | MIT
| Doc PR | N/A
Add DirectoryResources to MessageCatalogues when loaded.
So that when a file is added to one of the directories the cache for all MessageCatalogues will be invalidated.
All directories must be added to all MessageCatalogues because we can't predict for which locale files will be added to each individual directory.
Also, now that the translator keeps track of its own directories for caching the container no longer needs to it. This means that when a translation changes or is added the container no longer needs to be fully rebuilt, saving a considerable amount of time (compilation time went down from ~4 seconds to ~1 second on each translation change/add in our project).
Commits
-------
a5246589cf Improve Translator caching
This PR was squashed before being merged into the 4.3-dev branch (closes#30916).
Discussion
----------
[Profiler] Update ProfilerController.php
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- 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.
-->
Commits
-------
6e0785f8c5 [Profiler] Update ProfilerController.php
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Changed initial_places to initial_marking, added property
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #30662 and #30656
| License | MIT
| Doc PR | https://github.com/symfony/symfony/issues/30656
EUFOSSA
---
* [Workflow] Changed initial_places to initial_marking, added property instead of type
* [Workflow] Finished integration of initial_marking + deprecated support for workflow + single state markin store
[Workflow] Deprecate worflow and single state marking
---
Here is an exemple of deprecation:
```
3x: Passing something else than "method" has been deprecated in Symfony 4.3.
1x in PhpFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in XmlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in YamlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
3x: The "framework.workflows.workflows.legacy.marking_store.arguments" configuration key has been deprecated in Symfony 4.3. Use "property" instead.
1x in PhpFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in XmlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in YamlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
3x: The "framework.workflows.workflows.legacy.initial_place" configuration key has been deprecated in Symfony 4.3, use the "initial_marking" configuration key instead.
1x in PhpFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in XmlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
1x in YamlFrameworkExtensionTest::testWorkflowLegacy from Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection
```
Commits
-------
039353546f [Workflow] Deprecate worflow and single state marking
87839cfaf9 [Workflow] Finished integration of initial_marking + deprecated support for workflow + single state markin store
73708a61b6 [Workflow] Changed initial_places to initial_marking, added property instead of type
* 4.2: (45 commits)
[Form] various minor fixes
Ensure the parent process is always killed
bugfix: the terminal state was wrong and not reseted
[Console] Fix inconsistent result for choice questions in non-interactive mode
Define null return type for Constraint::getDefaultOption()
[Routing] Fix: annotation loader ignores method's default values
[HttpKernel] Fix DebugHandlersListener constructor docblock
Skip Glob brace test when GLOB_BRACE is unavailable
bumped Symfony version to 4.2.6
updated VERSION for 4.2.5
updated CHANGELOG for 4.2.5
bumped Symfony version to 3.4.25
updated VERSION for 3.4.24
update CONTRIBUTORS for 3.4.24
updated CHANGELOG for 3.4.24
[EventDispatcher] cleanup
fix testIgnoredAttributesInContext
Re-generate icu 64.1 data
Improve PHPdoc / IDE autocomplete for config tree builder
[Bridge][Twig] DebugCommand - fix escaping and filter
...
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Fixed DIC config when the messenger is not installed
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
EUFOSSA
---
Fix:
```
In getConsole_Command_MessengerStopWorkersService.php line 9:
Attempted to load class "StopWorkersCommand" from namespace "Symfony\Component\Messenger\Command".
Did you forget a "use" statement for another namespace?
```
Commits
-------
292021b146 [Messenger] Fixed DIC config when the messenger is not installed
This PR was merged into the 4.3-dev branch.
Discussion
----------
[HttpKernel][Framework] Locale aware services
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Added a `LocaleAwareInterface` (and also a new service tag `kernel.locale_aware`) to be implemented on services that require the current locale at request time.
Also, refactored the actual Translator service to implement the overmentioned interface
Todo :
* [ ] Documention PR (will be written after some feedback)
Commits
-------
b9ac645d8b Locale aware service registration
This PR was squashed before being merged into the 4.3-dev branch (closes#29306).
Discussion
----------
[DomCrawler] Optionally use html5-php to parse HTML
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | WIP
| Fixed tickets | https://github.com/symfony/symfony/issues/29280, https://github.com/symfony/symfony/issues/28596
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10700
This PR introduces the possibility to parse HTML content in the Crawler using the html5-php library (https://github.com/Masterminds/html5-php). This allows for better support of HTML5 and fix many unexpected behaviors and inconsistencies of the native DOM extension.
Commits
-------
4050ec4257 [DomCrawler] Optionally use html5-php to parse HTML
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] fix HttpClient integration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
HttpClient should be an optional dep.
Fixes compat of SecurityBundle 4.2 with FrameworkBundle 4.3 as spotted by the CI.
Commits
-------
3e7a47c0bf [FrameworkBundle] fix HttpClient integration
This PR was merged into the 4.3-dev branch.
Discussion
----------
[RouterDebugCommand] add link to Controllers
| Q | A
| ------------- | ---
| Branch? | master for features
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Adds a link to the controller method on your IDE from dev's terminal:
<img width="734" alt="pr-debug-router" src="https://user-images.githubusercontent.com/29813575/54141007-1f3bc400-4425-11e9-82d0-1b37498d4953.png">
Configuration in your `services.yaml`:
```yaml
parameters:
debug.file_link_format: phpstorm://open?file=%%f&line=%%l
```
Commits
-------
e9fca21d6b [RouterDebugCommand] add link to Controllers
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] Add support for "wither" methods - for greater immutable services
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10991
Let's say we want to define an immutable service while still using traits for composing its optional features. A nice way to do so without hitting [the downsides of setters](https://symfony.com/doc/current/service_container/injection_types.html#setter-injection) is to use withers. Here would be an example:
```php
class MyService
{
use LoggerAwareTrait;
}
trait LoggerAwareTrait
{
private $logger;
/**
* @required
* @return static
*/
public function withLogger(LoggerInterface $logger)
{
$new = clone $this;
$new->logger = $logger;
return $new;
}
}
$service = new MyService();
$service = $service->withLogger($logger);
```
As you can see, this nicely solves the setter issues.
BUT how do you make the service container create such a service? Right now, you need to resort to complex gymnastic using the "factory" setting - manageable for only one wither, but definitely not when more are involved and not compatible with autowiring.
So here we are: this PR allows configuring such services seamlessly.
Using explicit configuration, it adds a 3rd parameter to method calls configuration: after the method name and its parameters, you can pass `true` and done, you just declared a wither:
```yaml
services:
MyService:
calls:
- [withLogger, ['@logger'], true]
```
In XML, you could use the new `returns-clone` attribute on the `<call>` tag.
And when using autowiring, the code looks for the `@return static` annotation and turns the flag on if found.
There is only one limitation: unlike services with regular setters, services with withers cannot be part of circular loops that involve calls to wither methods (unless they're declared lazy of course).
Commits
-------
f455d1bd97 [DI] Add support for "wither" methods - for greater immutable services
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] change the way http clients are configured by leveraging ScopingHttpClient
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR allows configuring scoped HTTP clients ("scoped_clients" replaces the previous "clients" options):
```yaml
framework:
http_client:
max_host_connections: 4
default_options:
# ...
scoped_clients:
github_client:
base_uri: https://api.github.com
headers:
Authorization: token abc123
# ...
```
The base URI is turned into a scoping regular expression so that the token will be sent only when the `github_client` service is requesting the corresponding URLs.
When the base URI is too restrictive, the `scope` option can be used explicitly to define the regexp that URLs must match before any other options are applied.
~All defined scopes are passed to a new `scoping_http_client` service, that can be used to hit endpoints with authentication pre-configured for several hosts. Its named autowiring alias is `HttpClientInterface $scopingClient` (this cannot be done with `http_client` as we want safe defaults, e.g. credentials should not be used implicitly when writing webhooks/crawlers.)~
Commits
-------
f1a26b9aea [FrameworkBundle] change the way http clients are configured by leveraging ScopingHttpClient
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Form] Add file links for described classes in debug:form command
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
![debug_form_file_link](https://user-images.githubusercontent.com/2028198/55357775-d1eac980-549b-11e9-8aa8-500aee629753.png)
Commits
-------
dcba01d212 Add file links for described classes
This PR was merged into the 4.3-dev branch.
Discussion
----------
New PHPUnit assertions for the WebTestCase
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | replaces #29990
| License | MIT
| Doc PR | n/a
While reviewing #29990, and working on some tests, I realized that we could do better by adding PHPUnit constraint classes in various components that are then used in WebTextCase.
**Before**
```php
<?php
namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testSomething()
{
$client = static::createClient();
$crawler = $client->request('GET', '/test');
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('Hello World', $crawler->filter('h1')->text());
}
}
```
**After**
```php
<?php
namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testSomething()
{
$client = static::createClient();
$client->request('GET', '/test');
$this->assertResponseIsSuccessful();
$this->assertSelectorTextContains('h1', 'Hello World');
}
}
```
Commits
-------
4f91020c8d added PHPUnit assertions in various components
2f8040ee84 Create new PHPUnit assertions for the WebTestCase
This PR was merged into the 4.3-dev branch.
Discussion
----------
Changing messenger bus id from 'message_bus' to 'messenger.default_bus'
Changing messenger bus tag from 'message_bus' to 'messenger.message_bus'
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | Maybe
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30670
| License | MIT
| Doc PR |
All is in the title.
This PR change the tag of the default bus from 'message_bus' to 'messenger.message_bus'.
Commits
-------
3cee1cac12#30690 - Changing messenger bus id from 'message_bus' to 'messenger.default_bus'
This PR was squashed before being merged into the 4.3-dev branch (closes#30569).
Discussion
----------
[FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27787, symfony/symfony-docs#7988 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | none <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- 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.
-->
Create a very late controller argument value resolver to throw an intuitive error message when controller fails because it is not registered as a service.
Commits
-------
fbfc623b72 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Validator][DoctrineBridge][FWBundle] Automatic data validation
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes<!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11132
This feature automatically adds some validation constraints by inferring existing metadata. To do so, it uses the PropertyInfo component and Doctrine metadata, but it has been designed to be easily extendable.
Example:
```php
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Dummy
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
public $id;
/**
* @ORM\Column(nullable=true)
*/
public $columnNullable;
/**
* @ORM\Column(length=20)
*/
public $columnLength;
/**
* @ORM\Column(unique=true)
*/
public $columnUnique;
}
$manager = $this->managerRegistry->getManager();
$manager->getRepository(Dummy::class);
$firstOne = new Dummy();
$firstOne->columnUnique = 'unique';
$firstOne->columnLength = '0';
$manager->persist($firstOne);
$manager->flush();
$dummy = new Dummy();
$dummy->columnNullable = 1; // type mistmatch
$dummy->columnLength = '012345678901234567890'; // too long
$dummy->columnUnique = 'unique'; // not unique
$res = $this->validator->validate($dummy);
dump((string) $res);
/*
Object(App\Entity\Dummy).columnUnique:\n
This value is already used. (code 23bd9dbf-6b9b-41cd-a99e-4844bcf3077f)\n
Object(App\Entity\Dummy).columnLength:\n
This value is too long. It should have 20 characters or less. (code d94b19cc-114f-4f44-9cc4-4138e80a87b9)\n
Object(App\Entity\Dummy).id:\n
This value should not be null. (code ad32d13f-c3d4-423b-909a-857b961eb720)\n
Object(App\Entity\Dummy).columnNullable:\n
This value should be of type string. (code ba785a8c-82cb-4283-967c-3cf342181b40)\n
*/
```
It also works for DTOs:
```php
class MyDto
{
/** @var string */
public $name;
}
$dto = new MyDto();
$dto->name = 1; // type error
dump($validator->validate($dto));
/*
Object(MyDto).name:\n
This value should be of type string. (code ba785a8c-82cb-4283-967c-3cf342181b40)\n
*/
```
Supported constraints currently are:
* `@NotNull` (using PropertyInfo type extractor, so supports Doctrine metadata, getters/setters and PHPDoc)
* `@Type` (using PropertyInfo type extractor, so supports Doctrine metadata, getters/setters and PHPDoc)
* `@UniqueEntity` (using Doctrine's `unique` metadata)
* `@Length` (using Doctrine's `length` metadata)
Many users don't understand that the Doctrine mapping doesn't validate anything (it's just a hint for the schema generator). It leads to usability and security issues (that are not entirely fixed by this PR!!).
Even the ones who add constraints often omit important ones like `@Length`, or `@Type` (important when building web APIs).
This PR aims to improve things a bit, and ease the development process in RAD and when prototyping. It provides an upgrade path to use proper validation constraints.
I plan to make it opt-in, disabled by default, but enabled in the default Flex recipe. (= off by default when using components, on by default when using the full stack framework)
TODO:
* [x] Add configuration flags
* [x] Move the Doctrine-related DI logic from the extension to DoctrineBundle: doctrine/DoctrineBundle#831
* [x] Commit the tests
Commits
-------
2d64e703c2 [Validator][DoctrineBridge][FWBundle] Automatic data validation
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Messenger] Add a command to setup transports
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This PR add a `SetupTransportsCommand` that allow to setup the transports.
Actually the `AMQPTransport` is setup only if debug is enabled. With this PR the new `messenger:setup-transports` will setup all declared transports.
Commits
-------
fbb534a838 [Messenger] Add a command to setup transports
This PR was merged into the 4.3-dev branch.
Discussion
----------
Alias for each assets package
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | ? <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | <!-- required for new features -->
Add autowiring by type + name on assets packages
```yaml
framework:
assets:
packages:
xxx:
base_urls: 'xxxx'
```
```php
<?php
class MyService
{
private $xxxPackage;
public function __construct(PackageInterface $xxxPackage)
{
$this->xxxPackage = $xxxPackage;
...
}
public function myMethod(): string
{
return $this->xxxPackage->getUrl('some-image.png');
}
}
```
instead of:
```php
<?php
class MyService
{
private $packages;
public function __construct(Packages $packages)
{
$this->packages = $packages;
...
}
public function myMethod(): string
{
return $this->packages->getPackage('xxx')->getUrl('some-image.png');
}
}
```
Commits
-------
e8b9856ec3 Alias for each assets package
This PR was merged into the 4.2 branch.
Discussion
----------
[FrameworkBundle] properly describe service definitions without class
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30638
| License | MIT
| Doc PR |
Commits
-------
e5b0fd37f6 properly describe service definitions without class
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] Update Client class to KernelBrowser
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
I updated recently the WebTestCase with a check to provide a better/more clear exception message (see #30479). After that change @fabpot renamed different `Client` classes in components to a clearer name (for ex Client in HttpKernel is now KernelBrowser etc.). This PR aims to replace the Client in WebTestCase to the new name class name.
Commits
-------
28b6dd243e Replace class with new name.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] undeprecate the RoleHierarchyInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/22048#discussion_r260247046
| License | MIT
| Doc PR |
Instead of deprecating the interface it is sufficient to deprecate its
getReachableRoles() method and add a new getReachableRoleNames() method
in Symfony 5.
Commits
-------
2d3f2b7a74 undeprecate the RoleHierarchyInterface
Instead of deprecating the interface it is sufficient to deprecate its
getReachableRoles() method and add a new getReachableRoleNames() method
in Symfony 5.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Added support for many inital places
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #30080
| License | MIT
| Doc PR |
Commits
-------
1af1bf29ef Added support for many inital places
* 4.2:
[Phpunit] fixed support for PHP 5.3
Response prepare method update
[Workflow] Added missing license header
Fix case when multiple loaders are providing paths for the same namespace
Check if Client exists when test.client does not exist, to provide clearer exception message
throw TypeErrors to prepare for type hints in 5.0
[Form] Preventing validation of children if parent with Valid constraint has no validation groups
[Form] Added ResetInterface to CachingFactoryDecorator
Remove deprecated usage
[Tests] fixed compatbility of assertEquals(): void
Fixed usage of TranslatorInterface in form extension (fixes#30591)
[Intl][4.2] Fix test
[Intl] Fix test
[Validator] Add the missing translations for the Arabic (ar) locale
[Intl] Add compile binary
Fix DebugCommand when chain loader is involved
[Form] Fixed some phpdocs
* 3.4:
[Phpunit] fixed support for PHP 5.3
Response prepare method update
[Workflow] Added missing license header
Check if Client exists when test.client does not exist, to provide clearer exception message
[Form] Preventing validation of children if parent with Valid constraint has no validation groups
[Tests] fixed compatbility of assertEquals(): void
[Intl] Fix test
[Validator] Add the missing translations for the Arabic (ar) locale
[Intl] Add compile binary
[Form] Fixed some phpdocs
This PR was merged into the 4.3-dev branch.
Discussion
----------
[EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
PR green and ready. From UPGRADE files:
EventDispatcher
---------------
* The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)`, not doing so is deprecated
HttpKernel
----------
* Renamed `FilterControllerArgumentsEvent` to `ControllerArgumentsEvent`
* Renamed `FilterControllerEvent` to `ControllerEvent`
* Renamed `FilterResponseEvent` to `ResponseEvent`
* Renamed `GetResponseEvent` to `RequestEvent`
* Renamed `GetResponseForControllerResultEvent` to `ViewEvent`
* Renamed `GetResponseForExceptionEvent` to `ExceptionEvent`
* Renamed `PostResponseEvent` to `TerminateEvent`
Security
---------
* The `ListenerInterface` is deprecated, turn your listeners into callables instead.
* The `Firewall::handleRequest()` method is deprecated, use `Firewall::callListeners()` instead.
Commits
-------
75369dabb8 [EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN
This PR was squashed before being merged into the 3.4 branch (closes#30479).
Discussion
----------
Check if Client exists when test.client does not exist, to provide clearer exception message
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30420
| License | MIT
The `DotEnv` component does not overwrite by using environment variables declared in `.env` files.
In the `FrameworkExtension` will be checked if the framework.test config is set to a non-false value, if so it will load the `test.xml` file which contains the definition for the `test.client` service.
When running `php bin/phpunit` it will use `phpunit.xml.dist` but because we defined `APP_ENV` in our system it will not load `test.xml` so when creating a client to do functional tests, we'll get an exception which isn't correct: `You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit"`
This PR aims to add a clearer exception message which indicates what really should be done to fix the error message.
Commits
-------
b429950af6 Check if Client exists when test.client does not exist, to provide clearer exception message
This PR was merged into the 4.2 branch.
Discussion
----------
[Form] Added ResetInterface to CachingFactoryDecorator
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29259
| License | MIT
| Doc PR | ~
I don't know if this should be considered a feature and target master, but I tend to see it as a bug fix.
Commits
-------
4ddf5a14eb [Form] Added ResetInterface to CachingFactoryDecorator
This PR was squashed before being merged into the 4.3-dev branch (closes#30450).
Discussion
----------
[Profiler] Render the performance graph with SVG
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | Part 1, 3 and 4 of #27262
| License | MIT
| Doc PR | n/a
Following a suggestion by @ogizanagi in #27262,
Here's a proposal to render the Request Graph, from the performance profiler panel, with SVG instead of canvas.
Some benefits of the SVG format:
- The text labels are searchable and can be selected.
- It renders well on high DPI monitors.
- [Colors and text styles](https://github.com/symfony/symfony/issues/27262#issuecomment-388868068) can be defined with CSS just like the rest of the page.
In addition, SVG allow us to consider (and easily implement) interactives features such as:
- Zoom in and time navigation (thanks to the viewport).
- Highlight hovered line (or other DOM related events).
Preview:
![screenshot_2019-03-08 symfony profiler 1](https://user-images.githubusercontent.com/1846873/54036727-a33f4300-41bc-11e9-8be7-b1de10d4afd9.png)
Filtered events example:
![capture d ecran 2019-03-08 a 17 22 47](https://user-images.githubusercontent.com/1846873/54041039-00d88d00-41c7-11e9-9590-23e809415c34.png)
### Progress :
- [x] Render request events in SVG
- [x] Show labels with duration and memory
- [x] Show specific markers at start / end of lines
- [x] Re-render graph when window resize
- [x] Re-render graph when threshold change.
- [x] Generate graph legend with only existing categories (part 1. of #27262 )
- [x] Show sub-request area with hatched pattern
- [x] Allow to hide categories by clicking them on the legend (part 3. of #27262 )
- [x] Handle text overflow on long labels.
- [x] Ensure JS code is compatible with all supported browsers (used [classes](https://caniuse.com/#feat=es6-class) and [arrow functions](https://caniuse.com/#feat=arrow-functions).
- ~Add left-padding to sub-request graph?~
Commits
-------
a69a718ec9 [Profiler] Render the performance graph with SVG
This PR was squashed before being merged into the 4.3-dev branch (closes#30469).
Discussion
----------
Create a hyperlink to interfaces/classes that can be autowired
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Added hyperlink to definition of interfaces/classes that can be used for autowiring.
But I need help with:
- the aliases are becoming hyperlinks too, but shouldn't.
It's outputting `<fg=yellow;href=phpstorm://open?file=filepath&line=17>Symfony\Contracts\Translation\TranslatorInterface</> <fg=cyan>(translator.default)</>`
- it currently works with phpstorm because it's hardcoded but it should work with framework.ide option, but don't know what the best approach is to support that config option.
Commits
-------
a3dfcee406 Create a hyperlink to interfaces/classes that can be autowired
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] add ReverseContainer: a locator that turns services back to their ids
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR introduces a `ReverseContainer`, which is a class you can type hint for to get it as a service.
When you have a `ReverseContainer` at hand, you can then use it to know the service id of an object (if the object is not found, `null` is returned):
`$id = $reverseContainer->getId($someObject);`
You can also call `$reverseContainer->getService($id);` and get the service in return.
To be reversible, a service must either be public or be tagged with `container.reversible`.
I'm using this feature to serialize service references in a message, then send them through a Messenger bus, allowing the handler on the other side to use that referenced service to process the message. More specifically, my use case is sending messages for early cache expiration events through a bus and have a worker compute the soon-to-expire value in the background. The reversible services are the computation callbacks and the cache pools I need to compute the value for.
Commits
-------
ac1e4291e8 [DI] add ReverseContainer: a locator that turns services back to their ids
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
---
Just some cleaning. See
https://github.com/symfony/symfony/pull/29146#issuecomment-44418654
Commits
-------
a608797165 [Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension
This PR was merged into the 4.3-dev branch.
Discussion
----------
[BrowserKit] Rename Client to Browser
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
`Client` is very generic and used in 3 places: BrowserKit, HttpKernel, and FramewrokBundle. Each Client extends another one. So, to make things clearer, I'd like to rename Client to Browser like this:
Symfony\Component\BrowerKit\Client -> AbstractBrowser
Symfony\Component\HttpKernel\Client -> HttpKernelBrowser
Symfony\Bundle\FrameworkBundle\Client -> KernelBrowser
The next PR will introduce an `HttpBrowser` based on the new HttpClient component :)
Commits
-------
dbe4f8605b renamed Client to Browser
* 4.2: (27 commits)
cs fix
cs fix
[PHPUnit-Bridge] override some environment variables
[TwigBridge] Remove use spaceless tag
Upgrade zookeeper ext
[translation] Update defaut format from yml to yaml
Change default log level for output streams
update docblock to match the actual behavior
Don't resolve the Deprecation error handler mode until a deprecation is triggered
compatibility with phpunit8
Make 'headers' key optional for encoded messages
[Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
Fix undefined variable fromConstructor when passing context to getTypes
Added translations for chineese language.
Allow 3rd argument to be null
Remove whitespace (tab on blank line)
[Monolog] Really reset logger when calling logger::reset()
[Form] Fixes debug:form appears many times as type extensions configured with new getExtendedTypes method
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
...
* 3.4:
cs fix
cs fix
[PHPUnit-Bridge] override some environment variables
[TwigBridge] Remove use spaceless tag
[translation] Update defaut format from yml to yaml
Change default log level for output streams
update docblock to match the actual behavior
compatibility with phpunit8
[Debug][DebugClassLoader] Detect annotations before blank docblock lines on final and internal methods
Added translations for chineese language.
This PR was squashed before being merged into the 4.3-dev branch (closes#30385).
Discussion
----------
[SecurityBundle] Validate the IPs configured in access_control
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30299
| License | MIT
| Doc PR | -
Commits
-------
857ac9519e [SecurityBundle] Validate the IPs configured in access_control
This PR was squashed before being merged into the 4.3-dev branch (closes#29254).
Discussion
----------
[FrameworkBundle] Added the condition routing option to the debug router command
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- 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.
-->
This PR will add the condition routing option to debug:router command, to show if a route have conditions or not and showing this conditions.
Commits
-------
92bdc9b5f4 [FrameworkBundle] Added the condition routing option to the debug router command
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle][Routing] allow boolean container parameters for routes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30366
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/11059
This fixes https://github.com/symfony/symfony/issues/30366 and adds support for boolean container parameters in route conditions, defaults etc.
Commits
-------
21f4e38800 [FrameworkBundle][Routing] allow boolean container parameters for routes
* 4.2:
Removed non-existing parameters for LogoutUrlGenerator calls
[WebProfilerBundle] toolbar: invisible route name in Firefox
Drop spurious execution bit
[HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
[Validator] Add the missing translations for the Latvian ("lv") locale
Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
[Validator] Update Serbian translation file
* 3.4:
Removed non-existing parameters for LogoutUrlGenerator calls
[HttpKernel] Correctly merging cache directives in HttpCache/ResponseCacheStrategy
[Validator] Add the missing translations for the Latvian ("lv") locale
Fixed the DebugClassLoader compatibility with eval()'d code on Darwin
[Validator] Update Serbian translation file
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Security] deprecate the Role and SwitchUserRole classes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #20824
| License | MIT
| Doc PR | symfony/symfony-docs#11047
In #20801, we deprecated the `RoleInterface`. The next logical step would be to also deprecate the `Role` class. However, we currently have the `SwitchUserRole` class (a sub-class of `Role`) that acts as an indicator to check whether or not the authenticated user switched to another user.
This PR proposes an alternative solution to the usage of the special `SwitchUserRole` class by storing the original token inside the `UsernamePasswordToken`. This PR is not complete, but rather acts as a proof of concept of how we could get rid of the `Role` and the `SwitchUserRole` classes.
Please share your opinions whether you think this is a valid approach and I will be happy to finalise the PR.
Commits
-------
d7aaa615b9 deprecate the Role and SwitchUserRole classes
* 4.2: (26 commits)
Apply php-cs-fixer rule for array_key_exists()
[Cache] fix warming up cache.system and apcu
[Security] Change FormAuthenticator if condition
handles multi-byte characters in autocomplete
speed up tests running them without debug flag
[Translations] added missing Croatian validators
Fix getItems() performance issue with RedisCluster (php-redis)
[VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
IntegerType: reject submitted non-integer numbers
be keen to newcomers
[HttpKernel] Fix possible infinite loop of exceptions
fixed CS
[Validator] Added missing translations for Afrikaans
do not validate non-submitted form fields in PATCH requests
Update usage example in ArrayInput doc block.
[Console] Prevent ArgvInput::getFirstArgument() from returning an option value
[Validator] Fixed duplicate UUID
fixed CS
[EventDispatcher] Fix unknown priority
Avoid mutating the Finder when building the iterator
...
* 3.4: (24 commits)
Apply php-cs-fixer rule for array_key_exists()
[Security] Change FormAuthenticator if condition
handles multi-byte characters in autocomplete
speed up tests running them without debug flag
[Translations] added missing Croatian validators
Fix getItems() performance issue with RedisCluster (php-redis)
[VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning
IntegerType: reject submitted non-integer numbers
be keen to newcomers
[HttpKernel] Fix possible infinite loop of exceptions
fixed CS
[Validator] Added missing translations for Afrikaans
do not validate non-submitted form fields in PATCH requests
Update usage example in ArrayInput doc block.
[Console] Prevent ArgvInput::getFirstArgument() from returning an option value
[Validator] Fixed duplicate UUID
fixed CS
[EventDispatcher] Fix unknown priority
Avoid mutating the Finder when building the iterator
[Validator] Add the missing translations for the Greek (el) locale
...
This PR was merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle][SecurityBundle] speed up tests running them without debug flag
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
dfb924f6a9 speed up tests running them without debug flag
This PR was squashed before being merged into the 4.3-dev branch (closes#28919).
Discussion
----------
[DX][WebProfilerBundle] Add Pretty Print functionality for Request Content
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | n/a ?
## Why?
Quite often when attempting to debug issues with JSON requests sent to a Symfony API, I use the Web Profiler to check the request content. More often than not the request content isn't easily readable (99% of the time it's all stuck on a single line and impossible to read). I always find myself copying + pasting the content into a random online tool to have it "pretty-print" the JSON.
Usually this isn't an issue, but can be annoying when offline. There's also the security issue of sending entire JSON payloads to a third-party server just for formatting 😳. Alternatively, maybe developers copy+paste into their chosen editors and this PR is all a waste of time — I hope not 😛.
## How?
This PR adds "Pretty-Print" JSON functionality straight into the profiler.
We can use `collector.requestheaders` to detect if the request was JSON and conditionally show the Pretty Print button.
When the button is clicked, we format the JSON from the "Request Content" card.
## What does it look like?
Before:
![without-pretty-print](https://user-images.githubusercontent.com/573318/47180751-36b0ce00-d319-11e8-86ed-eb0d78ebcbe3.png)
After:
![pretty](https://user-images.githubusercontent.com/573318/47180763-3c0e1880-d319-11e8-995d-eba565aad827.png)
Non-JSON Requests (unchanged):
![non-json-request](https://user-images.githubusercontent.com/573318/47181080-03227380-d31a-11e8-8cf2-e8b2e8c1a21d.png)
## Things to consider
- Is `JSON.stringify(JSON.parse(content));` the safest, most efficient way to do this?
- Should the "Pretty Print" button be in-line next to the "Request Content" header? I couldn't find a pattern for this sort of thing elsewhere in the profiler.
- Do people want JSON formatted with 4 spaces, would 2 spaces be preferred? Should this be a configuration option stored in localStorage (such as the light/dark theme configuration)?
- Should this be a toggle? E.g. click to pretty print, then click to undo
## Future Improvements
Depending on how this is received it could be extended to support formatting different request content-types (e.g. XML formatting) — I assume.
## Progress
- [x] Gather feedback and decide where to perform the pretty-print: [server-side, or client-side](https://github.com/symfony/symfony/pull/28919#issuecomment-431508361).
*It was decided server-side would be better.*
Commits
-------
9f85103151 [DX][WebProfilerBundle] Add Pretty Print functionality for Request Content
This PR was squashed before being merged into the 4.3-dev branch (closes#29865).
Discussion
----------
[Console] Added suggestions for missing packages
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Currently, when someone runs one of the most common commands, e.g. `server:run`, but does not have a required package installed, they will get a general **'There are no commands defined...'** message.
This commit adds a more useful message, informing the user about a package that might be missing and suggesting a command that should be run in order to install it, e.g. `composer require symfony/web-server-bundle --dev`.
Commits
-------
423a54f46e [Console] Added suggestions for missing packages
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Routing] deprecate some router options
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://github.com/symfony/symfony/pull/28865#issuecomment-463480970
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
- 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.
-->
Commits
-------
bf4cd6164d [Routing] deprecate some router options
* 4.2:
[Console] Fix command testing with missing inputs
[Validator] Sync no/nb translation files
[Translation] Added a script to display the status of translations
[Validator] Added missing translations for Norwegian (\"no\") locale #30179
[Security\Guard] bump lowest version of security-core
[TwigBridge] Fix test
Remove unnecessary ProgressBar stdout writes (fixes flickering)
[Validator] improve translations for albanian ("sq") locale
[VarDumper] fix serializing Stub instances
[Validator] Added missing use statement for UnexpectedTypeException
Don't resolve the Deprecation error handler mode until a deprecation is triggered
bug #30245 fix lost namespace in eval (fizzka)
fix lost namespace in eval
[Twig] removed usage of non-namespaced classes
added missing dot
Update validators.lt.xlf
#30172 Add the missing validation translations for the Luxembourgish …
[Debug][ErrorHandler] Preserve next error handler
This PR was squashed before being merged into the 4.2 branch (closes#30245).
Discussion
----------
fix lost namespace in eval
Bugfix:
phpunit8 tearDown() declaration
Commits
-------
8743a1ada8 fix lost namespace in eval
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle][Translation] Added support for PHP files with trans() in translation commands
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29085
| License | MIT
| Doc PR | -
This PR allows translation commands be able to debug and update translation messages from any PHP file/class defined as service, injecting or wiring the `translator` service, e.g.:
```php
use Symfony\Component\Translation\TranslatorInterface;
class ParallelUniverseController extends AbstractController
{
public function hello(Request $request, TranslatorInterface $translator)
{
// this id 'hello_message' will be extracted from translation:update
$message = $translator->trans('hello_message');
// send message to space...
}
}
```
this supports all ways of wiring (auto or not): via constructor, public property, method calls, service subscriber and controller argument.
Commits
-------
9f9b828832 Added support for PHP files with translation in translation commands
This PR was squashed before being merged into the 4.2 branch (closes#30245).
Discussion
----------
fix lost namespace in eval
Bugfix:
phpunit8 tearDown() declaration
Commits
-------
8743a1ada8 fix lost namespace in eval
* 4.2:
allow to skip tests based on the supported version
Update validators.bg.xlf
Update validators.ca.xlf
fixed CS
Updated validators.eu.xlf with missing translations
fixed typo
backported a translation
[Validator] added missing translation for UK validator
Validator: add the Persian translations
Update validators.sq.xlf
fixed CS
forward valid numeric values to transform()
add constraint validators before optimizations
* 3.4:
allow to skip tests based on the supported version
Update validators.bg.xlf
Update validators.ca.xlf
fixed CS
Updated validators.eu.xlf with missing translations
fixed typo
backported a translation
[Validator] added missing translation for UK validator
Validator: add the Persian translations
Update validators.sq.xlf
fixed CS
forward valid numeric values to transform()
add constraint validators before optimizations
Writing tests for Form related features in the Doctrine and Twig bridges
as well as the FrameworkBundle is a pain as soon as these tests are run
with more recent versions of the Form component. This is due to the fact
that our tests in the bridges and bundle extend test cases from the
component. The tests in the component are expanded with every feature
that gets added there. However, these new features are not present in
the other packages in older version and we thus need to be able to skip
them somehow.
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle][Translation] Add support for Translator paths, Twig paths and Translator aware services paths in commands
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29085, #29633, #17739
| License | MIT
| Doc PR | TODO
Add custom (also common) Twig and Translation paths to the translation commands:
* Custom directories configured in `twig.paths`.
* Custom directories configured in `translator.paths`
* The `Resources/translations/` directory of `Validation` component (if installed).
* The `Resources/translations/` directory of `Form` component (if installed).
* The `Resources/translations/` directory of Security Core component (if installed).
Commits
-------
31d7a09bf5 Add support for translator paths and twig paths in translation commands
This PR was squashed before being merged into the 4.3-dev branch (closes#28635).
Discussion
----------
[Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes. Travis-ci isn't green because it tests the components separately. Fabbot.io requires license headers in files where they were not present before.
| Fixed tickets | #27698
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10065
Hi, this is an alternative to #27775.
`translation_parameters` is separated to `label_translation_parameters`, `help_translation_parameters`, `attr_translation_parameters`.
Commits
-------
b3f3c5361f [Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type
* 4.2: (25 commits)
Add missing ID_id validators translation
fixed CS
Added missing translations in validators.tr.xlf
Update validators.es.xlf
Update validators.hu.xlf
[Validator] Add the missing translations for the Welsh (cy) locale
[Validator] Add missing DE validator translations
[Validator] Add the missing translations for the Dutch (nl) locale
Add missing PL translation
Add missing translations.
Add missing translations for IT to Validator
minor #30184 [Validator] Add the missing translations for the Russian (ru) locale (antonch1989)
[Validator] Add the missing translations for the Arabic (ar) locale
add_missing_translations_for_portuguese : [Validator] Add the missing translations for the Portuguese ("pt") locale
[Validator] Add the missing translations for the French (fr) locale
[Validator] Add some missing contents to the English translation
use PropertyAccessorInterface instead of PropertyAccessor
Fix KernelTestCase compatibility for PhpUnit 8 (bis)
add xabbuh as code owner of the Form component
[Validator] Added a missing translation
...
* 3.4: (25 commits)
Add missing ID_id validators translation
fixed CS
Added missing translations in validators.tr.xlf
Update validators.es.xlf
Update validators.hu.xlf
[Validator] Add the missing translations for the Welsh (cy) locale
[Validator] Add missing DE validator translations
[Validator] Add the missing translations for the Dutch (nl) locale
Add missing PL translation
Add missing translations.
Add missing translations for IT to Validator
minor #30184 [Validator] Add the missing translations for the Russian (ru) locale (antonch1989)
[Validator] Add the missing translations for the Arabic (ar) locale
add_missing_translations_for_portuguese : [Validator] Add the missing translations for the Portuguese ("pt") locale
[Validator] Add the missing translations for the French (fr) locale
[Validator] Add some missing contents to the English translation
use PropertyAccessorInterface instead of PropertyAccessor
Fix KernelTestCase compatibility for PhpUnit 8 (bis)
add xabbuh as code owner of the Form component
[Validator] Added a missing translation
...
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] consolidate the mime types service definition
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I wonder if we couldn't simplify things by just initializing the default `MimeTypes` instance once the first one is going to be created.
Commits
-------
ce546f5e5b consolidate the mime types service definition
This PR was squashed before being merged into the 4.3-dev branch (closes#30111).
Discussion
----------
[SecurityBundle] Deprecate the normalization of the cookie names
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This is an alternative solution to #24018 providing a BC layer until Symfony 5.0.
Commits
-------
36c5df4589 [SecurityBundle] Deprecate the normalization of the cookie names
* 4.2:
New extensions were released supporting PHP 7.3
Remove "internal" annotation from datacollector serialization methods
replace mocks with real objects in tests
[DependencyInjection] fix#29930 add $lazyLoad flag to the generated factory code for lazy non-shared services
escape function does not always take a string
Fix phpunit 8 compatibility
render integer types with grouping as text input
ignore _method forms in NativeRequestHandler
don't lose int precision with not needed type casts
* 3.4:
Remove "internal" annotation from datacollector serialization methods
replace mocks with real objects in tests
Fix phpunit 8 compatibility
render integer types with grouping as text input
ignore _method forms in NativeRequestHandler
don't lose int precision with not needed type casts
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29830
| License | MIT
| Doc PR | n/a
this a fix for the issue #29830
After deliberation, we estimate that only `sid_length` and` sid_bits_per_character` session options should be exposed. These options à optional.
For others, we recommend changing your php.ini file
We can now configure the session like this :
```yaml
framwork:
session:
sid_length: 64 //optional, recommended value is 32
sid_bits_per_character: 6 //optional, recommended value is 5
```
This PR was merged into the 3.4 branch.
Discussion
----------
Fix KernelTestCase compatibility for PhpUnit 8
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? |no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30071
| License | MIT
| Doc PR |
As the PhpUnit 8 Testcase has different return types as PhpUnit 7 there need to be 2 different classes to support both PhpUnit 8 and PhpUnit 7. With a class alias we can then change which version is used based on the PhpUnit Version constant. The fix is a little bit hacky but to support different major versions I see no other way.
Not sure as we can't upgrade symfony/symfony to PhpUnit 8 how we can create a TestCase for this change.
Commits
-------
83a56a0cbe Fix phpunit 8 compatibility
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DependencyInjection] Added information about deprecated aliases in debug:autowiring
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | n/a
Fix and improves a bit PR #29968 and #29995
![Screenshot](https://i.imgur.com/GDj2NIY.png)
Commits
-------
3d2378dab5 [DependencyInjection] Added information about deprecated aliases in debug:autowiring
* 4.2:
fix merge
[FrameworkBundle] fix xsd
[FrameworkBundle] update xsd to match the 4.2 configuration
[FrameworkBundle] Update the xsd to match the actual session configuration
[Form] CsrfValidationListener marks the token as invalid if it is not a string
[Routing] fix perf issue when dumping large number of routes
Fix wrong value in file id attribute for Xliff 2.0
[VarDumper] Fixed phpDoc
[PhpUnitBridge] fix PHP 5.3 compat
[Messenger] Fix DataCollector template
[Filesystem] Fixed some docblocks and typos
bumped Symfony version to 4.2.4
updated VERSION for 4.2.3
updated CHANGELOG for 4.2.3
bumped Symfony version to 3.4.23
updated VERSION for 3.4.22
update CONTRIBUTORS for 3.4.22
updated CHANGELOG for 3.4.22
fix some minor typos
do not overwrite the constraint being evaluated
* 3.4:
[FrameworkBundle] Update the xsd to match the actual session configuration
[Form] CsrfValidationListener marks the token as invalid if it is not a string
[VarDumper] Fixed phpDoc
[PhpUnitBridge] fix PHP 5.3 compat
[Filesystem] Fixed some docblocks and typos
bumped Symfony version to 3.4.23
updated VERSION for 3.4.22
update CONTRIBUTORS for 3.4.22
updated CHANGELOG for 3.4.22
fix some minor typos
do not overwrite the constraint being evaluated
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Update the FrameworkBundle xsd to match the actual session configuration
* 4.2:
Add missing `@internal` annotations
Disable Twig in the profiler menu when Twig is not used
Mark some/most implementations of Serializable as `@internal`
[Config] ensure moving away from Serializable wont break cache:clear
[VarDumper] dont implement Serializable in Stub
[Config] fix compat with wrapping autoloaders
[Messenger] fixed RabbitMQ arguments not passed as integer values
* 3.4:
Add missing `@internal` annotations
Disable Twig in the profiler menu when Twig is not used
Mark some/most implementations of Serializable as `@internal`
[Config] ensure moving away from Serializable wont break cache:clear
[VarDumper] dont implement Serializable in Stub
[Config] fix compat with wrapping autoloaders
* 4.2:
[Routing] dont redirect routes with greedy trailing vars with no explicit slash
skip native serialize among child and parent serializable objects
[Routing] backport tests from 4.1
[MonologBridge] Remove unused local variable
Remove unreachable code
Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
Support use of hyphen in asset package name
Fix format strings for deprecation notices
Remove a harmless duplicate array key from VarDumper
[VarDumper] Fixed search bar
Remove gendered pronouns
Replace gender by eye color in tests
[Security] dont do nested calls to serialize()
* 4.1:
[Routing] dont redirect routes with greedy trailing vars with no explicit slash
skip native serialize among child and parent serializable objects
[Routing] backport tests from 4.1
[MonologBridge] Remove unused local variable
Remove unreachable code
Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
Support use of hyphen in asset package name
Remove gendered pronouns
Replace gender by eye color in tests
[Security] dont do nested calls to serialize()
* 3.4:
skip native serialize among child and parent serializable objects
[Routing] backport tests from 4.1
Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR
Support use of hyphen in asset package name
Remove gendered pronouns
Replace gender by eye color in tests
[Security] dont do nested calls to serialize()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes (Manual tests only)
| Fixed tickets | #28122
| License | MIT
| Doc PR | n/a
According to issue https://github.com/symfony/symfony-docs/pull/10442, we tested in a demo bundle, for example in src/AppBundle/Resources/config/config.yml a package using hyphens: app-client-frontend, and withouth the patch it fails because the package is not recognized. With the patch, it works as expected.
```
framework:
assets:
packages:
app-client-frontend:
version: "%env(FRONTEND_VERSION)%"
version_format: '%%2$s/dist/%%1$s'
base_urls:
- "%env(FRONTEND_URL)%"
```
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Mime] move add mime type guesser pass to the component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
ba20bb2e7e move add mime type guesser pass to the component
This PR was merged into the 4.3-dev branch.
Discussion
----------
[Routing] allow using compiled matchers and generators without dumping PHP code
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #29590
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10790
This is a resurrection of #25909 to make matcher+generator dumpers output PHP arrays instead of PHP code.
Don't be fooled by the diff stats, it's mostly fixtures.
This PR should contribute to making the Routing component easier to use standalone.
On the way back from SFLive USA.
![image](https://user-images.githubusercontent.com/243674/46920076-784e1b80-cf9d-11e8-86e7-850fffb409de.png)
Commits
-------
f0a519ac7d [Routing] allow using compiled matchers and generators without dumping PHP code
This PR was merged into the 4.3-dev branch.
Discussion
----------
introducing native php serialize() support for Messenger transport
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes and no
| New feature? | yes and no
| BC breaks? | maybe (yes if we change the default)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29163
| License | MIT
| Doc PR | TODO!
Messenger currently uses the Serialize to serialize to JSON and then unserialize. This creates a lot of issues:
1) The default serializer requires you to have getter & setter method (or public properties) for them to be serialized. This makes it easy for data to disappear. I've seen several really smart people have this problem.
2) Related to the above, the forced getters/setters (and no required constructor args) force you to design your message classes around this.
It's not that the serializer is doing a bad job - it's just not the right use-case for it.
This PR proposes simply using `serialize()` and `unserialize()`. This is the behavior we want: we want to put objects to sleep and wake them back up.
I believe the original reason we did not do this was so that we could export "generic JSON", in case we wanted other workers (not our Symfony app) to consume the messages. But, that's an edge case, and could still be accomplished by creating your own serializer.
Btw, Laravel uses `serialize()` as does Enqueue for (un)serializing Event objects. We're making our life more difficult for no benefit.
Cheers!
Commits
-------
97e2e32af4 Changing default serializer in Messenger component to PhpSerializer
3111cef9a4 Update src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.xml
4132bfebe7 updating CHANGELOGs and fixing tests
b4788e4808 introducing native php serialize() support for Messenger transport
* 4.2:
[HttpFoundation] Check file exists before unlink
[Console] Fixed#29835: ConfirmationQuestion with default true for answer '0'
[Cache] PDO-based cache pool table autocreation does not work
[Translation] Concatenated translation messages
[Form] ensure compatibility with older PHPUnit mocks
[Serializer] Docblock about throwing exceptions on serializer
[Cache] fix used variable name
[Debug][ErrorHandler] Preserve our error handler when a logger set another one
[Form] Changed UrlType input type to text when default_protocol is not null
[Bugfix] MemcachedSessionHandler::close() must close connection
Always pass $key to NullAdapter->createCacheItem
* 4.1:
[HttpFoundation] Check file exists before unlink
[Console] Fixed#29835: ConfirmationQuestion with default true for answer '0'
[Translation] Concatenated translation messages
[Form] ensure compatibility with older PHPUnit mocks
[Serializer] Docblock about throwing exceptions on serializer
[Debug][ErrorHandler] Preserve our error handler when a logger set another one
[Form] Changed UrlType input type to text when default_protocol is not null
[Bugfix] MemcachedSessionHandler::close() must close connection
* 3.4:
[HttpFoundation] Check file exists before unlink
[Console] Fixed#29835: ConfirmationQuestion with default true for answer '0'
[Translation] Concatenated translation messages
[Form] ensure compatibility with older PHPUnit mocks
[Serializer] Docblock about throwing exceptions on serializer
[Debug][ErrorHandler] Preserve our error handler when a logger set another one
[Form] Changed UrlType input type to text when default_protocol is not null
[Bugfix] MemcachedSessionHandler::close() must close connection
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] Changed UrlType input type to text when default_protocol is not null
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29690
| License | MIT
| Doc PR |
replaces #29691
Commits
-------
2791edf1fb [Form] Changed UrlType input type to text when default_protocol is not null
* 4.2:
Bump phpunit bridge cache id
[appveyor] fix create-project phpunit
Fix HttpKernel Debug requirement
Fix heredoc
use final annotation to allow mocking the class
synchronise the form builder docblock
Grammar fix in exception message
fix tests
forward the parse error to the calling code
Avoid dots in generated class names.
[Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends
ensure compatibility with older PHPUnit mocks
[Security] Do not mix usage of password_*() functions and sodium_*() ones
* 4.1:
Bump phpunit bridge cache id
[appveyor] fix create-project phpunit
Fix HttpKernel Debug requirement
Fix heredoc
use final annotation to allow mocking the class
synchronise the form builder docblock
Grammar fix in exception message
fix tests
forward the parse error to the calling code
[Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends
ensure compatibility with older PHPUnit mocks
[Security] Do not mix usage of password_*() functions and sodium_*() ones
* 3.4:
Bump phpunit bridge cache id
[appveyor] fix create-project phpunit
Fix HttpKernel Debug requirement
Fix heredoc
use final annotation to allow mocking the class
synchronise the form builder docblock
Grammar fix in exception message
fix tests
forward the parse error to the calling code
[Debug][DebugClassLoader] Match more cases for final, deprecated and internal classes / methods extends
ensure compatibility with older PHPUnit mocks
[Security] Do not mix usage of password_*() functions and sodium_*() ones
* 3.4:
fixed CS
fixed short array CS in comments
fixed CS in ExpressionLanguage fixtures
fixed CS in generated files
fixed CS on generated container files
fixed CS on Form PHP templates
fixed CS on YAML fixtures
fixed fixtures
switched array() to []
This PR was squashed before being merged into the 4.3-dev branch (closes#29813).
Discussion
----------
[FrameworkBundle] Remove ControllerTrait::isFormValid()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/24576#issuecomment-452220557
| License | MIT
| Doc PR |
**edit**: During the first draft I made, I did not use the request stack. I finally used it to mimic other shortcut! It was a bad idea. Now there is less code, it's simpler. Love it more
Commits
-------
2be1987ad1 [FrameworkBundle] Remove ControllerTrait::isFormValid()
This PR was squashed before being merged into the 4.1 branch (closes#29745).
Discussion
----------
SCA: minor code tweaks
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Eliminated a few excessive calls, tweaked query parameters sorting
Commits
-------
8887f76b64 SCA: minor code tweaks
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] pass project dir into the assets install command
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/29708#discussion_r244287106
| License | MIT
| Doc PR |
Commits
-------
b373d4206b pass project dir into the assets install command
* 4.2:
properly fix tests on PHP 5
fix tests on PHP 5
remove doubled dot from exception message
bug #29697 [DI] Fixed wrong factory method in exception (Wojciech Gorczyca)
[Intl] make type-hinted arguments nullable
[DI] Fixed wrong factory method in exception
Changed gender choice types to color
Fix unnecessary use
remove no longer needed PHP version checks
remove no longer needed PHP version checks
Fixed groupBy argument value in DefaultChoiceListFactoryTest
[HttpKernel] Correctly Render Signed URIs Containing Fragments
[HttpFoundation] Fix request uri when it starts with double slashes
* 4.1:
properly fix tests on PHP 5
fix tests on PHP 5
remove doubled dot from exception message
bug #29697 [DI] Fixed wrong factory method in exception (Wojciech Gorczyca)
[Intl] make type-hinted arguments nullable
[DI] Fixed wrong factory method in exception
Changed gender choice types to color
remove no longer needed PHP version checks
remove no longer needed PHP version checks
Fixed groupBy argument value in DefaultChoiceListFactoryTest
[HttpKernel] Correctly Render Signed URIs Containing Fragments
[HttpFoundation] Fix request uri when it starts with double slashes
* 4.2:
update years in license files
Fix: Adjust DocBlock
\"ParserTest->getParserTestData()\" -> only some more tests
access the container getting it from the kernel
Replace slave and master by replica and primary
Fix erasing cookies issue
[Lock] Pedantic improvements for lock
[EventDispatcher] Fixed phpdoc on interface
update year in license files
[VarExporter] fix exporting array indexes
[SecurityBundle] Fix traceable voters
[Console] Fix help text for single command applications
Fix random test failure on lock
improve error message when using test client without the BrowserKit component
Fixed minor typos in an error message
[Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
Fixed minor typos
Fix: Method can also return null
[Stopwatch] Fixed phpdoc for category name
* 4.1:
Fix: Adjust DocBlock
\"ParserTest->getParserTestData()\" -> only some more tests
access the container getting it from the kernel
[Lock] Pedantic improvements for lock
[EventDispatcher] Fixed phpdoc on interface
update year in license files
[Console] Fix help text for single command applications
Fix random test failure on lock
improve error message when using test client without the BrowserKit component
[Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
Fixed minor typos
Fix: Method can also return null
[Stopwatch] Fixed phpdoc for category name
* 3.4:
Fix: Adjust DocBlock
\"ParserTest->getParserTestData()\" -> only some more tests
[Lock] Pedantic improvements for lock
[EventDispatcher] Fixed phpdoc on interface
update year in license files
[Console] Fix help text for single command applications
Fix random test failure on lock
improve error message when using test client without the BrowserKit component
[Event Dispatcher] fixed 29703: TraceableEventDispatcher reset now sets callStack to null with test to dispatch after reset.
Fixed minor typos
Fix: Method can also return null
[Stopwatch] Fixed phpdoc for category name
This PR was merged into the 3.4 branch.
Discussion
----------
update year in license files
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Happy new year to each and everyone from the Symfony community. 🎉
Commits
-------
6c895b9757 update year in license files
* 4.2:
[Twig] Remove spaces to fix whitespace in tags
[Twig] Replace for-loops with blocks for attributes
fixed CS
[Tests] Change to willThrowException
[Console] fix PHPDoc in Command
Update FileLoaderLoadException.php
Fix wrong calls to clearstatcache
Add Vietnamese translation for validators
Allow running PHPUnit with "xdebug.scream" ON
[VarDumper] Add descriptors tests
[Cache] fix bad optim
[Yaml] detect circular references
[DI] fix reporting bindings on overriden services as unused
[Routing] minor fix or previous PR
* 4.2:
[FrameworkBundle] decouple debug:autowiring from phpdocumentor/reflection-docblock
Fix env fallback to an unresolved variable
[DI] map snake-case ids of service subscribers to camel-case autowiring aliases
* 4.2:
[Routing] fix trailing slash redirections involving a trailing var
[EventDispatcher] Revers event tracing order
[Security] Prefer clone over unserialize(serialize()) for user refreshment
[Console] OutputFormatter: move strtolower to createStyleFromString
Adjust tests to work in the armhf architecture. Fixes#29281.
Vietnamese translations improvement
[Form] Fixed FormErrorIterator class phpdoc
Renamed test controller from Controller to TestController so it doesn't show up in the IDE autocomplete.
Don't use he in docs when its not needed
EventSubscriberInterface isn't a man
Fix undefined variable in cache ArrayTrait
fixed public directory of web server and assets install when configured in composer.json
* 4.1:
[Routing] fix trailing slash redirections involving a trailing var
[EventDispatcher] Revers event tracing order
[Security] Prefer clone over unserialize(serialize()) for user refreshment
[Console] OutputFormatter: move strtolower to createStyleFromString
Adjust tests to work in the armhf architecture. Fixes#29281.
Vietnamese translations improvement
[Form] Fixed FormErrorIterator class phpdoc
Renamed test controller from Controller to TestController so it doesn't show up in the IDE autocomplete.
Don't use he in docs when its not needed
EventSubscriberInterface isn't a man
fixed public directory of web server and assets install when configured in composer.json
* 3.4:
[EventDispatcher] Revers event tracing order
[Security] Prefer clone over unserialize(serialize()) for user refreshment
[Console] OutputFormatter: move strtolower to createStyleFromString
Adjust tests to work in the armhf architecture. Fixes#29281.
Vietnamese translations improvement
[Form] Fixed FormErrorIterator class phpdoc
Renamed test controller from Controller to TestController so it doesn't show up in the IDE autocomplete.
Don't use he in docs when its not needed
EventSubscriberInterface isn't a man
fixed public directory of web server and assets install when configured in composer.json
This PR was merged into the 3.4 branch.
Discussion
----------
Fixed public directory when configured in composer.json
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
As documented you should be able to change the public-dir by composer.json so the server:run and assets:install should also use that configuration when available:
https://symfony.com/doc/3.4/configuration/override_dir_structure.html#override-the-web-directoryhttps://symfony.com/doc/current/configuration/override_dir_structure.html#override-the-public-directory
#SymfonyConHackDay2018
Commits
-------
c45062b71a fixed public directory of web server and assets install when configured in composer.json
* 4.2: (27 commits)
[VarExporter] dont call userland code with uninitialized objects
Fix typos in doc blocks
[Debug] ignore underscore vs backslash namespaces in DebugClassLoader
[TwigBridge][Form] Prevent multiple rendering of form collection prototypes
[FrameworkBundle] fix describing routes with no controllers
[DI] move RegisterServiceSubscribersPass before DecoratorServicePass
Update ValidationListener.php
[Yaml] ensures that the mb_internal_encoding is reset to its initial value
[Messenger] Restore message handlers laziness
[WebLink] Fixed documentation link
[Security] getTargetPath of TargetPathTrait must return string or null
[Hackday][Serializer] Deserialization ignores argument type hint from phpdoc for array in constructor argument
Optimize perf by replacing call_user_func with dynamic vars
[Cache] Fix dsn parsing
[Routing] fix dumping same-path routes with placeholders
[WebProfilerBundle][TwigBundle] CSS fixes
Add a docblock for FormFactoryInterface
[Security] defer log message in guard authenticator
[Validator] Added IBAN format for Vatican City State
merge conflicts
...
* 4.1:
Fix typos in doc blocks
[Debug] ignore underscore vs backslash namespaces in DebugClassLoader
[TwigBridge][Form] Prevent multiple rendering of form collection prototypes
[FrameworkBundle] fix describing routes with no controllers
[DI] move RegisterServiceSubscribersPass before DecoratorServicePass
Update ValidationListener.php
[Yaml] ensures that the mb_internal_encoding is reset to its initial value
[WebLink] Fixed documentation link
[Security] getTargetPath of TargetPathTrait must return string or null
[Hackday][Serializer] Deserialization ignores argument type hint from phpdoc for array in constructor argument
Optimize perf by replacing call_user_func with dynamic vars
[Routing] fix dumping same-path routes with placeholders
[Security] defer log message in guard authenticator
[Validator] Added IBAN format for Vatican City State
merge conflicts
filter out invalid Intl values
filter out invalid language values
[Validator] Fixed grouped composite constraints
[Form] Filter arrays out of scalar form types
Fix HeaderBag::get phpdoc
* 3.4:
[Debug] ignore underscore vs backslash namespaces in DebugClassLoader
[TwigBridge][Form] Prevent multiple rendering of form collection prototypes
[FrameworkBundle] fix describing routes with no controllers
[DI] move RegisterServiceSubscribersPass before DecoratorServicePass
Update ValidationListener.php
[Yaml] ensures that the mb_internal_encoding is reset to its initial value
[WebLink] Fixed documentation link
[Security] getTargetPath of TargetPathTrait must return string or null
[Hackday][Serializer] Deserialization ignores argument type hint from phpdoc for array in constructor argument
[Security] defer log message in guard authenticator
merge conflicts
Fix HeaderBag::get phpdoc
This PR was merged into the 4.3-dev branch.
Discussion
----------
[DI] compute autowiring error messages lazily
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29019
| License | MIT
| Doc PR | -
As suggested in the linked issue:
> the error message may ultimately be "hidden" because the definition in question is removed... and so we're doing work unnecessarily.
Commits
-------
3b3a1bd3cc [DI] compute autowiring error messages lazily
This PR was merged into the 4.3-dev branch.
Discussion
----------
[VarDumper] add support for links in CliDumper
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Same as #29168 for VarDumper:
![capture d ecran de 2018-11-15 20-10-08](https://user-images.githubusercontent.com/243674/48576196-24c04c00-e914-11e8-8a61-c1304c876243.png)
Thanks @ostrolucky for this nice discovery!
Commits
-------
e7cd44f5b2 [VarDumper] add support for links in CliDumper
This PR was merged into the 4.2 branch.
Discussion
----------
[FrameworkBundle][Controller] Use interface from Contracts to remove deprecation arnings
| Q | A
| ------------- | ---
| Branch? | 4.2?
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | I don't think so <!-- see https://symfony.com/bc -->
| Deprecations? | no - removing some :) <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | n/a
When we installed 4.2, we hit issues in our qa tools with [vimeo/psalm](https://github.com/vimeo/psalm) reporting that all of our controllers were implementing a deprecated interface (by extending the AbstractController).
This pr simply updates the AbstractController to use the interface provided in `symfony/contracts`
I'm not sure if there was any other reason for not including this in the 4.2 release (bc?), so apologies if I've overstepped this.
Commits
-------
f10227df3d [FrameworkBundle][Controller] Use interface from Contracts to remove deprecation warnings
* 4.2:
[TwigBridge] Deprecating legacy Twig paths in DebugCommand and simplifications
[Cache] Fixed Memcached adapter doClear()to call flush()
Fixes sprintf(): Too few arguments in Translator
fix TransChoiceTokenParser deprecation message
[DoctrineBridge] Conflict with Messenger <4.2
[Contracts] extract LocaleAwareInterface out of TranslatorInterface
* 4.2:
[VarExporter] fix dumping private properties from abstract classes
Fix empty output for debug:autowiring when reflection-docblock is not available
[Workflow] Fixed BC break for Workflow metadata
[Routing] ignore trailing slash for non-GET requests
* 4.2:
[Serializer] fixed DateTimeNormalizer to maintain microseconds when a different timezone required
[Routing] fix taking verb into account when redirecting
[TwigBundle] Sync tab navigation css
[WebProfilerBundle] Fix log filter in dark mode
[WebProfilerBundle][4.2] Deny messenger <4.2
[DI] Fix dumping expressions accessing single-use private services
[VarExporter] fix dumping protected property from abstract classes
[WebProfilerBundle] Split form field heading
Minor tweak for c3ad8a5
* 4.1:
[Serializer] fixed DateTimeNormalizer to maintain microseconds when a different timezone required
[Routing] fix taking verb into account when redirecting
[DI] Fix dumping expressions accessing single-use private services
[WebProfilerBundle] Split form field heading
* 3.4:
[Serializer] fixed DateTimeNormalizer to maintain microseconds when a different timezone required
[Routing] fix taking verb into account when redirecting
[WebProfilerBundle] Split form field heading
* 4.2:
fix cs
[FrameworkBundle] define doctrine as default_pdo_provider only if the package is installed
[Validator] Allow `ConstraintViolation::__toString()` to expose codes that are not null or emtpy strings
Added upgrade to HandlersLocator
fix type for $value in DocBlock
[WebProfilerBundle] Fix title case
[Config] fix path exclusion during glob discovery
[FrameworkBundle][Messenger] Restore check for messenger serializer default id
Fix wrapped loop of event listener
[DI] fix edge case in InlineServiceDefinitionsPass
undeprecate the single-colon notation for controllers
Update HttpKernel.php
* 4.1:
fix cs
[Validator] Allow `ConstraintViolation::__toString()` to expose codes that are not null or emtpy strings
fix type for $value in DocBlock
[WebProfilerBundle] Fix title case
Fix wrapped loop of event listener
[DI] fix edge case in InlineServiceDefinitionsPass
undeprecate the single-colon notation for controllers
Update HttpKernel.php
This PR was merged into the 4.1 branch.
Discussion
----------
undeprecate the single-colon notation for controllers
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
This is the same as https://github.com/symfony/symfony/pull/29218 but for `Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader`.
Commits
-------
09371ad6f1 undeprecate the single-colon notation for controllers
* 4.1: (23 commits)
[Routing] fix trailing slash redirection when using RedirectableUrlMatcher
[PropertyAccessor] fix encoding of cache keys
[WebProfiler] Detect empty file paths in file viewer
fixed CS
Changes for upcoming Travis' infra migration
Doc fix: clarify isMethodCacheable() returns true only for GET & HEAD
[MonologBridge] Return empty list for unknonwn requests
[DomCrawler] exclude fields inside "template" tags
Use XLIFF source rather than resname when there's no target
[DoctrineBridge] catch errors while converting to db values in data collector
[DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider
[EventDispatcher] Unwrap wrapped listeners internally
[Routing] fix trailing slash redirection when using RedirectableUrlMatcher
Removed the return type phpdoc
fix authorization checker variable name
[Routing] Remove duplicate schemes and methods for invokable controllers
Indentation error
[HttpFoundation] Fix trailing space for mime-type with parameters
[HttpFoundation] Fixed absolute Request URI with default port
[Bridge/PhpUnit] fix the fix
...
* 3.4:
[Routing] fix trailing slash redirection when using RedirectableUrlMatcher
[PropertyAccessor] fix encoding of cache keys
[WebProfiler] Detect empty file paths in file viewer
fixed CS
Changes for upcoming Travis' infra migration
Doc fix: clarify isMethodCacheable() returns true only for GET & HEAD
[DomCrawler] exclude fields inside "template" tags
Use XLIFF source rather than resname when there's no target
[DoctrineBridge] catch errors while converting to db values in data collector
[DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider
[EventDispatcher] Unwrap wrapped listeners internally
Indentation error
[HttpFoundation] Fix trailing space for mime-type with parameters
[HttpFoundation] Fixed absolute Request URI with default port
properly parse backslashes in unquoted env vars
Use intersection type when referring to ParentNodeDefinitionInterface
[BrowserKit] fixed BC Break for HTTP_HOST header; implemented same behaviour for HTTPS server parameter
* 4.1:
fix cs
fix cs
fix cs
SCA: consolidate non empty array checks across codebase
[cs] correct invalid @param types
[Bridge/PhpUnit] Use composer to download phpunit
[DI] fix taking lazy services into account when dumping the container
[Form] Fixed empty data for compound date interval
[Cache] fix optimizing Psr6Cache for AdapterInterface pools
deal with explicitly enabled workflow nodes
* 3.4:
fix cs
SCA: consolidate non empty array checks across codebase
[cs] correct invalid @param types
[Bridge/PhpUnit] Use composer to download phpunit
[DI] fix taking lazy services into account when dumping the container
[Form] Fixed empty data for compound date interval
[Cache] fix optimizing Psr6Cache for AdapterInterface pools
deal with explicitly enabled workflow nodes
* 4.1:
Undeprecate the single-colon notation for controllers
Command::addOption should allow int in $default
Update symfony links to https
[Form] Fixed keeping hash of equal \DateTimeInterface on submit
[PhpUnitBridge] Fix typo
[Routing] generate(null) should throw an exception
[Form] Minor fixes in docs and cs
[Workflow] Made code simpler
[Config] Unset key during normalization
[Form] Fixed empty data for compound date types
invalidate forms on transformation failures
[FrameworkBundle] fixed guard event names for transitions
method buildTransitionBlockerList returns TransitionBlockerList of expected transition
[FrameworkBundle] fixed guard event names for transitions
[PropertyAccessor] Fix unable to write to singular property using setter while plural adder/remover exist
* 3.4:
Command::addOption should allow int in $default
[Form] Fixed keeping hash of equal \DateTimeInterface on submit
[PhpUnitBridge] Fix typo
[Form] Minor fixes in docs and cs
[Config] Unset key during normalization
[Form] Fixed empty data for compound date types
invalidate forms on transformation failures
[PropertyAccessor] Fix unable to write to singular property using setter while plural adder/remover exist
This PR was merged into the 4.2-dev branch.
Discussion
----------
[SecurityBundle] Fix remember-me cookie framework inheritance when session is disabled
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29217
| License | MIT
| Doc PR | N/A
When `framework.session` configuration key is not an array, we ignore it.
Commits
-------
af81008cb6 [SecurityBundle] Fix remember-me cookie framework inheritance when session is disabled
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Add handled & sent stamps
| Q | A
| ------------- | ---
| Branch? | 4.2 <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs/issues/10661
Based on #29159
This new feature marks sent and handled messages, so middleware can act upon these and use the handler(s) result(s).
This is also the base of a next PR (#29167), introducing a query bus built on top of the message bus.
I'm not sure yet about the best way to determine the handlers and senders names/descriptions to store in the stamps:
- Handlers are callable. I've just reused the [console text descriptor](1c1818b876/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php (L457-L491)) format for now.
- ~~Sender are `SenderInterface` instances. `\get_class` is used for now, but a single message can be sent by multiple senders, including of the same class.~~ => Updated. Yielding the sender name if provided, the FQCN otherwise.
~~Instead, what about allowing to yield names from locators, and fallback on the above strategies otherwise? So we'll use transport names from the config for senders, and pre-computed compile-time handlers descriptions?~~
=> Done. For handlers, computing it at compile time might not be straightforward. Let's compute it lazily from `HandledStamp::fromCallable()`
---
### From previous conversations:
> What about not adding HandledStamp on `null` returned from handler
IMHO, `null` still is a result. The stamps allows to identify a message as being handled regardless of the returned value, so makes sense on its own and keeping would require one less check for those wanting to consume it.
> What about adding SentStamp?
Makes sense to me and I think it was requested by @Nyholm before on Slack.
So, included in this PR.
> Should it target 4.2 or 4.3?
Targeting 4.2, because of the removal of the handler result forwarding by middleware. A userland middleware could have used this result, typically a cache middleware. Which would now require extra boring code in userland. This will simplify it and allow users to create their query bus instance until 4.3.
Commits
-------
2f5acf790a [Messenger] Add handled & sent stamps
This PR was merged into the 4.2-dev branch.
Discussion
----------
[WebProfilerBundle] Remove unused data attr
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Actually spotted in #29192 when searching in master :)
The attribute is not used.
Commits
-------
7c593753ef [WebProfilerBundle] Remove unused data attr
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle][WebServerBundle] Revert deprecation of --env and --no-debug console options
This reverts commit 9f60ff8a4d.
This reverts commit 31b5615b51.
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28984
| License | MIT
| Doc PR | -
Working on recipes with @weaverryan, we figured out that this deprecation is just making our life more difficult. Let's revert it.
Same as #29126, reverts #28745 and #28653
Commits
-------
443f8ad374 [FrameworkBundle][WebServerBundle] Revert deprecation of --env and --no-debug console options
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Fix typos
| Q | A
| ------------- | ---
| Branch? | 4.2 <!-- see below -->
| Bug fix? | no
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
Just small typos extracted from #29166 in case it doesn't make it to 4.2.
Commits
-------
7e763f96c1 [Messenger] Fix typos
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle] conflict with Dotenv <4.2 to simplify recipes
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
In the recipe for fwb 4.2, we already assume that if dotenv is installed, it will be at v4.2 or higher.
Let's enforce this.
Commits
-------
0e80cc175f [FrameworkBundle] conflict with Dotenv <4.2 to simplify recipes
This PR was merged into the 4.2-dev branch.
Discussion
----------
Revert "bug #29154 [FrameworkBundle] Define APP_ENV/APP_DEBUG from argv via Application::bootstrapEnv()
This reverts commit 9253199de1, reversing
changes made to 664a032940.
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Replaced by https://github.com/symfony/recipes/pull/491, see description there.
Commits
-------
f3c5fda379 Revert "bug #29154 [FrameworkBundle] Define APP_ENV/APP_DEBUG from argv via Application::bootstrapEnv() (chalasr)"
* 2.8:
[Form] Fixed keeping hash of equal \DateTimeInterface on submit
[PhpUnitBridge] Fix typo
[Config] Unset key during normalization
invalidate forms on transformation failures
This PR was squashed before being merged into the 4.2-dev branch (closes#29183).
Discussion
----------
[HttpKernel] Fix collecting uploaded files
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #29178
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
a439681bd4 [HttpKernel] Fix collecting uploaded files
This PR was merged into the 3.4 branch.
Discussion
----------
[Workflow][FrameworkBundle] fixed guard event names for transitions
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28018https://github.com/symfony/symfony/pull/28007#issuecomment-40652420
| License | MIT
| Doc PR |
There is a bug when many transitions are defined with the same name.
I finished destillat's work and rebase against 3.4 as it's a bug fix.
There another point of failure, but it could not be fixed on 3.4. I will
be a need feature. The issue is related to `Workflow::can($subject, $transitionName)`.
Since the transitionName could be not unique, we will need to support
passing an instance of Transition. A new PR is incomming
Commits
-------
83dc473dd6 [FrameworkBundle] fixed guard event names for transitions
fb88bfc79a [FrameworkBundle] fixed guard event names for transitions
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] invalidate forms on transformation failures
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20916, #21242, #28584
| License | MIT
| Doc PR |
Commits
-------
385d9df29c invalidate forms on transformation failures
* 4.1:
[Form] Hardened test suite for empty data
Bump phpunit XSD version to 5.2
[Fwb][EventDispatcher][HttpKernel] Fix getClosureScopeClass usage to describe callables
Add required key attribute
* 3.4:
[Form] Hardened test suite for empty data
Bump phpunit XSD version to 5.2
[Fwb][EventDispatcher][HttpKernel] Fix getClosureScopeClass usage to describe callables
Add required key attribute
Some attributes being used in the phpunit configuration files, namely
failOnRisky and failOnWarning were introduced in phpunit 5.2.0. The
Composer configuration shows that tests should run with old versions of
phpunit, but phpunit only validates the configuration against the XSD
since phpunit 7.2.0.
These changes can be tested as follows:
wget http://schema.phpunit.de/5.2/phpunit.xsd
xargs xmllint --schema phpunit.xsd 1>/dev/null
find src -name phpunit.xml.dist| xargs xmllint --schema phpunit.xsd 1>/dev/null
See 7e06a82806
See 46e3745a03/composer.json (L98)
* 4.1:
[VarDumper] fix dump of closures created from callables
[DI] fix dumping inlined services
Add framework asset changes to upgrade 3.0 guide
[Travis] Bump ext-mongodb to 1.5.2 on Travis
[DI] dont track classes/interfaces used to compute autowiring error messages
[DI] fix GraphvizDumper ignoring inline definitions
bumped Symfony version to 4.1.8
updated VERSION for 4.1.7
updated CHANGELOG for 4.1.7
bumped Symfony version to 3.4.19
updated VERSION for 3.4.18
updated CHANGELOG for 3.4.18
bumped Symfony version to 2.8.48
updated VERSION for 2.8.47
update CONTRIBUTORS for 2.8.47
updated CHANGELOG for 2.8.47
Fix ini_get() for boolean values
* 3.4:
[VarDumper] fix dump of closures created from callables
[DI] fix dumping inlined services
Add framework asset changes to upgrade 3.0 guide
[Travis] Bump ext-mongodb to 1.5.2 on Travis
[DI] dont track classes/interfaces used to compute autowiring error messages
[DI] fix GraphvizDumper ignoring inline definitions
bumped Symfony version to 3.4.19
updated VERSION for 3.4.18
updated CHANGELOG for 3.4.18
bumped Symfony version to 2.8.48
updated VERSION for 2.8.47
update CONTRIBUTORS for 2.8.47
updated CHANGELOG for 2.8.47
Fix ini_get() for boolean values
This PR was merged into the 3.4 branch.
Discussion
----------
[VarDumper] fix dump of closures created from callables
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
We are missing displaying full information about closures created using `ReflectionMethod::getClosure()` or `Closure::fromCallable()`.
This PR fixes it. For VarDumper but also other places where we have logic to display them.
Commits
-------
1c1818b876 [VarDumper] fix dump of closures created from callables
This PR was merged into the 4.1 branch.
Discussion
----------
SCA: simplify some ifs in favour of null coalescing operator
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Some of ifs were replaced with null coalescing operator in order to simplify control flow.
Commits
-------
636a872389 SCA: reverted code style changes
c926b1abd3 SCA: reverted code style changes
300b31fa75 SCA: applied requested code style changes
0180cb936f SCA: simplify some ifs in favour of null coalescing operator
* 4.1:
SCA: removed unused variables
Remove duplicate condition
fix useless space in docblock
remove unneeded tearDown method
[Intl] Update the ICU data to 63.1
[FrameworkBundle] Fix broken exception message
[Messenger] send using the routing_key for AMQP transport
also clean away the NO_AUTO_CACHE_CONTROL_HEADER if we have no session
[TwigBundle] Fix usage of TwigBundle without FrameworkBundle
Revert "fixed CS"
[Serializer] Reduce class discriminator overhead
Skip empty proxy code
[Security] Fix "exclude-from-classmap"
[Security] Removed unsed trait import
[Config] Fix @method annotation
add missing double-quotes to extra_fields output message
[DI] Default undefined env to empty string during compile
Convert InsufficientAuthenticationException to HttpException
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] make TraceableMiddleware decorate a StackInterface instead of each middleware to free the callstack from noisy frames
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | no
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Right now, `TraceableMiddleware` works as a middleware decorator for the "handle" method. It means that *each middleware* frame in the call stack is wrapped between two noisy extra frames.
This is something we can remove by decorating the StackInterface instead: let's just stop/start events when the next middleware is fetched.
Thanks to this, only one frame *per bus* is added to measure middleware timings.
Commits
-------
73c8c23c79 [Messenger] make TraceableMiddleware decorate a StackInterface instead of each middleware to free the callstack from noisy frames
This PR was merged into the 4.2-dev branch.
Discussion
----------
[FrameworkBundle] make debug:autowiring list useful services and their description
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27207
| License | MIT
| Doc PR | -
This PR closes#27207: we don't need "semantics" anymore. 4.2 has everything already to allow us to separate useful services from the other ones: any autowireable *alias* **is** a useful service!
Add autowiring by type + parameter name (#28234) and the story is done: we can easily hint people about which features their bundles provide, without being polluted by for-wiring-only services.
Here is a screenshot running this command(before I excluded the aliases for $cacheApp and $cacheSystem):
![image 3](https://user-images.githubusercontent.com/243674/47437006-f41f4380-d7a7-11e8-9f76-7f23e9193ce8.png)
ping @weaverryan as we drafted that together.
Fixes a few issues found meanwhile.
That should definitely go in 4.2.
Commits
-------
56aab09b01 [FrameworkBundle] make debug:autowiring list useful services and their description
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Translation] allow using the ICU message format using domains with the "+intl-icu" suffix
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | no
| New feature? | yes
| BC breaks? | no (unless merged after 4.2)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This PR replaces the `FallbackFormatter` logic by explicit opt-in.
This allows triggering accurate exceptions when one wants to use the ICU message format but the extension (or the polyfill) is missing.
The way to opt-in is to put messages in a domain with the `+intl-icu` suffix *at loading/declaration time*.
E.g. translations in `messages+intl-icu.en.yaml` will be read as part of the `messages` domain , but will be parsed by intl's `MessageFormatter` instead of the default Symfony one.
To make it seamless to adopt the ICU format, `%`s are trimmed from parameter keys (idea borrowed from https://github.com/webfactory/WebfactoryIcuTranslationBundle)
This is for 4.2 as it changes a feature that is not released yet.
ping @Nyholm - we drafted this together.
Commits
-------
d95cc4d4c6 [Translation] allow using the ICU message format using domains with the "+intl-icu" suffix
This PR was merged into the 4.2-dev branch.
Discussion
----------
[TwigBridge] Remove $rootDir argument in CodeExtension
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://github.com/symfony/symfony-docs/pull/10547#issuecomment-432608538
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Forgotten in #28890
cc @javiereguiluz
Commits
-------
f8947242a9 [TwigBridge] Remove $rootDir argument in CodeExtension
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] remove classifying sub-namespaces in favor of semantic ones
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
While working on the component, I found it hard to discover the meaning of the `Asynchronous` and `Enhancers` sub-namespaces. Now that I know the component better, I understand they're only classifying namespaces with no specific technical semantics.
I'd like to remove them to make the component easier to discover.
This PR introduces a few new semantic sub-namespaces instead.
From the changelog:
* Classes in the `Middleware\Enhancers` sub-namespace have been moved to the `Middleware` one
* Classes in the `Asynchronous\Routing` sub-namespace have been moved to the `Transport\Sender\Locator` sub-namespace
* The `Asynchronous/Middleware/SendMessageMiddleware` class has been moved to the `Middleware` namespace
* `SenderInterface` and `ChainSender` classes have been moved to the `Transport\Sender` sub-namespace
* `ReceiverInterface` and its implementations have been moved to the `Transport\Receiver` sub-namespace
Commits
-------
16afb5e2b4 [Messenger] remove classifying sub-namespaces in favor of semantic ones
This PR was squashed before being merged into the 4.2-dev branch (closes#28875).
Discussion
----------
[FWBundle] Add a new method AbstractController::addLink()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? |no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | todo
This provides a convenient method to add `Link` headers to the current `Response` directly from the `Request` object.
It improves the developer experience and the discoverability of [the WebLink component](https://github.com/symfony/symfony-docs/pull/10309).
Usage:
```php
namespace App\Controller;
use Fig\Link\Link;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class MyAction extends AbstractController
{
public function __invoke(Request $request): Response
{
$this->addLink($request, new Link('mercure', 'https://demo.mercure.rocks'));
return $this->json(['foo' => 'bar']);
}
}
```
Commits
-------
4d20c39f70 [FWBundle] Add a new method AbstractController::addLink()