This PR was squashed before being merged into the 3.4 branch (closes#28604).
Discussion
----------
[Finder] fixed root directory access for ftp/sftp wrapper
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27423
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
This fixes a flaw introduced in 3.4.7 by #26763
In order to access the root folder with ftp wrapper, there MUST BE a slash present.
- Currently: from 3.4.7 on it just ```rtrim``` all seperators (```/```, ```\```) from directories
- Now: IF the directory is a (s)ftp:// wrapper (```#^s?ftp://#```) this fix just adds a slash (```/```) again
Commits
-------
9630a38d67 [Finder] fixed root directory access for ftp/sftp wrapper
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Security] Deprecate simple_preauth and simple_form in favor of Guard
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
5093b9fb47 [Security] Deprecate simple_preauth and simple_form in favor of Guard
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] drop "handler." prefix from ContainerHandlerLocator
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28621
| License | MIT
| Doc PR | -
I fail to understand what this prefix is for. Looks like boilerplate to me, let's drop it, isn't it?
An alternative to #28621
Commits
-------
6c56e82080 [Messenger] drop "handler." prefix from ContainerHandlerLocator
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Translation] marked getFallbackLocales() as internal
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #28579
| License | MIT
| Doc PR |
Added the deprication trigger error function to getFallbackLocales in the Translation component.
(Its my first PR, please tell me if i need to change something)
Commits
-------
9d67a68816 [Translation] marked getFallbackLocales() as internal
This PR was merged into the 2.8 branch.
Discussion
----------
Remove redundant path check
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | maybe?
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commit 0ec852d79f introduced this new method. As you can see, the code I'm removing always evaluates to `true` thanks to the first `if` statement in this method:
![image](https://user-images.githubusercontent.com/202034/46349212-70968a80-c61f-11e8-8360-7d6abc4d7414.png)
(I'm not sure if redundant code technically counts as a "bug", so I've assumed "yes it does" and targeted 2.8.)
Commits
-------
10795cf096 Remove redundant path check
This PR was squashed before being merged into the 4.2-dev branch (closes#28571).
Discussion
----------
[DependencyInjection] Improve ServiceLocatorTagPass service matching
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26892
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10397
Allows omitting of keys for service locator arguments (it will automatically take over the original definition alias).
Commits
-------
1c1210a3e8 [DependencyInjection] Improve ServiceLocatorTagPass service matching
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Validator] Pre-check constraint validator dependencies
| 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 | #25865
| 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
-------
0544985934 [Validator] Pre-check constraint validator dependencies
This PR was squashed before being merged into the 4.2-dev branch (closes#28661).
Discussion
----------
[Serializer] Add an option to skip null values
| 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
Adds a new option to not serialize `null` values:
```php
$dummy = new class {
public $foo;
public $bar = 'notNull';
};
$normalizer = new ObjectNormalizer();
$result = $normalizer->normalize($dummy, 'json', ['skip_null_values' => true]);
// ['bar' => 'notNull']
```
This feature is the only missing part to add [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) support in [API Platform](https://api-platform.com).
It will also help supporting this RFC in all other projects using the Symfony Serializer.
Commits
-------
d3c5055f7b [Serializer] Add an option to skip null values
* 4.1: (21 commits)
[php_cs] disable fopen_flags
[DI] fix error in dumped container
[CS] Remove unused variables passed to closures
[DI] fix dumping setters before their inlined instances
[CS] Remove empty comment
[CS] Enforces null type hint on last position in phpDocs
[CS] Use combined assignment operators when possible
Fix a typo in error messages
Don't return early as this bypasses the auto exit feature
[Console] Add missing null to input values allowed types
[PHPUnitBridge] Fix microtime() format
bumped Symfony version to 4.1.6
updated VERSION for 4.1.5
updated CHANGELOG for 4.1.5
bumped Symfony version to 3.4.17
updated VERSION for 3.4.16
updated CHANGELOG for 3.4.16
bumped Symfony version to 2.8.47
update CONTRIBUTORS for 2.8.46
updated VERSION for 2.8.46
...
* 3.4:
[php_cs] disable fopen_flags
[DI] fix error in dumped container
[CS] Remove unused variables passed to closures
[DI] fix dumping setters before their inlined instances
[CS] Remove empty comment
[CS] Enforces null type hint on last position in phpDocs
[CS] Use combined assignment operators when possible
Fix a typo in error messages
Don't return early as this bypasses the auto exit feature
[Console] Add missing null to input values allowed types
[PHPUnitBridge] Fix microtime() format
bumped Symfony version to 3.4.17
updated VERSION for 3.4.16
updated CHANGELOG for 3.4.16
bumped Symfony version to 2.8.47
update CONTRIBUTORS for 2.8.46
updated VERSION for 2.8.46
updated CHANGELOG for 2.8.46
* 2.8:
[php_cs] disable fopen_flags
[CS] Remove unused variables passed to closures
[CS] Remove empty comment
[CS] Enforces null type hint on last position in phpDocs
[CS] Use combined assignment operators when possible
Fix a typo in error messages
[Console] Add missing null to input values allowed types
[PHPUnitBridge] Fix microtime() format
bumped Symfony version to 2.8.47
update CONTRIBUTORS for 2.8.46
updated VERSION for 2.8.46
updated CHANGELOG for 2.8.46
This PR was merged into the 2.8 branch.
Discussion
----------
[CS] Enforces null type hint on last position in phpDocs
| Q | A
| ------------- | ---
| Branch? | 2.8
| 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 -->
As a majority in our codebase, the `null` typehint usually comes in the last position in phpDocs.
Commits
-------
efbba25577 [CS] Enforces null type hint on last position in phpDocs
This PR was merged into the 2.8 branch.
Discussion
----------
[CS] Use combined assignment operators when possible
| Q | A
| ------------- | ---
| Branch? | 2.8
| 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 -->
Less opcodes for us 😄
Commits
-------
c561e99394 [CS] Use combined assignment operators when possible
This PR was merged into the 2.8 branch.
Discussion
----------
[CS] Remove empty comment
| Q | A
| ------------- | ---
| Branch? | 2.8
| 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 -->
Commits
-------
3bfd877e16 [CS] Remove empty comment
This PR was merged into the 3.4 branch.
Discussion
----------
[DI] fix error in dumped container
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28658
| License | MIT
| Doc PR | -
(test case on its way)
Commits
-------
2d0aba6ff8 [DI] fix error in dumped container
This PR was squashed before being merged into the 4.1 branch (closes#28636).
Discussion
----------
[HttpFoundation] X-Accel-Mapping does not use HTTP key=value syntax
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? |no
| Tests pass? | yes
| Fixed tickets | #28627
| License | MIT
| Doc PR |
The `X-Accel-Mapping` header does not use the standard HTTP key=value syntax, so using `HeaderUtils::combine()` breaks paths with upper-case letters.
There is no good reason to use `HeaderUtils::combine()` in this case, so simply skip it.
Commits
-------
09343c27d7 [HttpFoundation] X-Accel-Mapping does not use HTTP key=value syntax
* 4.1:
[Console] simplified code
removed useless phpdoc
improve docblocks around group sequences
[Cache] prevent getting older entries when the version key is evicted
[WebProfilerBundle] added a note in the README
[Yaml] Skip parser test with root user
[Filesystem] Skip tests on readable file when run with root user
[FWBundle] Fix an error in WebTestCase::createClient's PHPDoc
[HttpFoundation][Security] forward locale and format to subrequests
[Console] Send the right exit code to console.terminate listeners
[HttpFoundation] fix hidding warnings from session handlers
Caching missed templates on cache warmup
* 3.4:
[Console] simplified code
removed useless phpdoc
improve docblocks around group sequences
[Cache] prevent getting older entries when the version key is evicted
[WebProfilerBundle] added a note in the README
[Yaml] Skip parser test with root user
[Filesystem] Skip tests on readable file when run with root user
[FWBundle] Fix an error in WebTestCase::createClient's PHPDoc
[HttpFoundation][Security] forward locale and format to subrequests
[Console] Send the right exit code to console.terminate listeners
[HttpFoundation] fix hidding warnings from session handlers
Caching missed templates on cache warmup
* 2.8:
improve docblocks around group sequences
[WebProfilerBundle] added a note in the README
[Filesystem] Skip tests on readable file when run with root user
[FWBundle] Fix an error in WebTestCase::createClient's PHPDoc
[HttpFoundation][Security] forward locale and format to subrequests
[Console] Send the right exit code to console.terminate listeners
Caching missed templates on cache warmup
This PR was merged into the 2.8 branch.
Discussion
----------
[Validator] improve docblocks around group sequences
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? |no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26889
| License | MIT
| Doc PR |
Commits
-------
179a081ee3 improve docblocks around group sequences
This PR was merged into the 4.2-dev branch.
Discussion
----------
[BrowserKit] throw exception when request() wasn't called
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | https://github.com/symfony/symfony/pull/27807#issuecomment-420985940
Commits
-------
41cfde19f6 throw exception when request() wasn't called
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] add "setCallbackWrapper()" on adapters implementing CacheInterface for more flexibility
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27730
| License | MIT
| Doc PR | -
Preparing my talk at SymfonyLive London, see you all there :)
This allows wrapping the callback passed to `->get($item, $callback, $beta)` in a callable that should at least return `$callback($item)`, but can do something around the call.
The default wrapper is locking the key to provide lock-based stampede protection.
That was already the case before this PR, but in a much dirtier way at the design level.
Fixes a few issues found meanwhile.
Commits
-------
8cf3625b11 [Cache] add "setCallbackWrapper()" on adapters implementing CacheInterface for more flexibility
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Cache] support configuring multiple Memcached servers in one DSN
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27855
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/issues/10402
Useful to reconfigure dynamically an array of memcached servers (eg removing a dead one or adding a new one).
DSN format is e.g. `memcached://localhost?host[foo.bar]=3`.
To ease generating the DSN programmatically, it works also with `memcached:?host[localhost]&host[localhost:12345]&host[/some/memcached.sock:]=3`.
The key of the "host" parameter is a "host:port" pair, the value is the weight of the "host:port" pair.
Sockets need to be specified with the trailing `:` (as shown in the last example).
Commits
-------
8e0605ac18 [Cache] support configuring multiple Memcached servers in one DSN
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpFoundation][Security] forward locale and format to subrequests
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28368, #21546
| License | MIT
| Doc PR | -
See discussion in linked issue.
Commits
-------
41eb1914f6 [HttpFoundation][Security] forward locale and format to subrequests
This PR was merged into the 4.2-dev branch.
Discussion
----------
[HttpFoundation] make cookies auto-secure when passing them $secure=null + plan to make it and samesite=lax the defaults in 5.0
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #26731
| License | MIT
| Doc PR | -
By creating Cookie instances using `null` for the `$secure` argument, this PR allows making cookies inherit their "secure" attribute from the request.
This PR also adds a forward to make $secure=null and samesite=lax the defaults in Symfony 5.0:
- either define all constructor's arguments explicitly
- or use the new `Cookie::create()` factory
Commits
-------
9493cfd5f2 [HttpFoundation] make cookies auto-secure when passing them $secure=null + plan to make it and samesite=lax the defaults in 5.0
This PR was merged into the 4.2-dev branch.
Discussion
----------
[SecurityBundle] make remember-me cookies auto-secure + inherit their default config from framework.session.cookie_*
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28338
| License | MIT
| Doc PR | -
Let's make it easier to have a good default security level, now for the remember-me cookie.
Commits
-------
6ec223bf6f [SecurityBundle] make remember-me cookies auto-secure + inherit their default config from framework.session.cookie_*
This PR was merged into the 4.2-dev branch.
Discussion
----------
[VarExporter] add Instantiator::instantiate() to create+populate objects without calling their constructor nor any other methods
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
A blend of features also provided by https://github.com/doctrine/instantiator and https://github.com/Ocramius/GeneratedHydrator in one simple method. Because it's just a few more lines on top of the existing code infrastructure in the component :)
For example, from the docblock:
```php
// creates an empty instance of Foo
Instantiator::instantiate(Foo::class);
// creates a Foo instance and sets one of its public, protected or private properties
Instantiator::instantiate(Foo::class, ['propertyName' => $propertyValue]);
// creates a Foo instance and sets a private property defined on its parent Bar class
Instantiator::instantiate(Foo::class, [], [
Bar::class => ['privateBarProperty' => $propertyValue],
]);
```
Instances of ArrayObject, ArrayIterator and SplObjectHash can be created
by using the special `"\0"` property name to define their internal value:
```php
// creates an SplObjectHash where $info1 is attached to $obj1, etc.
Instantiator::instantiate(SplObjectStorage::class, ["\0" => [$obj1, $info1, $obj2, $info2...]]);
// creates an ArrayObject populated with $inputArray
Instantiator::instantiate(ArrayObject::class, ["\0" => [$inputArray, $optionalFlag]]);
```
Misses some tests for now, but reuses the existing code infrastructure used to "unserialize" objects.
Commits
-------
d9bade0385 [VarExporter] add Instantiator::instantiate() to create+populate objects without calling their constructor nor any other methods
This PR was merged into the 3.4 branch.
Discussion
----------
[Cache] prevent getting older entries when the version key is evicted
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28445
| License | MIT
| Doc PR | -
As described in linked issue, using a strategy described in
https://github.com/memcached/memcached/wiki/ProgrammingTricks#deleting-by-namespace
Commits
-------
00855895a8 [Cache] prevent getting older entries when the version key is evicted
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Serializer] deprecated normalizers and encoders who dont implement the base interfaces
| 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 | None
Currently the `Serializer` can be constructed with any object regardless of whether or not it implements `NormalizerInterface` or `DenormalizerInterface`. This object will then be ignored when getting a normalizer/denormalizer, so in effect silently ignored for serializer operations.
This change throws an exception on construct if a given normalizer object does not implement one of these interfaces - are there use cases where this would not be true?
Commits
-------
cbc2be8ba8 [Serializer] deprecated normalizers and encoders who dont implement the base interfaces
This PR was merged into the 4.2-dev branch.
Discussion
----------
Make it clear that the profiler is for dev only
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | kinda yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes (permanent one)
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | symfony/symfony-docs#10386
Commits
-------
54fda55fd9 made it clear that the profiler is for dev only
This PR was squashed before being merged into the 3.4 branch (closes#28529).
Discussion
----------
[Yaml] Skip parser test with root user
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28478
| License | MIT
| Doc PR | -
This PR fix a test failure in YAML Component when running from a php docker container.
By defaut, root user is used to run phpunit. It means permission checking will fail (Root user is always allowed to read files)
Commits
-------
34429797b3 [Yaml] Skip parser test with root user
This PR was merged into the 2.8 branch.
Discussion
----------
[Filesystem] Skip tests on readable file when run with root user
| Q | A
| ------------- | ---
| Branch? | 2.8 <!-- see below -->
| 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 <!-- 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 | #28478 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | - <!-- required for new features -->
This PR fix tests failures in Filesystem Component when running from a php docker container.
By defaut, root user is used to run phpunit. It means permission checking will fail (Root user is always allowed to read files)
Linked to #28529
Commits
-------
ad500e74ec [Filesystem] Skip tests on readable file when run with root user
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DependencyInjection] improved message when alias service is not found
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28413
| License | MIT
| Doc PR |
When using the YAML config format, it can be confusing that you need to
prefix the aliased service id with an `@` character when passing it as
a string, but that you have to omit it when using the `alias` attribute:
```yaml
foo: '@App\Foo'
foo:
alias: 'App\Foo'
```
This commit will enhance the generated error message in cases where the
aliased service id is prefixed with the `@` character in the `alias`
option like this:
```yaml
foo:
alias: '@App\Foo'
```
Commits
-------
280ecbc2be improved message when alias service is not found
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Console] Add support for error ouput in the CommandTester
Move initialization of the streams to the trait so the `capture_stderr_separately` also works in the CommandTester.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27422
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Make it possible to test seperate stderr output.
```$tester = new CommandTester($command);
$tester->execute(
array('foo' => 'bar'),
array('capture_stderr_separately' => true)
);
$this->assertEquals('foo', $tester->getErrorOutput());
````
Commits
-------
cec5317 [Console] Add support for error ouput in the CommandTester
This PR was squashed before being merged into the 2.8 branch (closes#28545).
Discussion
----------
[Console] Send the right exit code to console.terminate listeners
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
When a Console command throws an exception without a status code, `Application::run()` takes care of setting the exit code to `1` when the exception does not provide a code itself.
This happens slightly too late, as `console.terminate` event listeners that are called from within `Application::doRunCommand()` are given the plain exeception code, before this conversion.
The result is that `console.*` event listeners that you might be using to log exit code e. g. for cron jobs will see a `0` code instead of the real value used to terminate the script.
***Todo:***
- [x] Make sure we've got tests covering this, i. e. do not mock out `doRunCommand()`.
Commits
-------
b90a3f1 [Console] Send the right exit code to console.terminate listeners
When using the YAML config format, it can be confusing that you need to
prefix the aliased service id with an `@` character when passing it as
a string, but that you have to omit it when using the `alias` attribute:
```yaml
foo: '@App\Foo'
foo:
alias: 'App\Foo'
```
This commit will enhance the generated error message in cases where the
aliased service id is prefixed with the `@` character in the `alias`
option like this:
```yaml
foo:
alias: '@App\Foo'
```
This PR was merged into the 3.4 branch.
Discussion
----------
[Debug] Fix false-positive "MicroKernelTrait::loadRoutes()" method is considered internal"
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes (fixing and unreleased issue)
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28549
| License | MIT
| Doc PR | -
Introduced in #28411
Just a failing test for now.
Commits
-------
46c4f71bf0 [Debug] Fix false-positive "MicroKernelTrait::loadRoutes()" method is considered internal"
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Debug] Trigger a deprecation for new parameters not defined in sub classes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/28316
| License | MIT
| Doc PR | -
I'm not sure the way https://github.com/symfony/symfony/pull/28316 is implemented is the best so here is an alternative.
Instead of counting on a call from the child method, it uses the `DebugClassLoader` and `@param` annotations. If a `@param` annotation is used on a parent but is then not actually implemented in the child class, a deprecation will be thrown.
Example:
```php
class ClassWithAnnotatedParameters
{
/**
* @param string $foo This is a foo parameter.
*/
public function fooMethod(string $foo)
{
}
/**
* @param string $bar parameter not implemented yet
*/
public function barMethod(/** string $bar = null */)
{
}
/**
* @param Quz $quz parameter not implemented yet
*/
public function quzMethod(/** Quz $quz = null */)
{
}
}
```
```php
class SubClassWithAnnotatedParameters extends ClassWithAnnotatedParameters {
public function fooMethod(string $foo) { }
public function barMethod($bar = null) { }
public function quzMethod() { }
}
```
A deprecation will be triggered because ``SubClassWithAnnotatedParameters::quzMethod()`` which doesn't definee `$quz`.
Commits
-------
1f5d8b62f7 [Debug] Trigger a deprecation for new parameters not defined in sub classes
* 4.1:
Fix CS
Allow reuse of Session between requests
[MonologBridge] Re-add option option to ignore empty context and extra data
[Lock] remove useless code
[PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file
Provide debug_backtrace with proper args
[DI] fix infinite loop involving self-references in decorated services
forward false label option to nested types
[DI] fix dumping lazy services
forward the invalid_message option in date types
* 3.4:
Fix CS
Allow reuse of Session between requests
[MonologBridge] Re-add option option to ignore empty context and extra data
[Lock] remove useless code
[PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file
Provide debug_backtrace with proper args
[DI] fix infinite loop involving self-references in decorated services
forward false label option to nested types
forward the invalid_message option in date types
* 2.8:
Fix CS
Allow reuse of Session between requests
Provide debug_backtrace with proper args
forward false label option to nested types
forward the invalid_message option in date types
This PR was merged into the 4.2-dev branch.
Discussion
----------
Add Zookeeper data store for Lock Component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | Not applicable
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10043
This change adds a new feature to the Lock Component to give the capability to store locks in Zookeeper Data Store. The corresponding documentation PR should describe how this works.
The change here also adds a functional test to make sure all the basic functionality of the lock using this data store works.
Requirements for this to work are having a PHP-Zookeeper extension available to use this.
Commits
-------
c72c297dc3 Add new Zookeeper Data Store. Add functional test for Zookeeper Data Store. Modify Store Factory to support initialization of Zookeeper Data Store.
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpFoundation] Allow reuse of Session between requests if ID did not change
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #13450
| License | MIT
| Doc PR | -
I stumbled upon the issue from https://github.com/symfony/symfony/issues/13450 in a more simple case than what was exposed in the issue. From my understanding, the problem arises when the session is used between an access to the session and a functional test request: because the session was accessed (usually using the container directly), the session has started and the following request fails.
This PR checks whether the ID was actually regenerated before throwing (if a setId is called with the same ID, it is the same request context, it shouldn't throw IMO).
Not sure I understood everything correctly though, feel free to fix it for me if needed.
Commits
-------
fd30f4a21d Allow reuse of Session between requests
This PR was merged into the 4.2-dev branch.
Discussion
----------
[VarDumper] Allow dd() to be called without arguments
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
**Description**
A while back the `dd()` helper was [added to the VarDumper component](https://github.com/symfony/symfony/pull/26970) which was (i think) inspired by Laravel's `dd()` helper. Laravel has [removed their version of the helper](https://github.com/laravel/framework/pull/25087) in favor of the helper in Symfony.
However, as opposed to the Laravel helper, the Symfony helper requires at least one argument. Calling the Laravel helper with no arguments simply killed the program (and usually showed a white screen), calling the Symfony helper with no arguments throws a `TypeError: Too few arguments to function dd()` exception (which gets rendered by the error handler and fills the whole screen with useless information).
Being able to call the `dd()` helper with no arguments is useful because it is a quick way to tell you if your code reaches a certain point. If it does, you can fill in the `dd()` with variables to keep debugging.
This PR allows the dd helper to be called without arguments.
This PR also makes the helper call `die` instead of `exit` to better reflect the function name 😄
Commits
-------
a73dfadc18 [VarDumper] Allow dd() to be called without arguments
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Ldap] Add verbose ext-ldap error if present for easier debugging
| Q | A
| ------------- | ---
| Branch? | master (be careful when merging)
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? |
| Fixed tickets | #28149
| License | MIT
| Doc PR |
Added an optional message suffix if ldap_errno is not equals to 0
Commits
-------
761415fc1b Add verbose ext-ldap error if present for easier debugging
This PR was squashed before being merged into the 4.2-dev branch (closes#28521).
Discussion
----------
[Yaml] Added support for multiple files or directories in LintCommand
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28498
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/10367
Commits
-------
d0f7950860 [Yaml] Added support for multiple files or directories in LintCommand
This PR was squashed before being merged into the 4.2-dev branch (closes#28522).
Discussion
----------
[Translation] Added support for multiple files or directories in XliffLintCommand
| 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/10368
Same approach of https://github.com/symfony/symfony/pull/28521
Commits
-------
88ec37bed7 [Translation] Added support for multiple files or directories in XliffLintCommand
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Contracts] fine tune composer.json declarations for suggest/provide
| 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
-------
8a11e76c14 [Contracts] fine tune composer.json declarations for suggest/provide
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] forward false label option to nested types
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/28469#discussion_r217880630
| License | MIT
| Doc PR |
This change does not fix any built-in Symfony form themes, but takes
into account the changes made in #28469 to allow third-party form themes
work properly.
Commits
-------
3247cdeea9 forward false label option to nested types
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Validator] Check the BIC country with symfony/intl
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28167
| License | MIT
| Doc PR | N/A
Check the BIC country code against the list from Intl component instead of a simple check alphabetical test.
This PR uses the Intl component which is not part of the required dependencies of the Validator component (https://github.com/symfony/validator/blob/master/composer.json): `symfony/intl` is only required for dev. So I'm making a PR against master because it may break existing code.
But `CountryValidator` does the same so it may not be an issue after all.
Commits
-------
27bd3a8192 [Validator] Check the BIC country with symfony/intl Fix#28167
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] forward the invalid_message option in date types
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #5880
| License | MIT
| Doc PR |
Commits
-------
5318e2eb15 forward the invalid_message option in date types
This change does not fix any built-in Symfony form themes, but takes
into account the changes made in #28469 to allow third-party form themes
work properly.
This PR was merged into the 4.2-dev branch.
Discussion
----------
[PhpUnitBridge] enable DebugClassLoader by default
| 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/issues/10360
With this PR, the phpunit-bridge will enable `DebugClassLoader` by default, making it do its job: throw deprecation notices at autoloading time. On top of #28329, this made me spot some glitches in the code base, fixed here also.
This can be disabled by configuring the listener in `phpunit.xml.dist` files, adding `<element key="debug-class-loader"><integer>0</integer></element>` next to `<element key="time-sensitive">...`.
Commits
-------
2fb11fce28 [PhpUnitBridge] enable DebugClassLoader by default
This PR was squashed before being merged into the 4.2-dev branch (closes#28441).
Discussion
----------
[Messenger] simple refactoring to have a more readable code
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
<!--
A simple refactoring to have a more readable code
-->
Commits
-------
5f61a27db5 [Messenger] simple refactoring to have a more readable code
* 4.1:
[TwigBridge] fix lowest version of symfony/form
Think positive
KernelInterface can return null container
[DI] Detect circular references with ChildDefinition parent
[VarDumper] Fix global dump function return value for PHP7
[Ldap] Use shut up operator on connection errors at ldap_start_tls
Implement startTest rather than startTestSuite
[OptionsResolver] remove dead code and useless else
[HttpFoundation] don't override StreamedResponse::setNotModified()
Added relevent links for parsing to the phpdoc
Add stricter checking for valid date time string
Fix symfony/console (optional) dependency for MonologBridge
fix not displaying labels when value is false
[Form] Fix DateTimeType html5 input format
This PR was merged into the 4.1 branch.
Discussion
----------
[Form][TwigBridge] fix not displaying labels when value is false
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28198
| License | MIT
| Doc PR |
Commits
-------
c4a6c9fa00 fix not displaying labels when value is false
* 3.4:
Think positive
KernelInterface can return null container
[DI] Detect circular references with ChildDefinition parent
[VarDumper] Fix global dump function return value for PHP7
[Ldap] Use shut up operator on connection errors at ldap_start_tls
Implement startTest rather than startTestSuite
[OptionsResolver] remove dead code and useless else
[HttpFoundation] don't override StreamedResponse::setNotModified()
Added relevent links for parsing to the phpdoc
Add stricter checking for valid date time string
Fix symfony/console (optional) dependency for MonologBridge
[Form] Fix DateTimeType html5 input format
* 2.8:
KernelInterface can return null container
[Ldap] Use shut up operator on connection errors at ldap_start_tls
[HttpFoundation] don't override StreamedResponse::setNotModified()
Added relevent links for parsing to the phpdoc
Add stricter checking for valid date time string
[Form] Fix DateTimeType html5 input format
This PR was squashed before being merged into the 3.4 branch (closes#28497).
Discussion
----------
[VarDumper] Fix global dump function return value for PHP7
Retarget of PR #28491. Reposting description below, with relevant updates.
| 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 |
In 3.4, the global `dump()` helper function in the VarDumper component was updated to return the arguments passed in to it. However, due to reusing the argument variable in the function, this introduces a bug in PHP7 in the return value of the function.
The variable used in the `foreach` loop overwrites the value passed in by the first argument. In PHP5, this is okay. In PHP7, even though the argument is passed by value, the value returned by `func_get_args()` is affected by changes to the arguments inside the function. This is a change from PHP5.
From the documentation for [`func_get_args()`](http://php.net/manual/en/function.func-get-args.php):
> If the arguments are passed by reference, any changes to the arguments will be reflected in the values returned by this function. As of PHP 7 the current values will also be returned if the arguments are passed by value.
This PR simply changes the name of the variable used in the `foreach` loop. It also adds a test file to test the return value of the global `dump()` function.
This is my first contribution to Symfony, so please let me know if the issue should be resolved in a different manner, or if the test should be modified in any way.
Thanks,
Patrick
Commits
-------
0def211b9b [VarDumper] Fix global dump function return value for PHP7
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpFoundation] don't override StreamedResponse::setNotModified()
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Alternative implementation to #27937, because `Response::setNotModified()` has been made final in 4.0 so we shouldn't override it.
Commits
-------
9ef7f7038d [HttpFoundation] don't override StreamedResponse::setNotModified()
This PR was merged into the 4.2-dev branch.
Discussion
----------
Trigger deprecation notices when inherited class calls parent method but misses adding new arguments
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This Pull Request concern severals components, the purpose here is to notify in dev mode that in a case of inherit class, a function will have a new or severals arguments in Symfony 5.0, therefore not implement it is deprecated since Symfony 4.2
The function is made by these conditions :
1- ```(func_num_args() < $x)``` where [x] is the number of arguments we will have in Symfony 5.0
this check allow to verify that the arguments are missing
2- ```(__CLASS__ !== \get_class($this))```
this check allow to verify that the name of the class is different than the base class, therefore that we are in the child class
3- ```(__CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName())```
this check allow to verify that the class of the current function is different than the base class, therefore the function has been rewrote into the child class
Code exemple :
```
public function method(/* void $myNewArgument = null */)
{
if ((func_num_args() < 1) && (__CLASS__ !== \get_class($this)) && (__CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName())){
@trigger_error(sprintf('The "%s()" method will have one `void $myNewArgument = null` argument in version 5.0 and higher.Not defining it is deprecated since Symfony 4.2.', __METHOD__ ), E_USER_DEPRECATED);
}
// do something
}
```
The unit test are made by creating a child Class using for the tested function ```return parent::function()``` and by calling this child class and catching the expected depreciation message
Commits
-------
f75fffa997 Trigger deprecation notices when inherited class calls parent method but misses adding new arguments
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] Fix DateTimeType html5 input format
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27233, #27254
| License | MIT
| Doc PR | N/A
Fix DateTimeType' HTML input format according to HTML specs. Currently `DateTimeType` produces html with format `yyyy-MM-dd'T'HH:mm:ssZ` but the HTML5 spec expects `yyyy-MM-dd'T'HH:mm:ss` (i.e. no `Z`). Chrome presents an empty date picker meaning edits or having a default date are broken.
Also the reverseTransform was expect to have a timezone attached, which it does not - and incorrectly marks it as being a UTC time in this case, instead of using the Transformers output TZ.
This is same as @franzwilding https://github.com/symfony/symfony/pull/27254 but with change to just straight use of `DateTime::format` and handling TZ in reverseTransform
Commits
-------
e21a1a4df1 Added relevent links for parsing to the phpdoc
4f06f1524d Add stricter checking for valid date time string
253d0a683b [Form] Fix DateTimeType html5 input format
* 4.1:
[Console] Fix typo in tests
[Console] Correct Command::initialize() and InputInterface::bind() phpdoc regarding thrown exceptions
[Console] fixed corrupt error output for unknown multibyte short option
[Console] fixed PHPDoc for setArgument/setOption in InputInterface
Register the messenger data collector only when the profiler is enabled
[Intl] Blacklist Eurozone and United Nations in Region Data Generator
* 3.4:
[Console] Fix typo in tests
[Console] Correct Command::initialize() and InputInterface::bind() phpdoc regarding thrown exceptions
[Console] fixed corrupt error output for unknown multibyte short option
[Console] fixed PHPDoc for setArgument/setOption in InputInterface
[Intl] Blacklist Eurozone and United Nations in Region Data Generator
* 2.8:
[Console] Correct Command::initialize() and InputInterface::bind() phpdoc regarding thrown exceptions
[Console] fixed corrupt error output for unknown multibyte short option
[Console] fixed PHPDoc for setArgument/setOption in InputInterface
[Intl] Blacklist Eurozone and United Nations in Region Data Generator
This PR was squashed before being merged into the 4.2-dev branch (closes#28373).
Discussion
----------
[Console] Support max column width in Table
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #22156, #27832
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/issues/10300
Continuation of #22225 to better preserve spaces (which preserves background colors), using `wordwrap` it caused some issues.
Also the wrapping was plain wrong by not taking the current line length into account.
While at it, it comes with `Table` integration :)
Given
```php
$table = new Table($output);
$table->setColumnMaxWidth(0, 2);
$table->setRow(0, ['pre <error>foo bar baz</error> post']);
$table->render();
$table = new Table($output);
$table->setColumnMaxWidth(0, 3);
$table->setRow(0, ['pre <error>foo bar baz</error> post']);
$table->render();
$table = new Table($output);
$table->setColumnMaxWidth(0, 4);
$table->setRow(0, ['pre <error>foo bar baz</error> post']);
$table->render();
```
![image](https://user-images.githubusercontent.com/1047696/45101516-f19b5880-b12b-11e8-825f-6a1d84f68f47.png)
Commits
-------
175f68f [Console] Support max column width in Table
This PR was merged into the 4.2-dev branch.
Discussion
----------
Remove all usages of call_user_func_array()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Because it's cleaner :) (and it saves creating one extra dummy array)
Commits
-------
b2718d7666 Remove all usages of call_user_func_array()
This PR was merged into the 2.8 branch.
Discussion
----------
[Console] Document what is validated before and after Command::initialize()
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26611
| License | MIT
| Doc PR | n/a
Commits
-------
b1aff99 [Console] Correct Command::initialize() and InputInterface::bind() phpdoc regarding thrown exceptions
This PR was merged into the 2.8 branch.
Discussion
----------
[Intl] Blacklist Eurozone and United Nations in Region Data Generator
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28260
| License | MIT
| Doc PR | -
Commits
-------
e2e4049721 [Intl] Blacklist Eurozone and United Nations in Region Data Generator
This PR was merged into the 4.2-dev branch.
Discussion
----------
[VarExporter] throw component-specific exceptions
| 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 makes "serializing/unserializing" with the component diverge a bit from native serialize/unserialize (wich can throw plain "Exception" instances), but I think we should still do it.
Commits
-------
2c444927bc [VarExporter] throw component-specific exceptions
This PR was squashed before being merged into the 2.8 branch (closes#28393).
Discussion
----------
[Console] fixed corrupt error output for unknown multibyte short option
| Q | A
| ------------- | ---
| Branch? | 2.8 <!-- see below -->
| 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 <!-- 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 | #28320 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | - <!-- required for new features -->
[Console] Fixed#28320 by using mb_substr instead of index access
<!--
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
-------
0f86156 [Console] fixed corrupt error output for unknown multibyte short option
This PR was squashed before being merged into the 2.8 branch (closes#28374).
Discussion
----------
[Console] fixed PHPDoc for setArgument/setOption in InputInterface
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28354
| License | MIT
| Doc PR |
Methods now accept a value of any type except objects not implementing __toString().
**Example use case:** when using array arguments/options I can't set them programmatically without getting errors about type mismatch (from the IDE). With this patch it now works as expected.
Commits
-------
61529f3cd7 [Console] fixed PHPDoc for setArgument/setOption in InputInterface
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Change AmqpExt classes constructor signature
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| 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
| License | MIT
| Doc PR | n/a
This pull requests does 2 things:
* It makes `Connection` a first argument of AmqpExt classes. I think it makes sense as this is the most important argument for those classes.
* As the `Serializer` is now a second argument, I propose to make it optional and use the default serializer that we've added recently if `null` (`Serializer::create()`)
It makes the component even more user friendly when not using Symfony full stack (and provide good defaults).
Commits
-------
2d55ae5212 [Messenger] changed AmqpExt classes constructor signature
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Uses a messenger serializer, not an individual encoder/decoder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ø
| License | MIT
| Doc PR | Will come
Makes the component-based even simpler.
**Before**
```php
$encoderDecoder = Serializer::create();
$middleware = [new SendMessageMiddleware(new SenderLocator([
Message::class => new AmqpTransport($encoderDecoder, $encoderDecoder, $connection),
]))];
```
**After**
```php
$middleware = [new SendMessageMiddleware(new SenderLocator([
Message::class => new AmqpTransport(Serializer::create(), $connection),
]))];
```
Commits
-------
5b93f5f45e Uses a messenger serializer, not an individual encoder/decoder
This PR was merged into the 3.4 branch.
Discussion
----------
[Controller][ServiceValueResolver] Making method access case insensitive
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28254
| License | MIT
| Doc PR | -
Fix#28254 by making the method access insensitive in `ServiceValueResolver`.
Commits
-------
cc6f82769b [Controller][ServiceValueResolver] Making method access case insensitive
This PR was merged into the 2.8 branch.
Discussion
----------
[Console] Fix SymfonyQuestionHelper::askQuestion() with choice value as default
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/26885
| License | MIT
| Doc PR | n/a
There is an inconsistency between `SymfonyStyle::askQuestion(new ChoiceQuestion(...))` and `SymfonyStyle::choice(...)`, the former does not support to have a choice value as default instead of a choice key while the latter handles both.
This is causing an `undefined index` notice breaking interactive command testing, fixed here.
Commits
-------
c51dda0 [Console] Fix SymfonyQuestionHelper::askQuestion() with choice value as default
* 4.1:
[DI] configure inlined services before injecting them when dumping the container
Consistently throw exceptions on a single line
fix fopen calls
Update .editorconfig
* 3.4:
[DI] configure inlined services before injecting them when dumping the container
Consistently throw exceptions on a single line
fix fopen calls
Update .editorconfig
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Add a SenderLocator decoupled from ContainerInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | upcoming
For handler locators, we have a generic `HandlerLocator` class that takes a simple mapping instead of a service locator. The same did not exist for sender locators. So, this PR adds this possibility as well. That allows for something like this:
```php
new MessageBus([
new SendMessageMiddleware(new SenderLocator([
Message::class => new AmqpTransport($encoderDecoder, $encoderDecoder, $connection),
])),
new HandleMessageMiddleware(new HandlerLocator([
Message::class => new MessageHandler(),
])),
]);
```
Commits
-------
e658e155aa [Messenger] added a SenderLocator decoupled from ContainerInterface
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger][Profiler] Trace middleware execution
| 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 | part of #27262 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
This is a start for #27262 with:
- traceable Messenger middlewares
- ~~a dedicated category for http kernel controller args resolvers~~ => See #28387
<img width="1071" alt="screenshot 2018-05-20 a 12 23 55" src="https://user-images.githubusercontent.com/2211145/40278071-98c04924-5c2a-11e8-9770-d78ac62d2c16.PNG">
Messenger middleware are traced, with bus info (if not shared accros buses):
<img width="1069" alt="screenshot 2018-05-20 a 12 28 15" src="https://user-images.githubusercontent.com/2211145/40278073-9e6979f4-5c2a-11e8-9657-ee3aa057a5be.PNG">
Another possibility is to use the middleware id instead of the class (with or without extra bus info?):
<img width="1074" alt="screenshot 2018-05-20 a 12 32 24" src="https://user-images.githubusercontent.com/2211145/40278074-9e85f43a-5c2a-11e8-9f13-ad41de342079.PNG">
(_of course, collected times are faked here using `usleep` in the traceable middleware_)
Commits
-------
e974f67b1f [Messenger][Profiler] Trace middleware execution
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Change exceptions to use component's one
| 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 <!-- 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
| License | MIT
| Doc PR | n/a
<!--
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
-------
4e0e5e5fdb [Messenger] changed exceptions to use component's one
This PR was merged into the 4.2-dev branch.
Discussion
----------
[HttpKernel][Profiler] Add arg value resolver category in performances panel
| 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 | part of #27262 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
Extracted from https://github.com/symfony/symfony/pull/27321
<img width="1071" alt="screenshot 2018-05-20 a 12 23 55" src="https://user-images.githubusercontent.com/2211145/40278071-98c04924-5c2a-11e8-9770-d78ac62d2c16.PNG">
Commits
-------
b24e0543e0 [HttpKernel][Profiler] Add arg value resolver category in performances panel
* 4.1:
[appveyor] fix
[DI] Fix dumping some complex service graphs
Revert "minor #28321 [Routing] Fixed the interface description of the url generator interface (Toflar)"
Fixed caching of templates in default path on cache warmup
added missing LICENSE file
remove cache warmers when Twig cache is disabled
[Workflow] Make sure we do not run the next transition on an updated state
change baseUrl to basePath to fix wrong profiler url
[HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients
chore: rename Appveyor filename
Fixed the interface description of the url generator interface
Format file size in validation message according to binaryFormat option
* 3.4:
[appveyor] fix
Revert "minor #28321 [Routing] Fixed the interface description of the url generator interface (Toflar)"
Fixed caching of templates in default path on cache warmup
remove cache warmers when Twig cache is disabled
[HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients
chore: rename Appveyor filename
Fixed the interface description of the url generator interface
Format file size in validation message according to binaryFormat option
* 2.8:
[appveyor] fix
Revert "minor #28321 [Routing] Fixed the interface description of the url generator interface (Toflar)"
remove cache warmers when Twig cache is disabled
[HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients
chore: rename Appveyor filename
Fixed the interface description of the url generator interface
Format file size in validation message according to binaryFormat option
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DI] Forward Container::reset() to services implementing ResetInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | not really
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Should help the garbage collector during tests.
Commits
-------
5d26ba1fd6 [DI] Forward Container::reset() to services implementing ResetInterface
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Dotenv] use array instead of variadic in Dotenv::doLoad()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
According to comments done after merge in #26859.
Commits
-------
f3af2421f4 [Dotenv] use array instead of variadic in Dotenv::doLoad()
This PR was merged into the 4.2-dev branch.
Discussion
----------
[DI] leverage Contracts\Service
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Embedding #28206 for now.
This deprecates some generic interfaces from the DI component in favor of the similar ones proposed for `Contracts\Service`.
Commits
-------
87392ab30d [DI] leverage Contracts\Service
This PR was squashed before being merged into the 4.2-dev branch (closes#22225).
Discussion
----------
[Console] Support formatted text cutting
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes/no
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
allows cutting a formatted text to a certain width. Actually needed if we want to support max. column widths in tables (see #22156)
```php
$text = 'pre <error>foo bar baz</error> post';
dump('BEFORE');
$output->writeln(wordwrap($output->getFormatter()->format($text), 3, "\n", true), OutputInterface::OUTPUT_RAW);
dump('AFTER');
$output->writeln($output->getFormatter()->format($text, 3), OutputInterface::OUTPUT_RAW);
```
![image](https://cloud.githubusercontent.com/assets/1047696/24519346/19c9b0ca-1585-11e7-8437-0bcfb6fab63e.png)
Commits
-------
09f8ad9 [Console] Support formatted text cutting
This PR was merged into the 2.8 branch.
Discussion
----------
[FileValidator] Format file size in validation message according to binaryFormat option
| Q | A
| ------------- | ---
| Branch? | 2.8 up to master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #27682
| License | MIT
| Doc PR |
The binaryFormat option of the constraint is not taken into account if the maxsize limit is defined by the php configuration files.
This patch correct this inconsistent behavior.
If the binaryOption is not set, the unit of measurement used remains in binary because it’s the unit used in php configuration files.
Commits
-------
0edbbd3fea Format file size in validation message according to binaryFormat option
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Contracts] Add traits+interfaces from the DI component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
* added `Service\ServiceSubscriberInterface` to declare the dependencies of a class that consumes a service locator
* added `Service\ServiceSubscriberTrait` to implement `Service\ServiceSubscriberInterface` using methods' return types
* added `Service\ServiceLocatorTrait` to help implement PSR-11 service locators
Commits
-------
675abdcfee [Contracts] Add traits+interfaces from the DI component
This PR was merged into the 4.2-dev branch.
Discussion
----------
Mark ExceptionInterfaces throwable #2
| 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 has been reverted in beta of 4.1 because of lack of support in prophecy, which has been fixed since then (incl. release). Can be merged again.
References:
https://github.com/symfony/symfony/pull/26702https://github.com/symfony/symfony/pull/27420https://github.com/symfony/symfony/issues/27419https://github.com/phpspec/prophecy/pull/412
ping @dunglas @ciaranmcnulty @dkarlovi @Wirone @teohhanhui @stof @nicolas-grekas @ondrejmirtes
Commits
-------
17c3675226 Mark ExceptionInterfaces throwable
This PR was merged into the 4.2-dev branch.
Discussion
----------
[LOCK] Add a PdoStore
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #25400
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/9875
This is an alternative to #25578
Commits
-------
46fe1b0712 Add a PdoStore in lock
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Dotenv] add a flag to allow env vars override
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26846
| License | MIT
| Doc PR | symfony/symfony-docs#9568
I choose to use a new parameter in the constructor instead of `populate()` to not add boilerplate code to them who want allow overriding in their current setup. It's just a parameter to add in `Dotenv` creation instead of change or customize the loading of different .env files.
I targeted 4.1 despite the feature freeze because it's a small change but if you don't agree I can change to 4.2.
~~If you accept this PR I will do the doc PR then.~~
doc ready
Commits
-------
228b220495 [Dotenv] add Dotenv::overload() to allow env vars override
This PR was squashed before being merged into the 4.2-dev branch (closes#26997).
Discussion
----------
[PropertyInfo] Add an extractor to guess if a property is initializable
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| 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
When dealing with value objects, being able to detect if a property can be initialized using the constructor is a very valuable information. It's mandatory to add a proper value object support in API Platform and in the Serializer component.
See api-platform/core#1749 and api-platform/core#1843 for the related discussions, extended use cases and proof of concepts.
This PR adds a new interface to guess if a property can be initialized through the constructor, and an implementation using the reflection (in `ReflectionExtractor`).
Commits
-------
9d2ab9e348 [PropertyInfo] Add an extractor to guess if a property is initializable
This PR was merged into the 4.1 branch.
Discussion
----------
Add missing LICENSE file
| Q | A
| ------------- | ---
| Branch? | 4.1
| 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 | #28353
| 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
-------
6484ef8258 added missing LICENSE file
This PR was squashed before being merged into the 4.2-dev branch (closes#25125).
Discussion
----------
[VarDumper] New env var to select the dump format
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | todo
This PR introduces a new environment variable that can be used to force `dump()` to generate HTML even in CLI, or CLI even in a web context.
It allows to dump large objects when debugging a command, to open the resulting HTML in a browser, and to benefit of the nice JS UI (folded by default, search engine...).
Example usage:
VAR_DUMPER_FORMAT=html vendor/bin/behat > tmp.html; open -a firefox tmp.html
VAR_DUMPER_FORMAT=cli vendor/bin/behat > tmp.txt
Commits
-------
536125ac3c [VarDumper] New env var to select the dump format
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Uses Symfony Serializer by default for envelope items
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28164
| License | MIT
| Doc PR | ø
The original approach was to use `serialize`/`unserialize` for envelope items. It turns out it has limitations (see #28247) and reduces the compatibility with 3rd party systems (see #28164). This pull-request changes the existing mechanism by using Symfony Serializer by default.
It keeps the `serialize`/`unserialize` mechanism to allow users of the experimental component to keep using it in 4.2 and allow to have a non-disruptive upgrade to 4.2.
Commits
-------
9b575ab263 Uses Symfony Serializer by default for envelope items
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Process] Add relative path support for PHP_BINARY env var of PhpExecutableFinder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | /
| License | MIT
| Doc PR | /
At the moment, only the absolute path for PHP_BINARY env var works, for instance :
```
$ PHP_BINARY=/usr/bin/php7.2 php bin/console server:run
[OK] Server listening on http://127.0.0.1:8000
$ PHP_BINARY=php7.2 php bin/console server:run
[ERROR] Unable to find the PHP binary.
```
This PR makes possible the second command.
Commits
-------
52ed9889af Add relative path support for PHP_BINARY env var of PhpExecutableFinder
This PR was squashed before being merged into the 4.1 branch (closes#28322).
Discussion
----------
[Workflow] Make sure we do not run the next transition on an updated state
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR |
When you have a workflow like this, where all transitions are named the same.
![php](https://user-images.githubusercontent.com/1275206/44908106-87914680-ad1a-11e8-9c6f-e58de4b255e8.png)
The current behavior on `$stateMachine->apply($object, 'next')` is that it will go to "done".
It will do this because it checks the current "froms" at each iteration in the loop in `apply()`. It should check the valid transition before it actually apply them.
Commits
-------
d9dda76d8a [Workflow] Make sure we do not run the next transition on an updated state
This PR was merged into the 2.8 branch.
Discussion
----------
[HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #28125
| License | MIT
| Doc PR | -
Commits
-------
255455430a [HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Translation] Added intl message formatter.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | replaces #20007
| License | MIT
| Doc PR |
This PR will replace #20007 and continue the work from the original author.
I've have tried to address all comments made in the original PR.
Commits
-------
2a90931e52 cs
fb30c77659 Be more specific with what exception we catch
b1aa0047fd Only use the default translator if intl extension is loaded
f88153fa22 Updates according to feedback
597a15d7f7 Use FallbackFormatter instead of support for multiple formatters
2aa7181e15 Fixes according to feedback
a325a443ed Allow config for different domain specific formatters
b43fe21997 Add support for multiple formatters
c2b3dc0a90 [Translation] Added intl message formatter.
19e8e69979 use error
940d440e87 Make it a warning