This PR was merged into the 3.3-dev branch.
Discussion
----------
[FrameworkBundle] Fix "Locale class not found" in AboutCommand
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Found testing http://fabien.potencier.org/symfony4-demo.html with docker `php:7.1`
Commits
-------
0269f9d422 [FrameworkBundle] Fix "Locale class not found" in AboutCommand
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Fixed index args bug with ResolveNamedArgumentsPass
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | n/a
While upgrading a project, this code suddenly broke:
```yml
services:
ice_cream_service:
class: AppBundle\Service\IceCreamService
autowire: true
arguments:
1: 'http://api.example.com'
```
```php
class IceCreamService
{
public function __construct(EntityManager $em, $apiUrl)
{
}
}
```
Suddenly, the index `1` was not being mapped to `$apiUrl`. This was valid in 3.2, but broke when `ResolveNamedArgumentsPass` accidentally re-set the index. Simple fix :). Ping @dunglas
Cheers!
Commits
-------
7cc7c85919 Fixing bug where indexed args were set wrong in pass in some situations
This PR was merged into the 3.2 branch.
Discussion
----------
[Workflow] Move twig extension registration to twig bundle
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | not really
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
It's probably very late, but I think the twig extension registration is supposed to be done from the `TwigBundle` rather than the `FrameworkBundle`. Fortunately, it doesn't cause any issue currently when using the framework bundle and the workflow component without twig, because it only creates a `workflow.twig_extension` service you'll probably never call, and the `twig.extension` tag is never processed. But still, creates a useless service that cannot be called (and is not removed because it's public).
So this PR aims for consistency over other twig extensions registration, and removing this service when not using twig.
It isn't a BC break to me, as you usually already use the `TwigBundle` for other extensions.
Commits
-------
3fc80d10ef [Workflow] Move twig extension registration to twig bundle
This PR was merged into the 3.3-dev branch.
Discussion
----------
[FrameworkBundle] KernelTestCase: allow to provide the kernel class with a var
| Q | A
| ------------- | ---
| Branch? | 3.3
| Bug fix? | no
| New feature? | yes, but must-have for the new project structure when using flex
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22661
| License | MIT
| Doc PR | todo in https://symfony.com/doc/current/testing.html#your-first-functional-test
So, when using flex, the new `phpunit.xml.dist` will be:
```diff
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
- <server name="KERNEL_DIR" value="etc/" />
+ <server name="KERNEL_CLASS" value="App\Kernel" />
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>
```
As it may cause issues when refactoring, I added a `class_exists` check with an appropriate exception to indicate the class is either not found or not autoloadable.
Commits
-------
4f68912552 [FrameworkBundle] KernelTestCase: allow to provide the kernel class with a var
This PR was merged into the 3.2 branch.
Discussion
----------
[Workflow] fix use directives
| 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
Spotted while creating https://github.com/symfony/symfony/pull/22652
Commits
-------
08f4ad2275 [Workflow] fix use directives
* 2.8:
fixed CS
[DI] Fix PhpDumper blank lines around namespace
fixed CS
Filesystem: annotate the one network test with a "network" group.
[DependencyInjection] Don't store default deprecation template in every service definition instance
This PR was merged into the 2.7 branch.
Discussion
----------
[DI] Fix PhpDumper blank lines around namespace
| 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
219bce9916 tries to fix CS in an expected PhpDumper output, which actually shows the PhpDumper does not create proper blank lines around the namespace.
That's why tests are failing on https://github.com/symfony/symfony/pull/22660.
Commits
-------
c9f6c1680f [DI] Fix PhpDumper blank lines around namespace
This PR was merged into the 3.3-dev branch.
Discussion
----------
Improved the stack traces that don't contain a function
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
When a trace doesn't have a method/function associated, we display `n/a` and the file path below it. This usually happens in the first line of the stack traces. I don't think this looks OK, so I'm proposing to change it as follows:
### Before
![before-exception](https://cloud.githubusercontent.com/assets/73419/25782450/ae521cc6-334b-11e7-9e22-b31342667f6c.png)
### After
![after-exception](https://cloud.githubusercontent.com/assets/73419/25782451/b1b9957e-334b-11e7-812f-8c24ab8872df.png)
Commits
-------
9457558457 Improved the stack traces that don't contain a function
This PR was merged into the 3.3-dev branch.
Discussion
----------
[WebLink][TwigBundle] Fix registration of the twig extension
| Q | A
| ------------- | ---
| Branch? | 3.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | See http://symfony.com/blog/new-in-symfony-3-3-weblink-component comments
| License | MIT
| Doc PR | N/A
BTW it is the only extension not using a classic service definition and adding the tag using the `Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\ExtensionPass` class.
(Fabbot failure fixed in https://github.com/symfony/symfony/pull/22640)
Commits
-------
3d8a5646e7 [WebLink][TwigBundle] Fix registration of the twig extension
This PR was merged into the 3.3-dev branch.
Discussion
----------
Make the exception pages work when the WebProfilerBundle is not installed
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22631
| License | MIT
| Doc PR | -
Commits
-------
98353b0032 Make the exception pages work when the WebProfilerBundle is not installed
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI][DX] Fix missing autoconfigure in container debug
| 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
Added missing autoconfigure flag for `debug:container` with service id.
Commits
-------
f50afad839 fixed missing autoconfigure in container debug
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Fix Cannot declare class ...\DefinitionDecorator, because the name is already in use
| Q | A
| ------------- | ---
| Branch? | 3.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21369
| License | MIT
| Doc PR | N/A
The `return` trick doesn't seem to work, and php is still trying to declare the `DefinitionDecorator` class, which causes the "Cannot declare class ...\DefinitionDecorator, because the name is already in use" error because of the `class_alias` previously declared in `ChildDefinition.php`.
This never happens as soon as the `ChildDefinition` class is used first, as the alias will take hand, but their are some situations, like in some unit test cases it can happen apparently, because `DefinitionDecorator` is used first.
Commits
-------
530849e4b5 [DI] Fix Cannot declare class ...\DefinitionDecorator, because the name is already in use
This PR was merged into the 3.3-dev branch.
Discussion
----------
Improving autowire exception when you type-hint a class & alias is available
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none
| License | MIT
| Doc PR | n/a
Suppose you type-hint a class instead of the correct interface (which is aliased):
```php
public function __construct(Logger $logger)
```
Current error:
> Cannot autowire service "AppBundle\Security\PostVoter": argument "$logger" of method "__construct()" references class "Symfony\Bridge\Monolog\Logger" but no such service exists. You should maybe alias this class to one of these existing services: "monolog.logger", "monolog.logger.request", "monolog.logger.console", "monolog.logger.cache", "monolog.logger.templating", "monolog.logger.translation", "monolog.logger.profiler", "monolog.logger.php", "monolog.logger.event", "monolog.logger.router", "monolog.logger.security", "monolog.logger.doctrine"; or type-hint against interface "Psr\Log\LoggerInterface" instead.
New error:
> Cannot autowire service "AppBundle\Security\PostVoter": argument "$logger" of method "__construct()" references class "Symfony\Bridge\Monolog\Logger" but no such service exists. Try changing the type-hint to "Psr\Log\LoggerInterface" instead.
The correct "suggestion" was always there (at the end). I think if there is already a definitive alias available for your type-hint, we can say that they are simply using the wrong type-hint and suggest *only* that.
Commits
-------
5a3c156798 Improving autowire exception when you type-hint a class and there is an interface alias available
This PR was merged into the 3.3-dev branch.
Discussion
----------
[FrameworkBundle] Add type hint for ContainerInterface on ControllerTrait
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
When inspecting code using the `ControllerTrait`, IDE autocompletion and automatic type resolving of services does not work as the IDE (e.g. PHPStorm with the Symfony plugin) does not know what `$this->container` refers to:
![image](https://cloud.githubusercontent.com/assets/27403/25742248/eee5f280-318e-11e7-83df-c417bc7edb84.png)
This adds a type hint for the container property, making the IDE aware what `container` is.
![image](https://cloud.githubusercontent.com/assets/27403/25742238/dceda64a-318e-11e7-9f63-c92a82e75744.png)
Commits
-------
7f416ede17 [FrameworkBundle] Add type hint for ContainerInterface to ControllerTrait
This PR was merged into the 3.3-dev branch.
Discussion
----------
[TwigBundle] Remove unecessary use to make fabbot happy
| Q | A
| ------------- | ---
| Branch? | 3.3
| 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
-------
044cbaf1e1 [TwigBundle] Remove unecessary use to make fabbot happy
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes#22630).
Discussion
----------
Filesystem: annotate the one network test with a "network" group.
This is one tiny commit that lets us avoid hitting the network while running the test suite. We've packaged symfony-filesystem in Gentoo, and our users can run the test suite when they install it. However, network access is forbidden during the test phase (it causes spurious failures, privacy issues, etc.). By marking the one network test with `@group network`, we are able to skip it with `--exclude-group network`.
| 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
-------
fd0dd57e74 Filesystem: annotate the one network test with a "network" group.
Tests that require network access can be problematic, because they
depend on some external state not under your control. That can lead to
"random" failures when the code in question actually works fine. The
Filesystem component has one such test, and this commit adds it to the
"network" group (for PHPUnit).
Doing so lets the user skip that particular test, by running phpunit
with the --exclude-group flag. We take advantage of this in Gentoo,
where every user has the ability to run the test suite but network
access is forbidden.
This PR was squashed before being merged into the 3.3-dev branch (closes#22624).
Discussion
----------
debug:container --types (classes/interfaces)
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | none, but needed in symfony/symfony-docs#7807
| License | MIT
| Doc PR | n/a
In Symfony 3.3, the *type* (i.e. class/interface) is the most important thing about a service. But, we don't have a way for the user to know *what* types are available. This builds on top of `debug:container` to make `debug:container --types`:
<img width="1272" alt="screen shot 2017-05-03 at 3 42 37 pm" src="https://cloud.githubusercontent.com/assets/121003/25678671/8bebacaa-3018-11e7-9cf6-b7654e2cae88.png">
I think we need this for 3.3, so I've made the diff as *small* as possible. We could make improvements for 3.4, but just *having* this is the most important. I could even remove `format` support to make the diff smaller.
~~This depends on #22385, which fixes a "bug" where private services aren't really shown.~~
Thanks!
Commits
-------
25a39c2682 debug:container --types (classes/interfaces)
This PR was merged into the 2.8 branch.
Discussion
----------
[DependencyInjection] Don't store default deprecation template in every service definition instance
| Q | A
| ------------- | ---
| Branch? | 2.8+
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
While debugging I noticed that each service definition contains a default deprecation template, even if it was not marked as deprecated
Commits
-------
388ee467c5 [DependencyInjection] Don't store default deprecation template in every service definition instance
* 3.2:
[appveyor] Run the test suite on PHP 7.1
[appveyor][3.x] Run the test suite on PHP 7.1
[EventDispatcher] fix merge of #22541 from 2.8
bumped Symfony version to 3.2.9
updated VERSION for 3.2.8
updated CHANGELOG for 3.2.8
bumped Symfony version to 2.8.21
updated VERSION for 2.8.20
updated CHANGELOG for 2.8.20
bumped Symfony version to 2.7.28
updated VERSION for 2.7.27
update CONTRIBUTORS for 2.7.27
updated CHANGELOG for 2.7.27
* 2.8:
[appveyor] Run the test suite on PHP 7.1
bumped Symfony version to 2.8.21
updated VERSION for 2.8.20
updated CHANGELOG for 2.8.20
bumped Symfony version to 2.7.28
updated VERSION for 2.7.27
update CONTRIBUTORS for 2.7.27
updated CHANGELOG for 2.7.27