This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] add ServiceLocatorTagPass::register() to share service locators
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Right now, one service locator is created per controller / service subscriber. But since service locators are stateless, this is just wasting resources when several controllers have the exact same set of services managed by their locators (as would be the case when registering the new `AbstractController` as a service subscribers).
This PR fixes this issue, and a few related others found along the way.
Commits
-------
8ff764be82 [DI] add ServiceLocatorTagPass::register() to share service locators
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Dont trigger deprecation for event_dispatcher service
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22208
| License | MIT
| Doc PR | n/a
Mute deprecations for the event_dispatcher service keeping only relevant ones i.e when the api of the deprecated class is used intentionally, ugly but prevent breaking test suites like the [LexikJWTAuthenticationBundle one](https://travis-ci.org/lexik/LexikJWTAuthenticationBundle/jobs/216664013#L278).
Commits
-------
a49fe25fa3 [DI] Dont trigger deprecation for event_dispatcher service
This PR was merged into the 2.8 branch.
Discussion
----------
[DI] Autowiring and factories are incompatible with each others
| 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 | -
Commits
-------
9b601633a7 [DI] Autowiring and factories are incompatible with each others
This PR was merged into the 2.8 branch.
Discussion
----------
[DI] Don't use auto-registered services to populate type-candidates
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no (every bug fix is a bc break, isn't it?)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22162, ~~#21658~~
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
Alternative to #22170 and ~~#21665~~.
The core issue fixed here is that auto-registered services should *not* be used as type-candidates.
The culprit is this line:
`$this->populateAvailableType($argumentId, $argumentDefinition);`
Doing so creates a series of wtf-issues (the linked ones), with no simple fixes (the linked PRs are just dealing with the simplest cases, but the real fix would require a reboot of autowiring for every newly discovered types.)
The other changes accommodate for the removal of the population of the `types` property, and fix a few other issues found along the way:
- variadic constructors
- empty strings injection
- tail args removal when they match the existing defaults
Commits
-------
992c677534 [DI] Don't use auto-registered services to populate type-candidates
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Serializer][XmlEncoder] Added a FORMAT constant
| 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 | -
Added a FORMAT constant in the XmlEncoder class to normalize it like other Encoder classes.
Commits
-------
0a0901b8bc [Serializer] Added a FORMAT constant in the XmlEncoder class
This PR was merged into the 2.7 branch.
Discussion
----------
[ExpressionLanguage] Provide the expression in syntax errors
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19445
| License | MIT
| Doc PR | n/a
This finishes the PR #19449.
Commits
-------
7cd744133d Complete the injection of the expression in all syntax errors
dc55db2a9d add expression text to SyntaxError
This PR was merged into the 2.8 branch.
Discussion
----------
[PropertyInfo] Support nullable array or collection
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22248
| License | MIT
| Doc PR |
`@var array|null` was always considered as not nullable in the `PhpDocExtractor`.
Commits
-------
74ee588924 support nullable array or collection
* 2.7:
Lighten tests output by removing composer suggestions
CS: Remove invisible chars
Disable resource tracking if the config component is missing
[EventDispatcher] Remove unneded count()
Fix tests expecting a valid date
[Console] Fix table cell styling
[Console] Revised exception rendering
[WebProfilerBundle] Normalize whitespace in exceptions passed in headers
Disable color support detection for tests
[Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Workflow] Added 'workflow_marked_places' twig function
| 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 someone uses a custom MarkingStore, the value in the
$subject::marking can be really different from the value inside
Marking::getPlaces(). This occurs, for example, when the value stored in
the subject is a bit mask.
So it's always safer to get the places names from the marking, and so
with this new function.
---
usage:
```twig
{{ workflow_marked_places(post)|join(',') }}
```
Commits
-------
ead6f142bb [Workflow] Added 'workflow_marked_places' twig function
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes#22249).
Discussion
----------
Lighten tests output by removing composer suggestions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Tests on PHP 7.1 has more that 4'000 output lines. I suggest to remove composer suggestions, to lighten a bit output.
Commits
-------
8c8b181 Lighten tests output by removing composer suggestions
This PR was squashed before being merged into the 2.7 branch (closes#22232).
Discussion
----------
CS: Remove invisible chars
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | n/a
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
I found out that we have 2 non-visible in regular IDE chars in codebase.
One is just inside a comment, it could be safely removed.
But second is inside a real code, I have replaced it with `pack`, so one won't accidentally replace non-breaking space with regular space.
Commits
-------
0f623f4 CS: Remove invisible chars
This PR was merged into the 2.7 branch.
Discussion
----------
[DI] Fix fatal error at ContainerBuilder::compile() if config is not installed
| 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
Using the DI component independently, running the following code:
```php
(new ContainerBuilder())->compile();
```
gives
> Fatal error: Uncaught Error: Class 'Symfony\Component\Config\Resource\FileResource' not found
Considering that using the container without ever compiling it doesn't really make sense, I think this currently makes the config component an hard requirement. I propose to make it softer as a bug fix, enabling resource tracking by default only if the config component is installed.
Commits
-------
75d5cb1 Disable resource tracking if the config component is missing
This PR was merged into the 3.3-dev branch.
Discussion
----------
[HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22171, silexphp/Silex#1496
| License | MIT
| Doc PR | -
Implementing `ServiceSubscriberInterface` creates a dep on the DI component, which Silex can't afford. Let's revert that part.
@GromNaN can you please confirm this fixes your issue?
Commits
-------
7cd90f5c97 [HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener
This PR was merged into the 2.7 branch.
Discussion
----------
[Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22103
| License | MIT
| Doc PR | -
Commits
-------
ef39b704cc [Form] Improve the exceptions when trying to get the data in a PRE_SET_DATA listener and the data has not already been set
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Fix table cell styling
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | tiny one
| BC breaks? | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
Fixes an issue with newlines and table cells. Remembered this little trick from @chalasr as we had it before with style blocks i believe..
```php
$table = new Table($output);
$table->setRows(array(
array(new TableCell('<error>Dont break'."\n".'here</error>', array('colspan' => 2))),
new TableSeparator(),
array('foo', new TableCell('<error>Dont break'."\n".'here</error>', array('rowspan' => 2))),
array('bar'),
));
$table->render();
```
Before
![image](https://cloud.githubusercontent.com/assets/1047696/24467857/74dacc9e-14b6-11e7-8f62-3831508ac949.png)
After
![image](https://cloud.githubusercontent.com/assets/1047696/24467923/bb578f0e-14b6-11e7-85ed-039cd73b81a0.png)
Commits
-------
53ecf8393e [Console] Fix table cell styling
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Component] [Yaml] [Parser] : can parse with trailing space as 2.8
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass? | yes
| Fixed tickets | #22193
| License | MIT
| Doc PR | symfony/symfony-docs
Missing rtrim method in line to parse as the version 2.8 does
Commits
-------
ce3d5ab7d1 [Component] [Yaml] [Parser] : can parse with trailing space as 2.8
This PR was merged into the 3.3-dev branch.
Discussion
----------
fix required Twig version
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22212
| License | MIT
| Doc PR |
In the TwigBundle, the constraint is already correct: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/composer.json#L24
Commits
-------
70e638039c fix required Twig version
This PR was merged into the 2.8 branch.
Discussion
----------
[Form] Avoid forcing to define the choices_as_values option when using choice_loader
| Q | A
| ------------- | ---
| Branch? |2.8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
When using the choice loader, choices are ignored entirely. Forcing the dev to add the choices_as_values just to avoid the deprecation warning (and then to remove the option again at some point in 3.x due to deprecation) is a bad developer experience.
Commits
-------
fb4d8de5e4 Avoid forcing to define the choices_as_values option when using choice_loader
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] CommandTester: disable color support detection
| 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 | -
By default, the command tester relies on [color support guessing](3fe419cf66/src/Symfony/Component/Console/Output/StreamOutput.php (L91)) to enable output decoration.
This is an issue for tests in that guessing is done against the stream instance on Linux and against the actual environment running the test on Windows, so color support can be detected on Windows even when the used stream is a memory stream like here, resulting in non-deterministic tests.
This PR disables output decoration by default. This will only change behavior on Windows with color support, as guessing on Linux always detects color as not supported for memory streams anyway. Tests should enable decoration explicitly when they want to test it.
A better fix would be to actually detect that we are using a memory stream on Windows as well, but I'm not sure it's possible.
Commits
-------
3fe419cf66 Disable color support detection for tests
This PR was merged into the 2.7 branch.
Discussion
----------
Fix tests expecting a valid date
| 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 |
Tests are failing in 2.7 and 2.8 because the day 0 is not considered valid.
Commits
-------
071548090b Fix tests expecting a valid date
When using the choice loader, choices are ignored entirely. Forcing the dev
to add the choices_as_values just to avoid the deprecation warning (and then
to remove the option again at some point in 3.x due to deprecation) is a bad
developer experience.
When someone uses a custom MarkingStore, the value in the
$subject::marking can be really different from the value inside
Marking::getPlaces(). This occurs, for example, when the value stored in
the subject is a bit mask.
So it's always safer to get the places names from the marking, and so
with this new function.
This PR was merged into the 3.2 branch.
Discussion
----------
Fix @param in PHPDoc
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | no
| License | MIT
| Doc PR | no
Errors reported by Sami API Doc generator on branch 3.2
```
ERROR: The "factory" @param tag variable name is wrong (should be "objectLoader") on "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader::__construct" in src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php:68
ERROR: The "objectLoader" @param tag variable name is wrong (should be "factory") on "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader::__construct" in src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php:68
ERROR: "7" @param tags are expected but only "6" found on "Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController::__construct" in src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php:50
ERROR: "3" @param tags are expected but only "2" found on "Symfony\Component\Asset\PathPackage::__construct" in src/Symfony/Component/Asset/PathPackage.php:35
ERROR: "2" @param tags are expected but only "1" found on "Symfony\Component\Cache\Adapter\PhpArrayAdapter::create" in src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php:64
ERROR: "3" @param tags are expected but only "1" found on "Symfony\Component\Cache\Adapter\RedisAdapter::__construct" in src/Symfony/Component/Cache/Adapter/RedisAdapter.php:39
ERROR: The "format" @param tag variable name is wrong (should be "fileLinkFormat") on "Symfony\Component\Debug\ExceptionHandler::setFileLinkFormat" in src/Symfony/Component/Debug/ExceptionHandler.php:90
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\Compiler\Compiler::addPass" in src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:73
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\Compiler\PassConfig::addPass" in src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php:97
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass" in src/Symfony/Component/DependencyInjection/ContainerBuilder.php:311
ERROR: "2" @param tags are expected but only "3" found on "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface::getProxyFactoryCode" in src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php:41
ERROR: "0" @param tags are expected but only "1" found on "Symfony\Component\HttpFoundation\Request::isMethodSafe" in src/Symfony/Component/HttpFoundation/Request.php:1458
ERROR: "5" @param tags are expected but only "6" found on "Symfony\Component\Serializer\Normalizer\AbstractNormalizer::instantiateObject" in src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php:291
```
Errors that cannot be fixed are due to new arguments not included in the method signature for backward compatibility, but actually used by the code.
Commits
-------
6ed9d0e4c1 Fix @param in PHPDoc
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Throw on "configured-keys <> getSubscribedServices()" mismatch
| 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 reported on Slack, this creates DX issues, and provides no practical benefit. Let's throw instead of logging.
Commits
-------
4da8884ca4 [DI] Throw on "configured-keys <> getSubscribedServices()" mismatch