Skip to content

Untitled #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from
Closed

Untitled #3

wants to merge 0 commits into from

Conversation

jwage
Copy link
Contributor

@jwage jwage commented Sep 2, 2010

No description provided.

fabpot added a commit that referenced this pull request Jul 27, 2011
Commits
-------

07298ac Detect EOF when reading input stream

Discussion
----------

[Console] Detect EOF when reading input stream

This is related to commits 511a9a1 and 3a5d508.

First of them introduced abort-on-EOF and the second regressed the functionality.
Problem is stream_get_line() doesn't return false on EOF. So it needs call to feof() to
detect the situation.

Still, it's not ideal. With fgets() it worked fine, but with stream_get_line() one has to press
CTRL+D twice to get out. I presume this could be bug in PHP itself.

But better than nothing. Please consider.

---------------------------------------------------------------------------

by fabpot at 2011/07/19 22:47:53 -0700

I have used `stream_get_line` especially because it does not return `false` on eof. This is needed when you pass your own stream for unit tests.

---------------------------------------------------------------------------

by lenar at 2011/07/25 06:05:59 -0700

This is not the best solution I think. Tests should mimic and cope with real life not the other way around.
Better solution would be to fix testcase. Like this: lenar/SensioGeneratorBundle@6ff3f26. Or maybe create a special "testing" stream wrapper that wraps php://memory and gives out just linefeeds after real data ends.

And then change stream_get_line() back to fgets() if there is no other reason for this change.

---------------------------------------------------------------------------

by fabpot at 2011/07/25 06:24:20 -0700

When applying your patch to the generator bundle (and revert to use `fgets`), I get "RuntimeException: Aborted" exceptions.

---------------------------------------------------------------------------

by lenar at 2011/07/25 06:35:08 -0700

With d326f89 added + lenar/SensioGeneratorBundle@6ff3f26 I can successfully run every test in that file.

---------------------------------------------------------------------------

by fabpot at 2011/07/26 23:31:36 -0700

@lenar: not for me. I have many 'Aborted' exception on my Mac.

---------------------------------------------------------------------------

by fabpot at 2011/07/26 23:41:18 -0700

And I have the exact same errors on Linux:

    There were 7 errors:

    1) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateBundleCommandTest::testInteractiveCommand with data set #0 (array('/tmp'), 'Foo/BarBundle
    ', array('Foo\\BarBundle', 'FooBarBundle', '/tmp/', 'annotation', false))
    RuntimeException: Aborted

    .../Symfony/Component/Console/Helper/DialogHelper.php:40
    .../Symfony/Component/Console/Helper/DialogHelper.php:97
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php:165
    .../Symfony/Component/Console/Command/Command.php:205
    .../Symfony/Component/Console/Tester/CommandTester.php:66
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php:39

    2) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateBundleCommandTest::testInteractiveCommand with data set #1 (array('/tmp'), 'Foo/BarBundle
    BarBundle
    foo
    yml
    n', array('Foo\\BarBundle', 'BarBundle', 'foo/', 'yml', false))
    RuntimeException: Aborted

    .../Symfony/Component/Console/Helper/DialogHelper.php:40
    .../Symfony/Component/Console/Helper/DialogHelper.php:62
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php:83
    .../Symfony/Component/Console/Command/Command.php:214
    .../Symfony/Component/Console/Tester/CommandTester.php:66
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php:39

    3) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateBundleCommandTest::testInteractiveCommand with data set #2 (array('/tmp', 'yml', 'BarBundle', true), 'Foo/BarBundle
    ', array('Foo\\BarBundle', 'BarBundle', '/tmp/', 'yml', true))
    RuntimeException: Aborted

    .../Symfony/Component/Console/Helper/DialogHelper.php:40
    .../Symfony/Component/Console/Helper/DialogHelper.php:97
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php:165
    .../Symfony/Component/Console/Command/Command.php:205
    .../Symfony/Component/Console/Tester/CommandTester.php:66
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php:39

    4) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateDoctrineEntityCommandTest::testInteractiveCommand with data set #0 (array(), 'AcmeBlogBundle:Blog/Post
    ', array('Blog\\Post', 'annotation', array()))
    RuntimeException: Aborted

    .../Symfony/Component/Console/Helper/DialogHelper.php:40
    .../Symfony/Component/Console/Helper/DialogHelper.php:97
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php:145
    .../Symfony/Component/Console/Command/Command.php:205
    .../Symfony/Component/Console/Tester/CommandTester.php:66
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php:39

    5) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateDoctrineEntityCommandTest::testInteractiveCommand with data set #1 (array('AcmeBlogBundle:Blog/Post'), '', array('Blog\\Post', 'annotation', array()))
    RuntimeException: Aborted

    .../Symfony/Component/Console/Helper/DialogHelper.php:40
    .../Symfony/Component/Console/Helper/DialogHelper.php:97
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php:121
    .../Symfony/Component/Console/Command/Command.php:205
    .../Symfony/Component/Console/Tester/CommandTester.php:66
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php:39

    6) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateDoctrineEntityCommandTest::testInteractiveCommand with data set #2 (array(), 'AcmeBlogBundle:Blog/Post
    yml

    ', array('Blog\\Post', 'yml', array()))
    RuntimeException: Aborted

    .../Symfony/Component/Console/Helper/DialogHelper.php:40
    .../Symfony/Component/Console/Helper/DialogHelper.php:62
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php:153
    .../Symfony/Component/Console/Command/Command.php:205
    .../Symfony/Component/Console/Tester/CommandTester.php:66
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php:39

    7) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateDoctrineEntityCommandTest::testInteractiveCommand with data set #3 (array(), 'AcmeBlogBundle:Blog/Post
    yml
    title

    255
    description
    text

    ', array('Blog\\Post', 'yml', array(array('title', 'string', 255), array('description', 'text'))))
    RuntimeException: Aborted

    .../Symfony/Component/Console/Helper/DialogHelper.php:40
    .../Symfony/Component/Console/Helper/DialogHelper.php:62
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php:153
    .../Symfony/Component/Console/Command/Command.php:205
    .../Symfony/Component/Console/Tester/CommandTester.php:66
    .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php:39

