This PR was squashed before being merged into the 2.7 branch (closes#21790).
Discussion
----------
[Intl] Update ICU data to 58.2
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
ICU 58.2 was released: http://site.icu-project.org/download/58
Commits
-------
d135e5cd2f [Intl] Make tests pass after the ICU data update
65faa1043d [Intl] Update ICU data to 58.2
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Fix ordering of tags inheritance
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Tag inheritance should have predictable ordering, from child to parents.
This PR also adds tests for ResolveDefinitionInheritancePass (heavily inspired by ResolveDefinitionTemplatePass).
Commits
-------
18e7681fc5 [DI] Fix ordering of tags inheritance
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Form][Serializer] Add missing conflicts for DI
| Q | A
| ------------- | ---
| Branch? | master
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/21375#discussion_r103180920
| License | MIT
They make use of `PriorityTaggedServiceTrait` which is available since 3.2 only
Commits
-------
ddae4eff50 [Form][Serializer] Add missing conflicts for DI
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Remove experimental status from service-locator argument type
| 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/21625#issuecomment-282483374, https://github.com/symfony/symfony/pull/21625#discussion_r102232221, #21710
| License | MIT
The `service-locator` argument type is not controversial to me. We know its scope, nothing really surprising, just a map of services to be lazily loaded like `iterator` is (which is not experimental) but keyed.
About its api, it's just PSR-11 restricted to objects, nothing that can't be changed safely in the future.
As stated in https://github.com/symfony/symfony/pull/21625#issuecomment-282483374, it proven its usefulness already. I think what we were looking for by flagging it experimental is just to see it in action, we've 3 opened PRs for that (#21625, #21690, #21730).
This allows introducing deprecations for making use of the feature in the core, thus unlocks #21625 and #21690.
Commits
-------
46dc47af11 [DI] Remove experimental status from service-locator argument type
This PR was merged into the 3.3-dev branch.
Discussion
----------
[HttpKernel] Added the SessionValueResolver
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21159
| License | MIT
| Doc PR | (soon)
This feature adds the `SessionValueResolver`. That means that you no longer have to rely on injecting a `SessionInterface` implementation via the constructor or getting this implementation from the `Request`. Regardless of method, it does not know about the `getFlashBag()`.
By adding the `Session` to the action arguments, you can now type-hint against the implementation rather than interface, which contains the `getFlashBag()`, making it accessible rather than using duck-typing.
_It should also feel less like injecting a service into the constructor which has a state or getting a service from the request._
**Old Situation**
```php
class Controller
{
public function __construct(SessionInterface $session) { /* ... */ }
public function fooAction(Request $request)
{
$this->get('session')->get(...);
$request->getSession()->get(...);
$this->session->get(...)
// duck-typing
$this->get('session')->getFlashBag();
$request->getSession()->getFlashBag();
$this->session->getFlashBag();
$this->addFlash(...);
}
}
```
**New Situation** _- The controller shortcut for flashbag could in theory be removed now_
```php
class Controller
{
public function fooAction(Session $session)
{
$session->get(...);
$session->getFlashBag();
}
}
```
Commits
-------
b4464dcea1 Added the SessionValueResolver
* 3.2:
Revamped the README file
Fix missing namespace in AddConstraintValidatorPassTest
[SecurityBundle] simplified code
[ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported
* 2.8:
Revamped the README file
Fix missing namespace in AddConstraintValidatorPassTest
[ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported
* 2.7:
Revamped the README file
Fix missing namespace in AddConstraintValidatorPassTest
[ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported
This marks the X-Status-Code header method of setting a custom response
status code in exception listeners as deprecated. Instead there is now
a new method on the GetResponseForExceptionEvent that allows successful
status codes in the response sent to the client.
* 3.2:
Refactored other PHPUnit method calls to work with namespaced PHPUnit 6
Refactored other PHPUnit method calls to work with namespaced PHPUnit 6
Further refactorings to PHPUnit namespaces
resolve parameters in definition classes
* 2.8:
Refactored other PHPUnit method calls to work with namespaced PHPUnit 6
Further refactorings to PHPUnit namespaces
resolve parameters in definition classes
This PR was squashed before being merged into the 3.3-dev branch (closes#21122).
Discussion
----------
[ExpressionLanguage] Create an ExpressionFunction from a PHP function name
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
When we [extend Expression Language](http://symfony.com/doc/current/components/expression_language/extending.html), we often need to add PHP functions whose code is repetitive and redundant at the compiler/evaluator level. This PR proposes a new way more generic which allows to add a PHP function.
currently:
```php
$el = new ExpressionLanguage();
$compiler = function ($str) {
return sprintf('strtoupper(%s)', $str);
};
$evaluator = function ($arguments, $str) {
return strtoupper($str);
};
$el->addFunction(new ExpressionFunction('strtoupper', $compiler, $evaluator));
$el->evaluate('strtoupper("hello")'); // return "HELLO"
```
with this PR:
```php
$el->addFunction(ExpressionFunction::fromPhp('strtoupper'));
$el->evaluate('strtoupper("hello")'); // return "HELLO"
```
It includes PHP namespaced function:
```php
$el->addFunction(ExpressionFunction::fromPhp('My\strtoupper', 'my_strtoupper'));
$el->evaluate('my_strtoupper("hello")'); // return "HELLO"
```
Commits
-------
44d67ed5f5 [ExpressionLanguage] Create an ExpressionFunction from a PHP function name
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Serializer] Reduce complexity of NameConverter
Cleaner and faster implementation of camelcase normalization.
Speed improvement is particularly visible in long string input.
| 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
-------
50ca944278 [Serializer] Reduce complexity of NameConverter
This PR was merged into the 3.3-dev branch.
Discussion
----------
[VarDumper] Added a way to print or not comma separator and/or trailing comma
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
---
Usecase: Be able to display a dump on one line.
It's already used in the following projets: https://github.com/bobthecow/psysh/blob/master/src/Psy/VarDumper/Dumper.php#L93-L95
Commits
-------
1ef07515c1 [VarDumper] Added a way to print or not comma separator and/or trailing comma
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Yaml] fix DUMP_EMPTY_ARRAY_AS_SEQUENCE flag value
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
3953d76954 fix DUMP_EMPTY_ARRAY_AS_SEQUENCE flag value
This PR was squashed before being merged into the 2.8 branch (closes#21663).
Discussion
----------
Updated PHPUnit namespaces
| 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 | -
Follow Up of #21564
Commits
-------
205ced4 Updated PHPUnit namespaces
This PR was squashed before being merged into the 3.3-dev branch (closes#21471).
Discussion
----------
[Yaml] Allow dumping empty array as YAML sequence
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #9870, #15937, #16266
| License | MIT
| Doc PR |
PHP arrays are dumped as either YAML sequences or mappings, depending on whether the array has continuos integer keys or not.
An empty array is always dumped as a YAML mapping. Sometimes you want it dumped as a YAML sequence instead.
Commits
-------
87ffaf2b77 Bump version number
af7067c3cf Dump empty object as mapping
a6d94c1b53 [Yaml] Allow dumping empty array as YAML sequence
This PR was squashed before being merged into the 3.3-dev branch (closes#21478).
Discussion
----------
[Asset] Add support for preloading with links and HTTP/2 push
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | todo
Allows compatible clients to preload mandatory assets like scripts, stylesheets or images according to [the "preload" working draft of the W3C](https://www.w3.org/TR/preload/).
Thanks to this PR, Symfony will automatically adds `Link` HTTP headers with a `preload` relation for mandatory assets. If an intermediate proxy supports HTTP/2 push, it will convert preload headers. For instance [Cloudflare supports this feature](https://blog.cloudflare.com/using-http-2-server-push-with-php/).
It dramatically increases pages speed and make the web greener because only one TCP connection is used to fetch all mandatory assets (decrease servers and devices loads, improve battery lives).
Usage:
Updated version:
```html
<html>
<body>
Hello
<script src="{{ preload(asset('/scripts/foo.js'), 'script') }}"></script>
</body>
</html>
```
~~First proposal:~~
```html
<html>
<body>
Hello
<script src="{{ preloaded_asset('/scripts/foo.js', 'script') }}"></script>
</body>
</html>
```
- [x] Add tests
Commits
-------
7bab21700d [Asset] Add support for preloading with links and HTTP/2 push
This PR was merged into the 2.7 branch.
Discussion
----------
[Validator] do not guess getter method names
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #5219, #18700
| License | MIT
| Doc PR | TODO
Commits
-------
bd3a90a0c3 [Validator] do not guess getter method names
* 3.2:
[DependencyInjection] Fix using autowiring types when there are more than 2 services
[DependencyInjection] Fix autowiring collisions detection
[DI] Bug in autowiring collisions detection
* 2.8:
[DependencyInjection] Fix using autowiring types when there are more than 2 services
[DependencyInjection] Fix autowiring collisions detection
[DI] Bug in autowiring collisions detection
This PR was merged into the 2.8 branch.
Discussion
----------
[DependencyInjection] Fix autowiring types when there are more than 2 services colliding
| 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 |
There is a bug in the `AutowirePass`, when using more than 2 services colliding and you want to use the autowiring types: it may not work depending on their order because `notGuessableTypes` is not reset.
Commits
-------
5981278537 [DependencyInjection] Fix using autowiring types when there are more than 2 services
This PR was merged into the 2.8 branch.
Discussion
----------
[DependencyInjection] Fix autowiring collisions detection
| 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 |
Fixes https://github.com/symfony/symfony/pull/21658 by implementing the second proposal of https://github.com/symfony/symfony/pull/21658#issuecomment-280858452:
> Another idea: store the types used previously and check that new services registered don't implement them.
Commits
-------
bb70472dce [DependencyInjection] Fix autowiring collisions detection
6f578ee514 [DI] Bug in autowiring collisions detection
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Console] simplify the implementation of SymfonyStyle::comment()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes-ish
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
2321491d3f [Console] simplify the implementation of SymfonyStyle::comment()
* 3.2:
Fix typo in process error message
Update to PHPUnit namespaces
Minor typo fix messsagesData -> messagesData
remove translation data collector when not usable
This PR was merged into the 3.3-dev branch.
Discussion
----------
[PropertyInfo] Use iterators for PropertyInfoExtractor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Most of the time, when using the cache, the property info extractors are not used: the new iterator feature looks perfect to prevent their instantiation.
Commits
-------
38523a9 [PropertyInfo] Use iterators for PropertyInfoExtractor
This PR was squashed before being merged into the 3.3-dev branch (closes#21655).
Discussion
----------
[PropertyInfo] Make classes final
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
The classes of the PropertyInfo component do not provide extension points, so imo it's better to make them final in 4.0.
Commits
-------
313fec9 [PropertyInfo] Make classes final
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Add "instanceof" section for local interface-defined configs
| 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 is a direction follow up of #21357 on which we're working together with @dunglas. From the description posted there:
There is some work being done to include features of [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle) in the core of Symfony. The goal of all those PRs is to improve the developper experience of the framework, allow to develop faster while preserving all benefits of using Symfony (strictness, modularity, extensibility...) and make it easier to learn for newcomers.
This PR implements the tagging feature of ActionBundle in a more generic way. It will help to get rid of `AppBundle` in the the standard edition and to register automatically some classes including commands.
Here is an example of config (that can be embedded in the standard edition) to enable those features:
```yaml
# config/services.yml
services:
_defaults:
autowire: ['get*', 'set*'] # Enable constructor, getter and setter autowiring for all services defined in this file
_instanceof:
Symfony\Component\Console\Command: # Add the console.command tag to all services defined in this file having this type
tags: ['console.command']
# Set tags but also other settings like "public", "autowire" or "shared" here
Twig_ExtensionInterface:
tags: ['twig.extension']
Symfony\Component\EventDispatcher\EventSubscriberInterface:
tags: ['kernel.event_subscriber']
App\: # Register all classes in the src/Controller directory as services
psr4: ../src/{Controller,Command,Twig,EventSubscriber}
```
It's part of our 0 config initiative: controllers and commands will be automatically registered as services and "autowired", allowing the user to create and inject new services without having to write a single line of YAML or XML.
When refactoring changes are also automatically updated and don't require to update config files. It's a big win for rapid application development and prototyping.
Of course, this is fully compatible with the actual way of defining services and it's possible to switch (or mix) approaches very easily. It's even possible to start prototyping using 0config features then switch to explicit services definitions when the project becomes mature.
Commits
-------
773eca7794 [DependencyInjection] Tests + refacto for "instanceof" definitions
2fb601983f [DependencyInjection] Add "instanceof" section for local interface-defined configs
* 3.2:
consistently parse omitted keys as the colon
bumped Symfony version to 3.2.5
updated VERSION for 3.2.4
update CONTRIBUTORS for 3.2.4
updated CHANGELOG for 3.2.4
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Don't try to instantiate reflection class if it doesn't exist
| Q | A
| ------------- | ---
| Branch? | master
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Introduced in https://github.com/symfony/symfony/pull/21419 so master only.
It breaks on bundles that ~~do not use the convention for naming their `Configuration`~~ do not have configuration, e.g. SecurityBundle's FirewallEntryPointExtension for which tests are actually broken (see travis).
Commits
-------
f9b917a60a [DI] Don't instantiate unexisting reflection class
This PR was squashed before being merged into the 3.3-dev branch (closes#20896).
Discussion
----------
[Console] Enhance MarkdownDescriptor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
In order to add usefulness to this descriptor, this PR allows to jump to a command description by clicking on the command name on the application summary.
It's not a generic approach but IMHO a quick win that should work at least for Github flavoured markdown.
The markdown format should also avoid using `Application::getLongVersion` as the markdown document title, as it may contain tags (and unnecessary information using the framework).
Lastly, the markdown format is now cleaned from tags initially used for console output formatting and only keeps properly escaped ones.
Commits
-------
ef5b087b4f Do not output formatting tags
6896865bcc [Console] MarkdownDescriptor: Don't use getLongVersion
fc2395e237 [Console] MarkdownDescriptor: Link to commands anchors
* 3.2:
Permit empty suffix on Windows
fixed CS
[FrameworkBundle] Remove unused import
[Console][Table] fixed render when using multiple rowspans.
add docblocks for Twig url and path function to improve ide completion
check for circular refs caused by method calls
[Serializer] fix upper camel case conversion (see #21399)
[DI] Auto register extension configuration classes as a resource
[Console] Updated phpdoc on return types
* 2.8:
Permit empty suffix on Windows
[Console][Table] fixed render when using multiple rowspans.
add docblocks for Twig url and path function to improve ide completion
check for circular refs caused by method calls
[Serializer] fix upper camel case conversion (see #21399)
[DI] Auto register extension configuration classes as a resource
[Console] Updated phpdoc on return types
* 2.7:
Permit empty suffix on Windows
[Console][Table] fixed render when using multiple rowspans.
add docblocks for Twig url and path function to improve ide completion
check for circular refs caused by method calls
[Serializer] fix upper camel case conversion (see #21399)
[DI] Auto register extension configuration classes as a resource
[Console] Updated phpdoc on return types
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Form][FrameworkBundle] Move FormPass to the Form component
| 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 | n/a
So that anyone using only Form and DI can use it for registering form types/type guessers.
Follows #19443, related to #21284
Commits
-------
e68a6d963c [FrameworkBundle][Form] Move FormPass to the Form component
This PR was merged into the 3.3-dev branch.
Discussion
----------
[FrameworkBundle][Serializer] Move SerializerPass to the Serializer
| 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 | n/a
Part of #21284
Commits
-------
95cf5084c0 [FrameworkBundle][Serializer] Move SerializerPass to the Serializer
This PR was merged into the 2.7 branch.
Discussion
----------
[DependencyInjection] check for circular refs caused by method calls
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19362
| License | MIT
| Doc PR |
Before we check for circular references, dependencies coming from method calls are not part of the dependency graph. That why the pass is not able to detect circular references like the one described in #19362 during compilation of the container.
If we add another check after all the optimisation passes have been processed, we should be able to detect these circular references too.
Commits
-------
fe4f7eccf7 check for circular refs caused by method calls
This PR was merged into the 2.7 branch.
Discussion
----------
[Serializer] fix upper camel case conversion (see #21399)
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | ?
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21399
| License | MIT
Improve upper camel case support of CamelCaseToSnakeCaseConverter (`ThisIsATest` now converts to `this_is_a_test` instead of `_this_is_a_test`).
Commits
-------
81e771ca1a [Serializer] fix upper camel case conversion (see #21399)
This PR was squashed before being merged into the 3.3-dev branch (closes#21450).
Discussion
----------
[Security] Lazy load guard authenticators and authentication providers
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Authentication stops on the first authenticator that fails or succeeds, let's instantiate them only if actually needed.
Commits
-------
cd6422ae73 [SecurityBundle] Lazy load authentication providers
b8a23ded63 [Security][Guard] Lazy load authenticators
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Deprecate underscore-services in YamlFileLoader
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
As discussed when introducing `_defaults`
Commits
-------
7781082587 [DI] Deprecate underscore-services in YamlFileLoader
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI][FrameworkBundle] ServiceLocator: Tests dumpers & update descriptors
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
This simply ensures the new feature is properly considered by the different dumpers, and updates the console descriptors to support the new `ServiceLocatorArgument`.
I also added the number of elements in an array/iterator/service_locator argument when using the `TextDescriptor` in this PR.
(fabbot is complaining about the new yaml tags support)
Commits
-------
aa9074d25a [DI][FrameworkBundle] ServiceLocator: Tests dumpers & update descriptors
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Use glob pattern to load config files
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21173
| License | MIT
| Doc PR | -
This relates to #21173, but I'm not sure if it completely fixes the issue.
This allows to use a glob pattern to load config files, which makes the following possible:
```
# config.yml
imports:
- { resource: "*.yml" }
- { resource: "folder/*.yml" }
- { resource: "/etc/myapp/*.{yml,xml}" }
```
It can also be used in a container extension, if a bundle uses a lot of configs:
```
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('*.yml');
$loader->load('routing/*');
```
Commits
-------
519180ef56 Use glob pattern to load config file
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Updated phpdoc on return types
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
The return type of “ask” is not necessarily a string (notice that “doAsk” may return mixed type).
Same for “validateAttempts” (validator may return something else than a string).
Commits
-------
442a304292 [Console] Updated phpdoc on return types
This PR was merged into the 2.7 branch.
Discussion
----------
[DI] Auto register extension configuration classes as a resource
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
Auto-register an extension configuration class as a resource from a compiler pass; not implicitly by the base extension class.
Causing some extensions to register its configuration, whereas others dont (e.g. framework bundle).
Fixes consistent cache invalidation whenever a configuration definition changes.
Commits
-------
142416b7d4 [DI] Auto register extension configuration classes as a resource
* 3.2: (27 commits)
Improve tracking of environment variables in the case of private services
[DI] Align AutowirePass with 2.8
property constraints can be added in child classes
added test for staticClassLoader in LazyLoadingMetadatafactory
fixed PHPUnit setUp and tearDown method visibility
spelling fixes
Readd Symfony version status in the toolbar
[Security] LdapUserProvider should not throw an exception if the UID key does not exist in an LDAP entry
make sure that null can be the invalid value
[VarDumper] Improve dump of AMQP* Object
Fix annotations cache folder path
[FrameworkBundle] Wire ArrayCache for annotation reader at bootstrap
Ignore missing 'debug.file_link_formatter' service in Debug bundle
[VarDumper] Fixed dumping of terminated generator
bumped Symfony version to 3.2.4
updated VERSION for 3.2.3
updated CHANGELOG for 3.2.3
bumped Symfony version to 2.8.18
updated VERSION for 2.8.17
updated CHANGELOG for 2.8.17
...
* 2.8:
property constraints can be added in child classes
added test for staticClassLoader in LazyLoadingMetadatafactory
spelling fixes
Readd Symfony version status in the toolbar
make sure that null can be the invalid value
[VarDumper] Improve dump of AMQP* Object
[VarDumper] Fixed dumping of terminated generator
bumped Symfony version to 2.8.18
updated VERSION for 2.8.17
updated CHANGELOG for 2.8.17
bumped Symfony version to 2.7.25
updated VERSION for 2.7.24
update CONTRIBUTORS for 2.7.24
updated CHANGELOG for 2.7.24
[FrameworkBundle] Simplify createPackageDefinition
fix directory resource considers same timestamp not fresh
return false early from directory resource
* 2.7:
property constraints can be added in child classes
added test for staticClassLoader in LazyLoadingMetadatafactory
spelling fixes
make sure that null can be the invalid value
bumped Symfony version to 2.7.25
updated VERSION for 2.7.24
update CONTRIBUTORS for 2.7.24
updated CHANGELOG for 2.7.24
[FrameworkBundle] Simplify createPackageDefinition
fix directory resource considers same timestamp not fresh
return false early from directory resource
This PR was merged into the 3.2 branch.
Discussion
----------
[DI] Align AutowirePass with 2.8
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Follow up a less than ideal [merge conflict resolution](https://github.com/symfony/symfony/pull/18691#issuecomment-218803903), found while reviewing AutowirePass in 2.8 and 3.2 and wondering about the delta. Should reduce future merge conflicts and help history tracking.
Commits
-------
dd5236a [DI] Align AutowirePass with 2.8
This PR was merged into the 3.2 branch.
Discussion
----------
Improve tracking of environment variables in the case of private services
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21273
| License | MIT
Recently, I stumbled upon an issue with environment variables that I had troubles to understand. Here it is:
I have two environment variables, defined in my `parameters.yml` with a default value of empty:
``` yaml
parameters:
env(MAILJET_PUBLIC_KEY): ''
env(MAILJET_PRIVATE_KEY): ''
```
I use these variables only in a private service:
``` xml
<service id="app.mailjet.transport" class="AppBundle\Mailjet\MailjetApiTransport" public="false">
<argument type="service" id="csa_guzzle.client.mailjet_api"/>
<argument>%env(MAILJET_PUBLIC_KEY)%</argument>
<argument>%env(MAILJET_PRIVATE_KEY)%</argument>
</service>
```
This private service is not used by any other service for the moment.
As the service is private and not used by any other service, the `RemoveUnusedDefinitionsPass` removes it from the container. However, when the container dumper dumps the container, it checks if the environment variable was dumped. As the service is now gone, an expection is thrown (`EnvParameterException, Incompatible use of dynamic environment variables "MAILJET_PUBLIC_KEY", "MAILJET_PRIVATE_KEY" found in parameters.`).
Commits
-------
f380ba3 Improve tracking of environment variables in the case of private services
This PR was merged into the 2.7 branch.
Discussion
----------
[Validator] property constraints can be added in child classes
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21538, #21567
| License | MIT
| Doc PR |
This reverts the changes done in #21053 (and applies the test written by @angelk in #21538). I think trying to "fix" #15950 with the changes from #21053 was a mistake. Child classes should be able to refine validation constraints (I basically agree with @ro0NL's reasoning in https://github.com/symfony/symfony/issues/21567#issuecomment-278729990.
Commits
-------
9513a8aa52 property constraints can be added in child classes
a266ff799c added test for staticClassLoader in LazyLoadingMetadatafactory
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Add support for named arguments
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | todo
This PR introduces named arguments for services definitions. It's especially useful to inject parameters in an autowired service. It is (at least partially) an alternative to #21376 and #20738.
Usage:
```yml
services:
_defaults: { autowire: true }
Acme\NewsletterManager: { $apiKey: "%mandrill_api_key%" }
# Alternative (traditional) syntax
services:
newsletter_manager:
class: Acme\NewsletterManager
arguments:
$apiKey: "%mandrill_api_key%"
autowire: true
```
```php
use Doctrine\ORM\EntityManager;
use Psr\Log\LoggerInterface;
namespace Acme;
class NewsletterManager
{
private $logger;
private $em;
private $apiKey;
public function __construct(LoggerInterface $logger, EntityManager $em, $apiKey)
{
$this->logger = $logger;
$this->em = $em;
$this->apiKey = $apiKey;
}
}
```
Commits
-------
8a126c8537 [DI] Deprecate string keys in arguments
2ce36a6074 [DependencyInjection] Add a new pass to check arguments validity
6e501296f9 [DependencyInjection] Add support for named arguments
This PR was squashed before being merged into the 3.3-dev branch (closes#19371).
Discussion
----------
[Serializer] Give access to the context to support* 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 | n/a |
This is a current use case to want to access the context form the `supports*` methods. This PR fixes this limitation.
Maybe can it be considered a bug fix?
Commits
-------
6a7a16e517 [Serializer] Give access to the context to support* methods
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Replace container injection by explicit service locators
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20658
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/7458
This adds a new `ServiceLocatorArgument` (`!service_locator`) argument type which takes a list of services, meant to be used as a concrete service locator in order to avoid the remaining needs for injecting the container when it's only a matter of dependency lazy-loading.
Config:
```yaml
App\FooBar: [!service_locator { key1: '@service1', key2: '@service2' }]
```
```xml
<service class="App\FooBar" public="false">
<argument type="service-locator">
<argument type="service" key="key1" id="service1"/>
<argument type="service" key="key2" id="service2"/>
</argument>
</service>
```
```php
new ServiceLocatorArgument(array('key1' => new Reference('service1'), 'key2' => new Reference('service2'));
```
Usage:
```php
$locator->has('key1') // true
$locator->has('service1') // false, the defined key must be used
$locator->get('key1'); // service1 instance
$locator->get('service1'); // exception
$locator->has('not-specified') // false
$locator->get('not-specified'); // exception
```
We have some concrete use cases in the core where this would be useful (see e.g. SecurityBundle's FirewallMap), same in userland/3rd party code (see related RFC).
Commits
-------
e7935c0adb [DI] Replace container injection by explicit service locators
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Serializer] Add the possibility to filter attributes
| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | n/a |
| License | MIT |
| Doc PR | todo |
This new features give the possibility to the end user to select select fields to normalize.
Exemple:
``` php
class Foo
{
public $a = '1';
public $b = '2';
public $c = '3';
}
$normalizer = new \Symfony\Component\Serializer\Normalizer\ObjectNormalizer();
$normalizer->normalize(new Foo(), null, ['attributes' => ['a', 'c']]);
// ['a' => '1', 'c' => '3']
```
Denormalization is also supported. This feature works for any normalizer using the `Symfony\Component\Serializer\Normalizer\AbstractNormalizer` class.
The main use case is to permit to API clients to optimize responses length by dropping unnecessary information like in the following example:
```
http://exemple.com/cars?fields=a,c
{'a' => 1, 'c' => 2}
```
Thanks to this PR, support for this feature will be available out of the box in [API Platform](https://api-platform.com).
Commits
-------
b3826fb0e7 [Serializer] Add the possibility to filter attributes
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Add prototype services for PSR4-based discovery and registration
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | to be done
Talking with @dunglas, we wondered if this could be a good idea, as a more general approach to folder-based service registration as done in [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle/blob/master/DependencyInjection/DunglasActionExtension.php).
So here is the implementation.
This allows one to define a set of services as such:
```yaml
services:
App\:
resources: ../src/{Controller,Command} # relative to the current file as usual
autowire: true # or any other attributes really
```
This looks for php files in the "src" folder, derivates PSR-4 class names from them, and uses `class_exists` for final discovery. The resulting services are named after the classes found this way.
The "resource" attribute can be a glob to select only a subset of the classes/files.
This approach has several advantages over [DunglasActionBundle](https://github.com/dunglas/DunglasActionBundle/blob/master/DependencyInjection/DunglasActionExtension.php):
- it is resilient to missing parent classes (see test case)
- it loads classes using the normal code path (the autoloader), thus play well with them (e.g. if one registered a special autoloader).
- it is more predictable, because it uses discovered paths as the only source of ids/classes to register - vs relying on `get_declared_classes`, which would make things context sensitive.
Fits well with current initiatives to me.
Commits
-------
03470b788e [DI] Add "psr4" service attribute for PSR4-based discovery and registration
This PR was squashed before being merged into the 3.3-dev branch (closes#21465).
Discussion
----------
[Debug] Support `@final` on methods
| 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/21461#discussion_r98401148
| License | MIT
| Doc PR |
This adds support for `@final` on methods:
```php
class Foo {
/**
* @final since version 2.0.
*/
public function bar()
{
}
}
```
ping @nicolas-grekas
Commits
-------
1b0a6b6c45 [Debug] Support on methods
This PR was merged into the 3.3-dev branch.
Discussion
----------
Secure unserialize by restricting allowed classes when using PHP 7
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ---
| License | MIT
| Doc PR | ---
While playing around with Symfony in a PHP 7.1 application I noticed a warning in how EnvParameterResoure uses unserialize. Since PHP 7.0 introduced the options argument which allows to restrict which classes can be unserialized for better security, it might make sense to use it here. As far as I can tell this is no BC break, it only provides an additional safety mechanism.
Commits
-------
b4201810b9 Conditionally add options to unserialize in PHP 7.0+.
This PR was squashed before being merged into the 2.7 branch (closes#21458).
Discussion
----------
[Config] Early return for DirectoryResource
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | sure?
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets |
| Related PRs | #21440
| License | MIT
| Doc PR | n/a
Alternate PR that implements an early return for `DirectoryResource` to increase the speed on large file sets. We can never return early with `true` without checking all assets within the resource, as the aforementioned referenced PR did; hence this PR takes the counter approach and returns `false` early where appropriate.
_Conversation about possible bug at https://github.com/symfony/symfony/pull/21458#discussion_r98366339._
Commits
-------
d5746ecfd2 fix directory resource considers same timestamp not fresh
96107e21f1 return false early from directory resource
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Config][DI] Add ComposerResource to track the runtime engine + deps
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
So that the container is invalidated whenever a new PHP runtime is used, a PHP-extension is added, or vendors are changed.
Commits
-------
a960c761d1 [Config][DI] Add ComposerResource to track runtime + vendors
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Deprecate (un)setting pre-defined services
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | #19192
| License | MIT
| Doc PR | -
This PR is the subset of #19668 that fixes#19192: it deprecates (un)setting pre-defined services.
This opens the path to some optimizations in the dumped container in 4.0.
Commits
-------
fdb2140b81 [DI] Deprecate (un)setting pre-defined services
This PR was squashed before being merged into the 3.3-dev branch (closes#21194).
Discussion
----------
[Yaml] Add tags support
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/21185
| License | MIT
| Doc PR |
This PR adds custom tags support to the Yaml component.
Symfony tags (`!!binary`, `!str`, etc.) are still managed in the parser to have a lighter diff but we'll be able to convert them later if we want to.
The primary addition of this PR is the `TagInterface`:
```php
interface TagInterface
{
public function construct(mixed $value): mixed;
}
```
It can be used to register custom tags. An example that could be used to convert [the syntax `=iterator`](https://github.com/symfony/symfony/pull/20907#issuecomment-270728216) to a tag:
```php
final class IteratorTag implements TagInterface
{
public function construct(mixed $value): mixed
{
return new IteratorArgument($value);
}
}
$parser = new Parser(['iterator' => new IteratorTag()]);
```
If you think this is too complex, @nicolas-grekas [proposed an alternative](https://github.com/symfony/symfony/issues/21185#issuecomment-271074840) to my proposal externalizing this support by introducing a new class `TaggedValue`.
Commits
-------
4744107 [Yaml] Add tags support
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] ContainerBuilder::compile() can optionally resolve env vars in parameter bag
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #21420
| License | MIT
| Doc PR | -
Here is a new feature allowing one to do `$container->compile(true)` and get the env vars resolved using the current env.
Commits
-------
a3fd512271 [DI] ContainerBuilder::compile() can optionally resolve env vars in parameter bag
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Implement PSR-11
TODO:
- [x] wait for a stable version of the psr/container package;
- [x] ~~deprecate instanciating ServiceNotFoundException directly, or using any of its methods directly;~~ not relevant anymore
- [x] act on the outcome of https://github.com/php-fig/container/issues/8 (solved in https://github.com/php-fig/container/issues/9) ;
- [x] ~~solve the mandatory NotFoundExceptionInterface on non-existing service
problem (with a flag ?);~~ non-issue, see comments below
- [x] provide meta-package psr/container-implementation if all problems can
be solved.
| Q | A
| ------------- | ---
| Branch? | master
| New feature? | yes
| BC breaks? | not at the moment
| Tests pass? | didn't pass before pushing, or even starting to code, will see Travis
| License | MIT
| Doc PR | TODO
This PR is a first attempt at implementing PSR-11, or at least trying to get closer to it.
Delegate lookup is optional, and thus not implemented for now.
Commits
-------
bde0efd01c Implement PSR-11
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Process] Accept command line arrays and per-run env vars, fixing signaling and escaping
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #12488, #11972, #10025, #11335, #5759, #5030, #19993, #10486
| License | MIT
| Doc PR | -
I think I found a way to fix this network of issues once for all.
Of all the linked ones, only the last two are still open: the remaining were closed in dead ends.
Instead of trying to make `ProcessUtil::escapeArgument` work correctly on Windows - which is impossible as discussed in #21347 - this PR deprecates it in favor of a more powerful approach.
Depending on the use case:
- when a simple command should be run, `Process` now accepts an array of arguments (the "binary" being the first arg). Making this the responsibility of `Process` (instead of `ProcessBuilder`) gives two benefits:
- escape becomes an internal detail that doesn't leak - thus can't be misused ([see here](https://github.com/symfony/symfony/pull/21347#issuecomment-274051370))
- since we know we're running a single command, we can prefix it automatically by "exec" - thus fixing a long standing issue with signaling
```php
$p = new Process(array('php', '-r', 'echo 123;'));
echo $p->getCommandLine();
// displays on Linux:
// exec 'php' '-r' 'echo 123;'
```
- when a shell expression is required, passing a string is still allowed. To make it easy and look-like sql prepared statements, env vars can be used when running the command. Since the shell is OS-specific (think Windows vs Linux) - this PR assumes no portability, so one should just use each shell's specific syntax.
From the fixtures:
```php
$env = array('FOO' => 'Foo', 'BAR' => 'Bar');
$cmd = '\\' === DIRECTORY_SEPARATOR ? 'echo !FOO! !BAR! !BAZ!' : 'echo $FOO $BAR $BAZ';
$p = new Process($cmd, null, $env);
$p->run(null, array('BAR' => 'baR', 'BAZ' => 'baZ'));
$this->assertSame('Foo baR baZ', rtrim($p->getOutput()));
$this->assertSame($env, $p->getEnv());
```
Commits
-------
330b61fecb [Process] Accept command line arrays and per-run env vars, fixing signaling and escaping
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Refacto / cleanup / minor fixes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
An almost neutral refacto touching only new things in master - unlocking some next steps.
- renames "autowire method" to "autowire call"
- renames `GetterProxyInterface` to `InheritanceProxyInterface`
- moves some helpers in a new internal `InheritanceProxyHelper`
- some other minor things
Commits
-------
ad5b5b5d93 [DI] Refacto / cleanup / minor fixes
* 3.2:
Remove 3.1 from PR template
fixed test name
[Cache] Fix class exists checks in PhpArrayAdapter
Casting TableCell value to string.
[FrameworkBundle] fixed custom domain for translations in php templates
[Form] Fixed DateType format option
[Config] Fix checking cache for non existing meta file
* 2.8:
Remove 3.1 from PR template
fixed test name
Casting TableCell value to string.
[FrameworkBundle] fixed custom domain for translations in php templates
[Form] Fixed DateType format option
[Config] Fix checking cache for non existing meta file
* 2.7:
Remove 3.1 from PR template
fixed test name
Casting TableCell value to string.
[FrameworkBundle] fixed custom domain for translations in php templates
[Form] Fixed DateType format option
This PR was merged into the 2.8 branch.
Discussion
----------
[Config] Fix checking cache for non existing meta file
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | maybe
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
17f02e0 [Config] Fix checking cache for non existing meta file
This PR was merged into the 2.7 branch.
Discussion
----------
[Form] Fixed DateType format option for single text widget
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
It's currently not possible to use a custom format with `DateType` when not using one of the three values day, month or year (i.e in my case "MM/yyyy").
The formatter handles it, it looks like this option check is wrong, this PR fixes it.
Commits
-------
9e0d531d36 [Form] Fixed DateType format option
This PR was squashed before being merged into the 2.7 branch (closes#21430).
Discussion
----------
Casting TableCell value to string.
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21429
| License | MIT
| Doc PR |
PHP throws a catchable fatal error when the value from this method is
used in strstr in the Table class. This fixes the error by casting to a string before returning the value.
Commits
-------
1e5707fed3 Casting TableCell value to string.
This PR was merged into the 3.3-dev branch.
Discussion
----------
[HttpKernel][FrameworkBundle] Lazy load argument value resolvers
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
The ArgumentResolver resolves an arg using the first ArgumentValueResolver which `supports()` it (which can be complex, see e.g. [sensiolabs/SensioFrameworkExtraBundle#436](https://github.com/sensiolabs/SensioFrameworkExtraBundle/pull/436/files#diff-865d48d9369c4431bce36ba642834570R10)).
Commits
-------
02b4aaa25f [HttpKernel] Lazy load argument value resolvers
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI][Config] Add & use ReflectionClassResource
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #21079
| License | MIT
| Doc PR | -
With new changes comming to 3.3, we need a more generic reflection tracking logic than the one already managed by the autowiring subsystem.
This PR adds a new ReflectionClassResource in the Config component, and a new ContainerBuilder::getReflectionClass() method in the DI one (for fetching+tracking reflection-related info).
ReflectionClassResource tracks changes to any public or protected properties/method.
PR updated and ready, best viewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/21419/files?w=1).
changelog:
* added `ReflectionClassResource` class
* added second `$exists` constructor argument to `ClassExistenceResource` - with a special mode that prevents fatal errors from happening when some parent class is broken (logic generalized from AutowiringPass)
* made `ClassExistenceResource` also work with interfaces and traits
* added `ContainerBuilder::getReflectionClass()` for retrieving and tracking reflection class info
* deprecated `ContainerBuilder::getClassResource()`, use `ContainerBuilder::getReflectionClass()` or `ContainerBuilder::addObjectResource()` instead
Commits
-------
37e44939ef [DI][Config] Add & use ReflectionClassResource
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Allow to count on lazy collection arguments
| 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/21450#issuecomment-275931764
| License | MIT
| Doc PR | todo (with https://github.com/symfony/symfony-docs/issues/7336)
When using the new iterator feature of the DI component to lazy load collection, we always know the number of arguments in the collection (only the invalidBehavior set to `IGNORE_ON_INVALID_REFERENCE` may change this number). So we are able to generate and use a `RewindableGenerator` implementing `\Countable` by computing this value ahead.
So, in a service accepting `array|iterable`, like in the `GuardAuthenticationListener` (see #21450):
```php
class GuardAuthenticationListener implements ListenerInterface
{
private $guardAuthenticators;
/**
* @param iterable|GuardAuthenticatorInterface[] $guardAuthenticators The authenticators, with keys that match what's passed to GuardAuthenticationProvider
* @param LoggerInterface $logger A LoggerInterface instance
*/
public function __construct($guardAuthenticators, LoggerInterface $logger = null)
{
// ...
}
public function handle(GetResponseEvent $event)
{
if (null !== $this->logger) {
$context = array()
if (is_array($this->guardAuthenticators) || $this->guardAuthenticators instanceof \Countable) {
$context['authenticators'] = count($this->guardAuthenticators);
}
$this->logger->debug('Checking for guard authentication credentials.', $context);
}
// ...
}
}
```
we still keep the ability to call count without loosing the lazy load benefits.
Commits
-------
f23e460 [DI] Allow to count on lazy collection arguments
* 3.2:
Add HEADER_FORWARDED to setTrustedHeaderName docs
Fix phpDoc typo
[FrameworkBundle][Console] JsonDescriptor: Respect original output
Remove dead code
Enable dump() in autoload-dev
add missing functional Serializer test case
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] : Fix bad generation of proxy class when use overriden getter on class with constructor
[DI] : Fix bad generation of proxy class when use overriden getter on class with constructor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21507
| License | MIT
- [X] Add test fail
- [X] Fix bug
- [X] Run test pass
Commits
-------
2440b0f [DI] : Fix bad generation of proxy class when use overriden getter on class with constructor
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Process] Deprecate not inheriting env vars + compat related settings
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
Turning compat on/off is not a feature in itself.
About env vars: if one has unwanted env vars, one will still be able to remove them explicitly for the command. From my experience, not having eg PATH or HTTP_PROXY, etc. is more problematic. I'd prefer people to care about setting/unsetting the environment vars **they know about**, rather than allowing them to start with no ENV and discover later that they missed setting some var.
Commits
-------
df14451a73 [Process] Deprecate not inheriting env vars + compat related settings
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Deduplicate resources while adding them
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Since the string cast of resources is already used to deduplicate them, let's do it earlier. This can only decrease memory usage.
Commits
-------
04853fc5c3 [DI] Deduplicate resource while adding them
* 3.2:
[Console] Fix too strict test
[FrameworkBundle] Execute the PhpDocExtractor earlier
[validator] Updated croatian translation
Update DebugHandlersListener.php
ignore invalid cookies expires date format
[Console] SfStyleTest: Remove COLUMN env on tearDown
[TwigBundle] Fix the name of the cache warming test class
[Console] Fix TableCell issues with decoration
Add missing pieces in the upgrade guide to 3.0
* 2.8:
[Console] Fix too strict test
[FrameworkBundle] Execute the PhpDocExtractor earlier
[validator] Updated croatian translation
ignore invalid cookies expires date format
[TwigBundle] Fix the name of the cache warming test class
[Console] Fix TableCell issues with decoration
Add missing pieces in the upgrade guide to 3.0
* 2.7:
[Console] Fix too strict test
[validator] Updated croatian translation
ignore invalid cookies expires date format
[TwigBundle] Fix the name of the cache warming test class
[Console] Fix TableCell issues with decoration
Add missing pieces in the upgrade guide to 3.0
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Remove usages of ClassExistenceResource
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
As discussed in #21452 (see last comments)
Commits
-------
ec8f1ad453 [DI] Remove usages of ClassExistenceResource
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Add getter injection
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20657
| License | MIT
| Doc PR | symfony/symfony-docs#7300
Getter overriding by the container will allow a new kind of dependency injection which enables easier laziness and more immutable classes, by not requiring any corresponding setter. See linked issue for more.
This is WIP:
- [x] wire the concept
- [x] dump anonymous classes with PhpDumper
- [x] generate at runtime in ContainerBuilder::createService
- [x] tests
- [x] make it work on PHP 5
Commits
-------
cb498580d1 [DI] Add getter injection
This PR was merged into the 3.3-dev branch.
Discussion
----------
[HttpFoundation] Mark more methods as `@final`
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
Follow up of #19734 (ping @GuilhemN)
Commits
-------
84a664f929 [HttpFoundation] Mark more methods as `@final`
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Enhance logging in compiler passes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
We should log more in compiler passes - and this should be better integrated in usual log reports.
For logging more, let's drop LoggingFormatter and add a simple "log" method on ContainerBuilder.
For better integration, let's throw silenced notices - they can be caught by our Debug handler.
Commits
-------
fb200a0d2f [DI] Enhance logging in compiler passes
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI][DX] Do not map id to class for global classes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yesish
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21380
| License | MIT
| Doc PR | N/A
Using a global classname as service id without specifying the definition class attribute won't work anymore after this, in the benefit of properly throwing an exception at compilation time for a misconfigured service. Service ids could previously be wrongly interpreted as a class name.
So:
```yml
services:
app_bar:
arguments: ['foo']
```
will now properly result into:
> Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: The definition for "app_bar" has no class.
at compilation time.
Commits
-------
bb870304f0 [DI][DX] Do not map id to class for global classes
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Security] make LdapBindAuthenticationProvider capable of searching for the DN
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #16823, #20905
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/7420
I guess due to the separation between the user and auth provider something like the following isn't ok (note: the following works just fine for me but if course in the end the username is the DN and not the user provided shorter username):
```diff
diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php
index 5ebb09a..18d7825 100644
--- a/src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php
+++ b/src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php
@@ -70,7 +70,7 @@ class LdapBindAuthenticationProvider extends UserAuthenticationProvider
*/
protected function checkAuthentication(UserInterface $user, UsernamePasswordToken $token)
{
- $username = $token->getUsername();
+ $username = $user->getUsername();
$password = $token->getCredentials();
if ('' === $password) {
@@ -78,10 +78,7 @@ class LdapBindAuthenticationProvider extends UserAuthenticationProvider
}
try {
- $username = $this->ldap->escape($username, '', LdapInterface::ESCAPE_DN);
- $dn = str_replace('{username}', $username, $this->dnString);
-
- $this->ldap->bind($dn, $password);
+ $this->ldap->bind($username, $password);
} catch (ConnectionException $e) {
throw new BadCredentialsException('The presented password is invalid.');
}
diff --git a/src/Symfony/Component/Security/Core/User/LdapUserProvider.php b/src/Symfony/Component/Security/Core/User/LdapUserProvider.php
index fc42419..8194c4c 100644
--- a/src/Symfony/Component/Security/Core/User/LdapUserProvider.php
+++ b/src/Symfony/Component/Security/Core/User/LdapUserProvider.php
@@ -115,7 +115,7 @@ class LdapUserProvider implements UserProviderInterface
{
$password = $this->getPassword($entry);
- return new User($username, $password, $this->defaultRoles);
+ return new User($entry->getDn(), $password, $this->defaultRoles);
}
/**
```
Therefore I created an entire new auth provider.
Commits
-------
8ddd5333a3 Merge pull request #1 from nietonfir/http_basic_ldap
a783e5c9c5 Update HttpBasicLdapFactory
a30191f30a make LdapBindAuthenticationProvider capable of searching for the DN
* 3.2:
fixed typo
fixed composer.json
[HttpKernel] Fix Bundle name regression
always check for all fields to be mapped
clarify exception when no args are configured
[PropertyAccess] Handle interfaces in the invalid argument exception
[DI] Fix defaults overriding empty strings in AutowirePass
[Debug] Workaround "null" $context
[Debug] Remove $context arg from handleError(), preparing for PHP 7.2
[FrameworkBundle] Dont wire "annotations.cached_reader" before removing passes
[Routing] Fix BC break in AnnotationClassLoader defaults attributes handling
Fix tests with ICU 57.1
Fix the condition checking the minimum ICU version
* 3.1:
fixed typo
fixed composer.json
always check for all fields to be mapped
clarify exception when no args are configured
[PropertyAccess] Handle interfaces in the invalid argument exception
[DI] Fix defaults overriding empty strings in AutowirePass
[Debug] Workaround "null" $context
[Debug] Remove $context arg from handleError(), preparing for PHP 7.2
[Routing] Fix BC break in AnnotationClassLoader defaults attributes handling
Fix tests with ICU 57.1
Fix the condition checking the minimum ICU version
* 2.8:
always check for all fields to be mapped
clarify exception when no args are configured
[PropertyAccess] Handle interfaces in the invalid argument exception
[DI] Fix defaults overriding empty strings in AutowirePass
[Debug] Workaround "null" $context
[Debug] Remove $context arg from handleError(), preparing for PHP 7.2
[Routing] Fix BC break in AnnotationClassLoader defaults attributes handling
Fix tests with ICU 57.1
Fix the condition checking the minimum ICU version
* 2.7:
always check for all fields to be mapped
clarify exception when no args are configured
[PropertyAccess] Handle interfaces in the invalid argument exception
[Debug] Workaround "null" $context
[Debug] Remove $context arg from handleError(), preparing for PHP 7.2
[Routing] Fix BC break in AnnotationClassLoader defaults attributes handling
Fix tests with ICU 57.1
Fix the condition checking the minimum ICU version
This PR was squashed before being merged into the 2.7 branch (closes#21360).
Discussion
----------
[PropertyAccess] Handle interfaces in the invalid argument exception
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
Before :
`Expected argument of type "dule\MenuBundle\Entity\AbstractMenu::setMenuElements() must implement interface Doctrine\Common\Collections\Collection", "array" given`
After :
`Expected argument of type "Doctrine\Common\Collections\Collection", "array" given`
Commits
-------
be52b39031 [PropertyAccess] Handle interfaces in the invalid argument exception
This PR was merged into the 2.7 branch.
Discussion
----------
[Routing] Fix BC break in AnnotationClassLoader defaults attributes handling
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | 77289b9023 (commitcomment-20572462)
| License | MIT
| Doc PR | n/a
This fixes a BC break introduced in #21333. Instead of removing the automatic request attributes creation, we keep it but only for attributes that are mandatory (i.e. present in the route path).
Thanks to @iltar for the idea.
Commits
-------
1d298f0417 [Routing] Fix BC break in AnnotationClassLoader defaults attributes handling
This PR was squashed before being merged into the 2.7 branch (closes#21320).
Discussion
----------
Fix ICU dependant tests
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
#20551 changed the condition checking if the ICU version matches the stubbed data. The change intended to enable tests on more ICU versions, but it actually has limited them. I'm still not convinced it should've been done but let's at least fix the condition. Ideal solution would be to have the latest ICU data available on travis (still not there https://github.com/travis-ci/travis-ci/issues/3616).
I also needed to fix several tests.
Currently skipped tests in components depending on ICU data:
| | 4.8.1.1 | 54.1 | 55.1 | 57.1 |
|---|---|--|--|--|
| Intl | 488 | 488 | 7 | 6 |
| Locale | 0 | 0 | 0 | 0 |
| Translation| 0 | 0 | 0 | 0 |
| Validator | 69 | 69 | 69 | 0 |
| Form | 75 | 75 | 75 | 1 |
Commits
-------
d3b5d8efdf Fix tests with ICU 57.1
677d820874 Fix the condition checking the minimum ICU version
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Debug] Deprecate ContextErrorException
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Since the `$context` argument is going to be deprecated in PHP 7.2 (see https://wiki.php.net/rfc/deprecations_php_7_2#errcontext_argument_of_error_handler), let's deprecate ContextErrorException altogether.
Commits
-------
c3797074ff [Debug] Deprecate ContextErrorException
This PR was squashed before being merged into the 3.3-dev branch (closes#21348).
Discussion
----------
[DependencyInjection] Yaml: check if $tags is an array before using it
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
1c9b5c9 [DependencyInjection] Yaml: check if is an array before using it
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Fix return of YamlFileLoader::parseDefaults
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no (or very unlikely)
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
I've messed up the return value of parseDefaults under certain conditions in #21342. Here is the fix... Sorry about that.
Commits
-------
5cf76f7 [DependencyInjection] Fix return of YamlFileLoader::parseDefaults
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Use current class as default class for factory declarations
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20888
| License | MIT
| Doc PR | Should update the notice about the "class" attribute on http://symfony.com/doc/current/service_container/factories.html#20888 makes sense to me, considering the following sample extracted from the documentation:
```xml
<service id="app.newsletter_manager" class="AppBundle\Email\NewsletterManager">
<factory class="AppBundle\Email\NewsletterManager" method="create" />
</service>
```
The class is used as a factory to create itself, thus it can be simplified to:
```xml
<service id="app.newsletter_manager" class="AppBundle\Email\NewsletterManager">
<factory method="create" />
</service>
```
However, it's not possible to provide the same feature for the YAML format, because it doesn't allow to distinct a function from a method call if the class is not provided explicitly under the `factory` key, whereas the xml format use a dedicated `function` attribute.
Would this inconsistency between those two formats be a no-go for this feature?
The doc notices:
> When using a factory to create services, the value chosen for the class option has no effect on the resulting service. The actual class name only depends on the object that is returned by the factory. However, the configured class name may be used by compiler passes and therefore should be set to a sensible value.
If this is merged, it should be updated wisely in order to not confuse everyone with this feature when using the xml format.
UPDATE: The yaml format is now supported when the class is not provided in the factory array:
```yml
services:
my_factory:
class: Bar\Baz
factory: [~, 'create']
```
Commits
-------
e6d85700d5 [DependencyInjection] Use current class as default class for factory declarations
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Remove an unused docblock
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
The removal of this doc block was forgotten in #21327.
Commits
-------
9e33434548 [DependencyInjection] Remove an unused docblock
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Console][FrameworkBundle] Log console exceptions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10895
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/7373
Continues #19382, fixing some issues including:
- ability to display the input string for any `InputInterface` implementation (cast to string if possible, use the command name otherwise)
- if the input can be casted as string, cleanup the result (from `command "'command:name' --foo=bar" ` to `command "command:name --foo=bar"`)
- made `ExceptionLister::$logger` private instead of protected
- changed methods name from `onKernel*` to `onConsole*` (e.g. `onConsoleException`) and removed unnecessary doc blocks
- Added more tests
Log for an exception:
> [2016-12-22 00:34:42] app.ERROR: Exception thrown while running command: "cache:clear -vvv". Message: "An error occured!" {"exception":"[object] (RuntimeException(code: 0): An error occured! at /Volumes/HD/Sites/tests/sf-demo-3.2/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php:61)","command":"cache:clear -vvv","message":"An error occured!"} []
Commits
-------
919041c1ad Add Console ExceptionListener
9896547a4d Add basic support for automatic console exception logging
Handle non string-castable inputs
Cleanup input for display
Naming changes
InputInterface doesnt have a toString()
Logger must be private
Remove useless doc blocks
Tweak tests
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Add Yaml syntax for short services definition
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | todo
In my experience, most (at least, a lot) of the service definitions in an end-application only require the class and constructor arguments.
#21133 allows to get rid of the `class` attribute by using the service id.
Which means only arguments remain for most use-cases. Hence, we could support this syntax:
#### Before:
```yml
services:
App\Foo\Bar:
arguments: ['@baz', 'foo', '%qux%']
```
#### After:
```yml
services:
App\Foo\Bar: ['@baz', 'foo', '%qux%']
```
It works especially well along with services `_defaults` introduced in #21071 :
```yml
services:
_defaults:
public: false
autowire: ['set*']
tags: ['serializer.normalizer']
App\Serializer\FooNormalizer: ['@baz', 'foo', '%qux%']
```
Commits
-------
83b599c6ad [DI] Add Yaml syntax for short services definition
This PR was squashed before being merged into the 3.3-dev branch (closes#20694).
Discussion
----------
[Cache] Implement PSR-16 SimpleCache v1.0
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | not yet
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/issues/7409
Second iteration on the topic after #20636 raised some issues.
Please don't squash while merging.
Commits
-------
6219dd6b62 [Cache] Create PSR-16 variants of all PSR-6 adapters
99ae9d6a35 [Cache] Move adapter implementations to traits
848a33ed3e [Cache] Implement PSR-16 SimpleCache v1.0
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Factorize compiler passes around new AbstractRecursivePass
| 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 an AbstractRecursivePass that is able to visit the definition tree recursively everywhere a Definition or a Reference can be nested.
All existing compiler passes that need recursivity are updated to leverage this new class.
This remove a bunch of boilerplate that was previously repeated all over.
It also fixes compiler passes that eg missed looking at configurators for no reason (this "fix" is a new feature really).
It then applies recursivity to AutowirePass, that does not handle it today, but should.
I'm happy that the net result is a loss of 153 lines :)
Commits
-------
6acb80f48f [DI] Factorize compiler passes around new AbstractRecursivePass
This PR was merged into the 2.7 branch.
Discussion
----------
[Validator] Improved error message for missing upload_tmp_dir
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
I ran into a problem in which the value for upload_tmp_dir was set in php.ini, but PHP was unable to write to the specified location. PHP returns an UPLOAD_ERR_NO_TMP_DIR in $_FILES when it can't find or use the tmp dir, and my application displayed the error for $uploadNoTmpDirErrorMessage, from which I drew the conclusion that the ini setting was missing or emtpy.
This conclusion was based on the wording in the error message, which explicitly states that 'no temporary folder was configured', which is not actually correct. According to the [PHP documentation](http://php.net/manual/en/features.file-upload.errors.php):
> UPLOAD_ERR_NO_TMP_DIR
> Value: 6; Missing a temporary folder. Introduced in PHP 5.0.3.
'Missing' might be interpreted as 'the value for the ini setting is missing', but also as 'the configured folder is missing'.
I thought it might save someone some time if the error message from the Symfony Validator makes this explicit, which is what this PR aims to do.
I also updated the Dutch and Polish translations, because those, in addition to English, are the languages spoken in my team.
Commits
-------
afbf22746a [Validator] Improved error message for missing upload_tmp_dir
* 3.2: (40 commits)
fixed CS
fixed CS
fixed CS fixer config
fixed typo
Revert "fixed typo"
fixed typo
fixed CS
Avoid setting request attributes from signature arguments in AnnotationClassLoader
[DependencyInjection] Add some missing typehints in YamlFileLoader
[DependencyInjection] minor: Fix a DocBlock
[HttpKernel] Give higher priority to adding request formats
[Cache] Fix tags expiration
[PhpUnit] Blacklist DeprecationErrorHandler in stack traces
[PropertyInfo] Don't try to access a property thru a static method
[PropertyInfo] Exclude static methods form properties guessing
[Workflow] Added new validator to make sure each place has unique translation names
[Cache] [PdoAdapter] Fix MySQL 1170 error (blob as primary key)
[FrameworkBundle] Fix third level headers for MarkdownDescriptor
[Ldap] Using Ldap stored username instead of form submitted one
[Ldap] load users with the good username case
...
* 3.1: (31 commits)
fixed CS
fixed CS
fixed CS fixer config
fixed typo
Revert "fixed typo"
fixed typo
fixed CS
Avoid setting request attributes from signature arguments in AnnotationClassLoader
[DependencyInjection] Add some missing typehints in YamlFileLoader
[DependencyInjection] minor: Fix a DocBlock
[HttpKernel] Give higher priority to adding request formats
[PropertyInfo] Don't try to access a property thru a static method
[PropertyInfo] Exclude static methods form properties guessing
[FrameworkBundle] Fix third level headers for MarkdownDescriptor
[Ldap] Using Ldap stored username instead of form submitted one
[Ldap] load users with the good username case
[DoctrineBridge] Fixed invalid unique value as composite key
[Doctrine Bridge] fix UniqueEntityValidator for composite object primary keys
[TwigBundle] do not lose already set method calls
#20411 fix Yaml parsing for very long quoted strings
...
* 2.8: (26 commits)
fixed CS
fixed CS
fixed CS fixer config
fixed typo
Revert "fixed typo"
fixed typo
fixed CS
Avoid setting request attributes from signature arguments in AnnotationClassLoader
[DependencyInjection] Add some missing typehints in YamlFileLoader
[DependencyInjection] minor: Fix a DocBlock
[HttpKernel] Give higher priority to adding request formats
[PropertyInfo] Don't try to access a property thru a static method
[PropertyInfo] Exclude static methods form properties guessing
[FrameworkBundle] Fix third level headers for MarkdownDescriptor
[TwigBundle] do not lose already set method calls
#20411 fix Yaml parsing for very long quoted strings
CS: apply is_null
DX: remove invalid inheritdoc
bumped Symfony version to 2.8.17
updated VERSION for 2.8.16
...
* 2.7:
fixed typo
Revert "fixed typo"
fixed typo
fixed CS
Avoid setting request attributes from signature arguments in AnnotationClassLoader
[DependencyInjection] Add some missing typehints in YamlFileLoader
[DependencyInjection] minor: Fix a DocBlock
[HttpKernel] Give higher priority to adding request formats
[FrameworkBundle] Fix third level headers for MarkdownDescriptor
[TwigBundle] do not lose already set method calls
#20411 fix Yaml parsing for very long quoted strings
CS: apply is_null
DX: remove invalid inheritdoc
bumped Symfony version to 2.7.24
updated VERSION for 2.7.23
update CONTRIBUTORS for 2.7.23
updated CHANGELOG for 2.7.23
[FrameworkBundle] Skip test if xdebug.file_link_format is defined.
This PR was merged into the 3.3-dev branch.
Discussion
----------
[ClassLoader] Deprecated the component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Follow up of #20668
Commits
-------
8a37722adb [ClassLoader] Deprecated the component
This PR was merged into the 2.7 branch.
Discussion
----------
[DependencyInjection] Add some missing typehints in YamlFileLoader
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
34330e5136 [DependencyInjection] Add some missing typehints in YamlFileLoader
This PR was merged into the 2.8 branch.
Discussion
----------
[PropertyInfo] Don't try to access a property thru a static method
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
See also #21331.
Commits
-------
3b4858fe88 [PropertyInfo] Don't try to access a property thru a static method
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Workflow] Introduce concept of SupportStrategyInterface
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #20751
| License | MIT
| Doc PR | -
Commits
-------
134a58b4c4 [Workflow] Fixed code and tests
184301206f [Workflow] Introduce concept of SupprtStrategyInterface to allow other support checks than class instance
This PR was squashed before being merged into the 3.3-dev branch (closes#21065).
Discussion
----------
Added cache data collector and profiler page
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19297
| License | MIT
| Doc PR | n/a
Adding a first version of cache profiler page. Most things are taken from PHP-cache.
FYI: @aequasi
### What is included?
A collector, recording adapter and a profiler page.
![screen shot 2016-12-27 at 16 07 35](https://cloud.githubusercontent.com/assets/1275206/21502325/4bee2ed4-cc4f-11e6-89fc-37ed16aca864.png)
![screen shot 2016-12-27 at 16 07 45](https://cloud.githubusercontent.com/assets/1275206/21502326/4bee9450-cc4f-11e6-904d-527b7b0ce85b.png)
### What is not included?
* A good logo
* Nice design on the profiler page
This PR aims to pass as the minimum requirement for a cache page. Im happy to do fancy extra features but those should be a different PR.
Commits
-------
7497f1c6b6 Added cache data collector and profiler page
This PR was merged into the 3.2 branch.
Discussion
----------
[Workflow] Fixed support of multiple transitions with the same name.
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
---
The previous behavior was underterministic because it took the first
transition during the `can` and the `apply` method. But the "first"
does not mean anything. Now the workflown apply all possible transitions
with the same name.
Commits
-------
edd5431e6e [Workflow] Fixed support of multiple transition with the same name.
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Debug] Trigger deprecation on `@final` annotation in DebugClassLoader - prepare making some classes final
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | follows https://github.com/symfony/symfony/pull/19734
| License | MIT
| Doc PR | |
BC promises become quickly huge but making classes `final` can limit these promises.
At the same time, many classes of the symfony codebase are not meant to be extended and could be `final`; that's the goal of this PR: prepare making them final in 4.0 by triggering deprecations in their constructor:
```php
public function __construct()
{
if (__CLASS__ !== get_class($this)) {
@trigger_error(sprintf('Extending %s is deprecated since 3.3 and won\'t be supported in 4.0 as it will be final.', __CLASS__), E_USER_DEPRECATED);
}
}
```
I updated two classes for now but we can do much more if you like it.
Commits
-------
c2ff111986 [Debug] Trigger deprecation on `@final` annotation in DebugClassLoader
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Remove synthetic services from methodMap + generated methods
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
For synthetic services, the generated methods are just dead code to fill opcache ;)
And having them in "methodMap" prevents using the property for checking if a service comes from a (non-synthetic) definition or not.
This prepares some changes that we'd like to do in 4.0, see #19668.
Commits
-------
c1e1e999f3 [DI] Remove synthetic services from methodMap + generated methods
This PR was merged into the 3.3-dev branch.
Discussion
----------
[VarDumper] Add search keyboard shortcuts
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21174
| License | MIT
| Doc PR | Worth to mention?
So, this PR simply adds the following shortcuts to navigate between matches, based on main browsers conventions:
- <kbd>CTRL/CMD</kbd> + (<kbd>shift</kbd>* +) <kbd>G</kbd>
- (<kbd>shift</kbd>* +) <kbd>ENTER</kbd>
- (<kbd>shift</kbd>* +) <kbd>F3</kbd>
_* <kbd>shift</kbd> allows to go backwards_
At first, I wanted to add a help box somewhere, but:
- I don't know where to place it. As the var dumper is now used everywhere in the profiler, it should not be importune and should work in narrowed places.
- We use those shortcuts in order to replicate the main softwares/browsers behavior. So we may not need it at all.
This PR also fixes a minor issue where pressing a key not changing the input would have restarted the search query.
Commits
-------
58fe4315ae [VarDumper] Add search keyboard shortcuts
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Mark generated containers as final
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
So that we don't have to care anymore about BC for protected methods in generated containers.
Will leverage deprecations triggered in #20493
Commits
-------
ce0ee1e484 [DI] Mark generated containers as final
This PR was merged into the 3.3-dev branch.
Discussion
----------
[VarDumper] Fixed typo in new search input
| 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 | symfony/symfony-docs#... <!--highly recommended for new features-->
I guess both work out.. but using `of` notation is way more common.
Btw chrome search doesnt show `0 of 0` (at least not initially).. maybe worth it?
/cc @ogizanagi
Commits
-------
f8d63a6 [VarDumper] Fixed typo in new search input
This PR was merged into the 3.1 branch.
Discussion
----------
[DX][Cache] Set right cacheItem type hint on AdapterInterface getters
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Fixes missing cache item type hint on pool getters so methods on Symfony CacheItem
is correctly suggested when using IDE's or api documentation.
As proposed here: https://github.com/symfony/symfony/issues/19728#issuecomment-269615921
_Note: Specifically sets array of CacheItems as return type of getItems as phpdoc and IDEs supports
this by now, and since this is specifically what is being returned. If Sami does not still support this we can adjust to what was originally suggested._
Commits
-------
5f7baa5 [DX][Cache] Set right type hint for cacheItem on AdapterInterface getters
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Cache] Relax binary-constraint on Memcached connections
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
If it's green then it's PSR-6 compliant.
Commits
-------
284d363 [Cache] Relax binary-constraint on Memcached connections
The previous behavior was underterministic because it took the first
transition during the `can` and the `apply` method. But the "first"
does not mean anything. Now the workflow apply all possible
transitions with the same name.
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Fixes missing type hint for cache item on pool getters so methods on Symfony CacheItem
is correclty suggested when using IDE's or api documentation.
As proposed here: https://github.com/symfony/symfony/issues/19728#issuecomment-269615921
Note: Specifically sets array of items as return type of getItems as phpdoc and IDEs supports
this by now, and since this is specifically what is being returned.
* 3.2:
[Cache] Using strpbrk() instead of strcspn() is faster
bumped Symfony version to 3.2.3
updated VERSION for 3.2.2
updated CHANGELOG for 3.2.2
bumped Symfony version to 3.1.10
updated VERSION for 3.1.9
updated CHANGELOG for 3.1.9
* 3.2:
Fix getMock usage
Remove dead code
[Form] DateTimeToLocalizedStringTransformer does not use TZ when using only date
[Validator] Fix caching of constraints derived from non-serializable parents
[TwigBundle] Fix bug where namespaced paths don't take parent bundles in account
[FrameworkBundle] Fix relative paths used as cache keys
respect groups when merging constraints
fix IPv6 address handling in server commands
* 3.1:
Fix getMock usage
Remove dead code
[Form] DateTimeToLocalizedStringTransformer does not use TZ when using only date
[Validator] Fix caching of constraints derived from non-serializable parents
[TwigBundle] Fix bug where namespaced paths don't take parent bundles in account
[FrameworkBundle] Fix relative paths used as cache keys
respect groups when merging constraints
fix IPv6 address handling in server commands
* 2.8:
Fix getMock usage
Remove dead code
[Form] DateTimeToLocalizedStringTransformer does not use TZ when using only date
[Validator] Fix caching of constraints derived from non-serializable parents
[TwigBundle] Fix bug where namespaced paths don't take parent bundles in account
[FrameworkBundle] Fix relative paths used as cache keys
respect groups when merging constraints
fix IPv6 address handling in server commands
* 2.7:
[Form] DateTimeToLocalizedStringTransformer does not use TZ when using only date
[Validator] Fix caching of constraints derived from non-serializable parents
[TwigBundle] Fix bug where namespaced paths don't take parent bundles in account
[FrameworkBundle] Fix relative paths used as cache keys
respect groups when merging constraints
fix IPv6 address handling in server commands
* 3.2:
[FrameworkBundle] Add annotated validator cache test case
Fix a typo
[Ldap] Always have a valid connection when using the EntryManager
[FrameworkBundle] Fix class_exists() checks in PhpArrayAdapter-related cache warmers
This PR was merged into the 2.7 branch.
Discussion
----------
[Form] DateTimeToLocalizedStringTransformer does not use timezone when using date only
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21217
| License | MIT
The `DateTimeToLocalizedStringTransformer` when used with a pattern that have only date (in `DateType` for instance) does not convert the result in the desired output
Reproduction steps:
- Use `DateType` in a form
- Set the `model_timezone` to `Pacific/Tahiti`, having default timezone to `Europe/Berlin`.
- Enter the date `2017-01-10`
- Submit the form
- Notice that the received data is `2017-01-10 00:00 Europe/Berlin`, whereas it should be `2017-01-10 11:00 Europe/Berlin`
Commits
-------
031d8c2c8b [Form] DateTimeToLocalizedStringTransformer does not use TZ when using only date
This PR was merged into the 3.3-dev branch.
Discussion
----------
Add a new Dotenv component
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | symfony/symfony-docs#7350
This introduces a new Dotnv Component that manages `.env` files. Read the referenced doc PR above for more information about usage:
But here, I want to explain the rationale behind creating such a component instead of reusing an existing one.
* First, this version only implements what you can do in a "real" bash shell script (which is what a `.env` really is): so **no value validation** for instance (and anyway, an env var value is always a string). That's important as in production, we should use real env variables, and we don't have validation for them there;
* It allows to only parse a file without populating the env variables (we have 3 stages: `load` `parse` and `populate`);
* Strict implementation of what you can do in a `.env` file, same behavior as bash ($VAR and ${VAR} are supported for instance, executing commands as well);
* Great error messages: I spent a lot of time being sure that error reporting is top notch;
* Clean, simple, and straightforward code (small public API);
* It only does `.env` management, there is no uneeded abstractions like being able to add an env variable directly (just use `putenv`);
There are some unimplemented features as I don't think they are needed and would increase the complexity of the code: several concatenated strings `FOO='foo'"bar"` for instance.
Commits
-------
5a6be8ae9c [Dotenv] added the component
This PR was squashed before being merged into the 2.7 branch (closes#20793).
Discussion
----------
[Validator] Fix caching of constraints derived from non-serializable parents
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12302
| License | MIT
| Doc PR | -
This change allows to still cache constraints even when an uncachable constraint (i.e. Callback)
is added to a parent class at runtime.
This is achived by caching only the constraints that are loaded for the class in question only
and merging parent and interface constraints after reading from cache.
Commits
-------
9dd6b0c [Validator] Fix caching of constraints derived from non-serializable parents
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Deprecate case insentivity of service identifiers
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | minor (see UPGRADE note)
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #21193
| License | MIT
| Doc PR | -
As discussed in linked RFC.
Commits
-------
d08f1101df [DI] Deprecate case insentivity of service identifiers
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Form] DateIntervalType: Allow to configure labels & enhance form theme
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no (unless someone relies on this non themed type)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | Should document the new `labels` option
I just realized by using it for last fixes in #20886 and #20877 that this type was not really themed:
### before
<img width="861" alt="screenshot 2016-12-13 a 00 54 35" src="https://cloud.githubusercontent.com/assets/2211145/21121792/c589d27a-c0ce-11e6-8368-a396fda3bc7a.PNG">
At least labels should appear, but this also means being able to change them (thus the new `labels` option).
I think the form themes should provide a functional & minimalistic integration like this:
### after
<img width="862" alt="screenshot 2016-12-13 a 00 54 17" src="https://cloud.githubusercontent.com/assets/2211145/21121814/d9c4ead6-c0ce-11e6-94e1-41e6c14884a7.PNG">
---
(On screenshots above, I've only added a css rule to remove the 100% width of the `.table` class. See https://github.com/symfony/symfony/pull/20887#discussion_r92069557)
Commits
-------
bfd9e50bbb [Form] DateIntervalType: Allow to configure labels & enhance form theme
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Form] Removed unused ResolvedTypeFactory in FormFactory constructor
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
____
This PR just removes some legacy code from 2.x.
Commits
-------
3607eb3dd0 [Form] Removed unused ResolvedTypeFactory in FormFactory constructor
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] FileLoaders: Allow to explicit type to load
| 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/issues/20308
| License | MIT
| Doc PR | Not yet
(fabbot will scream out regarding the PR fixtures)
Commits
-------
6b660c2114 [DI] FileLoaders: Allow to explicit type to load
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Config][FrameworkBundle] Allow to dump extension config reference sub-path
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
Same as https://github.com/symfony/symfony/pull/18940 but for the `config:dump-reference` command:
<img width="975" alt="screenshot 2016-11-29 a 19 09 04" src="https://cloud.githubusercontent.com/assets/2211145/20722577/6c9f9b98-b667-11e6-9683-9a304ff80895.PNG">
Only available for yaml, because it's the most common format when developing an end-application, and dumping a sub xml document causes some issues and raises more questions with the current `XmlReferenceDumper` implementation (namespaces, root name, ...).
Commits
-------
869bb1530b [Config][FrameworkBundle] Allow to dump extension config reference sub path
This PR was merged into the 2.7 branch.
Discussion
----------
[Validator] respect groups when merging constraints
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20853
| License | MIT
| Doc PR |
Commits
-------
9a60057f42 respect groups when merging constraints
* 3.2:
[DI] Add missing legacy group on testLegacy
Minor tweaks
Fix merge
[DI] Dont share service when no id provided
Fix Container and PhpDumper test inaccuracies
[DI] Fix missing new line after private alias
[ClassLoader] Throw an exception if the cache is not writeable
Fixing regression in TwigEngine exception handling.
* 3.1:
Fix merge
[DI] Dont share service when no id provided
Fix Container and PhpDumper test inaccuracies
[DI] Fix missing new line after private alias
[ClassLoader] Throw an exception if the cache is not writeable
Fixing regression in TwigEngine exception handling.
* 2.8:
Fix merge
[DI] Dont share service when no id provided
Fix Container and PhpDumper test inaccuracies
[DI] Fix missing new line after private alias
[ClassLoader] Throw an exception if the cache is not writeable
Fixing regression in TwigEngine exception handling.
* 2.7:
[DI] Dont share service when no id provided
Fix Container and PhpDumper test inaccuracies
[DI] Fix missing new line after private alias
[ClassLoader] Throw an exception if the cache is not writeable
Fixing regression in TwigEngine exception handling.
This PR was merged into the 2.7 branch.
Discussion
----------
Fix Container and PhpDumper test inaccuracies
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Stumbled upon and fixed some minor inaccuracies in tests for DI container, they might have lead to undetected changes of `Container`'s behavior
Commits
-------
24b93cc Fix Container and PhpDumper test inaccuracies
This PR was merged into the 2.7 branch.
Discussion
----------
[DI] Dont share service when no id provided
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
814f633 [DI] Dont share service when no id provided
This PR was merged into the 3.3-dev branch.
Discussion
----------
[HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19738
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/7343
Replaces #19740. Native "getSize" is reported to return false on error, so using false as return type doesn't break the signature.
Commits
-------
8011209a18 [HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Yaml] Remove unused 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 | symfony/symfony-docs#... <!--highly recommended for new features-->
This PR removes an unused argument of `Inline::parseScalar()`. I based it on master as that's not really a bug fix but the lowest applicable branch is 3.0 (the method was not internal in 2.x).
Commits
-------
1a14a1f274 [Yaml] Remove an unused argument
* 3.2:
[TwigBundle] fixed usage when Templating is not installed
[Validator] Check cascasdedGroups for being countable
[Cache] Add changelog for 3.2
[Cache] Add changelog
[Filesystem] Check that the directory is writable after created it in dumpFile()
[HttpFoundation] Improved set cookie header tests
[Serializer] int is valid when float is expected when deserializing JSON
[Console] increased code coverage of Output classes
Added missing headers in fixture files
[Profiler][VarDumper] Fix minor color issue & duplicated selector
* 3.1:
[TwigBundle] fixed usage when Templating is not installed
[Validator] Check cascasdedGroups for being countable
[Cache] Add changelog
[Filesystem] Check that the directory is writable after created it in dumpFile()
[HttpFoundation] Improved set cookie header tests
[Serializer] int is valid when float is expected when deserializing JSON
[Console] increased code coverage of Output classes
Added missing headers in fixture files
[Profiler][VarDumper] Fix minor color issue & duplicated selector
* 2.8:
[TwigBundle] fixed usage when Templating is not installed
[Validator] Check cascasdedGroups for being countable
[Filesystem] Check that the directory is writable after created it in dumpFile()
[HttpFoundation] Improved set cookie header tests
[Console] increased code coverage of Output classes
[Profiler][VarDumper] Fix minor color issue & duplicated selector
* 2.7:
[TwigBundle] fixed usage when Templating is not installed
[Validator] Check cascasdedGroups for being countable
[Filesystem] Check that the directory is writable after created it in dumpFile()
[HttpFoundation] Improved set cookie header tests
[Console] increased code coverage of Output classes
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Filesystem] Add appendToFile()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | todo
So we could append content to a file:
```php
(new Filesystem)->appendToFile($file, 'bar');
```
instead of doing it in two steps:
```php
if (false === $content = @file_get_contents($file)) {
throw new \Exception();
}
(new Filesystem)->dumpFile($file, $content.'bar');
```
Doing it opt-in using `dumpFile(..., $append = false)` would have been enough but not possible for BC.
Commits
-------
1f7b753670 [Filesystem] Add appendToFile()
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Filesystem] Add appendToFile()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | todo
So we could append content to a file:
```php
(new Filesystem)->appendToFile($file, 'bar');
```
instead of doing it in two steps:
```php
if (false === $content = @file_get_contents($file)) {
throw new \Exception();
}
(new Filesystem)->dumpFile($file, $content.'bar');
```
Doing it opt-in using `dumpFile(..., $append = false)` would have been enough but not possible for BC.
Commits
-------
9fb5293122 [Filesystem] Add appendToFile()
This PR was squashed before being merged into the 2.7 branch (closes#21155).
Discussion
----------
[Validator] Check cascasdedGroups for being countable
Prevents notice for PHP 7.2
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR |
Just repeated for this place https://github.com/symfony/symfony/pull/20859
Waiting travis to fill in the `Tests pass` field
`cascasdedGroups` can be null at this point (according to failures and phpdoc)
Commits
-------
8fa45a130b [Validator] Check cascasdedGroups for being countable
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Yaml] parse multi-line strings
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
When working on #21084, I discovered that the YAML parser does not support (unquoted) multi-line strings (neither as plain strings nor as values for mappings). This PR adds support for them.
Commits
-------
ec593b923b [Yaml] parse multi-line strings
This PR was merged into the 3.3-dev branch.
Discussion
----------
[EventDispatcher] Deprecate ContainerAwareEventDispatcher
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
These methods shouldn't be available to end users.
Commits
-------
c4a6a8a47c [EventDispatcher] Deprecate ContainerAwareEventDispatcher
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Dont call get() when not required - µ-optim
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
(could be applied on 3.2, please advise)
Helps a bit on https://rawgit.com/kocsismate/php-di-container-benchmarks/master/var/benchmark.html
note: if we want more performance, we should consider deprecating case insensitivity of service identifiers.
Commits
-------
7a42199115 [DI] Dont call get() when not required - µ-optim
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI][EventDispatcher] Add & wire closure-proxy argument type
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12521, #12007, #20039
| License | MIT
| Doc PR | -
By resolving event subscribers at compile time, then wrapping listeners in a closure, we get laziness almost for free. This should solve/replaced all the above linked issues.
(WIP because tests are missing)
Commits
-------
ecdf857b61 [DI][EventDispatcher] Add & wire closure-proxy argument type
* 3.2:
[Bridge/PhpUnit] Relax expectedDeprecation for forward compat
[FrameworkBundle] Remove Response* from classes to compile
[Workflow] Removed twig from composer.json (dev section, not used)
This PR was squashed before being merged into the 2.7 branch (closes#20972).
Discussion
----------
[HttpFoundation] Improved set cookie header tests
| Q | A
| ------------- | ---
| Branch? | 2.7 (already in master)
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
Separated from #20569
Commits
-------
05bce71d7a [HttpFoundation] Improved set cookie header tests
This PR was merged into the 3.3-dev branch.
Discussion
----------
Deprecate ClassCollectionLoader and Kernel::loadClassCache
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #20668
| License | MIT
As suggested by @nicolas-grekas in #20668 I added deprecation notices to ClassCollectionLoader and Kernel::loadClassCache.
Commits
-------
660d79a186 Deprecates ClassCache-cache warmer.
This PR was squashed before being merged into the 3.1 branch (closes#21165).
Discussion
----------
[Serializer] int is valid when float is expected when deserializing JSON
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | api-platform/api-platform#37
| License | MIT
| Doc PR | n/a
JSON only has a Number type corresponding to both `int` and `float` PHP types.
PHP's `json_encode`, JavaScript's `JSON.stringify`, Go's `json.Marshal` as well as most other JSON encoders convert floating-point numbers like `12.0` to `12` (the decimal part is dropped when possible).
PHP's `json_decode` automatically converts Numbers without a decimal part to integers.
Actually, the Serializer rejects integers when a float is expected, this PR fixes this behavior when denormalizing JSON-based formats.
Port of api-platform/core#714.
/cc @gorghoa @Shine-neko
Commits
-------
4125455775 [Serializer] int is valid when float is expected when deserializing JSON
This PR was squashed before being merged into the 2.7 branch (closes#21124).
Discussion
----------
[Console] increased code coverage of Output classes
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This PR increases the coverage of Output classes of the Console component from 80.81% to 94.95%
Commits
-------
ab4ba23 [Console] increased code coverage of Output classes
This PR was merged into the 3.3-dev branch.
Discussion
----------
No fallback to REQUEST_TIME in TimeDataCollector
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no (?)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
As of PHP 5.4 the `REQUEST_TIME_FLOAT` is available and the minimum version of PHP is 5.5 in Symfony. I think it's safe to use as I can't find cases where this is _not_ defined.
Commits
-------
ba00543 No fallback to REQUEST_TIME in TimeDataCollector
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Implement lazy collection type using generators
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | -
| Fixed tickets | #20875
| License | MIT
| Doc PR | -
Following the RFC https://github.com/symfony/symfony/issues/20875, this PR aims to implement lazy services collections using generators internally.
For now, I suggest to support only XML and PHP definitions. Supporting YAML means adding another convention to the language and this is not the aim of this PR.
- [x] value object holding the semantic (IteratorArgument)
- [x] iterator dumping
- [x] lazyness awareness in CheckCircularReferencesPass & GraphvizDumper
- [x] rewindable iterators
- [x] `*_ON_INVALID_REFERENCE` behavior
- [x] ContainerBuilder::createService
- [x] ArgumentInterface handling in compiler passes
Commits
-------
1dbf52ad03 [DI] Add "=iterator" arguments to Yaml loader
5313943692 [DependencyInjection] Implement lazy collection type using generators
* 3.2:
[Cache] Remove silenced warning tiggered by PhpArrayAdapter
[Cache] Fix order of writes in ChainAdapter
[Console] Fix return type in Terminal docblocks
This PR was merged into the 3.2 branch.
Discussion
----------
[Cache] Remove silenced warning tiggered by PhpArrayAdapter
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Because many reported this silenced warning, which happens all the time unless `cache:warmup` has been run.
Commits
-------
a9dfcd8 [Cache] Remove silenced warning tiggered by PhpArrayAdapter
This PR was merged into the 3.2 branch.
Discussion
----------
[Console] Fix return type in Terminal docblocks
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This PR updates the docblock to reflect what's already in the code.
Commits
-------
6afb0afa24 [Console] Fix return type in Terminal docblocks
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Console] Show hidden commands in json & xml descriptors
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no (may be considered, but as hidden commands did not exist before 3.2, looks more like a behavior change, hence a feature)
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/20866#issuecomment-266678895
| License | MIT
| Doc PR | N/A
Commits
-------
b6cf240ab5 [Console] Show hidden commands in json & xml descriptors
This PR was merged into the 3.2 branch.
Discussion
----------
[DependencyInjection] Fix the priority order of compiler pass trait
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20332, #20993
| License | MIT
| Doc PR | ~
A regression has appeared between the version `3.1` and `3.2` on the compilation passes using a priority option (see #20332).
Indeed, the order is no longer preserved for service definitions with the same priority. This is caused by the `SplPriorityQueue` class that does not have a FIFO implementation (see this [comment](https://github.com/symfony/symfony/issues/20332#issuecomment-268096527)).
The PR #20993 fixes the problem but only for Forms, not for all compiler passes using the `PriorityTaggedServiceTrait` trait since `3.2`.
Commits
-------
aac9a7e Fix the priority order of compiler pass trait
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Security] use authenticated token for json authentication
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21123
| License | MIT
| Doc PR | N/A
When using `UsernamePasswordJsonAuthenticationListener` with [LexikJWTAuthenticationBundle](https://github.com/lexik/LexikJWTAuthenticationBundle), we get a type exception
> Type error: Argument 1 passed to Lexik\Bundle\JWTAuthenticationBundle\Security\Http\Authentication\AuthenticationSuccessHandler::handleAuthenticationSuccess() must implement interface Symfony\Component\Security\Core\User\UserInterface, string given, called in .../vendor/lexik/jwt-authentication-bundle/Security/Http/Authentication/AuthenticationSuccessHandler.php on line 47
This error occurs because the `UsernamePasswordJsonAuthenticationListener` send to the authentication success handler the token which have the user as a string and not the authenticated one that have a UserInterface as user.
Commits
-------
208c617716 use authenticated token for json authentication
This PR was squashed before being merged into the 3.3-dev branch (closes#21088).
Discussion
----------
Rename DebugAccessDecisionManager to TraceableAccessDecisionManager
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21085
| License | MIT
[EDIT] No longer WIP, test passing. Also, test added to preserve BC with the SecurityBundle.
Commits
-------
c5e0e59 Rename DebugAccessDecisionManager to TraceableAccessDecisionManager
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Security] Typo fix
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Remove an extra space, will make fabbot happy for #21136.
Commits
-------
4def721 [Security] Typo fix
This PR was merged into the 2.7 branch.
Discussion
----------
[HttpFoundation] Validate/cast cookie expire time
| Q | A
| ------------- | ---
| Branch? | 2.7
| 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 | symfony/symfony-docs#... <!--highly recommended for new features-->
Commits
-------
8215dbdb31 [HttpFoundation] Validate/cast cookie expire time
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Validator] support DateTimeInterface instances for times
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
The same has already been done for the `Date` and `DateTime` constraints in #18759.
Commits
-------
1fa9276937 support DateTimeInterface instances for times
This PR was merged into the 3.2 branch.
Discussion
----------
[Yaml] add missing indicator character
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
The comma was mentioned in the deprecation message, though it actually was never checked before in the condition.
Commits
-------
8725e0b [Yaml] add missing indicator character
This PR was merged into the 3.3-dev branch.
Discussion
----------
Added missing use statemenet
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
We should use Symfony\Component\Translation\Exception\RuntimeException
Commits
-------
f9848be Added missing use statemenet
* 3.2:
do not depend on a fixed date in layout tests
[Console] Escape default value when dumping help
[Console] OS X Can't call cli_set_process_title php without superuser
Fixed @return when returning this or static #bis
fixed @return when returning this or static
Polish translation improvement in Validator component
[Console] Descriptors should use Helper::strlen
[Config] Improve PHPdoc / IDE autocomplete
[Debug] Wrap call to ->log in a try catch block
[Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes
fix merge
[cache] Bump RedisAdapter timeout to 5s
fixed @return when returning this or static
[SecurityBundle] Made collection of user provider unique when injecting them to the RemberMeService
remove is_writable check on filesystem cache
* 3.1:
do not depend on a fixed date in layout tests
[Console] Escape default value when dumping help
[Console] OS X Can't call cli_set_process_title php without superuser
Fixed @return when returning this or static #bis
fixed @return when returning this or static
Polish translation improvement in Validator component
[Console] Descriptors should use Helper::strlen
[Config] Improve PHPdoc / IDE autocomplete
[Debug] Wrap call to ->log in a try catch block
[Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes
fix merge
[cache] Bump RedisAdapter timeout to 5s
fixed @return when returning this or static
[SecurityBundle] Made collection of user provider unique when injecting them to the RemberMeService
remove is_writable check on filesystem cache
* 2.8:
do not depend on a fixed date in layout tests
[Console] Escape default value when dumping help
[Console] OS X Can't call cli_set_process_title php without superuser
Fixed @return when returning this or static #bis
Polish translation improvement in Validator component
[Console] Descriptors should use Helper::strlen
[Config] Improve PHPdoc / IDE autocomplete
[Debug] Wrap call to ->log in a try catch block
[Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes
[SecurityBundle] Made collection of user provider unique when injecting them to the RemberMeService
* 2.7:
do not depend on a fixed date in layout tests
[Console] Escape default value when dumping help
[Console] OS X Can't call cli_set_process_title php without superuser
Polish translation improvement in Validator component
[Console] Descriptors should use Helper::strlen
[Config] Improve PHPdoc / IDE autocomplete
[Debug] Wrap call to ->log in a try catch block
[Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes
[SecurityBundle] Made collection of user provider unique when injecting them to the RemberMeService
* 3.2:
respect skipped and incomplete tests
[DI] Minor fixes in FactoryReturnTypePass
[TwigBridge] Fix upgrade/changelog notes
[Debug] Fixed cast of stream
[Console] minor addition to #20817 for branch 3.2
By default, the `DateType` as well as the `DateTimeType` set the choices
being available for the year to a range starting five years in the past.
After some time, this will make tests fail when the year of the fixed
date being used as the initial data is before the first year being part
of the choices.
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] OS X Can't call cli_set_process_title php without superuser
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
The console component test suite is failing on OS X (10.12.2) as the `cli_set_process_title` function seems not to be allowed to be called without superuser. It seems to be an OS X limitation.
At least, the test suite should pass and a warning should be shown when using the component with this feature on OS X.
---
refs:
- http://stackoverflow.com/questions/27803120/cannot-set-process-title-in-a-php-command-line-script-using-cli-set-process-titl
- https://github.com/liip/php-osx/issues/139
- https://github.com/zfcampus/zf-console/pull/22
Commits
-------
9928c0d [Console] OS X Can't call cli_set_process_title php without superuser
This PR was squashed before being merged into the 2.7 branch (closes#20900).
Discussion
----------
[Console] Descriptors should use Helper::strlen
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
Commits
-------
8e9a5f8 [Console] Descriptors should use Helper::strlen
This PR was merged into the 2.7 branch.
Discussion
----------
[Config] Improve PHPdoc / IDE autocomplete
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes-ish
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
The missing pieces for fixing the autocomplete in IDE's (tested in `PhpStorm 2016.3.2`).
Each method seems to be found now for the framework bundle configuration 😱
Actually uses #20923 where needed, but i think we should go with it consistently.
Relates to https://github.com/symfony/symfony/pull/20290#issuecomment-257303145
Commits
-------
3f3c6e0 [Config] Improve PHPdoc / IDE autocomplete
This PR was squashed before being merged into the 2.7 branch (closes#21010).
Discussion
----------
[Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
When trying to call a method on an anonymous class (with or without methods) the `UndefinedMethodFatalErrorHandler` tries to iterate `null`.
For ref.: https://3v4l.org/l26u1
Commits
-------
ed713ae [Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes
This PR was merged into the 3.1 branch.
Discussion
----------
[cache] Bump RedisAdapter default timeout to 5s
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Bump RedisAdapter timeout to 5s because (at least with Predis) 0 means 0s
Commits
-------
eaca2a4 [cache] Bump RedisAdapter timeout to 5s
* 3.2:
[FrameworkBundle] Ignore AnnotationException exceptions in the AnnotationsCacheWarmer
fixed @return when returning this or static
override property constraints in child class
removed unneeded comment
[Console] improved code coverage of Command class
[FrameworkBundle] Make TemplateController working without the Templating component
[FrameworkBundle] Allow multiple transactions with the same name
Only count on arrays or countables to avoid warnings in PHP 7.2
* 3.1:
fixed @return when returning this or static
override property constraints in child class
removed unneeded comment
[Console] improved code coverage of Command class
[FrameworkBundle] Make TemplateController working without the Templating component
Only count on arrays or countables to avoid warnings in PHP 7.2
* 2.8:
fixed @return when returning this or static
override property constraints in child class
removed unneeded comment
[Console] improved code coverage of Command class
[FrameworkBundle] Make TemplateController working without the Templating component
Only count on arrays or countables to avoid warnings in PHP 7.2
* 2.7:
fixed @return when returning this or static
override property constraints in child class
[Console] improved code coverage of Command class
Only count on arrays or countables to avoid warnings in PHP 7.2
This PR was merged into the 2.7 branch.
Discussion
----------
Fix @return statements to use $this or static when relevant
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20290
| License | MIT
| Doc PR | n/a
see #20290
Commits
-------
3c0693d fixed @return when returning this or static
This PR was merged into the 2.7 branch.
Discussion
----------
Avoid warning in PHP 7.2 because of non-countable data
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Recently, the "[Counting of non-countable objects][1]" RFC was merged in PHP 7.2-dev. This means `count()` now causes a warning when passing anything that's not countable (e.g. `null` or `''`).
As PHP does not lazily execute conditions, `FormUtil::isEmtpy($data) || 0 === count($data)` will cause *both* conditions to be executed. This means `count($data)` errors when `$data` is empty.
Splitting it up in 2 statements avoids the warning being triggered in PHP 7.2.
See https://travis-ci.org/symfony-cmf/content-bundle/jobs/181815895 for a failing test caused by this bug.
[1]: https://wiki.php.net/rfc/counting_non_countables
Commits
-------
94253e8 Only count on arrays or countables to avoid warnings in PHP 7.2
This PR was squashed before being merged into the 2.7 branch (closes#20817).
Discussion
----------
[Console] improved code coverage of Command class
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This PR increases the code coverage of the Command class from ``86.82%`` to ``96.90%``.
Commits
-------
d393113 [Console] improved code coverage of Command class
* 3.2:
use HHVM 3.15 to run tests
[TwigBridge] fix Twig 2.x compatibility
removed some PHP CS Fixer rules
Improve language
[Console] SymfonyStyle: Escape trailing backslashes in user texts
Mention the community review guide
[Form] fix group sequence based validation
[Console] Fix question formatting using SymfonyStyle::ask()
* 3.1:
use HHVM 3.15 to run tests
[TwigBridge] fix Twig 2.x compatibility
removed some PHP CS Fixer rules
Improve language
[Console] SymfonyStyle: Escape trailing backslashes in user texts
Mention the community review guide
[Form] fix group sequence based validation
[Console] Fix question formatting using SymfonyStyle::ask()
* 2.8:
use HHVM 3.15 to run tests
[TwigBridge] fix Twig 2.x compatibility
removed some PHP CS Fixer rules
Improve language
[Console] SymfonyStyle: Escape trailing backslashes in user texts
Mention the community review guide
[Form] fix group sequence based validation
[Console] Fix question formatting using SymfonyStyle::ask()
* 2.7:
use HHVM 3.15 to run tests
[TwigBridge] fix Twig 2.x compatibility
removed some PHP CS Fixer rules
Improve language
[Console] SymfonyStyle: Escape trailing backslashes in user texts
Mention the community review guide
[Form] fix group sequence based validation
[Console] Fix question formatting using SymfonyStyle::ask()
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Fix question formatting using SymfonyStyle::ask()
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20964
| License | MIT
| Doc PR | n/a
Given
```php
$io = new SymfonyStyle($input, $output);
$io->ask('Do you want to use Foo\\Bar <comment>or</comment> Foo\\Baz\\?', 'Foo\\Bar');
```
Before output
![before](http://image.prntscr.com/image/af3806f866654deda2dec79b50d1ffa2.png)
After output
![after](http://image.prntscr.com/image/59c031d9e02949cebeae7a4734c7043f.png)
Commits
-------
e189183 [Console] SymfonyStyle: Escape trailing backslashes in user texts
9d46712 [Console] Fix question formatting using SymfonyStyle::ask()
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] update changelog and upgrade files
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20634
| License | MIT
| Doc PR |
Commits
-------
ad7afe0 Added a needed blank line
d2b4996 [DI] update changelog and upgrade files
This PR was merged into the 2.7 branch.
Discussion
----------
[Form] fix group sequence based validation
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20929
| License | MIT
| Doc PR |
Commits
-------
fb91f74 [Form] fix group sequence based validation
* 3.1:
fixed obsolete getMock() usage
fixed obsolete getMock() usage
fixed obsolete getMock() usage
[WebProfilerBundle] Display multiple HTTP headers in WDT
do not remove the Twig ExceptionController service
removed obsolete condition
do not try to register incomplete definitions
* 2.8:
fixed obsolete getMock() usage
fixed obsolete getMock() usage
[WebProfilerBundle] Display multiple HTTP headers in WDT
do not remove the Twig ExceptionController service
removed obsolete condition
do not try to register incomplete definitions
This PR was merged into the 3.3-dev branch.
Discussion
----------
[WebProfilerBundle] Split PHP version if needed
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes/no
| Fixed tickets | https://github.com/symfony/symfony/pull/20697#issuecomment-263966015
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
Commits
-------
1241a00 [WebProfilerBundle] Split PHP version if needed
This PR was squashed before being merged into the 3.3-dev branch (closes#20634).
Discussion
----------
[DI] Deprecate dumping an uncompiled container
| 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/19673#issuecomment-242001836
| License | MIT
| Doc PR | reference to the documentation PR, if any
It makes the PHP dumper less complex. Compiled container goes in, compiled container goes out.
Relates to #19673
Commits
-------
da50fdb [DI] Deprecate dumping an uncompiled container
This PR was squashed before being merged into the 3.3-dev branch (closes#20923).
Discussion
----------
#20921 [Config] Provide shorthand methods for ArrayNodeDefinition::pr…
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20921
| License | MIT
Commits
-------
22b8490#20921 [Config] Provide shorthand methods for ArrayNodeDefinition::pr…
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Fix DefinitionDecorator existency for composer authoritative+IDEs
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
So that the class is defined for naive parser (e.g. IDEs & composer class map generator).
Fixes autoloading in authoritative mode.
Commits
-------
9c3f755 [DI] Fix DefinitionDecorator existency for composer authoritative+IDEs
* 3.2:
[Security] Fix test
[Validator] phpize default option values
test for the Validator component to be present
[Serializer] Fix MaxDepth annotation exceptions
[DependencyInjection] Fix on-invalid attribute type in xsd
[FrameworkBundle] Fix PHP form templates on translatable attributes
[VarDumper] Fix dumping by-ref variadics
[Validator] add Indonesian translation
fixed CS
[config] Fix issue when key removed and left value only
[HttpFoundation] Fix cookie to string conversion for raw cookies
Fix misresolved parameters in debug:config on 3.2
[Console] fixed BC issue with static closures
[TwigBundle] Config is now a hard dependency
[FrameworkBundle] framework.annotations default should be true only if doctrine/annotations is installed
[Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
* 3.1:
[Security] Fix test
[Validator] phpize default option values
test for the Validator component to be present
[Serializer] Fix MaxDepth annotation exceptions
[DependencyInjection] Fix on-invalid attribute type in xsd
[FrameworkBundle] Fix PHP form templates on translatable attributes
[VarDumper] Fix dumping by-ref variadics
[Validator] add Indonesian translation
fixed CS
[config] Fix issue when key removed and left value only
[HttpFoundation] Fix cookie to string conversion for raw cookies
[Console] fixed BC issue with static closures
[Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
* 2.8:
[Security] Fix test
[Validator] phpize default option values
test for the Validator component to be present
[DependencyInjection] Fix on-invalid attribute type in xsd
[FrameworkBundle] Fix PHP form templates on translatable attributes
[VarDumper] Fix dumping by-ref variadics
[Validator] add Indonesian translation
fixed CS
[config] Fix issue when key removed and left value only
[Console] fixed BC issue with static closures
[Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
* 2.7:
[Validator] phpize default option values
test for the Validator component to be present
[DependencyInjection] Fix on-invalid attribute type in xsd
[FrameworkBundle] Fix PHP form templates on translatable attributes
[VarDumper] Fix dumping by-ref variadics
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Make ContainerBuilder::resolveEnvPlaceholders() able to inline the values of referenced env vars.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Being able to resolve environment variables at compile time as a replacement for `SYMFONY__` special env vars, unlocking their deprecation (see #20100).
Commits
-------
713b081 [DI] Make ContainerBuilder::resolveEnvPlaceholders() able to inline the values of referenced env vars.
This PR was merged into the 3.3-dev branch.
Discussion
----------
Request exceptions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20389, #20615, #20662
| License | MIT
| Doc PR | n/a
Replaces #20389 and #20662. The idea is to generically manage 400 responses when an exception implements `RequestExceptionInterface`.
The "weird" caches on the request for the host and the clients IPs allows to correctly manage exceptions in an exception listener/controller (as we are duplicating the request there, but we don't want to throw an exception there).
Commits
-------
32ec288 [HttpFoundation] refactored Request exceptions
d876809 Return a 400 response for suspicious operations
This PR was merged into the 3.3-dev branch.
Discussion
----------
[HttpKernel] Fix Bundle name regression
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20117
| License | MIT
| Doc PR | N/A
The bundle name can be set manually instead of being guessed from the class name, as the property is protected.
However, a regression prevents this name to be used, as calling `Bundle::getNamespace()` recomputes the bundle name from class instead.
The ability to name explicitly bundles is appreciable when dealing with "virtual" ones, or when providing bundles in a library under a `Vendor\MyPackage\Bridge\Symfony\Bundle` namespace. No need to rename the bundle class `VendorMyPackageBundle` which will make the instantiation in `Kernel::registerBundle()` quite ugly:
```diff
- new Vendor\MyPackage\Bridge\Symfony\Bundle\VendorMyPackageBundle()
+ new Vendor\MyPackage\Bridge\Symfony\Bundle\Bundle()
```
What about removing `Bundle::parseClassName()` and processing the namespace and bundle name separately, but keeping the `namespace` property introduced in #20117?
Commits
-------
3b5127d [HttpKernel] Fix Bundle name regression
* 2.7:
[Validator] add Indonesian translation
fixed CS
[config] Fix issue when key removed and left value only
[Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
This PR was merged into the 2.7 branch.
Discussion
----------
[Security] AbstractVoter->supportsAttribute gives false positive if attribute is zero (0)
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Issue is easy to reproduce with test giving negative data set.
0 should not pass as supported attribute for any set of attributes but it does as in_array in the method does not use flag 'strict' set to true.
As this is abstract voter and is used by users with their code flag 'strict' should be set to true.
Since is there in 2.7 and 2.8 (LTS) IMHO it should be fixed.
Commits
-------
8306530 [Security] AbstractVoter method supportsAttribute gives false positive if attribute is zero (0)
When a key attribute is mapped and the key is removed from the value array, if
only 'value' element is left in the array, it should replace its wrapper
array.
Assume the original value array is as follows (key attribute is 'id').
```php
array(
'things' => array(
array('id' => 'option1', 'value' => 'value1'),
array('id' => 'option2', 'value' => 'value2')
)
)
```
After normalized, the above shall be converted to the following array.
```php
array(
'things' => array(
'option1' => 'value1',
'option2' => 'value2'
)
)
```
It's also possible to mix 'value-only' and 'none-value-only' elements in
the array:
```php
array(
'things' => array(
array('id' => 'option1', 'value' => 'value1'),
array('id' => 'option2', 'value' => 'value2', 'foo' => 'foo2')
)
)
```
The above shall be converted to the following array.
```php
array(
'things' => array(
'option1' => 'value1',
'option2' => array('value' => 'value2','foo' => 'foo2')
)
)
```
The 'value' element can also be array:
```php
array(
'things' => array(
array(
'id' => 'option1',
'value' => array('foo'=>'foo1', 'bar' => 'bar1')
)
)
)
```
The above shall be converted to the following array.
```php
array(
'things' => array(
'option1' => array('foo' => 'foo1', 'bar' => 'bar1')
)
)
```
When using VariableNode for value element, it's also possible to mix
different types of value elements:
```php
array(
'things' => array(
array('id' => 'option1', 'value' => array('foo'=>'foo1', 'bar' => 'bar1')),
array('id' => 'option2', 'value' => 'value2')
)
)
```
The above shall be converted to the following array.
```php
array(
'things' => array(
'option1' => array('foo'=>'foo1', 'bar' => 'bar1'),
'option2' => 'value2'
)
)
```
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #15270
| License | MIT
| Doc PR | n/a
This PR was squashed before being merged into the 2.8 branch (closes#20847).
Discussion
----------
[Console] fixed BC issue with static closures
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20845
| License | MIT
| Doc PR | n/a
Static closures were unable to be used in Command::setCode since #14431. This change fixes the BC break and ensures static closures can still be used.
Edit: It seems the inability to bind static closures was considered a feature in PHP5 but was considered a bug by PHP7. As such, the tests need to work around this fact - but the code can remain the same. This code change can be tidied/removed once Symfony is PHP7+ only.
Discussion here:
https://bugs.php.net/bug.php?id=64761https://bugs.php.net/bug.php?id=68792
Commits
-------
3247308 [Console] fixed BC issue with static closures
* 3.2:
[Console] Review Application docblocks
[Cache] Improve performances into foreach (PhpFilesAdapter)
bumped Symfony version to 3.2.2
updated VERSION for 3.2.1
updated CHANGELOG for 3.2.1
bumped Symfony version to 3.1.9
updated VERSION for 3.1.8
updated CHANGELOG for 3.1.8
Add support for REDIS_URL environment variables.
bumped Symfony version to 2.8.16
updated VERSION for 2.8.15
updated CHANGELOG for 2.8.15
bumped Symfony version to 2.7.23
updated VERSION for 2.7.22
update CONTRIBUTORS for 2.7.22
updated CHANGELOG for 2.7.22
Update PHP CS Fixer config file
* 3.1:
[Console] Review Application docblocks
bumped Symfony version to 3.1.9
updated VERSION for 3.1.8
updated CHANGELOG for 3.1.8
bumped Symfony version to 2.8.16
updated VERSION for 2.8.15
updated CHANGELOG for 2.8.15
bumped Symfony version to 2.7.23
updated VERSION for 2.7.22
update CONTRIBUTORS for 2.7.22
updated CHANGELOG for 2.7.22
Update PHP CS Fixer config file
* 2.8:
[Console] Review Application docblocks
bumped Symfony version to 2.8.16
updated VERSION for 2.8.15
updated CHANGELOG for 2.8.15
bumped Symfony version to 2.7.23
updated VERSION for 2.7.22
update CONTRIBUTORS for 2.7.22
updated CHANGELOG for 2.7.22
Update PHP CS Fixer config file
* 2.7:
[Console] Review Application docblocks
bumped Symfony version to 2.7.23
updated VERSION for 2.7.22
update CONTRIBUTORS for 2.7.22
updated CHANGELOG for 2.7.22
Update PHP CS Fixer config file
This PR was squashed before being merged into the 2.7 branch (closes#20813).
Discussion
----------
[Console] Review Application docblocks
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
~I know there must be a lot of other places in the core where there is some repeated or useless informations in docblocks, but everytime I dig into the `Application` class, I see this, and I don't want to repeat things for consistency when adding new methods 😅 (for instance in #20808, the `setCatchThrowables / areThrowablesCaught ` methods do not need a docblock description IMHO).~
~This PR adapts docblocks where:~
- ~A docblock description is not required, as everything can be expressed in the `@return / @param` argument (the case mentioned above)~
- ~Information is redundant between description and tags, and the context does not have to be reminded again:~
```diff
/**
* Adds an array of command objects.
*
* If a Command is not enabled it will not be added.
*
- * @param Command[] $commands An array of commands
+ * @param Command[] $commands
*/
public function addCommands(array $commands)
{
foreach ($commands as $command) {
$this->add($command);
}
}
```
Commits
-------
d8c18cc [Console] Review Application docblocks
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] replace DefinitionDecorator by ChildDefinition
| 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
The DefinitionDecorator class does not deal with decorated services. It reflects a parent-child-relationship between definitions instead. To avoid confusion, this commit deprecates the existing DefinitionDecorator class and introduces a new DefinitionExtension class as replacement.
Commits
-------
184f7ff replace DefinitionDecorator with ChildDefinition
The DefinitionDecorator class does not deal with decorated services. It
reflects a parent-child-relationship between definitions instead. To
avoid confusion, this commit deprecates the existing DefinitionDecorator
class and introduces a new ChildDefinition class as replacement.
* 3.2:
[WebProfilerBundle] Fix AJAX panel with fetch requests
Don’t compile when Opcache is not enabled on CLI
DateIntervalType: 'invert' should not inherit the 'required' option
[Form] DateIntervalType: Do not try to translate choices
[TwigBridge] fix constructor args check
Allow simple-phpunit to be used with an HTTP proxy
Minor fixes for 3.2
Fix a web profiler form issue with fields added to the form after the form was built
do not trigger deprecations for valid YAML
Write an exception message in a one heading line
[Workflow] Added missing docblock
[Finder] Refine phpdoc about argument for NumberComparator
Fixed max width from ajax request url element (td)
Fix unresolved parameters from default bundle configs in debug:config
[github] Tweak PR template
[Serializer] Optimize max depth checking
* 3.1:
Write an exception message in a one heading line
[Finder] Refine phpdoc about argument for NumberComparator
Fixed max width from ajax request url element (td)
Fix unresolved parameters from default bundle configs in debug:config
[github] Tweak PR template
[Serializer] Optimize max depth checking
* 2.8:
Write an exception message in a one heading line
[Finder] Refine phpdoc about argument for NumberComparator
Fix unresolved parameters from default bundle configs in debug:config
[github] Tweak PR template
* 2.7:
Write an exception message in a one heading line
[Finder] Refine phpdoc about argument for NumberComparator
Fix unresolved parameters from default bundle configs in debug:config
[github] Tweak PR template
This PR was squashed before being merged into the 3.3-dev branch (closes#20487).
Discussion
----------
[Console] Disallow inheritance from ProgressBar
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20427
| License | MIT
| Doc PR | ~
Changed `ProgressBar` to `final`, fixed tests.
As explained below, this modification doesn't break BC because inheritance from `ProgressBar` was not possible anyway.
See: https://github.com/symfony/symfony/issues/20427
Commits
-------
a2668f6 [Console] Disallow inheritance from ProgressBar
This PR was merged into the 3.1 branch.
Discussion
----------
[Serializer] Optimize max depth checking
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes/no
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Avoid to call the metadata factory for each attribute when max depth checking is enabled.
Prepare the code for the "serialized name" feature (that also requires metadata) in Symfony 3.3.
Commits
-------
bb3ee76 [Serializer] Optimize max depth checking
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Added Yaml syntax shortcut for name-only tags
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | todo
This PR adds a little shorcut for tags without any attributes. There are increasingly more name-only tags in Symfony and having to do `{ name: twig.extension }` for these seems way too verbose to me.
**Before**
```yaml
services:
app.twig_extension:
class: AppBundle\Twig\AppExtension
tags:
- { name: twig.extension }
```
**After**
```yaml
services:
app.twig_extension:
class: AppBundle\Twig\AppExtension
tags: [twig.extension]
# or
# - twig.extension
```
This of course means we introduce a new format to achieve the same goal. I believe this isn't a big problem as the decision is distinctive and simple: If you configure tag attributes, use the long format, otherwise use the short format.
Backwards compatibility
---
In this PR, an exception was removed to allow this new shortcut format. The BC promise doesn't cover exceptions and I think removing the exception here should cause anything to break:
* Applications shouldn't rely on exceptions
* If code was triggering this exception before, it would not cause any behaviour change after this PR: The service just retrieves an unused tag, which is simply ignored by the container.
Commits
-------
7fa8c8a Added Yaml syntax shortcut for name-only tags
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Added a shortcut method for autowired definitions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | todo
This is a simple proposal to make adding autowired definitions to the `ContainerBuilder` a little easier. Registering autowired services in PHP code was quite verbose at the moment, while the whole point of autowiring is quick service registration.
**Before**
```php
$container->register('app.twig_extension', AppExtension::class)
->setAutowired(true)
->addTag('twig.extension')
;
```
**After**
```php
$container->autowire('app.twig_extension', AppExtension::class)
->addTag('twig.extension')
;
```
With https://github.com/symfony/symfony/pull/20264, this will be even nicer:
```php
$container->autowire(AppExtension::class)
->addTag('twig.extension')
;
```
Commits
-------
6ef4ce8 Added a shortcut method for autowired definitions
This PR was squashed before being merged into the 3.3-dev branch (closes#20697).
Discussion
----------
Updated the "PHP config" panel in the profiler
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
I propose to update this panel taking some of the ideas introduced by @ro0NL in #20126:
* Adding more info that helps debugging problems (like 32/64 bits, the locale and the timezone)
* Removing anything related to PHP acceleration that is not OPcache or APC
### Before
![php-config-before](https://cloud.githubusercontent.com/assets/73419/20751739/b557ca9a-b6fd-11e6-98c4-49e80b16d424.png)
### After
![php-config-after](https://cloud.githubusercontent.com/assets/73419/20751740/b7da5c38-b6fd-11e6-8619-3d3b5f477887.png)
Commits
-------
531053b Updated the "PHP config" panel in the profiler
This PR was merged into the 2.7 branch.
Discussion
----------
[Finder] Refine phpdoc about argument for NumberComparator
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
The most important being the addition of "string" to `Finder::depth()`.
Commits
-------
9b9d339 [Finder] Refine phpdoc about argument for NumberComparator
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Console] Improve markdown format
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | no
| New feature? | no
| BC breaks? | not sure?
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
This improves the markdown description for a console application. To make the ouput read more friendly and intuitively (less bloated IMHO).
Before:
Markdown files in https://github.com/symfony/symfony/tree/master/src/Symfony/Component/Console/Tests/Fixtures
After:
Markdown files in https://github.com/ro0NL/symfony/tree/console/markdown/src/Symfony/Component/Console/Tests/Fixtures
Commits
-------
302a19d [Console] Improve markdown format
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Console] Include application name/version in JSON descriptions
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
To be consistent with other formats.
Commits
-------
a43e040 [Console] Include application name/version in JSON descriptions
This PR was squashed before being merged into the 3.2 branch (closes#20883).
Discussion
----------
Don’t compile when Opcache is not enabled on CLI
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20878
| License | MIT
This should fix#20878 "Zend OPcache seems to be disabled, can't compile file" when Opcache is enabled, but `opcache.enable_cli` is turned off.
Commits
-------
5222643 Don’t compile when Opcache is not enabled on CLI
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Console] Improve UX on not found namespace/command
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
This improves the DX/UX when you don't remember what a command is called.. Traditionally you get this message saying "command x is ambiguous (Y, Z or 6 more)" and if the one you are looking for is in the 6 more you are out of luck. You then have to run the console without arg again, get 50 commands displayed, then have to scroll up to find which one it is you meant.
With this patch you get all suggestions always, even with description, so you can make an informed decision right away. See before/after on the screenshot below.
![image](https://cloud.githubusercontent.com/assets/183678/21080350/c3d446ea-bfac-11e6-934b-ba3d7c3dd34d.png)
Commits
-------
aae5fb1 Improve UX on not found namespace/command
This PR was squashed before being merged into the 3.2 branch (closes#20877).
Discussion
----------
DateIntervalType: 'invert' should not inherit the 'required' option
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20876
| License | MIT
| Doc PR | -
As explained in #20876,
> In the DateIntervalType, there is a field, called 'invert', that allows for negative intervals. This is outputted as a checkbox. Which is fine, but it shouldn't be required.
Commits
-------
b1597f1 DateIntervalType: 'invert' should not inherit the 'required' option
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Finder] Deprecate ExceptionInterface
| 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
This interface was missed in https://github.com/symfony/symfony/pull/15805, and should have been removed in 3.0.
Ideally, the component should have such an interface, though, as other components does. But the only domain exception in this component is an `AccessDeniedException` used by the `RecursiveDirectoryIterator`. So it isn't worth it right now.
I think this interface was almost internal actually, but anyway the `\Symfony\Component\Finder\Adapter\AdapterInterface` interface does not exist anymore. So the `ExceptionInterface::getAdapter()` signature cannot be satisfied anyway. I guess anyone relying on this interface in any way should have notice that and removed anything related to Symfony Finder's adapters when upgrading to 3.0.
Should we consider removing it directly in the 3.1 branch instead?
Commits
-------
1b600b0 [Finder] Deprecate ExceptionInterface
This PR was merged into the 3.2 branch.
Discussion
----------
[Form] DateIntervalType: Do not try to translate choices
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
When using choice widgets, the form type should not try to translate each options, otherwise, you'll get something like this:
<img width="150" alt="screenshot 2016-12-12 a 23 37 09" src="https://cloud.githubusercontent.com/assets/2211145/21119721/25411620-c0c4-11e6-9848-95393d1d21c4.PNG">
<img width="1075" alt="screenshot 2016-12-12 a 23 37 23" src="https://cloud.githubusercontent.com/assets/2211145/21119722/2543ccf8-c0c4-11e6-9842-ae84dc895a0b.PNG">
Commits
-------
b6831d2 [Form] DateIntervalType: Do not try to translate choices
This PR was merged into the 3.2 branch.
Discussion
----------
[Yaml] do not trigger deprecations for valid YAML
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19874
| License | MIT
| Doc PR |
Commits
-------
1436349 do not trigger deprecations for valid YAML
This PR was merged into the 3.2 branch.
Discussion
----------
Minor fixes for 3.2
| Q | A
| ------------- | ---
| Branch? | 3.2
| 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 only fix minor issues in the codebase introduced in 3.2.
Refs:
- YamlEncoder 9366a7dc77
- File helper: d9a84990cf
- VarDumper ClassStub: 788f7e84b0
- Cache tag based invalidation 19764af74f
- CacheWarmer for Serializer: 810f4694af
- SymfonyStyle simplified test: 85e5060fa1
- Workflow Definition builder: ffaeba39fc
---
There are other issues in older branches, but I guess it's not worth it for them, as it'll only add more conflicts. But for 3.2, it should be feasible.
Commits
-------
7bdfc84 Minor fixes for 3.2
* 3.2:
[Routing] Mention minor BC break about UrlGenerator & query strings
fixed composer.json
fixed composer.json
Skip test when iconv extension is missing
Fix upgrade notes
[Config] fix dev dependencies
Fix bundle commands are not available via find()
This PR was merged into the 2.7 branch.
Discussion
----------
Skip test when iconv extension is missing
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
ae7377d Skip test when iconv extension is missing
This PR was merged into the 2.7 branch.
Discussion
----------
[Config] Do not skip YamlReferenceDumperTest entirely
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
The test is now completed in 3.2, but for older branch, any changes in the `YamlReferenceDumper` is not tested on travis and requires to test it manually or comment the `markTestIncomplete` line.
`assertEquals` should still be used on 3.2.
Commits
-------
1ed9335 [Config] Do not skip YamlReferenceDumperTest entirely
* 3.2:
[WebProfilerBundle] Fix whitespace control in layout.html.twig
[HttpKernel] Fix open_basedir compat in DataCollector
[Validator] Fix init of YamlFileLoader::$classes for empty files
* 3.2: (51 commits)
[FrameworkBundle] [Workflow] Fix service marking store configuration
Fix merge
[Validator] add class name to the cache key
[Serializer] Remove AbstractObjectNormalizer::isAttributeToNormalize
Throw less misleading exception when property access not found
[Twig] Fix deprecations with Twig 1.29
[FrameworkBundle] Fix validation cache warmer with failing or missing classes
Fixed typo
[FrameworkBundle] Removed the kernel.debug parameter from the cache pool namespace seed
Fix email address
fix the docblock in regard to the role argument
[Bridge\Twig] Trigger deprecation when using FormExtension::$renderer
Don't use the "app" global variable in the profiler
[VarDumper] fix tests when xdebug is enabled
Fix merge
FIXED NON EXISTING TYPE DECLARATION
[Form] Add failing test for data collector bug
[Cache] Fix dumping SplDoublyLinkedList iter mode
[Form] Fix FormDataCollector
Ignore missing 'debug.file_link_formatter' service in Debug and Twig bundles
...
* 3.1: (28 commits)
Fix merge
[Validator] add class name to the cache key
[Serializer] Remove AbstractObjectNormalizer::isAttributeToNormalize
Throw less misleading exception when property access not found
[Twig] Fix deprecations with Twig 1.29
Fixed typo
[FrameworkBundle] Removed the kernel.debug parameter from the cache pool namespace seed
Fix email address
fix the docblock in regard to the role argument
Don't use the "app" global variable in the profiler
[VarDumper] fix tests when xdebug is enabled
Fix merge
FIXED NON EXISTING TYPE DECLARATION
[Cache] Fix dumping SplDoublyLinkedList iter mode
[Console] fixed PHP7 Errors when not using Dispatcher
Regression test for missing controller arguments (3.1)
Regression test for missing controller arguments
fix a test checking for a value
[Form][DX] FileType "multiple" fixes
fixed CS
...
This PR was squashed before being merged into the 3.1 branch (closes#20745).
Discussion
----------
[Validator] add class name to the cache key
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20685
| License | MIT
| Doc PR |
Adding the class name to the cache key to avoid collision
Commits
-------
1681fc9 [Validator] add class name to the cache key
This PR was squashed before being merged into the 3.1 branch (closes#20530).
Discussion
----------
[Serializer] Remove AbstractObjectNormalizer::isAttributeToNormalize
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | unclear
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
I've introduced this method by error in #17113. It has been forgotten during a refactoring. It has always been unused, is not covered by our test suite and has never been documented.
Technically it's a BC break (because this is a protected method), but I think that it's better to remove it has it has never be intended to be used, it's just a miss. An alternative is to deprecate it and remove it in v4.
Commits
-------
fea18aa [Serializer] Remove AbstractObjectNormalizer::isAttributeToNormalize
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes#19141).
Discussion
----------
Throw less misleading exception when property access not found
Prevent throwing a NoSuchPropertyException with a somewhat misleading message "Neither the property "X" nor one of the methods "addX()"/"removeX()", "setX()", "x()", "__set()" or "__call()" exist and have public access in class when the access cannot be determined, for instance if the doctrine schema is not up to date.
| Q | A |
| --- | --- |
| Branch? | 3.1 for fixes |
| Bug fix? | no |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| License | MIT |
Commits
-------
ec28da4 Throw less misleading exception when property access not found
* 2.8:
[Twig] Fix deprecations with Twig 1.29
Fixed typo
Fix email address
fix the docblock in regard to the role argument
[VarDumper] fix tests when xdebug is enabled
Fix merge
[Cache] Fix dumping SplDoublyLinkedList iter mode
[Console] fixed PHP7 Errors when not using Dispatcher
Regression test for missing controller arguments
fix a test checking for a value
[Form][DX] FileType "multiple" fixes
fixed CS
[TwigBundle] Fix twig loader registered twice
[WebProfilerBundle] Fix dump block is unfairly restrained
[Console] Fix wrong handling of multiline arg/opt descriptions
[DependencyInjection] PhpDumper.php: hasReference() should not search references in lazy service arguments.
[Form] fixed "empty_value" option deprecation
Cast result to int before adding to it
This PR was merged into the 2.7 branch.
Discussion
----------
Cast result to int before adding to it
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This fixes the occasional warning about non-numeric values when using PHP 7.1.
Commits
-------
70c42f2 Cast result to int before adding to it
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Yaml] Small optimization of the parser
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Very small optimization in the Yaml parser but as it is executed often, there are performance gains (I used [this benchmark](https://gist.github.com/GuilhemN/364c4ddcc8349eaa080054d5f8ef8685); you can see the [comparison master / this PR](https://blackfire.io/profiles/compare/0f4e5497-d410-4c76-83e9-d8fa8e46ce18/graph)).
Commits
-------
5fc8e86 [Yaml] Small optimization of the parser
This PR was merged into the 2.7 branch.
Discussion
----------
[Security] fix the docblock in regard to the role argument
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Makes the docblocks consistent with the `UserInterface` since #17525.
Commits
-------
4e563ae fix the docblock in regard to the role argument
This PR was merged into the 3.3-dev branch.
Discussion
----------
[ClassLoader] Deprecate Apc/WinCache/Xcache class loaders
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
See https://github.com/composer/composer/pull/5559
Commits
-------
fa36e1d [ClassLoader] Deprecate Apc/WinCache/Xcache class loaders
This PR was squashed before being merged into the 3.3-dev branch (closes#20524).
Discussion
----------
[Serializer][XmlEncoder] Allow removing empty tags in generated XML
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20398
| License | MIT
| Doc PR | ~
Allow a new option in $context of XmlEncoder.php to remove empty tags if $context['remove_empty_tags'] setted to true, changing this :
```xml
<node>
<subnode>Value</subnode>
<emptysubnode/>
</node>
```
To this :
```xml
<node>
<subnode>Value</subnode>
</node>
```
Commits
-------
0cb4d8e [Serializer][XmlEncoder] Allow removing empty tags in generated XML
This PR was merged into the 3.2 branch.
Discussion
----------
[Serializer] Fix argument object denormalization
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20670
| License | MIT
| Doc PR | N/A
Fixes#20670. I've seen https://github.com/symfony/symfony/pull/19277#discussion-diff-69389638 so I think it's the right thing to do, but I didn't follow the thread at the time, so I may have missed something.
Ping @theofidry, @dunglas.
Commits
-------
27de65a [Serializer] Fix argument object denormalization
This PR was squashed before being merged into the 2.7 branch (closes#20736).
Discussion
----------
[Console] fixed PHP7 Errors when not using Dispatcher
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #17257, #20110, #20111
| License | MIT
| Doc PR | n/a
Original fix, #19813, works only when there is event dispatcher available.
This PR fix the issue also for scenario without event dispatcher.
Closes#20110 issue and #20111 PR connected to it.
Closing #17257 , as everywhere the error is converted to exception and it should be handled
Commits
-------
899fa79 [Console] fixed PHP7 Errors when not using Dispatcher
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Serializer] Throw exception when extra attributes are used during an object denor…
| Q | A |
| --- | --- |
| Branch? | "master" |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #19948 |
| License | MIT |
| Doc PR | [#6975](https://github.com/symfony/symfony-docs/pull/6975) |
I will update the doc if you're ok with this PR.
Commits
-------
565a984 throw exception when extra attributes are used during an object denormalization
* 2.7:
Regression test for missing controller arguments
fix a test checking for a value
[Form][DX] FileType "multiple" fixes
fixed CS
[TwigBundle] Fix twig loader registered twice
[Console] Fix wrong handling of multiline arg/opt descriptions
[DependencyInjection] PhpDumper.php: hasReference() should not search references in lazy service arguments.
[Form] fixed "empty_value" option deprecation
This PR was squashed before being merged into the 2.7 branch (closes#20418).
Discussion
----------
[Form][DX] FileType "multiple" fixes
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/12547
| License | MIT
| Doc PR | -
# (1st) Derive "data_class" option from passed "multiple" option
Information
-------------
Following this tutorial ["How to Upload Files"][1] but storing many `brochures` instead of one, i.e.:
```php
// src/AppBundle/Entity/Product.php
class Product
{
/**
* @var string[]
*
* @ORM\Column(type="array")
*/
private $brochures;
//...
}
```
```php
//src/AppBundle/Form/ProductType.php
$builder->add('brochures', FileType::class, array(
'label' => 'Brochures (PDF files)',
'multiple' => true,
));
```
The Problem
--------------
I found a pain point here when the form is loaded again after save some brochures (Exception):
> The form's view data is expected to be an instance of class Symfony\Component\HttpFoundation\File\File, but is a(n) array. You can avoid this error by setting the "data_class" option to null or by adding a view transformer that transforms a(n) array to an instance of Symfony\Component\HttpFoundation\File\File.
The message is very clear, but counter-intuitive in this case, because the form field (`FileType`) was configured with `multiple = true`, so IMHO it shouldn't expect a `File` instance but an array of them at all events.
The PR's effect
---------------
**Before:**
```php
$form = $this->createFormBuilder($product)
->add('brochures', FileType::class, [
'multiple' => true,
'data_class' => null, // <---- mandatory
])
->getForm();
```
**After:**
```php
$form = $this->createFormBuilder($product)
->add('brochures', FileType::class, [
'multiple' => true,
])
->getForm();
```
# (2nd) Return empty `array()` at submit no file
Information
-------------
Based on the same information before, but adding some constraints:
```php
// src/AppBundle/Entity/Product.php
use Symfony\Component\Validator\Constraints as Assert;
class Product
{
/**
* @var string[]
*
* @ORM\Column(type="array")
*
* @Assert\Count(min="1") // or @Assert\NotBlank()
* @Assert\All({
* @Assert\File(mimeTypes = {"application/pdf", "application/x-pdf"})
* })
*
*/
private $brochures;
}
```
This should require at least one file to be stored.
The Problem
--------------
But, when no file is uploaded at submit the form, it's valid completely. The submitted data for this field was `array(null)` so the constraints pass without any problem:
* `@Assert\Count(min="1")` pass! because contains at least one element (No matter what)
* `@Assert\NotBlank()` it could pass! because no `false` and no `empty()`
* `@Assert\File()` pass! because the element is `null`
Apart from that really we expecting an empty array instead.
The PR's effect
----------------
**Before:**
```php
// src/AppBundle/Entity/Product.php
use Symfony\Component\Validator\Constraints as Assert;
class Product
{
/**
* @var string[]
*
* @ORM\Column(type="array")
*
* @Assert\All({
* @Assert\NotBlank,
* @Assert\File(mimeTypes = {"application/pdf", "application/x-pdf"})
* })
*
*/
private $brochures;
}
```
**After:**
```php
// src/AppBundle/Entity/Product.php
use Symfony\Component\Validator\Constraints as Assert;
class Product
{
/**
* @var string[]
*
* @ORM\Column(type="array")
*
* @Assert\Count(min="1") // or @Assert\NotBlank
* @Assert\All({
* @Assert\File(mimeTypes = {"application/pdf", "application/x-pdf"})
* })
*
*/
private $brochures;
}
```
[1]: http://symfony.com/doc/current/controller/upload_file.html
Commits
-------
36b7ba6 [Form][DX] FileType "multiple" fixes
This PR was squashed before being merged into the 3.3-dev branch (closes#18952).
Discussion
----------
[Security] Add a JSON authentication listener
| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | n/a |
| License | MIT |
| Doc PR | symfony/symfony-docs#7081 |
Add a new authentication listener allowing to login by sending a JSON document like:
`{"_username": "dunglas", "_password": "foo"}`.
It is similar to the traditional form login (but take a JSON document as entry) and is convenient for APIs, especially used in combination with JWT.
See https://github.com/api-platform/core/issues/563 and https://github.com/lexik/LexikJWTAuthenticationBundle/issues/123#issuecomment-173860682 for previous discussions.
- [x] Add functional tests in security bundle
Commits
-------
02178bc [Security] Add a JSON authentication listener
This PR was merged into the 2.7 branch.
Discussion
----------
[Form] fixed "empty_value" option deprecation
| Q | A
| ------------- | ---
| Branch? | 2.x only
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/15945#r86547326
| License | MIT
| Doc PR | ~
I didn't make any profiling but a resolver instance is passed to `configureOptions()` creating locale variables including those exceptions for each field using one of the patched form types, so I guess the memory usage can grow really fast.
Commits
-------
7e84907 [Form] fixed "empty_value" option deprecation
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DomCrawler] Add support for formaction and formmethod attributes
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
This adds supports for the ``formaction`` and ``formmethod`` of submit elements, which override the values defined on the ``<form>`` element.
This works only when you call ``$crawler->form()`` on a Crawler containing a button, not when it contains the ``<form>`` itself of course (as the button override is applied only when using this button to submit, not when using another way).
Other button-level overrides are not implemented:
- ``formtarget`` is useless as we don't implement ``target`` either (the Crawler does not deal with frame-based pages anyway)
- ``formnovalidate`` is ignored, as we don't automatically disable the form validation on ``novalidate`` either, but we require an explicit disabling instead (this might be subject to a separate PR though, as it could make sense)
- ``formenctype`` is ignored as we also ignore ``enctype`` (we always submit file fields, even when missing the proper enctype)
Commits
-------
717cf8a [DomCrawler] Add support for formaction and formmethod attributes
This PR was squashed before being merged into the 3.3-dev branch (closes#20509).
Discussion
----------
[Serializer] Allow to specify a single value in @Groups
| 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/19374#issuecomment-256688002
| License | MIT
| Doc PR | todo
Tiny DX improvement:
Before:
```php
use Symfony\Component\Serializer\Annotation\Groups;
class Product
{
/**
* @Groups({"admins"})
*/
public $itemsSold;
}
```
Now allowed:
```php
use Symfony\Component\Serializer\Annotation\Groups;
class Product
{
/**
* @Groups("admins")
*/
public $itemsSold;
}
```
Commits
-------
926aa48 [Serializer] Allow to specify a single value in @Groups
This PR was merged into the 3.2 branch.
Discussion
----------
[Validator] Bring egulias/email-validator ~2.0 to parity with ~1.2
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | could be ?
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
When using egulias/email-validator ~1.2, we make a strict check of the email, which means that emails with RFC warnings will fail validation.
Currently with egulias/email-validator ~2.0, emails with warnings are considerate valids.
This pull request make EmailValidator with egulias/email-validator ~2.0 behave as with egulias/email-validator ~1.2.
Commits
-------
01b2f66 Switch to NoRFCWarningsValidation
* 3.2:
[Config] ConfigCache::isFresh() should return false on __PHP_Incomplete_Class
[VarDumper] Use default color for ellipsed namespaces/paths
mark alias as private during creation
[Serializer] Remove unused GetSetMethodNormalizer::denormalize
* 3.1:
[Config] ConfigCache::isFresh() should return false on __PHP_Incomplete_Class
mark alias as private during creation
[Serializer] Remove unused GetSetMethodNormalizer::denormalize
This PR was merged into the 2.7 branch.
Discussion
----------
[Config] ConfigCache::isFresh() should return false when unserialize() fails
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20654
| License | MIT
| Doc PR | -
Removes some `Warning: Class __PHP_Incomplete_Class has no unserializer` failures when clearing the cache.
Commits
-------
609245e [Config] ConfigCache::isFresh() should return false on __PHP_Incomplete_Class
This PR was merged into the 3.2 branch.
Discussion
----------
[VarDumper] Use default color for ellipsed namespaces/paths
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20669
| License | MIT
| Doc PR | -
Eases readability by helping the eye to focus more quickly on the class name and less on its namespace.
And let' disable ellipses on the profiler panels, fixing #20669 meanwhile.
![capture du 2016-11-29 11-00-00](https://cloud.githubusercontent.com/assets/243674/20705475/5d512c9a-b623-11e6-881d-04ae58453824.png)
Commits
-------
ebc23cf [VarDumper] Use default color for ellipsed namespaces/paths
* 3.2:
[ClassLoader] Use only forward slashes in generated class map
[VarDumper][HttpKernel] Enhance perf of ExceptionCaster & DataCollector
ensure the proper context for nested validations
bug #20653 [WebProfilerBundle] Profiler includes ghost panels
Fixed getRouteParams() when no parameters are available
bumped Symfony version to 3.2.0
updated VERSION for 3.2.0-RC2
updated CHANGELOG for 3.2.0-RC2
* 2.8:
[ClassLoader] Use only forward slashes in generated class map
ensure the proper context for nested validations
bug #20653 [WebProfilerBundle] Profiler includes ghost panels
* 2.8:
[ClassLoader] Use only forward slashes in generated class map
ensure the proper context for nested validations
bug #20653 [WebProfilerBundle] Profiler includes ghost panels
* 2.7:
[ClassLoader] Use only forward slashes in generated class map
ensure the proper context for nested validations
bug #20653 [WebProfilerBundle] Profiler includes ghost panels
* 3.2:
Fix tests that do not trigger any depreciation
[HttpFoundation] Fix test ensuring isMethodSafe() checks cacheable
[Cache] Mark FilesystemAdapterTrait as internal
[FrameworkBundle] Dont rely on any parent definition for "cache.annotations"
* 3.2:
[Routing] Fail properly when a route parameter name cannot be used as a PCRE subpattern name
[FrameworkBundle] Improve performance of ControllerNameParser
Update documentation link to the component
[HttpFoundation] Add links to RFC-7231
[DI] Initialize properties before method calls
[Bridge/Doctrine] Use cache.prefix.seed parameter for generating cache namespace
Tag missing internals
Add missing example for 'path' argument in debug:config
[WebProfilerBundle] Dont use request attributes in RouterController
Fix complete config tests
* 3.1:
[Routing] Fail properly when a route parameter name cannot be used as a PCRE subpattern name
[FrameworkBundle] Improve performance of ControllerNameParser
Update documentation link to the component
[HttpFoundation] Add links to RFC-7231
[DI] Initialize properties before method calls
Tag missing internals
[WebProfilerBundle] Dont use request attributes in RouterController
Fix complete config tests
* 2.8:
[Routing] Fail properly when a route parameter name cannot be used as a PCRE subpattern name
[FrameworkBundle] Improve performance of ControllerNameParser
Update documentation link to the component
[HttpFoundation] Add links to RFC-7231
[DI] Initialize properties before method calls
Tag missing internals
[WebProfilerBundle] Dont use request attributes in RouterController
Fix complete config tests
* 2.7:
[Routing] Fail properly when a route parameter name cannot be used as a PCRE subpattern name
[FrameworkBundle] Improve performance of ControllerNameParser
Update documentation link to the component
[HttpFoundation] Add links to RFC-7231
[DI] Initialize properties before method calls
Tag missing internals
[WebProfilerBundle] Dont use request attributes in RouterController
Fix complete config tests
This PR was squashed before being merged into the 2.7 branch (closes#20474).
Discussion
----------
[Routing] Fail properly when a route parameter name cannot be used as a PCRE subpattern name
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/7139
This is a follow up PR to https://github.com/symfony/symfony/pull/20327.
I also decided to improve the current `is_numeric()` check that is done by a truer one. The current limitation is that a PCRE subpattern name must not start with a digit which is different.
Commits
-------
73fbd08 [Routing] Fail properly when a route parameter name cannot be used as a PCRE subpattern name
This PR was merged into the 2.7 branch.
Discussion
----------
[HttpFoundation] Add links to RFC-7231
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
ping @xabbuh
Commits
-------
c17a85b [HttpFoundation] Add links to RFC-7231
This PR was merged into the 2.7 branch.
Discussion
----------
Tag missing internals
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
Commits
-------
97e94b4 Tag missing internals
This PR was squashed before being merged into the 2.7 branch (closes#20566).
Discussion
----------
[DI] Initialize properties before method calls
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes-ish
| New feature? | no
| BC breaks? | not sure
| Deprecations? | no
| Tests pass? | not yet (only dumps seem to fail)
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
Given
```yml
services:
handler:
class: AppBundle\Handler
properties:
debug: '%kernel.debug%'
calls:
- [handle]
```
I totally expected `Handler::$debug` to be set before `Handler::handle` is called. It was not.. and it's really annoying :)
Commits
-------
0af433b [DI] Initialize properties before method calls
* 3.2:
Fix merge
[DI] Fixed custom services definition BC break introduced in ec7e70fb…
[HttpKernel] Deprecate checking for cacheable HTTP methods in Request::isMethodSafe()
[Process] Fix kill process on reached timeout using getIterator()
[DI] Aliases should preserve the aliased invalid behavior
* 3.1:
[DI] Fixed custom services definition BC break introduced in ec7e70fb…
[Process] Fix kill process on reached timeout using getIterator()
[DI] Aliases should preserve the aliased invalid behavior
This PR was squashed before being merged into the 2.7 branch (closes#20609).
Discussion
----------
[DI] Fixed custom services definition BC break introduced in ec7e70fb…
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no, fixes previous BC
| Deprecations? | no
| Tests pass? | yes (verified on Win only)
| Fixed tickets | #20608
| License | MIT
| Doc PR | -
Commits
-------
7a5e11e [DI] Fixed custom services definition BC break introduced in ec7e70fb…
This PR was merged into the 3.1 branch.
Discussion
----------
[Process] Fix process continuing after reached timeout using getIterator()
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20594
| License | MIT
| Doc PR | n/a
Commits
-------
10992cd [Process] Fix kill process on reached timeout using getIterator()
This PR was merged into the 3.2 branch.
Discussion
----------
[HttpKernel] Deprecate checking for cacheable HTTP methods in Request::isMethodSafe()
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
Late deprecation for 3.2, see #20602.
Commits
-------
34e7b95 [HttpKernel] Deprecate checking for cacheable HTTP methods in Request::isMethodSafe()
* 3.2: (24 commits)
[Filesystem] Remove extra argv in dumpFile() tests
[DI] minor FileLoaders tests update
[FrameworkBundle] Add framework.cache.prefix_seed for predictible cache key prefixes
[SecurityBundle] Remove FirewallContext mandatory FirewallConfig argument deprecation
[HttpKernel] Revert BC breaking change of Request::isMethodSafe()
[DI] Allow null as default env value
[WebProfilerBundle] Fix deprecated uses of profiler_dump
[SecurityBundle] Fix FirewallConfig nullable arguments
[FrameworkBundle] Avoid warming up the validator cache for non-existent classes
[DOMCrawler] Bug fixed
[FrameworkBundle] Mark cache.default_*_provider services private
[Process] Do feat test before enabling TTY mode
bumped Symfony version to 3.1.8
updated VERSION for 3.1.7
updated CHANGELOG for 3.1.7
bumped Symfony version to 2.8.15
updated VERSION for 2.8.14
updated CHANGELOG for 2.8.14
bumped Symfony version to 2.7.22
updated VERSION for 2.7.21
...
* 3.1:
[Filesystem] Remove extra argv in dumpFile() tests
[DI] minor FileLoaders tests update
[HttpKernel] Revert BC breaking change of Request::isMethodSafe()
[DOMCrawler] Bug fixed
[FrameworkBundle] Mark cache.default_*_provider services private
[Process] Do feat test before enabling TTY mode
bumped Symfony version to 3.1.8
updated VERSION for 3.1.7
updated CHANGELOG for 3.1.7
bumped Symfony version to 2.8.15
updated VERSION for 2.8.14
updated CHANGELOG for 2.8.14
bumped Symfony version to 2.7.22
updated VERSION for 2.7.21
update CONTRIBUTORS for 2.7.21
updated CHANGELOG for 2.7.21
Fix annotation type for $context
[Doctrine][Form] support large integers
* 2.8:
[DI] minor FileLoaders tests update
[HttpKernel] Revert BC breaking change of Request::isMethodSafe()
[DOMCrawler] Bug fixed
[Process] Do feat test before enabling TTY mode
bumped Symfony version to 2.8.15
updated VERSION for 2.8.14
updated CHANGELOG for 2.8.14
bumped Symfony version to 2.7.22
updated VERSION for 2.7.21
update CONTRIBUTORS for 2.7.21
updated CHANGELOG for 2.7.21
Fix annotation type for $context
[Doctrine][Form] support large integers
* 2.7:
[DI] minor FileLoaders tests update
[HttpKernel] Revert BC breaking change of Request::isMethodSafe()
[DOMCrawler] Bug fixed
[Process] Do feat test before enabling TTY mode
bumped Symfony version to 2.7.22
updated VERSION for 2.7.21
update CONTRIBUTORS for 2.7.21
updated CHANGELOG for 2.7.21
[Doctrine][Form] support large integers
This PR was merged into the 2.7 branch.
Discussion
----------
[HttpKernel] Revert BC breaking change of Request::isMethodSafe()
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes (reverting a previous BC break)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20562
| License | MIT
| Doc PR | -
As spotted in #20562, we should not have broken a minor version. Instead, we should have deprecated the bad behavior. This is done in #20603.
Commits
-------
0c3b7d7 [HttpKernel] Revert BC breaking change of Request::isMethodSafe()
This PR was merged into the 3.2 branch.
Discussion
----------
[WebProfilerBundle] Fix deprecated uses of profiler_dump
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Replaces #20571 that made me realize that we completely missed updating the "Request / Response" panel that is current triggering a bunch of deprecation notices about profiler_dump. Yet, these notices triggered by the profiler are not displayed anywhere (what, we don't have a profiler for the profiler? :) ). And we missed them.
Commits
-------
b4c327d [WebProfilerBundle] Fix deprecated uses of profiler_dump
This PR was merged into the 2.8 branch.
Discussion
----------
Fix annotation type for $context
| 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 | -
Previous type ExecutionContextInterface was referring to a non declared namespace. Replacing it by ExecutionContextInterface2Dot5 fixes autocomplete.
Commits
-------
55e134c Fix annotation type for $context
This PR was merged into the 2.7 branch.
Discussion
----------
[Process] Do feat test before enabling TTY mode
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20565
| License | MIT
| Doc PR | -
Commits
-------
69bfbbf [Process] Do feat test before enabling TTY mode
* 3.1:
[YAML] Fix processing timestamp with timezone
[ci] Testing with UTC hides bugs
[DI] Fix error when trying to resolve a DefinitionDecorator
[DoctrineBridge] Fix deprecation message/documentation of implementing UserProviderInterface using the entity provider
Fix time-sensitive tests that use data providers
[Validator] improve and added more Indonesian translation.
This PR was merged into the 3.1 branch.
Discussion
----------
[YAML] Fix processing timestamp strings with timezone
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20399
| License | MIT
| Doc PR | -
Parse date strings containing timezone data correctly
Default date strings not containing timezone data to UTC
Commits
-------
cdb11a7 [YAML] Fix processing timestamp with timezone
* 2.8:
[ci] Testing with UTC hides bugs
[DI] Fix error when trying to resolve a DefinitionDecorator
[DoctrineBridge] Fix deprecation message/documentation of implementing UserProviderInterface using the entity provider
[Validator] improve and added more Indonesian translation.
* 2.7:
[ci] Testing with UTC hides bugs
[DI] Fix error when trying to resolve a DefinitionDecorator
[Validator] improve and added more Indonesian translation.
This PR was merged into the 2.7 branch.
Discussion
----------
[ci] Testing with UTC hides bugs
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
As shown by #20550, we're having bugs because we don't in proper TZ conditions.
Let's do Europe on Travis, and America on Windows.
Commits
-------
e0f9bda [ci] Testing with UTC hides bugs
This PR was merged into the 2.7 branch.
Discussion
----------
[DI] Fix error when trying to resolve a DefinitionDecorator
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Instead of the currently obscure `ReflectionException: Class does not exist` message, let's throw a useful error message.
Commits
-------
8e0da2f [DI] Fix error when trying to resolve a DefinitionDecorator
This PR was merged into the 3.2-dev branch.
Discussion
----------
[DI] Revert "deprecate get() for uncompiled container builders"
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #18728
| License | MIT
| Doc PR | -
ping @xabbuh
This reverts commit 27f4680294, reversing
changes made to e4177a0744.
While upgrading a few projects to 3.2, I found it impossible to remove this deprecation without duplicating "by hand" the instantiation logic of some service needed in a compiler pass.
See https://github.com/dustin10/VichUploaderBundle/blob/master/DependencyInjection/Compiler/RegisterPropelModelsPass.php#L30 for such an example into the wild.
I think we should revert this deprecation. Using the container builder before it is compiled is tricky. Yet, bootstrapping in general is tricky and full of chicken-and-egg issues. In this case, using some services while bootstrapping the container works well. Deprecating would be fine if we were to provide some viable alternative. Duplicating the instantiation logic doesn't qualify as such to me, hence the proposed revert.
@xabbuh, if you'd like to keep some test cases that may be unrelated to the revert, please add comments on the PR, or better: push on my fork, branch revert-get-deprec.
Commits
-------
e449af0 Revert "feature #18728 deprecate get() for uncompiled container builders (xabbuh)"
* 3.1:
[Debug] Remove GLOBALS from exception context to avoid endless recursion
[Serializer] Improve test coverage of the MaxDepth annotation
DX: replace @link with @see annotation
bumped min version of Twig to 1.28
This PR was merged into the 3.1 branch.
Discussion
----------
[Serializer] Improve test coverage of the MaxDepth annotation
| Q | A
| ------------- | ---
| Branch? | 3.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
Commits
-------
5311696 [Serializer] Improve test coverage of the MaxDepth annotation
This PR was merged into the 2.7 branch.
Discussion
----------
[Debug] Remove GLOBALS from exception context to avoid endless recursion
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This fixes a endless recursion as seen in https://github.com/felixfbecker/php-language-server/pull/137 - it only happens if you trigger an error in the global context so it's kinda hard to write a test for, but hopefully the fix can be accepted.
Commits
-------
1bb95ac [Debug] Remove GLOBALS from exception context to avoid endless recursion
This PR was squashed before being merged into the 3.2-dev branch (closes#20492).
Discussion
----------
[Workflow] Clarify validator API + fixed unknown "scalar" marking store
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | yes
| New feature? | no
| BC breaks? | no, if merged in 3.2
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
See also https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ValidateWorkflowsPass.php#L48
Commits
-------
a9cb38b [Workflow] Clarify validator API + fixed unknown "scalar" marking store
* 3.1:
[TwigBridge] fix tests
Tag the FormFieldRegistry as being internal
[Form] Fix Date\TimeType marked as invalid on request with single_text and zero seconds
[FrameworkBundle] Register the ArrayDenormalizer
[Serializer] Fix DataUriNormalizer's regex
[Validator] Added missing swedish translation
[TranslationDebug] workaround for getFallbackLocales.
[Translation] fixed nested fallback catalogue using multiple locales.
fixed phpdoc
[Command] Fixed method comments as phpDoc syntax
Added single quotes for upgrade guides.
* 2.8:
[TwigBridge] fix tests
Tag the FormFieldRegistry as being internal
[Form] Fix Date\TimeType marked as invalid on request with single_text and zero seconds
[Validator] Added missing swedish translation
[TranslationDebug] workaround for getFallbackLocales.
[Translation] fixed nested fallback catalogue using multiple locales.
fixed phpdoc
[Command] Fixed method comments as phpDoc syntax
Added single quotes for upgrade guides.
* 2.7:
[TwigBridge] fix tests
Tag the FormFieldRegistry as being internal
[Form] Fix Date\TimeType marked as invalid on request with single_text and zero seconds
[Validator] Added missing swedish translation
[TranslationDebug] workaround for getFallbackLocales.
[Translation] fixed nested fallback catalogue using multiple locales.
fixed phpdoc
[Command] Fixed method comments as phpDoc syntax
This PR was merged into the 2.7 branch.
Discussion
----------
Tag the FormFieldRegistry as being internal
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
The phpdoc already describes it as being internal (since it was introduced). This adds the proper tag to mark it as internal in our standard way.
Commits
-------
0801f97 Tag the FormFieldRegistry as being internal
This PR was squashed before being merged into the 2.7 branch (closes#20307).
Discussion
----------
[Form] Fix Date\TimeType marked as invalid on request with single_text and zero seconds
| Q | A |
| --- | --- |
| Branch? | 2.7 |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | 20304 |
| License | MIT |
| Doc PR | |
Fix: When using a form with an Time type with option 'widget' => 'single_text', and 0 is selected in the seconds, we obtain an TransformationFailedException "Unable to reverse value for property path "[time]": Data missing". Check ticket #20304
Commits
-------
bcb03e0 [Form] Fix Date\TimeType marked as invalid on request with single_text and zero seconds
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Workflow] Removed private Definition::addPlaces
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
There is no need for this method
Commits
-------
c546857 Removed private Definition::addPlaces
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Workflow] Set the marking then announce enabled transition
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
It allows to auto-apply some transition from a listener. If we don't do that, the marking is not updated in the listener yet, so the transition is not really enabled.
The feature was asked on [twitter](https://twitter.com/gaetanbuellet/status/796387741420441600)
And It has been implemented (userland) [here](9fda92a705)
Commits
-------
51dad72 [Workflow] Set the marking then announce enabled transition
This PR was merged into the 2.7 branch.
Discussion
----------
[YAML] PHPDoc fixes for inline parser/dumper
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
Commits
-------
dd47295 fixed phpdoc
This PR was merged into the 3.2-dev branch.
Discussion
----------
[DI] Force env params to be string|null
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
93c25f8 [DI] Force env params to be string|null
* ScalarMarkingStore -> SingleStateMarkingStore
* PropertyAccessorMarkingStore -> MultipleStateMarkingStore
And I also made optionnal the `marking_store` config, to let the
componant choose the best marking store depending on the type
(state_machine or workflow).
This PR was squashed before being merged into the 2.7 branch (closes#20275).
Discussion
----------
[HttpFoundation] Avoid implicit null to array conversion in request matcher
| Q | A |
| --- | --- |
| Branch? | 2.7 |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any |
| License | MIT |
| Doc PR | reference to the documentation PR, if any |
`null` is allowed _and_ passed as default value from the constructor. Lets be explicit.
Commits
-------
a2c0a78 [HttpFoundation] Avoid implicit null to array conversion in request matcher
This PR was squashed before being merged into the 3.2-dev branch (closes#20424).
Discussion
----------
[HttpKernel] Removed forgotten setCacheVersionInfo()
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | yes
| New feature? | no
| BC breaks? | no-ish
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
Forgotten in #14351
Commits
-------
8e70193 [HttpKernel] Removed forgotten setCacheVersionInfo()
* 3.1:
fixed CS
Properly format value in UniqueEntityValidator
[Translation][fallback] add missing resources in parent catalogues.
removed a deprecation notice
[Form] Fix show float values as choices values in ChoiceType
Remove double use Statement
Improved the design of the metrics in the profiler
[Yaml] set arguments depending on the PHP version
[Console] Fix infinite loop on missing input
[HttpFoundation][Session] memcached connection should not be closed
* 2.8:
[Translation][fallback] add missing resources in parent catalogues.
removed a deprecation notice
[Form] Fix show float values as choices values in ChoiceType
Remove double use Statement
Improved the design of the metrics in the profiler
[Console] Fix infinite loop on missing input
[HttpFoundation][Session] memcached connection should not be closed
* 2.7:
[Translation][fallback] add missing resources in parent catalogues.
removed a deprecation notice
[Form] Fix show float values as choices values in ChoiceType
[HttpFoundation][Session] memcached connection should not be closed
This PR was merged into the 2.7 branch.
Discussion
----------
[Form] Fixed show float values as choice value in ChoiceType
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #13817
| License | MIT
| Doc PR | -
There is a closed [issue][1] related to this before Symfony 2.7 (when choice value still was the key from the `array`). This issue already happened in 2.7+ but now inside Symfony core.
Information
-----------
[This method][3] checks whether the given choices can be cast to strings without generating duplicates (3ab8189080 in #16705):
```php
private function castableToString(array $choices, array &$cache = array())
{
foreach ($choices as $choice) {
if (is_array($choice)) {
if (!$this->castableToString($choice, $cache)) {
return false;
}
continue;
} elseif (!is_scalar($choice)) {
return false;
} elseif (isset($cache[$choice])) { // <---- red breakpoint
return false;
}
$cache[$choice] = true; // <---- red breakpoint
}
return true;
}
```
So it should to keep [scalar values (integer, float, string or boolean)][2] as choice values always (unless have duplicates values).
The Problem
-----------
But in this situation it doesn't happen:
```php
$form = $this->createFormBuilder()
->add('foo', ChoiceType::class, [
'choices' => [
'Min' => 0.5,
'Mid' => 1.0,
'Max' => 1.5,
]
])
->getForm();
```
**Output:**
```html
<select id="form_foo" name="form[foo]">
<option value="0">Min</option>
<option value="1">Mid</option>
<option value="2">Max</option>
</select>
```
[**Why?**][5]
If the key of the array is a float number, it's interpreted as integer automatically:
```php
// ...
$cache[$choice] = true;
// when $choice = 0.5: $cache = [0 => true]
// when $choice = 1.0: $cache = [0 => true, 1 => true]
```
Then, when `$choice = 1.5` [this sentence][4] `isset($cache[1.5])` returns `true` because really checks `isset($cache[1])` and this key already exists, so `castableToString()` returns `false` (detected as duplicate) and the choices values are generated incrementing integers as values.
The PR's Effect
-------------
**Before:**
```html
<select id="form_foo" name="form[foo]">
<option value="0">Min</option>
<option value="1">Mid</option>
<option value="2">Max</option>
</select>
```
**After:**
```html
<select id="form_foo" name="form[foo]">
<option value="0.5">Min</option>
<option value="1">Mid</option>
<option value="1.5">Max</option>
</select>
```
[1]: https://github.com/symfony/symfony/issues/13817
[2]: http://php.net/manual/en/function.is-scalar.php
[3]: https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php#L228
[4]: https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php#L239
[5]: https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php#L243
Commits
-------
3564228 [Form] Fix show float values as choices values in ChoiceType
This PR was merged into the 2.7 branch.
Discussion
----------
[HttpFoundation][Session] Fix memcache session handler
| Q | A
| ------------- | ---
| Branch? | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 3.0, 3.1, master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commit 0216e05605 removed the opening of connection to memcached server on call to `open()`, because it's assumed that connection is already opened. However, `close()` still closes the connection. As a result no more read/write calls can be made if session got closed, as the connection does not get reestablished.
Basically MemcacheSessionHandler should follow same logic as Memcache**d**SessionHandler, which is exactly what this MR acomplishes.
Commits
-------
0423d894 [HttpFoundation][Session] memcached connection should not be closed
This PR was merged into the 3.2-dev branch.
Discussion
----------
[DependencyInjection] fixed ini file values conversion
| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no-ish |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | n/a |
| License | MIT |
| Doc PR | n/a |
When using the ini format to load parameters in the Container, the parameter values were converted by PHP directly (`'true'` => `1` for instance). But when using the YAML or XML format, the conversions are much broader and more precise (`'true'` => `true` for instance). This PR fixed fixes this discrepancy by using the same rules as XML (we could use `INI_SCANNER_TYPED` for recent versions of PHP but the rules are not exactly the same, so I prefer consistency here).
One might argue that this is a new feature and that this should be merged into master, which I can accept as well. In master, the `XmlUtils::phpize()` method should be deprecated and replaced by a more generic phpize class.
ping @symfony/deciders
Commits
-------
4ccfce6 [DependencyInjection] fixed ini file values conversion
This PR was merged into the 3.2-dev branch.
Discussion
----------
[HttpKernel] Base DataCollector throws warning on unsupported scheme strings
| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | N/A |
| License | MIT |
| Doc PR | N/A |
The issue concerns any collector based on the abstract `Symfony\Component\HttpKernel\DataCollector\DataCollector` class using `cloneVar` on a string containing a unsupported scheme.
The easiest way to reproduce the issue is to add a simple query parameter like `?uri=foo://bar` on any url of your application:
> ContextErrorException in DataCollector.php line 134:
> Warning: file_exists(): Unable to find the wrapper "foo" - did you forget to enable it when you configured PHP?
This PR simply fixes the issue by muting the warning on `file_exists`. But maybe there is a better strategy.
Commits
-------
52faa00 Fix base DataCollector throws warning on unsupported scheme strings
* 3.1:
[PhpUnitBridge] Fix undefined variable
Compatibility with Twig 1.27
Remove extra line in doc-block comment
[VarDumper] Fix dumping Twig source in stack traces
Enhance GAE compat by removing some realpath()
[DependencyInjection] Remove old code in XML loader
bumped Symfony version to 3.1.7
updated VERSION for 3.1.6
updated CHANGELOG for 3.1.6
bumped Symfony version to 2.8.14
updated VERSION for 2.8.13
updated CHANGELOG for 2.8.13
bumped Symfony version to 2.7.21
updated VERSION for 2.7.20
update CONTRIBUTORS for 2.7.20
updated CHANGELOG for 2.7.20
[SecurityBundle] Fix twig-bridge lowest dep
* 2.8:
Compatibility with Twig 1.27
[VarDumper] Fix dumping Twig source in stack traces
Enhance GAE compat by removing some realpath()
bumped Symfony version to 2.8.14
updated VERSION for 2.8.13
updated CHANGELOG for 2.8.13
bumped Symfony version to 2.7.21
updated VERSION for 2.7.20
update CONTRIBUTORS for 2.7.20
updated CHANGELOG for 2.7.20
[SecurityBundle] Fix twig-bridge lowest dep
* 2.7:
Compatibility with Twig 1.27
Enhance GAE compat by removing some realpath()
bumped Symfony version to 2.7.21
updated VERSION for 2.7.20
update CONTRIBUTORS for 2.7.20
updated CHANGELOG for 2.7.20
[SecurityBundle] Fix twig-bridge lowest dep
This PR was merged into the 3.2-dev branch.
Discussion
----------
Added a default ide file link web view
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
When having no `framework.ide` configured or `framework.ide = symfony` the file link open the source in a web view (eg `_profiler/open?file=/src/AppBundle/Controller/DefaultController.php&line=50#line50`).
![](https://cl.ly/2Z0W2J020p43/feature_ide.png)
Commits
-------
ba6bcca Added a default ide file link web view
This PR was merged into the 3.1 branch.
Discussion
----------
[Yaml] Fix 7.1 compat
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Should make CI green again with PHP 7.1 RC4.
Commits
-------
89b78f2 [Yaml] Fix 7.1 compat
* 3.1:
Fix edge case with StreamedResponse where headers are sent twice
removed usage of Twig_Compiler::addIndentation
A decorated service should not keep the autowiring types
merge tags instead of completely replacing them
* 2.8:
Fix edge case with StreamedResponse where headers are sent twice
removed usage of Twig_Compiler::addIndentation
A decorated service should not keep the autowiring types
merge tags instead of completely replacing them
* 2.7:
Fix edge case with StreamedResponse where headers are sent twice
removed usage of Twig_Compiler::addIndentation
merge tags instead of completely replacing them
This PR was merged into the 2.8 branch.
Discussion
----------
[DependencyInjection] A decorated service should not keep the autowiring 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/20260#issuecomment-255364862
| License | MIT
| Doc PR | n/a
When decorating a service which is not abstract and has `autowiring_types`, the decorator should be the one used for autowiring methods of autowired services, so we should explicitly empty them on the decorated definition after merged them into the child. See https://github.com/symfony/symfony/pull/20260#issuecomment-255364862 for a use case where we are forced to manually empty the decorated service's `autowiring_types`.
Commits
-------
5951378 A decorated service should not keep the autowiring types
* 3.1:
[TwigBundle] fixed usage of getSource in tests
Trim constant values in XmlFileLoader
move test to the HttpKernel component
[TwigBridge] fixed Twig_Source required argument
[HttpKernel] Fix a regression in the RequestDataCollector
[HttpKernel] Refactor a RequestDataCollector test case to use a data provider
* 2.8:
[TwigBundle] fixed usage of getSource in tests
Trim constant values in XmlFileLoader
move test to the HttpKernel component
[TwigBridge] fixed Twig_Source required argument
* 2.7:
[TwigBundle] fixed usage of getSource in tests
Trim constant values in XmlFileLoader
move test to the HttpKernel component
[TwigBridge] fixed Twig_Source required argument
This PR was merged into the 2.7 branch.
Discussion
----------
[FrameworkBundle][HttpKernel] move test to the HttpKernel component
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/19443#discussion_r83414612
| License | MIT
| Doc PR |
The moved test case does not test the `AddConsoleCommandPass` class, but ensures certain behavior in the `registerCommands()` method of the `Bundle` class from the HttpKernel component.
Commits
-------
c9ca322 move test to the HttpKernel component
This PR was merged into the 3.1 branch.
Discussion
----------
[HttpKernel] Fix a regression in the RequestDataCollector
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19701
| License | MIT
| Doc PR | -
The regression was introduced by refactoring made as part of #17589 (if/else statements where rearranged).
Commits
-------
57008ea [HttpKernel] Fix a regression in the RequestDataCollector
26b90e4 [HttpKernel] Refactor a RequestDataCollector test case to use a data provider
This PR was merged into the 3.2-dev branch.
Discussion
----------
[DependencyInjection] Fix FactoryReturnTypePass position in PassConfig
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19161, #19191
| License | MIT
| Doc PR |
Commits
-------
dfb5cc3 [DependencyInjection] Fix FactoryReturnTypePass position in PassConfig
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Form] Change FormTypeGuesserChain to accept Traversable
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I'm using symfony/form without the rest of the framework and this will make things a bit easier for me.
Commits
-------
5e4f4d4 [Form] Change FormTypeGuesserChain to accept Traversable
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Validator] Allow validating multiple groups in one GroupSequence step
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
To see what I've changed just look at the last commit. The other two are just refactoring without any effect.
GroupSequenceProviderInterface seems to be the recommended solution for conditional validators (like when some properties should be required only if other property has a certain value). And it's a good solution honestly. Except for the fact that it's completely useless when I want to get validation violations for all groups at once and not just violations for the first group that caused any violations.
```php
// If the User validation group causes any violations the Premium group will not be
// validated at all even if the $this->isPremium() is true.
class User implements GroupSequenceProviderInterface {
public function getGroupSequence() {
$groups = array('User');
if ($this->isPremium()) {
$groups[] = 'Premium';
}
return $groups;
}
}
```
To be honest I never found a use case for this step-by-step behavior. When user fills a form I want to show him all errors at once not just some subset.
It's surprisingly easy to fix this. With just one changed line in RecursiveContextualValidator it's perfectly solveable:
```php
// With this PR it is possible to do this and get violations for both groups like this.
class User implements GroupSequenceProviderInterface {
public function getGroupSequence() {
$groups = array('User');
if ($this->isPremium()) {
$groups[] = 'Premium';
}
return [$groups]; // this line has changed
}
}
```
Commits
-------
31b609e [Validator] Allow validating multiple groups in one GroupSequence step
3847bad [Validator] Refactor tests
38b643a [Validator] Fix annotation
* 3.1:
[VarDumper] Fix source links with latests Twig versions
[DomCrawler] Optimize DomCrawler::relativize()
[HttpKernel] Fix source links with latests Twig versions
[DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions
* 2.8:
[VarDumper] Fix source links with latests Twig versions
[DomCrawler] Optimize DomCrawler::relativize()
[HttpKernel] Fix source links with latests Twig versions
[DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions
* 2.7:
[DomCrawler] Optimize DomCrawler::relativize()
[HttpKernel] Fix source links with latests Twig versions
[DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions
This PR was merged into the 2.7 branch.
Discussion
----------
[DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20229
| License | MIT
| Doc PR | -
@klausi could you please validate this patch? Is it an improvement over yours? (sorry I don't have the proper use case to test.)
Commits
-------
17757d8 [DomCrawler] Optimize DomCrawler::relativize()
5b26e33 [DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions
* 3.1:
[TwigBridge] removed deprecations added in Twig 1.27
PHP CS Fixer: use php_unit_dedicate_assert
3.0 Upgrade Guide: Added details describing how to pass data to a form through the options resolver
fixed Filesystem:makePathRelative and added 2 more testcases
no 304 response if method is not cacheable
move tags from decorated to decorating service
* 2.8:
[TwigBridge] removed deprecations added in Twig 1.27
PHP CS Fixer: use php_unit_dedicate_assert
3.0 Upgrade Guide: Added details describing how to pass data to a form through the options resolver
fixed Filesystem:makePathRelative and added 2 more testcases
no 304 response if method is not cacheable
move tags from decorated to decorating service
* 2.7:
[TwigBridge] removed deprecations added in Twig 1.27
PHP CS Fixer: use php_unit_dedicate_assert
fixed Filesystem:makePathRelative and added 2 more testcases
no 304 response if method is not cacheable
move tags from decorated to decorating service
This PR was merged into the 3.2-dev branch.
Discussion
----------
[ExpressionLanguage] Making cache PSR6 compliant
| 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 | [#7064](https://github.com/symfony/symfony-docs/pull/7064)
Adding Cache component compatible ParserCache in ExpressionLanguage component.
I hope you will find it useful :) I would like to make tests also
Commits
-------
a7352ff [ExpressionLanguage] Making cache PSR6 compliant
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Serializer] Support specifying format for DateTimeNormalizer::denormalize
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | symfony/symfony-docs#7063
Commits
-------
ff23924 [Serializer] Support specifying format for DateTimeNormalizer::denormalize
This PR was merged into the 2.7 branch.
Discussion
----------
[HttpFoundation] no 304 response if method is not cacheable
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Since #19321 OPTIONS and TRACE are considered safe methods. But both methods should not lead to "304 Not modified" responses.
Commits
-------
3d6b450 no 304 response if method is not cacheable
This PR was merged into the 2.7 branch.
Discussion
----------
[DependencyInjection] move tags from decorated to decorating service
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20150
| License | MIT
| Doc PR |
Commits
-------
7def83c move tags from decorated to decorating service
This PR was squashed before being merged into the 3.2-dev branch (closes#20214).
Discussion
----------
Fix/broken merging of parameter bag env placeholders
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20213
| License | MIT
| Doc PR | reference to the documentation PR, if any
In PR https://github.com/symfony/symfony/pull/20199 I made changes after review that broke the use of env variables, sorry about that - should have checked it a bit more before making the changes.
@nicolas-grekas, I know you're very busy with all that merging, but if you could take a look at this it would be great since you know most about it.
Commits
-------
b53e0de Fix/broken merging of parameter bag env placeholders
- Changed surrogate capability name to symfony
- Changed user agent of the BrowserKit Client to 'Symfony BrowserKit'
- Changed 'symfony2' to 'symfony' in timing templates
- Updated changelog and upgrade files
* 3.1:
[travis] Test on PHP 7.1
simplified code
Remove unused variable
3.0 Upgrade Guide: Added Table of Contents
[HttpFoundation] add missing upgrade entry
[FrameworkBundle] Convert null prefix to an empty string in translation:update command
Improved the deprecation messages for service aliases
[Serializer] minor: Remove an extra space in a YamlFileLoader error
[HttpKernel] Clean ArgumentMetadataFactory::getType()
[PropertyInfo] Fix edge cases in ReflectionExtractor
* 2.8:
[travis] Test on PHP 7.1
simplified code
Remove unused variable
[FrameworkBundle] Convert null prefix to an empty string in translation:update command
[PropertyInfo] Fix edge cases in ReflectionExtractor
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Cache] Accept only array in TagAwareAdapter::invalidateTags()
| 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 to be sure that we won't suffer from some stupid incompatibility if a cache-tags PSR is published one day. See discussion: https://github.com/symfony/symfony/issues/19728#issuecomment-251674712
Commits
-------
a08acc7 [Cache] Accept only array in TagAwareAdapter::invalidateTags()
This PR was merged into the 3.2-dev branch.
Discussion
----------
Use the method map as authoritative list of factories for dumped containers
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | only for weird broken cases
| Deprecations? | yes (but only for people doing weird things)
| Tests pass? | yes
| Fixed tickets | #11761, #19690
| License | MIT
| Doc PR | n/a
The initial implementation of the method factory discovery was based on a naming convention for factory methods. However, this naming convention allowed to generate the same name for multiple ids. In the meantime, a method map was introduced to solve this issue (and others).
When accessing a service with a different id than the official one (thanks to ambiguities), this breaks the sharing of the service, as it creates a new instance each time and replaces the existing shared instance. This was also inconsistent between a dumped container (affected by this) and a non-dumped container (reporting a service not found error for the other id).
The method map is now the authoritative way to discover available service factories. When the dumped container was generated with a method map (which is the case when using the dumper shipped in the component), the logic based on defined methods is not executed anymore. This forbids using another id than the real one to access the service (preventing to trigger the broken behavior). So this breaks BC for people being lucky (i.e. they were using the broken id only once and *before* any usage of the official id) and fixes a WTF bug for all others.
When using a dumper which does not fill the method map, the old logic is still applied, but deprecation warnings are triggered on access to dumped services. Currently, this will trigger a deprecation warning for each new service instantiation. I have not found an easy way to trigger it only once (except adding a private property to remember we already triggered it, but is it worth it ?), but only people writing a project container by hand or writing their own dumper would ever see such deprecation anyway (as the core dumper generates the method map).
Additionally, this makes ``getServiceIds`` faster by avoiding doing a regex match for each method in the class.
Commits
-------
03b9108 Use the method map as authoritative list of factories for dumped containers
This PR was merged into the 3.2-dev branch.
Discussion
----------
[HttpKernel] removed implicit dep on Console
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
HttpKernel does not have console as a dependency, so we must ensure that this is not implicitly required (`DebugHandlersListener` already has this check).
Commits
-------
414206d [HttpKernel] removed implicit dep on Console
This PR was squashed before being merged into the 3.1 branch (closes#20180).
Discussion
----------
Improved the deprecation messages for service aliases
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19832
| License | MIT
| Doc PR |
Commits
-------
b1b21bf Improved the deprecation messages for service aliases
This PR was squashed before being merged into the 3.1 branch (closes#20174).
Discussion
----------
[Serializer] minor: Remove an extra space in a YamlFileLoader error
| Q | A
| ------------- | ---
| Branch? | 3.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
Commits
-------
a1bc96b [Serializer] minor: Remove an extra space in a YamlFileLoader error
This PR was merged into the 2.8 branch.
Discussion
----------
[PropertyInfo] Fix edge cases in ReflectionExtractor
| 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 | -
This should make ReflectionExtractor a bit more robust.
ping @dunglas (~~don't miss the changed test case~~).
Commits
-------
bffdfad [PropertyInfo] Fix edge cases in ReflectionExtractor
* 3.1:
Minor fixes & cleanups
[DependencyInjection] Add missing PHPDoc type
Correct a typo in the ReflectionExtractor's description
[HttpFoundation] JSONP callback validation
[Console] Improved the explanation of the hasOption() method
Uniformize exception vars according to our CS
add missing use statement
bug #18042 [Security] $attributes can be anything, but RoleVoter assumes strings
* 2.8:
[DependencyInjection] Add missing PHPDoc type
Correct a typo in the ReflectionExtractor's description
[HttpFoundation] JSONP callback validation
[Console] Improved the explanation of the hasOption() method
Uniformize exception vars according to our CS
add missing use statement
bug #18042 [Security] $attributes can be anything, but RoleVoter assumes strings
* 2.7:
[HttpFoundation] JSONP callback validation
[Console] Improved the explanation of the hasOption() method
add missing use statement
bug #18042 [Security] $attributes can be anything, but RoleVoter assumes strings
This PR was merged into the 2.7 branch.
Discussion
----------
[Security] $attributes can be anything, but RoleVoter assumes strings
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #18042
| License | MIT
| Doc PR | reference to the documentation PR, if any
Commits
-------
ad3ac95 bug #18042 [Security] $attributes can be anything, but RoleVoter assumes strings
This PR was merged into the 2.8 branch.
Discussion
----------
[DependencyInjection] Add missing PHPDoc type
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
4cae9c0 [DependencyInjection] Add missing PHPDoc type
The initial implementation of the method factory discovery was based on a
naming convention for factory methods. However, this naming convention allowed
to generate the same name for multiple ids. In the meantime, a method map was
introduced to solve this issue (and others).
When accessing a service with a different id than the official one (thanks to
ambiguities), this breaks the sharing of the service, as it creates a new
instance each time and replaces the existing shared instance. This was also
inconsistent between a dumped container (affected by this) and a non-dumped
container (reporting a service not found error for the other id).
The method map is now the authoritative way to discover available service
factories. When the dumped container was generated with a method map (which
is the case when using the dumper shipped in the component), the logic based
on defined methods is not executed anymore. This forbids using another id than
the real one to access the service (preventing to trigger the broken behavior).
When using a dumper which does not fill the method map, the old logic is still
applied, but deprecation warnings are triggered on access to dumped services.
* 3.1:
Fix event annotation for arguments resolving event
[HttpKernel] Fix nullable types handling
[FrameworkBundle] Alter container class instead of kernel name in cache:clear command
[VarDumper] Fix ReflectionNamedType->getName() detection
[Console] Fix validation of null values using SymfonyStyle::ask()
[Validator] Add Czech and Slovak translations for BIC
[Console] Escape default value and question in SymfonyStyle::ask()
* 2.8:
[FrameworkBundle] Alter container class instead of kernel name in cache:clear command
[VarDumper] Fix ReflectionNamedType->getName() detection
[Console] Fix validation of null values using SymfonyStyle::ask()
[Validator] Add Czech and Slovak translations for BIC
[Console] Escape default value and question in SymfonyStyle::ask()
* 2.7:
[FrameworkBundle] Alter container class instead of kernel name in cache:clear command
[Console] Fix validation of null values using SymfonyStyle::ask()
[Console] Escape default value and question in SymfonyStyle::ask()
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Escape question text and default value in SymfonyStyle::ask()
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19493
| License | MIT
| Doc PR | n/a
Commits
-------
eed3cc5 [Console] Escape default value and question in SymfonyStyle::ask()
This PR was merged into the 3.2-dev branch.
Discussion
----------
Hide commands from ApplicationDescriptor, but allow invoking
I would like to hide commands from cluttering the descriptors, but still allow their invocation from code or cron.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
Commits
-------
746dab3 casting setPublic() arg to bool
0a3c290 update docblocks and added test
6d87837 Update ApplicationDescription.php
e969581 update hidden to public
3efa874 Update Command.php
dfc1ac8 Update Command.php
cd77139 Update Command.php
56a8b93 Update Command.php
fb1f30c Update Command.php
1993196 Update Command.php
1add2ad Update Command.php
b73f494 Update ApplicationDescription.php
8d0262f Update Command.php
b423ab4 Add hidden field
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Fix validation of empty values using SymfonyQuestionHelper::ask()
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? |no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
When using `QuestionHelper::ask()` it's allowed to return an empty value as answer, e.g:
```php
$helper = new QuestionHelper();
$question = new Question('foo', false);
$question->setValidator(function ($v) { return $v; });
$answer = $helper->ask($input, $output, $question);
```
Just typing `enter` for answering this question works, the value of `$answer` would be `false`.
But doing the same with `SymfonyQuestionHelper::ask()`:
```php
$helper = new SymfonyQuestionHelper();
$question = new Question('foo', false);
$question->setValidator(function ($v) { return $v; });
$answer = $helper->ask($input, $output, $question);
```
> [ERROR] A value is required.
Same for `''` or `null`.
Here I kept the same check but used as default validator, if a validator is set and allows an empty value to be returned then it's ok.
Also I am not sure about if this default validator should be kept, imho we should be consistent with the default question helper, using the `SymfonyQuestionHelper` should only impact the output.
Diff best viewed [like this](https://github.com/symfony/symfony/pull/20141/files?w=1)
ping @kbond
Commits
-------
a8b910b [Console] Fix validation of null values using SymfonyStyle::ask()
This PR was merged into the 3.2-dev branch.
Discussion
----------
Class existence resource
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | see #20094
| License | MIT
| Doc PR | n/a
Commits
-------
222b56d [TwigBundle] added support for ClassExistenceResource when relevant
d98eb7b [Config] added ClassExistenceResource
This PR was merged into the 2.8 branch.
Discussion
----------
[Validator] Add Czech and Slovak translations for BIC
| 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 |
Commits
-------
af84d23 [Validator] Add Czech and Slovak translations for BIC
This PR was merged into the 3.2-dev branch.
Discussion
----------
Simplified link-to-source mapping definitions in debug.file_link_format
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19950
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/7019
Having to json_encode here (or any other kind of encoding) is really tedious to deal with: it makes it hard to have things working quickly. `%f` and `%l` aren't encoded anyway, so let's use very unlikely chars as separators here also instead.
Commits
-------
27df38e Simplified link-to-source mapping definitions in debug.file_link_format
* 3.1:
[travis] Use hhvm-stable instead of discontinued hhvm-3.12
bumped Symfony version to 3.1.6
updated VERSION for 3.1.5
updated CHANGELOG for 3.1.5
bumped Symfony version to 2.8.13
updated VERSION for 2.8.12
updated CHANGELOG for 2.8.12
bumped Symfony version to 2.7.20
updated VERSION for 2.7.19
update CONTRIBUTORS for 2.7.19
updated CHANGELOG for 2.7.19
[Validator] Url validator not validating hosts ending in a number
This PR was squashed before being merged into the 2.7 branch (closes#20102).
Discussion
----------
[Validator] Url validator not validating hosts ending in a number
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no (Should validate slightly more urls)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | None that I could find
| License | MIT
| Doc PR |
We ran into an issue where the URL validator wasn't validating URL that we got from a legitimate (intranet) URL. Afaict from skimming RFCs the URL `http://myhost123/` is valid, however the current regular expression doesn't accept the last part of a hostname (in this case the entire hostname is the last part as there are no periods in the host).
I've fixed this by adding the numbers unicode character property to the regular expression, I'm not sure but symbol characters (`\pS`) might need to be added to the group as well.
Commits
-------
934c434 [Validator] Url validator not validating hosts ending in a number
* 2.8:
Use "more entropy" option for uniqid()
reset constraint options
added checks for public services on compiler passes that use service id and not references
This PR was merged into the 2.7 branch.
Discussion
----------
[Validator] Reset constraint options
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20106
| License | MIT
| Doc PR | reference to the documentation PR, if any
I think it's good to reset the internal pointer of the options array if we depend on `key($options)`. I've added tests to clarify we intentionally check for the first key.
The current behavior actually differs for hhvm/php7 - https://3v4l.org/e6r6E
Commits
-------
4c6ddd4 reset constraint options
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Config] avoid loaded non-needed class in prod
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
16489d6 [HttpKernel] avoid loading a class that's not-needed when doing HTTP
8371b50 [Config] avoid loaded non-needed class in prod
* 3.1:
[TwigBundle] added missing dependencies for tests
fixed CS
adding missing dep
[TwigBundle] Adjust CacheWarmingTest for TemplateCacheWarmer introduced in 2.8
[TwigBundle] Fix CacheWarmingTest are order dependent
Revert "bug #20080 [Form] compound forms without children should be considered rendered implicitly (backbone87)"
[2.7][VarDumper] Fix PHP 7.1 compat
[2.8][VarDumper] Fix PHP 7.1 compat
silent file operation to avoid open basedir issues
Fix#19943 Make sure to process each interface metadata only once
#17580 compound forms without children should be considered rendered implicitly
* 2.8:
[TwigBundle] added missing dependencies for tests
fixed CS
[TwigBundle] Adjust CacheWarmingTest for TemplateCacheWarmer introduced in 2.8
[TwigBundle] Fix CacheWarmingTest are order dependent
Revert "bug #20080 [Form] compound forms without children should be considered rendered implicitly (backbone87)"
Fix#19943 Make sure to process each interface metadata only once
#17580 compound forms without children should be considered rendered implicitly
This PR was merged into the 2.7 branch.
Discussion
----------
Fix#19943 Make sure to process each interface metadata only once
| Q | A
| ------------- | ---
| Branch? | 2.7+
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19943
| License | MIT
| Doc PR | N/A
Here is the fix for #19943, If you have `InterfaceA <- InterfaceB <- Class` with a constraint on a method defined on `InterfaceA`, the constraint and its eventual violations are currently validated and reported twice.
Copy from https://github.com/symfony/symfony/issues/19943#issuecomment-250238529:
As far as I can see, the problem seems to arise in [`LazyLoadingMetadataFactory`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php#L117-L123):
[`ReflectionClass::getInterfaces()`](http://php.net/manual/en/reflectionclass.getinterfaces.php) returns both interfaces implemented directly and through inheritance (either through another interface or through a parent class). In the end, the following process occurs:
1. `PriceInterface` is parsed and its `NotBlank` constraint on `value` is loaded
2. `VariablePriceInterface` is parsed and inherits `PriceInterface`'s constraints (which is OK).
3. `ProductPrice` is parsed and inherits both `PriceInterface` and `VariablePriceInterface`'s constraints, which leads to a duplicated `NotBlank` constraint, one from each Interface.
The Best Way ™️ would be to be able to extract the list of interfaces implemented by a class directly only. However, the process seems a bit intricate... I will start working on it and prepare a PR to that effect. However, if any of you has a better idea, I'm all hears...
TODO:
- [x] Regression tests to make sure the bug doesn't reappear
Commits
-------
2f9b65aFix#19943 Make sure to process each interface metadata only once
This PR was merged into the 2.7 branch.
Discussion
----------
[Form] compound forms without children should be considered rendered implicitly
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | possibly
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #17580
| License | MIT
| Doc PR | n/a
Commits
-------
8234f2a#17580 compound forms without children should be considered rendered implicitly
Using file operations on a symlink that points to a file outside the
directories being allowed by the open_basedir setting leads to PHP
warnings being raised.
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Format JSON fixtures
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
Should make merging upstream easier due better diffs.
```php
foreach (glob('src/Symfony/Component/Console/Tests/Fixtures/*.json') as $file) {
file_put_contents($file, str_replace(PHP_EOL, "\n", json_encode(json_decode(trim(file_get_contents($file))), JSON_PRETTY_PRINT))."\n");
}
```
Should be re-applied on 2.8, 3.1 and master.
Commits
-------
2ca7823 format json fixtures
This PR was merged into the 2.7 branch.
Discussion
----------
[Finder] Trim trailing directory slash in ExcludeDirectoryFilterIterator
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19599
| License | MIT
| Doc PR | reference to the documentation PR, if any
In this context `path` equals `path/`
Commits
-------
e0e5f0c apply rtrim
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Cache] Handle arbitrary key length when the backend cant using hashing
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Saving some bits from #19521 :) Already awaited by PdoAdapter which defines the property.
Commits
-------
11f448f [Cache] Handle arbitrary key length when the backend cant using hashing
* 3.1:
expectedException expects FQCN
Fixed expectedException annotations
[Cache] Fix password used to make the redis connection.
Security and validators messages translation to Latvian
[Form] FormView->isRendered() remove dead code and simplify the flow
Fixed issue with legacy find() method not working as expected
* 2.8:
expectedException expects FQCN
Fixed expectedException annotations
Security and validators messages translation to Latvian
[Form] FormView->isRendered() remove dead code and simplify the flow
* 2.7:
Fixed expectedException annotations
Security and validators messages translation to Latvian
[Form] FormView->isRendered() remove dead code and simplify the flow
This PR was merged into the 3.1 branch.
Discussion
----------
[Ldap] Fixed issue with legacy find() method not working as expected
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19804
| License | MIT
| Doc PR |
This PR fixes two bugs. The first, with the legacy `LdapClient` class' `find()` method not working as expected, sometimes throwing errors, which is an after-effect of missing Ldap attributes normalisation in the ResultIterator, and the second one being that the `find()` method does not return the expected output, which should be the same as PHP's `ldap_get_entries()` method.
As a reminder, this method should only be used by legacy software, which need to provide compatibility with Symfony 3.0 and Symfony 2.8.
Commits
-------
3bae5ea Fixed issue with legacy find() method not working as expected
This PR was merged into the 2.7 branch.
Discussion
----------
Security and validators messages translation to Latvian
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
ff72f21 Security and validators messages translation to Latvian
This PR was merged into the 3.2-dev branch.
Discussion
----------
[ExpressionLanguage] fixed a BC break
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | fixes a BC break :)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | see https://github.com/symfony/symfony/pull/19060#r79791581
| License | MIT
| Doc PR | n/a
Commits
-------
b00930f [ExpressionLanguage] fixed a BC break
* 3.1:
[VarDumper] Fix test
Revert "minor #20011 Use UUID for error codes for Form validator. (Koc)"
Use UUID for error codes for Form validator.
Use UUID for error codes for Form validator.
Fixed regression when exception message swallowed when logging it.
[HttpFoundation] Enable memcached tests with the latest memcached extension
* 2.8:
[VarDumper] Fix test
Revert "minor #20011 Use UUID for error codes for Form validator. (Koc)"
Use UUID for error codes for Form validator.
Use UUID for error codes for Form validator.
Fixed regression when exception message swallowed when logging it.
[HttpFoundation] Enable memcached tests with the latest memcached extension
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Form][EventDispatcher] Fix VarDumper usage related to perf regression
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19978
| License | MIT
| Doc PR | -
Commits
-------
294868e [Form][EventDispatcher] Fix VarDumper usage related to perf regression
This PR was merged into the 2.8 branch.
Discussion
----------
Use UUID for error codes for Form validator.
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | tiny, but it allowed http://symfony.com/doc/current/contributing/code/bc.html#changing-classes
| Deprecations? | no
| Tests pass? | I hope so :)
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
3693e83 Use UUID for error codes for Form validator.
* 2.7:
Revert "minor #20011 Use UUID for error codes for Form validator. (Koc)"
Use UUID for error codes for Form validator.
Fixed regression when exception message swallowed when logging it.
[HttpFoundation] Enable memcached tests with the latest memcached extension
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Routing] Fixed route generation with fragment defined as defaults
| Q | A
| ------------- | ---
| Branch? | "master"
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
As stated in https://symfony.com/blog/new-in-symfony-3-2-routing-improvements, it should support `_fragment` option as part of `_defaults` of route definition.
Commits
-------
3c36596 [Routing] Fixed route generation with fragment defined as defaults
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Translation] added Base Exception for the 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 | ~
Commits
-------
0fa4397 [Translation] added Base Exception for the component.
This PR was merged into the 2.7 branch.
Discussion
----------
[DX] Fixed regression when exception message swallowed when logging it.
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | maybe, wait for Travis
| Fixed tickets | fixed regression introduced in #13418
| License | MIT
| Doc PR | -
The problem is: after merging referenced PR we cann't understand what error occured and why authentication request failed (see attached screenshot). Previously it displays exception message, but now it only displays class of the exception.
![9003644109](https://cloud.githubusercontent.com/assets/191082/18717550/f0df61c4-8028-11e6-8dbb-684e4928e913.jpg)
Commits
-------
042cb6b Fixed regression when exception message swallowed when logging it.
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Routing] fix reference type argument type
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
a8dd628 [Routing] fix reference type argument type
* 3.1:
[TwigBridge] removed Twig null nodes (deprecated as of Twig 1.25)
Make redis host configurable in tests
[Console] Fix empty optionnal options with = separator in argv
This PR was merged into the 3.2-dev branch.
Discussion
----------
[DependencyInjection] Automatically detect the definitions class when possible
| 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/issues/19161
| License | MIT
| Doc PR |
> Thanks to the features of php 7.0 we can now guess the class of a service created with a factory:
> ```php
> function myFactory(): MyServiceClass
> {
> }
> ```
>
> So I propose to create a new pass to automatically update the services definition when possible. This is particularly useful for autowiring (this way you don't have to copy-paste the class name of the service, especially when this is from a third party library).
>
> What do you think ?
Commits
-------
63afe3c [DependencyInjection] Automatically detect the definitions class when possible
This PR was squashed before being merged into the 3.1 branch (closes#19974).
Discussion
----------
Make redis host configurable in tests
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Makes running tests on dockerized environments possible, since we can now export the `REDIS_HOST` environment variable:
```
REDIS_HOST=redis ./phpunit src/Symfony/Component/Cache
```
If this gets merged, in master we can later replace the `SYMFONY__REDIS_HOST` usage in the FrameworkBundle with the new `env(REDIS_HOST)`.
Commits
-------
c87de00 Make redis host configurable in tests
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Security] AccessDeniedException: rename object to subject
| 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/19473#r72766336
| License | MIT
| Doc PR |
With this change the name is inline with what we use in the base voter
interface.
Commits
-------
9603ffa AccessDeniedException: rename object to subject
This PR was merged into the 3.2-dev branch.
Discussion
----------
fixed a deprecation warning in tests
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
9e1589e fixed a deprecation warning in tests
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Config] Fix (Yaml|Xml)ReferenceDumper for nested prototypes
| 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 tries to fix the nested prototypes case for the `YamlReferenceDumper` and `XmlReferenceDumper`.
### Before
```yml
cms_pages:
# Prototype
page: []
```
### After
```yml
cms_pages:
# Prototype
page:
# Prototype
locale:
title: ~ # Required
path: ~ # Required
```
~~However, the `YamlReferenceDumperTest::testDumper` is marked as skipped, due to another unsupported prototype usage, but that's another issue (the `connections` key). Thus, the bug fix must be tested manually :/ (I'd recommend to merge #19570 first)~~
Commits
-------
1e80510 [Config] Fix YamlReferenceDumper for nested prototypes
This PR was merged into the 3.2-dev branch.
Discussion
----------
[FrameworkBundle] Parse source link maps using json_decode() instead of parse_str()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | updated code exists only on master
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19807
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/6944
Because `parse_str()` turns some characters into underscores in keys (e.g. `.`).
Commits
-------
9b174fb [FrameworkBundle] Parse source link maps using json_decode() instead of parse_str()
This PR was merged into the 3.2-dev branch.
Discussion
----------
[Yaml] Port of #19922 for 3.2
| Q | A
| ------------- | ---
| Branch? | master
| Tests pass? | yes
| License | MIT
The command has been moved in 3.2 so the new path is unmerged.
Commits
-------
017e88b [Yaml] Port of #19922 for 3.2
This PR was merged into the 3.2-dev branch.
Discussion
----------
[DI] Allow injecting ENV parameters at runtime using %env(MY_ENV_VAR)%
| Q | A
| ------------- | ---
| Branch? | master
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #10138, #7555, #16403, #18155
| License | MIT
| Doc PR | https://github.com/symfony/symfony-docs/pull/6918
This is an alternative approach to #18155 for injecting env vars into container configurations.
With this PR, anywhere parameters are allowed, one can use `%env(ENV_VAR)%` to inject a dynamic env var. Additionally, if one sets a value to such parameters in e.g. the `parameter.yml` file (`env(ENV_VAR): foo`), this value will be used as a default value when the env var is not defined. If no default value is specified, an `EnvVarNotFoundException` will be thrown at runtime.
Unlike previous attempts that also used parameters (#16403), the implementation is compatible with DI extensions: before being dumped, env vars are resolved to uniquely identifiable string placeholders that can get through DI extensions manipulations. When dumped, these unique placeholders are replaced by dynamic calls to a getEnv method..
ping @magnusnordlander @dzuelke @fabpot
Commits
-------
bac2132 [DI] Allow injecting ENV parameters at runtime using %env(MY_ENV_VAR)% syntax
* 3.1:
added a comment about a workaround
[Finder] no PHP warning on empty directory iteration
[HttpKernel] Fixed the nullable support for php 7.1 and below
fixed CS
[Form] Fix typo in doc comment
Fix version constraint
[Config] Handle open_basedir restrictions in FileLocator
Fixed bad merge
[DoctrineBridge][PropertyInfo] Treat Doctrine decimal type as string
[bugfix] [Console] Set `Input::$interactive` to `false` when command is executed with `--quiet` as verbosity level
Use JSON_UNESCAPED_SLASHES for lint commands output
Fixed collapsed ChoiceType options attributes
[FrameworkBundle] Remove cache clearer default value in config
Consider the umask setting when dumping a file.
Fixed the nullable support for php 7.1 and below
Make ReflectionExtractor compatible with ReflectionType changes in PHP 7.1
This PR was squashed before being merged into the 3.2-dev branch (closes#19197).
Discussion
----------
[Serializer][FrameworkBundle] Add a CSV encoder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | todo
Usage:
```php
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Encoder\CsvEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
$serializer = new Serializer(array(new ObjectNormalizer()), array(new CsvEncoder()));
// or $serializer = $container->get('serializer'); when using the full stack framework
$serializer->encode($something, 'csv');
$serializer->decode(<<<'CSV'
id,name
1,Kévin
CSV
, 'csv');
```
CSV files must contain a header line with property names as keys.
ping @clementtalleu @Simperfit @gorghoa
Commits
-------
e71f5be [Serializer][FrameworkBundle] Add a CSV encoder
This PR was squashed before being merged into the 3.2-dev branch (closes#19257).
Discussion
----------
[Validator][Choice] Make strict the default option for choice validation
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | #18973
| License | MIT
| Doc PR | -
This is just the WIP as there are two options.
1. Just change default which would only possible to introduce in 4.x or in 3.2 if this BC break is considered as acceptable
2. Add a new option e.g. `strictComparison` which defaults to true in 4.x and deprecate the usage of the strict option for 3.2.
3. Just deprecate strict = false and remove the option but I would be against that as we remove flexibility which might be wanted.
As per discussion I went ahead with option 3. We can then still decide if we want to remove the option entirely or eventually reenable setting strict to false in a later release.
Commits
-------
177c513 [Validator][Choice] Make strict the default option for choice validation
This PR was squashed before being merged into the 3.2-dev branch (closes#19326).
Discussion
----------
[Serializer][FrameworkBundle] Add a YAML encoder
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | todo
Add YAML support to the Serializer.
Commits
-------
9366a7d [Serializer][FrameworkBundle] Add a YAML encoder
This PR was merged into the 3.2-dev branch.
Discussion
----------
[PropertyInfo] Extract the logic converting a php doc to a Type
| 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 creates a new trait `PhpDocTypeHelperTrait` extracting some logic of the `PhpDocExtractor`.
I would like to detect the return type of some methods but this is not easily doable as I have to transform the doc types to a ``Type`` instance.
Is this ok for you ?
Commits
-------
d6e93d8 [PropertyInfo] Extract the logic converting a php doc to a Type in PhpDocTypeHelperTrait
This PR was merged into the 3.2-dev branch.
Discussion
----------
[master][console] Allow multiple options to be set.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| License | MIT
This PR add the possibility to set multiple options on a formatted string output.
Example:
```php
$output->writeln('<fg=green;options=bold,underscore>Test</>');
```
Secondly it makes the behavior on invalid values consistent.
```php
// current
$output->writeln('<fg=lime;>Test</>'); // throws exception
$output->writeln('<options=italic;>Test</>'); // silent ignore
// new
$output->writeln('<fg=lime;>Test</>'); // throws exception
$output->writeln('<options=italic;>Test</>'); // throws exception
```
All other changes are about making the code more strict or other SCA/CS fixes.
Commits
-------
1430138 Allow multiple options to be set.
This PR was squashed before being merged into the 3.2-dev branch (closes#19584).
Discussion
----------
[DependencyInjection] Improve ParameterNotFoundException when accessing a nested parameter
| 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
A common problem under beginners is to think that the dot notation is used to access nested arrays saved in parameters (*common here means someone asks help for this problem at least once a week on IRC*). Adding a little extra detail to the exception message and a working alternative should help pointing these people in the right direction before spending time debugging this.
It's quite late in the night over here, so the wording of the exception message probably isn't great. I'm happy to accept better suggestions 😃
Commits
-------
df70f06 [DependencyInjection] Improve ParameterNotFoundException when accessing a nested parameter