This PR was merged into the 2.3 branch.
Discussion
----------
[ClassLoader] Use symfony/polyfill-apcu
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Fixes APC usage on PHP 7 or when APCu bc-layer is disabled
Commits
-------
623595f [ClassLoader] Use symfony/polyfill-apcu
This PR was squashed before being merged into the 2.3 branch (closes#17370).
Discussion
----------
[HttpFoundation][Cookie] Cookie DateTimeInterface fix
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
I came across an issue with expiration times on cookies. They were not working with DateTimeImmutable but only the DateTime implementation itself. I refactored this to work with the DateTimeInterface.
Commits
-------
f1f9754 [HttpFoundation][Cookie] Cookie DateTimeInterface fix
This PR was merged into the 2.3 branch.
Discussion
----------
do not ship with a custom rng implementation
Commits
-------
b91441c removed obsolete tests, fixed composer.json
fcd3160 do not ship with a custom rng implementation
This PR was squashed before being merged into the 2.8 branch (closes#17253).
Discussion
----------
[Console] HHVM read input stream bug
| Q | A
| ------------- | ---
| Bug fix? | [yes]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [no]
| Tests pass? | [yes]
| License | MIT
HHVM readline() function requires a parameter see:
https://github.com/facebook/hhvm/blob/master/hphp/runtime/ext/readline/ext_readline.php
But the php readline does not require one.
```
In Symfony\Component\Console\Helper\QuestionHelper
…
readFromInput($stream)
…
```
we use readline() without a parameter.
HHVM Version:
```
HipHop VM 3.10.1 (rel)
Compiler: tags/HHVM-3.10.1-0-g689b4969a141620ee5a282ce0dbf72278c84d44b
Repo schema: 6c99ee1f98340f6f3ef397a332583f0e843a627d
```
Docker Container:
```
docker run --rm -it -v `pwd`:`pwd` -w `pwd` brunoric/hhvm:deb hhvm test.php ls
```
Test.php
```
<?php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Helper\QuestionHelper;
require_once "vendor/autoload.php";
$console = new Application();
$console
->register('ls')
->setDescription('Try input')
->setCode(function (InputInterface $input, OutputInterface $output) {
$question = new Question('Your email address: ');
$question->setValidator(
function ($answer) {
return $answer;
}
);
$question->setMaxAttempts(5);
$helper = new QuestionHelper();
$email = $helper->ask($input, $output, $question);
$output->writeln(sprintf('Email Adress: <info>%s</info>', $email));
})
;
$console->run();
```
composer.json
```
{
"require": {
"symfony/console": "^3.0"
}
}
```
Result:
No input is possible and you got a warning
```
Your email address:
Warning: readline() expects exactly 1 parameter, 0 given in /clitest/vendor/symfony/console/Helper/QuestionHelper.php on line 436
Email Adress:
```
Fix:
Add a empty string parameter to readline() or use fgets() for hhvm.
Commits
-------
e7f17a7 [Console] HHVM read input stream bug
* 2.8:
Fix max width for multibyte keys in choice question
[Console] Display console application name even when no version set
Remove empty statements.
* 2.7:
Fix max width for multibyte keys in choice question
[Console] Display console application name even when no version set
Remove empty statements.
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes#17314).
Discussion
----------
Fix max width for multibyte keys in choice question
Fixes wrong key max width for ChoiceQuestion in multibyte strings
Before:
![before](https://cloud.githubusercontent.com/assets/2435655/12203385/977e88c0-b626-11e5-9425-d497f84a9ab3.png)
After:
![after](https://cloud.githubusercontent.com/assets/2435655/12203390/9d9a0b4e-b626-11e5-8d4e-ba9290820778.png)
To replicate you can use this code as an example:
```
namespace AppBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
class QuesionCommand extends Command
{
protected function configure()
{
$this->setName('app:question');
$this->setDescription('Command for testing PR');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$helper = $this->getHelper('question');
$question = new ChoiceQuestion('Choose something:',
[
'foo' => 'foo',
'żółw' => 'bar',
'łabądź' => 'baz',
'известно' => 'lorem',
'газета' => 'ipsum',
],
0);
$colour = $helper->ask($input, $output, $question);
$output->writeln('you have chosen: ' . $colour);
}
}
```
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/15368
| License | MIT
| Doc PR | -
Commits
-------
5d2463b Fix max width for multibyte keys in choice question
This PR was squashed before being merged into the 2.3 branch (closes#17326).
Discussion
----------
[Console] Display console application name even when no version set
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
When displaying help of an Application with a name but no version, it show "Console Tool" instead of the application name.
Commits
-------
61e810e [Console] Display console application name even when no version set
This PR was merged into the 2.3 branch.
Discussion
----------
[2.3] Remove empty statements.
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Test run for new fixer to see if it would be suitable for SF.
For ref.: https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1671
Commits
-------
4491c97 Remove empty statements.
* 2.8:
[Yaml] Fix tests on PHP 7.0.2
[FrameworkBundle] Don't log twice with the error handler
[2.7] Workaround https://bugs.php.net/63206
[2.3] Workaround https://bugs.php.net/63206
Add closing parenthesis
[Serializer] Unset object_to_populate after using it
[Serializer] Allow to use proxies in object_to_populate
Conflicts:
src/Symfony/Component/Debug/ErrorHandler.php
src/Symfony/Component/HttpFoundation/JsonResponse.php
* 2.7:
[Yaml] Fix tests on PHP 7.0.2
[2.7] Workaround https://bugs.php.net/63206
[2.3] Workaround https://bugs.php.net/63206
Add closing parenthesis
[Serializer] Unset object_to_populate after using it
[Serializer] Allow to use proxies in object_to_populate
This PR was merged into the 2.7 branch.
Discussion
----------
[Serializer] Allow to use proxies in object_to_populate
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #15627, dunglas/DunglasApiBundle#381
| License | MIT
| Doc PR | n/a
Allows to populate a proxy (or any class having the given type).
Commits
-------
b16b5b9 [Serializer] Allow to use proxies in object_to_populate
This PR was merged into the 2.8 branch.
Discussion
----------
[FrameworkBundle] Don't log twice with the error handler
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #16980
| License | MIT
| Doc PR | -
ping @Tobion @yapro does it work as expected with this patch?
Commits
-------
5926ff2 [FrameworkBundle] Don't log twice with the error handler
This PR was merged into the 2.3 branch.
Discussion
----------
[Yaml] Fix tests on PHP 7.0.2
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #1234
| License | MIT
| Doc PR | -
Related to https://bugs.php.net/66179 that has been fixed in 7.0.2
Commits
-------
902f6dd [Yaml] Fix tests on PHP 7.0.2