---------------------------------------------------------------------------

by lenar at 2011/07/26 23:56:46 -0700

@fabpot: and you modified all those tests? I only modified ```Tests/Command/GenerateDoctrineCrudCommandTest.php```
and that doesn't fail as I see from your log. I just provided example, though I could add necessary changes for other tests too.

---------------------------------------------------------------------------

by fabpot at 2011/07/27 00:09:32 -0700

@lenar: ah, sorry about that. Then, can you provide a fix for all the other tests too? Thanks a lot.

---------------------------------------------------------------------------

by lenar at 2011/07/27 00:22:54 -0700

@fabpot: actually what do you think about this kind of fix instead for tests: lenar/SensioGeneratorBundle@517f263cb01ea2ea1ef2 instead my previous proposal (lenar/SensioGeneratorBundle@6ff3f26). Really simple, short and effective.

---------------------------------------------------------------------------

by fabpot at 2011/07/27 00:37:51 -0700

@lenar: looks good to me. Can you create a PR?

---------------------------------------------------------------------------

by lenar at 2011/07/27 00:45:36 -0700

@fabpot: sensiolabs/SensioGeneratorBundle#60
fabpot added a commit that referenced this pull request Nov 9, 2011
Commits
-------

d974a4a Merge pull request #4 from stealth35/test_mo_loader
cf05646 delete useless tests
19f9de9 [Translation] fix gettext tests
965f2bf Merge pull request #3 from stealth35/test_mo_loader
9c2a26d [Translation] add Mo loader tests
9af2342 [Translation] Added the gettext loaders

Discussion
----------

[Translation] Added the gettext loaders

This is the squashed version of the work done by @xaav in #634.

@stealth35 you said you will work on the dumpers. do you have some stuff on it ?

---------------------------------------------------------------------------

by drak at 2011/10/24 19:28:43 -0700

Is there any more progress with this?

---------------------------------------------------------------------------

by stealth35 at 2011/10/25 00:57:19 -0700

I work on the dumpers, but the Po loader is wrong, caus' the Po ressource can be multiline,

     msgid ""
     "Here is an example of how one might continue a very long string\n"
     "for the common case the string represents multi-line output.\n"

http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files

Anyway the Po format is an intermediate format to Mo file, (like .txt to .res file for ICU), IMO we can just support the real gettext format : Mo

---------------------------------------------------------------------------

by stealth35 at 2011/11/03 02:00:24 -0700

@stof The MO Dumper is ready (stealth35/symfony@f2d1d5b), should we keep the PO format ?

---------------------------------------------------------------------------

by fabpot at 2011/11/07 08:50:59 -0800

@stealth35: The PO is what people will use for their translations. They will then dump it to MO. So, we need both PO and MO loaders and dumpers.

---------------------------------------------------------------------------

by stealth35 at 2011/11/08 01:25:39 -0800

@fabpot, I'm ready for both dumpers, you can merge this, and I'll open a PR for the dumpers

---------------------------------------------------------------------------

by fabpot at 2011/11/08 22:37:47 -0800

I've just had a look at this PR code again and I see that the unit tests are pretty slim. Is it possible to add some tests for the mo loader?

---------------------------------------------------------------------------

by stealth35 at 2011/11/09 01:15:25 -0800

@fabpot test send to @stof ✌️

---------------------------------------------------------------------------

by stof at 2011/11/09 02:22:55 -0800

and merged in this branch

---------------------------------------------------------------------------

by fabpot at 2011/11/09 02:39:09 -0800

The tests do not pass for me:

    There was 1 error:

    1) Symfony\Tests\Component\Translation\Loader\MoFileLoaderTest::testLoadDoesNothingIfEmpty
    InvalidArgumentException: MO stream content has an invalid format.

    /Users/fabien/work/symfony/git/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php:79
    /Users/fabien/work/symfony/git/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php:46
    /Users/fabien/work/symfony/git/symfony/tests/Symfony/Tests/Component/Translation/Loader/MoFileLoaderTest.php:34

    --

    There was 1 failure:

    1) Symfony\Tests\Component\Translation\Loader\PoFileLoaderTest::testLoad
    Failed asserting that two arrays are equal.
    --- Expected
    +++ Actual
    @@ @@
     Array (
    -    'foo' => 'bar'
     )

    /Users/fabien/work/symfony/git/symfony/tests/Symfony/Tests/Component/Translation/Loader/PoFileLoaderTest.php:25
homer6 pushed a commit to homer6/symfony that referenced this pull request Nov 9, 2011
fabpot pushed a commit that referenced this pull request Dec 15, 2012
fix typos in PhpMatcherDumper
fabpot added a commit that referenced this pull request Dec 15, 2012
This PR was merged into the master branch.

Commits
-------

c84907b Merge pull request #3 from Tobion/patch-5
9ab5e4f fix typos in PhpMatcherDumper
60eeacd Fixed typos
4a073e6 [Form] Fixed duplicate case expression

Discussion
----------

Fixed Typos

---------------------------------------------------------------------------

by Tobion at 2012-12-14T22:51:05Z

:+1: Thanks for fixing some of my typos.
@pborreli see pborreli/symfony#3
dawehner pushed a commit to dawehner/symfony that referenced this pull request Jul 1, 2013
fabpot added a commit that referenced this pull request Dec 12, 2014
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #12453).

Discussion
----------

[Debug] Show only unique class candidates

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

```
PHPUnit 4.3.5 by Sebastian Bergmann.

Configuration read from .../symfony/phpunit.xml.dist

S....S.............................FFFS.......

Time: 2.29 seconds, Memory: 8.50Mb

There were 3 failures:

1) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #2 (array(1, 12, 'foo.php', 'Class \'UndefinedFunctionException\' not found'), 'Attempted to load class "UndefinedFunctionException" from the global namespace.
Did you forget a "use" statement for "Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException"?')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 Attempted to load class "UndefinedFunctionException" from the global namespace.
-Did you forget a "use" statement for "Symfony\Component\Debug\Exception\UndefinedFunctionException"?
+Did you forget a "use" statement for e.g. "Symfony\Component\Debug\Exception\UndefinedFunctionException" or "Symfony\Component\Debug\Exception\UndefinedFunctionException"?

.../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28

2) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #3 (array(1, 12, 'foo.php', 'Class \'PEARClass\' not found'), 'Attempted to load class "PEARClass" from the global namespace.
Did you forget a "use" statement for "Symfony_Component_Debug_Tests_Fixtures_PEARClass"?')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 Attempted to load class "PEARClass" from the global namespace.
-Did you forget a "use" statement for "Symfony_Component_Debug_Tests_Fixtures_PEARClass"?
+Did you forget a "use" statement for e.g. "Symfony_Component_Debug_Tests_Fixtures_PEARClass" or "Symfony_Component_Debug_Tests_Fixtures_PEARClass"?

.../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28

3) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #4 (array(1, 12, 'foo.php', 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found'), 'Attempted to load class "UndefinedFunctionException" from namespace "Foo\\Bar".
Did you forget a "use" statement for "Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException"?')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 Attempted to load class "UndefinedFunctionException" from namespace "Foo\Bar".
-Did you forget a "use" statement for "Symfony\Component\Debug\Exception\UndefinedFunctionException"?
+Did you forget a "use" statement for e.g. "Symfony\Component\Debug\Exception\UndefinedFunctionException" or "Symfony\Component\Debug\Exception\UndefinedFunctionException"?

.../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28
```

Commits
-------

db8a3ae [Debug] Show only unique class candidates
nicolas-grekas added a commit that referenced this pull request Apr 22, 2015
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Added support for SplFileInfo

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Before:
```
SplFileInfo {#3}
```

After:
```
SplFileInfo {#3
  path: "/home/greg/dev/github.com/lyrixx/gaga-photo/fixtures"
  filename: "grisou.jpg"
  basename: "grisou.jpg"
  pathname: "/home/greg/dev/github.com/lyrixx/gaga-photo/fixtures/grisou.jpg"
  extension: "jpg"
  realPath: "/home/greg/dev/github.com/lyrixx/gaga-photo/fixtures/grisou.jpg"
  aTime: 2015-04-20 23:21:15
  mTime: 2014-08-17 15:37:36
  cTime: 2015-04-20 23:09:51
  inode: 12197643
  size: 966553
  perms: 0100750
  owner: 1000
  group: 1000
  type: "file"
  writable: true
  readable: true
  executable: true
  file: true
  dir: false
  link: false
}
```

For a link:

```
SplFileInfo {#3
  path: ""
  filename: "link"
  basename: "link"
  pathname: "link"
  extension: ""
  realPath: "/home/greg/dev/github.com/symfony/var-dumper/composer.json"
  aTime: 2015-04-20 23:39:15
  mTime: 2015-04-20 23:39:15
  cTime: 2015-04-20 23:39:15
  inode: 11272232
  size: 967
  perms: 0100644
  owner: 1000
  group: 1000
  type: "link"
  writable: true
  readable: true
  executable: false
  file: true
  dir: false
  link: true
  linkTarget: "composer.json"
}
```

For a remote file:

```
SplFileInfo {#3
  path: "http://google.com"
  filename: "foobar.php"
  basename: "foobar.php"
  pathname: "http://google.com/foobar.php"
  extension: "php"
  realPath: false
  writable: false
  readable: false
  executable: false
  file: false
  dir: false
  link: false
}
```

For a CSV:
```
SplFileObject {#3
  path: ""
  filename: "test.csv"
  basename: "test.csv"
  pathname: "test.csv"
  extension: "csv"
  realPath: "/home/greg/dev/github.com/symfony/var-dumper/test.csv"
  aTime: 2015-04-21 12:55:07
  mTime: 2015-04-21 12:55:07
  cTime: 2015-04-21 12:55:07
  inode: 11272237
  size: 0
  perms: 0100644
  owner: 1000
  group: 1000
  type: "file"
  writable: true
  readable: true
  executable: false
  file: true
  dir: false
  link: false
  csvControl: array:2 [
    0 => ","
    1 => """
  ]
  flags: SKIP_EMPTY|READ_CSV
  maxLineLen: 0
  fstat: array:7 [
    "dev" => 64513
    "ino" => 11272237
    "nlink" => 1
    "rdev" => 0
    "blksize" => 4096
    "blocks" => 0
    "…" => "…20"
  ]
  eof: false
  key: 0
}

Commits
-------

e75c233 [VarDumper] Added support for SplFileObject
eb50b13 [VarDumper] Added support for SplFileInfo
dunglas referenced this pull request in dunglas/symfony Sep 21, 2015
Fix not recommended or operator
nicolas-grekas added a commit that referenced this pull request Nov 27, 2015
…ion on-demand (nicolas-grekas)

This PR was merged into the 2.8 branch.

Discussion
----------

[Bridge\PhpUnit] Display the stack trace of a deprecation on-demand

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR has been essential into making #16708, and I think everyone working on a 3.0 migration will need this.

Example:

```
$ SYMFONY_DEPRECATIONS_HELPER=/FormExtensionBootstrap3LayoutTest/ ./phpunit src/Symfony/Bridge/Twig/
PHPUnit 4.8.18 by Sebastian Bergmann and contributors.

Testing src/Symfony/Bridge/Twig/
................................................
Remaining deprecation triggered by Symfony\Bridge\Twig\Tests\Extension\FormExtensionBootstrap3LayoutTest::testSingleChoiceGrouped:
The value "false" for the "choices_as_values" option is deprecated since version 2.8 and will not be supported anymore in 3.0. Set this option to "true" and flip the contents of the "choices" option instead.
Stack trace:
#0 src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php(286): trigger_error()
#1 src/Symfony/Component/OptionsResolver/OptionsResolver.php(962): Symfony\Component\Form\Extension\Core\Type\ChoiceType->Symfony\Component\Form\Extension\Core\Type\{closure}()
#2 src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php(277): Symfony\Component\OptionsResolver\OptionsResolver->offsetGet()
#3 src/Symfony/Component/OptionsResolver/OptionsResolver.php(962): Symfony\Component\Form\Extension\Core\Type\ChoiceType->Symfony\Component\Form\Extension\Core\Type\{closure}()
#4 src/Symfony/Component/OptionsResolver/OptionsResolver.php(791): Symfony\Component\OptionsResolver\OptionsResolver->offsetGet()
#5 src/Symfony/Component/Form/ResolvedFormType.php(156): Symfony\Component\OptionsResolver\OptionsResolver->resolve()
#6 src/Symfony/Component/Form/FormFactory.php(119): Symfony\Component\Form\ResolvedFormType->createBuilder()
#7 src/Symfony/Component/Form/FormFactory.php(48): Symfony\Component\Form\FormFactory->createNamedBuilder()
#8 src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php(540): Symfony\Component\Form\FormFactory->createNamed()
#9 [internal function]: Symfony\Component\Form\Tests\AbstractBootstrap3LayoutTest->testSingleChoiceGrouped()
#10 {main}
KO src/Symfony/Bridge/Twig/
```

Commits
-------

5a88fb6 [Bridge\PhpUnit] Display the stack trace of a deprecation on-demand
@prestonfakeaccount
Copy link

Hi!

your pull request description seems to be incomplete or malformed:

  • The description shouldn't be empty.
  • The type should be one of: new feature, improvement, bug fix.

Would you mind to complete the contribution table ? This help us understand how interesting is your contribution.

Thank you!

(note: this is an automated message, but answering it will reach a real human )

1 similar comment
@prestonfakeaccount
Copy link

Hi!

your pull request description seems to be incomplete or malformed:

  • The description shouldn't be empty.
  • The type should be one of: new feature, improvement, bug fix.

Would you mind to complete the contribution table ? This help us understand how interesting is your contribution.

Thank you!

(note: this is an automated message, but answering it will reach a real human )

@stof
Copy link
Member

stof commented Jun 7, 2016

@prestonfakeaccount please don't use the Symfony repository to test your bot

@mickaelandrieu
Copy link
Contributor

@stof very sorry about it, it was really unexpected :/ It won't happen

HeahDude referenced this pull request in symfony-tools/carsonbot Jun 12, 2016
fabpot added a commit that referenced this pull request Jan 22, 2017
…utowired classes (brainexe)

This PR was squashed before being merged into the 3.1 branch (closes #21372).

Discussion
----------

[DependencyInjection] Fixed variadic method parameter in autowired classes

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | --
| License       | MIT

Autowiring classes containing methods with variadic method parameter throws a ReflectionException in compile process:

```
PHP Fatal error:  Uncaught ReflectionException: Internal error: Failed to retrieve the default value in /.../vendor/symfony/dependency-injection/Compiler/AutowirePass.php:437
Stack trace:
#0 /.../vendor/symfony/dependency-injection/Compiler/AutowirePass.php(437): ReflectionParameter->getDefaultValue()
#1 /.../vendor/symfony/dependency-injection/Compiler/AutowirePass.php(80): Symfony\Component\DependencyInjection\Compiler\AutowirePass::getResourceMetadataForMethod(Object(ReflectionMethod))
#2 /.../vendor/symfony/dependency-injection/Compiler/AutowirePass.php(105): Symfony\Component\DependencyInjection\Compiler\AutowirePass::createResourceForClass(Object(ReflectionClass))
#3 /.../vendor/symfony/dependency-injection/Compiler/AutowirePass.php(48): Symfony\Component\DependencyInjection\Compiler\AutowirePass->completeDefinition('__controller.Sw...', Object(Symfony\Component\DependencyInjection\Definition), Array)
#4 /.../vendor/symfony/dependency-injection/Compiler/Compiler in /.../vendor/symfony/dependency-injection/Compiler/AutowirePass.php on line 437
```

**Example:**
```
<?php
class FooVariadic
{
    public function bar(...$arguments)
    {
    }
}

$method = new ReflectionMethod(FooVariadic::class, 'bar');
$parameter = $method->getParameters()[0];
$parameter->getDefaultValue(); // -> ReflectionException: Internal error: Failed to retrieve the default value in ...
```

Commits
-------

a7f63de [DependencyInjection] Fixed variadic method parameter in autowired classes
fabpot added a commit that referenced this pull request Apr 29, 2021
…insensitive (javiereguiluz)

This PR was merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] Make debug:event-dispatcher search case insensitive

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

I was playing with the new features of `debug:event-dispatcher` and I thought that making the new search feature case insensitive could be better:

### Before

```
$ php bin/console debug:event-dispatcher mailer

 [WARNING] The event "mailer" does not have any registered listeners.
```

### After

```
$ php bin/console debug:event-dispatcher mailer

Registered Listeners of Event Dispatcher "debug.event_dispatcher" for "Symfony\Component\Mailer\Event\MessageEvent" Event
=========================================================================================================================

 ------- --------------------------------------------------------------------------- ----------
  Order   Callable                                                                    Priority
 ------- --------------------------------------------------------------------------- ----------
  #1      Symfony\Component\Mailer\EventListener\MessageListener::onMessage()         0
  #2      Symfony\Component\Mailer\EventListener\EnvelopeListener::onMessage()        -255
  #3      Symfony\Component\Mailer\EventListener\MessageLoggerListener::onMessage()   -255
 ------- --------------------------------------------------------------------------- ----------
```

Commits
-------

1e4c7d9 [FrameworkBundle] Make debug:event-dispatcher search case insensitive
nicolas-grekas added a commit that referenced this pull request Jan 24, 2022
…ce (Seldaek)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Process] Avoid calling fclose on an already closed resource

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

I got this in Composer while interrupting an install process with Ctrl-C.

```
PHP Fatal error:  Uncaught TypeError: fclose(): supplied resource is not a valid stream resource in /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php:50
Stack trace:
#0 /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php(50): fclose()
#1 /var/www/composer/vendor/symfony/process/Pipes/UnixPipes.php(50): Symfony\Component\Process\Pipes\AbstractPipes->close()
#2 [internal function]: Symfony\Component\Process\Pipes\UnixPipes->__destruct()
#3 {main}
  thrown in /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php on line 50
```

I am assuming it's due to a process which was not closed properly, which is very likely given we run a bunch of them concurrently.. It's pretty hard to debug as it's also hard to reproduce, so I am not sure what to do except handle this case gracefully in the close/__destruct function and hope that at least lets it clean up processes without crashing this way.

Commits
-------

a9e43a7 [Process] Avoid calling fclose on an already closed resource
ogizanagi added a commit that referenced this pull request Jun 6, 2022
Prevents:

> Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

on `getDefaultName()` returning `null`
HypeMC added a commit to HypeMC/symfony that referenced this pull request Jun 7, 2022
str_replace(): Passing null to parameter symfony#3 ($subject) of type array|string is deprecated
HypeMC added a commit to HypeMC/symfony that referenced this pull request Jun 7, 2022
str_replace(): Passing null to parameter symfony#3 ($subject) of type array|string is deprecated
fabpot added a commit that referenced this pull request Jun 7, 2022
This PR was merged into the 5.4 branch.

Discussion
----------

[Console] Fix deprecation when description is null

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Fixes `str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated` when `getDefaultDescription()` returns `null`, caused by #46574.

Commits
-------

7a08b52 [Console] Fix deprecation when description is null
fabpot pushed a commit that referenced this pull request Jul 20, 2022
Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
fabpot added a commit that referenced this pull request Jul 20, 2022
…usse, nicolas-grekas)

This PR was merged into the 6.2 branch.

Discussion
----------

[DoctrineBridge] Add an Entity Argument Resolver

| Q             | A
| ------------- | ---
| Branch?       | 6.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | part of #40333
| License       | MIT
| Doc PR        | todo

This PR provides an Argument Resolver for Doctrine entities.

This would replace the SensioFramework's DoctrineParamConverter (in fact most of the code is copy/pasted from here) and helps users to disable the paramConverter and fix the related issue.

usage:
```yaml
sensio_framework_extra:
    request:
        converters: false
services:
    Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver: ~
```

```php
#[Route('/blog/{slug}')]
public function show(Post $post)
{
}
```

or with custom options
```php
#[Route('/blog/{id}')]
public function show(
  #[MapEntity(entityManager: 'foo', expr: 'repository.findNotDeletedById(id)')]
  Post $post
)
{
}
```

Commits
-------

5a3df5e Improve EntityValueResolver (#3)
4524083 Add an Entity Argument Resolver
chalasr added a commit that referenced this pull request Nov 30, 2022
…Stan (ogizanagi)

This PR was merged into the 6.2 branch.

Discussion
----------

[Console] Fix `OutputInterface` options int-mask for PHPStan

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | N/A <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT
| Doc PR        | N/A

When upgrading an application to 6.2, I encountered this issue with PHPStan:

```shell
 ------ -------------------------------------------------------------------------------------------------------
  Line   Pilot/Runner/Output/MultiplexingOutput.php
 ------ -------------------------------------------------------------------------------------------------------
  79     Default value of the parameter #3 $options (0) of method
         App\Pilot\Runner\Output\MultiplexingOutput::write() is incompatible with type 1|2|4|16|32|64|128|256.
 ------ -------------------------------------------------------------------------------------------------------
```

The `MultiplexingOutput` implements the `OutputInterface` and defined `0` as the default value for `$options`:

```php
    public function write(string|iterable $messages, bool $newline = false, int $options = 0): void
```

as defined by the interface:

https://github.com/symfony/symfony/blob/69f46f231b16be1bce1e2ecfa7f9a1fb192cda22/src/Symfony/Component/Console/Output/OutputInterface.php#L40

When trying to use `self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL` as default value:

```shell
 ------ -------------------------------------------------------------------------------------------------------
  Line   Pilot/Runner/Output/MultiplexingOutput.php
 ------ -------------------------------------------------------------------------------------------------------
  79     Default value of the parameter #3 $options (33) of method
         App\Pilot\Runner\Output\MultiplexingOutput::write() is incompatible with type 1|2|4|16|32|64|128|256.
 ------ -------------------------------------------------------------------------------------------------------
```

Or simply using `Output::write()` with specific options:

```shell
 ------ -------------------------------------------------------------------------------------------------------
  Line   Pilot/Runner/Output/MultiplexingOutput.php
 ------ -------------------------------------------------------------------------------------------------------
  81     Parameter #3 $options of method Symfony\Component\Console\Output\Output::write() expects
         1|2|4|16|32|64|128|256, 33 given.
 ------ -------------------------------------------------------------------------------------------------------
```

Using PHPStan's [`int-mask-of`](https://phpstan.org/writing-php-code/phpdoc-types#integer-masks) is the solution for this, and allows by nature the `0` value.
It was even used [at some point](#47016 (comment)), but reverted to use `self::VERBOSITY_*|self::OUTPUT_*`. However, it does not behave as expected for masks.

So, either we use `int-mask-of`, or we revert to `int`?

Commits
-------

304a17a [Console] Fix OutputInterface options int-mask for PhpStan
nicolas-grekas added a commit that referenced this pull request Dec 13, 2022
This PR was merged into the 6.2 branch.

Discussion
----------

[HttpKernel] Fix `CacheAttributeListener` priority

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Currently the `CacheAttributeListener` & the `IsGrantedAttributeListener` have the same priority:

```
Registered Listeners for "kernel.controller_arguments" Event
============================================================

 ------- --------------------------------------------------------------------------------------------------------- ----------
  Order   Callable                                                                                                  Priority
 ------- --------------------------------------------------------------------------------------------------------- ----------
  #1      Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments()          10
  #2      Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments()   10
  #3      Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments()                         0
 ------- --------------------------------------------------------------------------------------------------------- ----------
```

Since the `CacheAttributeListener` is alphabetically first, it's first to get triggered. This can cause an unauthenticated user to receive a 304 Not modified instead of a 302 Redirect, resulting in the user seeing some stale content from when they were authenticated instead of getting redirected to the login page.

This PR changes the priority of the `CacheAttributeListener` to be lower than that of the `IsGrantedAttributeListener`.

Commits
-------

90eb89f [HttpKernel] Fix CacheAttributeListener priority
@remco-pc remco-pc mentioned this pull request Jun 16, 2023
derrabus pushed a commit to derrabus/symfony that referenced this pull request Jul 25, 2023
This PR was squashed before being merged into the 1.2-dev branch.

Discussion
----------

Add support for streamed Symfony request

As a continuation of symfony#3 and symfony#50 . Add support for converting a `ServerRequestInterface` with a large body to a Symfony request.

I'm not all too familiar with Symfony components, but I saw that a Symfony request supports `string|resource|null` as its body. Since calling `detach()` on a `StreamInterface` will make the stream unsuable I added a `$streamed` argument to the function in order to not make break any existing code, and to make it a conscious decision of the caller to stream the response.

I'm happy to make any necessary changes if needed.

Commits
-------

df26630 Add support for streamed Symfony request
nicolas-grekas added a commit that referenced this pull request Jan 29, 2024
…om socket (xdanik)

This PR was merged into the 5.4 branch.

Discussion
----------

[Mailer] Throw `TransportException` when unable to read from socket

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? |no
| Issues        | None
| License       | MIT

We are seeing error `fgets(): SSL: Connection reset by peer` multiple times a day from connection to Office 365 SMTP server (smtp.office365.com:587).
It's certainly related to some kind of timeout as we are sending emails from long running queue dispatcher and error shows up only occasionally and never with the first message. We are not seeing this issue with any other SMTP server, but we have not tested much past smtp.mandrillapp.com and local MailHog.

We have tried adjusting the `$pingThreshold` and `$restartThreshold` options, but without much success (well `$restartThreshold = 1` resolves the issue, but it also forces the transport to close connection after each message).

Stack trace:
```
#0 /var/www/vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php(77): fgets(Resource(stream))
#1 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(315): Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream->readLine()
#2 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(181): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->getFullResponse()
#3 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(140): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->executeCommand("RSET
", Array(1))
#4 /var/www/vendor/symfony/mailer/Mailer.php(45): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->send(Object(Symfony\Component\Mime\Email), Null)
#5 (our queue dispatcher): Symfony\Component\Mailer\Mailer->send(Object(Symfony\Component\Mime\Email))
```

App is running on PHP 8.0.28 on Debian Linux x64, Mailer v5.4.22.

I would gladly written some tests for this, but I don't know how to simulate calls to low-level stream functions like fgets.

Commits
-------

44d5b57 [Mailer] Throw TransportException when unable to read from socket
chalasr added a commit that referenced this pull request Mar 5, 2024
…lishing a message. (jwage)

This PR was squashed before being merged into the 6.4 branch.

Discussion
----------

[Messenger] [Amqp] Handle AMQPConnectionException when publishing a message.

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #36538 Fix #48241
| License       | MIT

If you have a message handler that dispatches messages to another queue, you can encounter `AMQPConnectionException` with the message "Library error: a SSL error occurred" or "a socket error occurred"  depending on if you are using tls or not or if you are running behind a load balancer or not.

You can manually reproduce this issue by dispatching a message where the handler then dispatches another message to a different queue, then go to rabbitmq admin and close the connection manually, then dispatch another message and when the message handler goes to dispatch the other message, you will get this exception:

```
a socket error occurred
#0 /vagrant/vendor/symfony/amqp-messenger/Transport/AmqpTransport.php(60): Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpSender->send()
#1 /vagrant/vendor/symfony/messenger/Middleware/SendMessageMiddleware.php(62): Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransport->send()
#2 /vagrant/vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php(34): Symfony\Component\Messenger\Middleware\SendMessageMiddleware->handle()
#3 /vagrant/vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php(61): Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle()
#4 /vagrant/vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php(41): Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle()
#5 /vagrant/vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php(37): Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle()
#6 /vagrant/vendor/symfony/messenger/Middleware/TraceableMiddleware.php(40): Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle()
#7 /vagrant/vendor/symfony/messenger/MessageBus.php(70): Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle()
#8 /vagrant/vendor/symfony/messenger/TraceableMessageBus.php(38): Symfony\Component\Messenger\MessageBus->dispatch()
#9 /vagrant/src/Messenger/MessageBus.php(37): Symfony\Component\Messenger\TraceableMessageBus->dispatch()
#10 /vagrant/vendor/symfony/mailer/Mailer.php(66): App\Messenger\MessageBus->dispatch()
#11 /vagrant/src/Mailer/Mailer.php(83): Symfony\Component\Mailer\Mailer->send()
#12 /vagrant/src/Mailer/Mailer.php(96): App\Mailer\Mailer->send()
#13 /vagrant/src/MessageHandler/Trading/StrategySubscriptionMessageHandler.php(118): App\Mailer\Mailer->sendEmail()
#14 /vagrant/src/MessageHandler/Trading/StrategySubscriptionMessageHandler.php(72): App\MessageHandler\Trading\StrategySubscriptionMessageHandler->handle()
#15 /vagrant/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php(152): App\MessageHandler\Trading\StrategySubscriptionMessageHandler->__invoke()
#16 /vagrant/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php(91): Symfony\Component\Messenger\Middleware\HandleMessageMiddleware->callHandler()
#17 /vagrant/vendor/symfony/messenger/Middleware/SendMessageMiddleware.php(71): Symfony\Component\Messenger\Middleware\HandleMessageMiddleware->handle()
#18 /vagrant/vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php(34): Symfony\Component\Messenger\Middleware\SendMessageMiddleware->handle()
#19 /vagrant/vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php(68): Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle()
#20 /vagrant/vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php(41): Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle()
#21 /vagrant/vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php(37): Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle()
#22 /vagrant/vendor/symfony/messenger/Middleware/TraceableMiddleware.php(40): Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle()
#23 /vagrant/vendor/symfony/messenger/MessageBus.php(70): Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle()
#24 /vagrant/vendor/symfony/messenger/TraceableMessageBus.php(38): Symfony\Component\Messenger\MessageBus->dispatch()
#25 /vagrant/vendor/symfony/messenger/RoutableMessageBus.php(54): Symfony\Component\Messenger\TraceableMessageBus->dispatch()
#26 /vagrant/vendor/symfony/messenger/Worker.php(162): Symfony\Component\Messenger\RoutableMessageBus->dispatch()
#27 /vagrant/vendor/symfony/messenger/Worker.php(109): Symfony\Component\Messenger\Worker->handleMessage()
#28 /vagrant/vendor/symfony/messenger/Command/ConsumeMessagesCommand.php(238): Symfony\Component\Messenger\Worker->run()
#29 /vagrant/vendor/symfony/console/Command/Command.php(326): Symfony\Component\Messenger\Command\ConsumeMessagesCommand->execute()
#30 /vagrant/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()
#31 /vagrant/vendor/symfony/framework-bundle/Console/Application.php(126): Symfony\Component\Console\Application->doRunCommand()
#32 /vagrant/vendor/symfony/console/Application.php(324): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand()
#33 /vagrant/vendor/symfony/framework-bundle/Console/Application.php(80): Symfony\Component\Console\Application->doRun()
#34 /vagrant/vendor/symfony/console/Application.php(175): Symfony\Bundle\FrameworkBundle\Console\Application->doRun()
#35 /vagrant/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php(49): Symfony\Component\Console\Application->run()
#36 /vagrant/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run()
#37 /vagrant/bin/console(11): require_once('...')
#38 {main}
```

TODO:

- [x] Add test for retry logic when publishing messages

Commits
-------

f123370 [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message.
xabbuh added a commit that referenced this pull request Aug 12, 2024
This PR was merged into the 5.4 branch.

Discussion
----------

[Yaml] 🐛 throw ParseException on invalid date

| Q             | A
| ------------- | ---
| Branch?       | 5.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues        | None <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT

(found in symfony-tools/docs-builder#179)

When parsing the following yaml:
```
date: 6418-75-51
```

`symfony/yaml` will throw an exception:
```
$ php main.php
PHP Fatal error:  Uncaught Exception: Failed to parse time string (6418-75-51) at position 6 (5): Unexpected character in /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php:714
Stack trace:
#0 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(714): DateTimeImmutable->__construct()
#1 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(312): Symfony\Component\Yaml\Inline::evaluateScalar()
#2 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(80): Symfony\Component\Yaml\Inline::parseScalar()
#3 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(790): Symfony\Component\Yaml\Inline::parse()
#4 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(341): Symfony\Component\Yaml\Parser->parseValue()
#5 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(86): Symfony\Component\Yaml\Parser->doParse()
#6 /tmp/symfony-yaml/vendor/symfony/yaml/Yaml.php(77): Symfony\Component\Yaml\Parser->parse()
#7 /tmp/symfony-yaml/main.php(8): Symfony\Component\Yaml\Yaml::parse()
#8 {main}
  thrown in /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php on line 714
```

This is because the "month" is invalid. Fixing the "month" will trigger about the same issue because the "day" would be invalid.

With the current change it will throw a `ParseException`.

Commits
-------

6d71a7e 🐛 throw ParseException on invalid date
nicolas-grekas added a commit that referenced this pull request Nov 20, 2024
…row exception (lyrixx)

This PR was merged into the 5.4 branch.

Discussion
----------

[HttpKernel] Ensure `HttpCache::getTraceKey()` does not throw exception

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

We have such logs in our logs. It's in our raw PHP logs. They are not caught by monolog, it's too early

```
[11-Oct-2024 01:23:33 UTC] PHP Fatal error:  Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Invalid method override "__CONSTRUCT". in /var/www/redirection.io/backend/blue/vendor/symfony/http-foundation/Request.php:1234
Stack trace:
#0 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/HttpCache/HttpCache.php(728): Symfony\Component\HttpFoundation\Request->getMethod()
#1 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/HttpCache/HttpCache.php(207): Symfony\Component\HttpKernel\HttpCache\HttpCache->getTraceKey()
#2 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/Kernel.php(188): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
#3 /var/www/redirection.io/backend/blue/web/app.php(9): Symfony\Component\HttpKernel\Kernel->handle()
#4 {main}
  thrown in /var/www/redirection.io/backend/blue/vendor/symfony/http-foundation/Request.php on line 1234

```

I managed to reproduced locally.
* Before the patch, without the http_cache, symfony returns a 405
* After the patch, without the http_cache, symfony returns a 405
* Before the patch, with the http_cache, symfony returns a 500, without any information (too early)
* After the patch, with the http_cache, symfony returns a 405

Commits
-------

a2ebbe0 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants