Commit Graph

41164 Commits

Author SHA1 Message Date
Sander 9fc56c7e28 [Serializer]: AbstractObjectNormalizer ignores the property types of discriminated classes
Add tests

Remove test group

Allow null

Add quux null attribute

Add quux value to serialize test
2019-07-08 09:31:20 +02:00
Fabien Potencier 166502c714 minor #32417 [Intl] Remove --dev from intl compile autoloader (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Remove --dev from intl compile autoloader

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Remove implicit composer default (`jakzal/php-intl` uses latest composer during compile)

Commits
-------

8ffc61692d [Intl] Remove --dev from intl compile autoloader
2019-07-08 08:36:40 +02:00
Fabien Potencier 6a1be4c3c7 minor #32401 [Intl] Init compile tmp volume (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Init compile tmp volume

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Fixes

```
Symfony\Component\Filesystem\Exception\IOException: Failed to create "/tmp/icu-data": mkdir(): Permission denied.
```

if the initial volume does not exists docker creates it as root, but the container runs for the current user.

Commits
-------

5e26d96a6b [Intl] Init compile tmp volume
2019-07-08 08:16:38 +02:00
Fabien Potencier d92c9b8568 bug #32421 [EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service (lyrixx)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead (closes #32421).

Discussion
----------

[EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service

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

In CLI, Symfony leaks because it uses the TraceableEventDispatcher.
Let's make this service resetable.

This PR is related to #32418

---

Side note: Forcing user to use the `ServicesResetter` is IMHO bad for
the DX. I prefer to have something that does not leak by default.
More over, the TraceableEventDispatcher stores some informations for the
profiler. But in CLI it does not make sens, since the tooling does not
exist. I have already fixed such issue for monolog in #30339. I think we
should do the same for the TraceableEventDispatcher.

---

Note: When using #32418 + this PR and with the following code, it does not leak **at all**

<details>
<summary>code</summary>

```php
<?php

namespace App\Command;

use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

class LeakCommand extends Command
{
    protected static $defaultName = 'leak';

    private $dispatcher;
    private $resetter;
    private $logger;

    public function __construct(EventDispatcherInterface $dispatcher, ServicesResetter $resetter, LoggerInterface $logger)
    {
        $this->dispatcher = $dispatcher;
        $this->resetter = $resetter;
        $this->logger = $logger;

        parent::__construct();
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->dispatcher->addListener(MyEvent::class, function ($e) {

        });
        for ($i=0; $i < INF; $i++) {
            $output->writeln(memory_get_usage());

            $this->dispatcher->dispatch(new MyEvent());
            $this->logger->debug('some log');

            // if ($i > 2000) {
            //     meminfo_dump(fopen('/tmp/my_dump_file.json', 'w'));
            //     die;
            // }

            usleep(100);
            $this->resetter->reset();
        }
    }
}

class MyEvent {}

```
</detail>

Commits
-------

5249eaf9d5 [EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service
2019-07-08 08:06:18 +02:00
Grégoire Pineau 5249eaf9d5 [EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service 2019-07-08 08:06:11 +02:00
Fabien Potencier f2d7170d1a minor #32416 [Console] Update inherit and add licence (Simperfit)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Update inherit and add licence

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | none   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | not needed <!-- required for new features -->

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

see https://github.com/symfony/symfony/pull/32318/files#r299561556 it needs to be updated in the lowest branch.

Commits
-------

ff0c14171b [Console] Update to inherit and add licence
2019-07-08 07:42:45 +02:00
Amrouche Hamza ff0c14171b
[Console] Update to inherit and add licence 2019-07-08 07:40:49 +02:00
Roland Franssen 8ffc61692d
[Intl] Remove --dev from intl compile autoloader 2019-07-07 09:15:14 +02:00
Tobias Schultze 52e8523f4a bug #32398 [Messenger] Removes deprecated call to ReflectionType::__toString() on MessengerPass (brunowowk)
This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Removes deprecated call to ReflectionType::__toString() on MessengerPass

Closes #32397

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

Removes deprecated call to ReflectionType::__toString() for 7.4 support

Commits
-------

0c52a531e2 Remove call to deprecated method
2019-07-06 21:00:30 +02:00
Bruno Nogueira Nascimento Wowk 0c52a531e2 Remove call to deprecated method 2019-07-06 14:57:33 -03:00
Roland Franssen 5e26d96a6b [Intl] Init compile tmp volume 2019-07-06 10:17:29 +02:00
Tobias Schultze 6a1bae27d1 fix merge 2019-07-05 22:59:32 +02:00
Tobias Schultze 5cf221707f Merge branch '3.4' into 4.2 2019-07-05 22:53:03 +02:00
Tobias Schultze 8e07e7773f minor #32399 [Messenger] Don't pass objects as class name to ContainerBuilder::register (derrabus)
This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Don't pass objects as class name to ContainerBuilder::register

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

Fixed a broken test that was discovered while working on #32390.

Commits
-------

e110603e5e Don't pass objects as class name to ContainerBuilder::register.
2019-07-05 21:49:02 +02:00
Tobias Schultze ddaf1becf3 minor #32391 [FrameworkBundle] pass default cache lifetime as an integer (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] pass default cache lifetime as an integer

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

Commits
-------

416502df4e pass default cache lifetime as an integer
2019-07-05 21:27:06 +02:00
Alexander M. Turek e110603e5e Don't pass objects as class name to ContainerBuilder::register. 2019-07-05 21:20:21 +02:00
Christian Flothmann 416502df4e pass default cache lifetime as an integer 2019-07-05 12:25:01 +02:00
Robin Chalas 7f4368114c bug #32379 [SecurityBundle] conditionally register services (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] conditionally register services

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

Commits
-------

8fbcdf250e conditionally register services
2019-07-05 11:26:59 +02:00
Nicolas Grekas 44e82520ee Merge branch '3.4' into 4.2
* 3.4:
  [PhpUnitBridge] fix running simple-phpunit on Windows
  fixed phpdocs
2019-07-05 08:33:37 +02:00
Nicolas Grekas d9833ace32 [PhpUnitBridge] fix running simple-phpunit on Windows 2019-07-05 08:33:19 +02:00
Fabien Potencier 77747a9472 fixed phpdocs 2019-07-05 06:54:49 +02:00
Christian Flothmann adcdd938a4 PHP 5 compat 2019-07-04 23:04:55 +02:00
Christian Flothmann 8fbcdf250e conditionally register services 2019-07-04 21:53:41 +02:00
Nicolas Grekas e30800df2c Merge branch '3.4' into 4.2
* 3.4:
  bump phpunit-bridge cache ids
2019-07-04 19:06:45 +02:00
Nicolas Grekas ea34d6dcf5 bump phpunit-bridge cache ids 2019-07-04 19:06:26 +02:00
Nicolas Grekas e0850631fc Merge branch '3.4' into 4.2
* 3.4:
  [Bridge/PhpUnit] fix running composer to install phpunit
2019-07-04 18:09:15 +02:00
Nicolas Grekas af850146a4 [Bridge/PhpUnit] fix running composer to install phpunit 2019-07-04 18:09:01 +02:00
Nicolas Grekas e9852bd9a1 Merge branch '3.4' into 4.2
* 3.4:
  [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
  [FrameworkBundle] reset cache pools between requests
2019-07-04 15:45:20 +02:00
Nicolas Grekas a383649ad7 bug #32363 [FrameworkBundle] reset cache pools between requests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] reset cache pools between requests

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

Looks like we missed this part: cache pools should all be reset between requests, at least to persist any deferred items. Replaces #32361 (which should be applied when merging 3.4 into 4.2).

Commits
-------

5ff45bac66 [FrameworkBundle] reset cache pools between requests
2019-07-04 15:42:09 +02:00
Nicolas Grekas db05791ceb bug #32365 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass

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

Spotted in and needed by #32294

Commits
-------

b06d0003a3 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass
2019-07-04 15:33:02 +02:00
Nicolas Grekas b06d0003a3 [DI] fix processing of regular parameter bags by MergeExtensionConfigurationPass 2019-07-04 11:26:59 +02:00
Nicolas Grekas 5ff45bac66 [FrameworkBundle] reset cache pools between requests 2019-07-04 11:11:41 +02:00
Fabien Potencier 02a25fe518 Merge branch '3.4' into 4.2
* 3.4:
  Fixes windows error
  Annotated correct return type for getInEdges()/getOutEdges().
2019-07-03 19:14:02 +02:00
Fabien Potencier 1dc3b4aaad bug #32187 [PHPUnit] Fixed composer error on Windows (misterx)
This PR was submitted for the 4.3 branch but it was merged into the 3.4 branch instead (closes #32187).

Discussion
----------

[PHPUnit] Fixed composer error on Windows

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets | #31750
| License       | MIT

Fixes bug when composer runs  from bat file that described in PATH env.

Commits
-------

1f8927a9a6 Fixes windows error
2019-07-03 19:13:30 +02:00
misterx 1f8927a9a6 Fixes windows error 2019-07-03 19:13:23 +02:00
Fabien Potencier c33c396a63 bug #32299 [Lock] Stores must implement `putOffExpiration` (jderusse)
This PR was merged into the 4.2 branch.

Discussion
----------

[Lock] Stores must implement `putOffExpiration`

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

Following https://github.com/symfony/symfony/pull/32198#pullrequestreview-256165051 every stores MUST implement the method `putOffExpiration` either by ignoring the arguments (by design they lock forever) or using a mechanism to define the expiration.

It was a mistake to add the dockblock `@throws NotSupportedException` tell me if it's a BC break, I'll create a dedicated PR for it.

Commits
-------

c986c86d1c [Lock] Stores must implement `putOffExpiration`
2019-07-03 18:27:50 +02:00
Fabien Potencier 927a3341c0 minor #32281 [DependencyInjection] Annotated correct return type for getInEdges()/getOutEdges() (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[DependencyInjection] Annotated correct return type for getInEdges()/getOutEdges()

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

This changed annotation was quite helpful when analyzing `PhpDumper` for #32266.

Commits
-------

28882f52cb Annotated correct return type for getInEdges()/getOutEdges().
2019-07-03 15:17:20 +02:00
Fabien Potencier 34c50c0963 minor #32306 [DependencyInjection] Removed unused field (derrabus)
This PR was merged into the 4.2 branch.

Discussion
----------

[DependencyInjection] Removed unused field

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

A minor issue I discovered while analyzing the DI component for #32238: `AnalyzeServiceReferencesPass` defines a private field `$expressionLanguage` that is not used.

Commits
-------

58651409b4 Removed unused field.
2019-07-03 14:39:02 +02:00
Tobias Schultze 44fa22056f Merge branch '3.4' into 4.2 2019-07-02 15:59:44 +02:00
Tobias Schultze b5cd483430 minor #32297 fix invalid call to PhpFileLoader::load() in a test (Tobion)
This PR was merged into the 3.4 branch.

Discussion
----------

fix invalid call to PhpFileLoader::load() in a test

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

#32288 for 3.4

Commits
-------

a03b5d8089 fix invalid call to PhpFileLoader::load() in a test
2019-07-02 15:46:01 +02:00
Maxime Steinhausser 26048bc498 minor #32046 [FrameworkBundle] Unconditionally register the DateIntervalNormalizer (ogizanagi)
This PR was merged into the 4.2 branch.

Discussion
----------

[FrameworkBundle] Unconditionally register the DateIntervalNormalizer

| Q             | A
| ------------- | ---
| Branch?       | 4.2 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Fwb conflicts with serializer <4.2 37fa45bbd1/src/Symfony/Bundle/FrameworkBundle/composer.json (L74)

so we can remove this obsolete condition from the extension (DateIntervalNormalizer exists since 3.4).

Commits
-------

c7cc780373 [FrameworkBundle] Unconditionally register the DateIntervalNormalizer
2019-07-01 17:04:24 +02:00
Alexander M. Turek 58651409b4 Removed unused field. 2019-07-01 14:42:30 +02:00
Jérémy Derussé c986c86d1c
[Lock] Stores must implement `putOffExpiration` 2019-07-01 09:24:46 +02:00
Tobias Schultze a03b5d8089 fix invalid call to PhpFileLoader::load() in a test 2019-07-01 01:07:21 +02:00
Alex Bowers 6c49a0c758 Add test case 2019-06-30 23:48:04 +01:00
Fabien Potencier 081c601243 minor #32257 [Security] [Guard] Removed useless param annotations (thomasbisignani)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] [Guard] Removed useless param annotations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/32254#issuecomment-506719957
| License       | MIT
| Doc PR        |

The PR removes useless `@param` annotation, it is linked with the https://github.com/symfony/symfony/pull/32254#issuecomment-506719957

Commits
-------

848e881d5d [Security] [Guard] Removed useless param annotations
2019-06-30 15:25:31 +02:00
Thomas Bisignani 848e881d5d [Security] [Guard] Removed useless param annotations 2019-06-30 11:22:15 +02:00
Alexander M. Turek 28882f52cb Annotated correct return type for getInEdges()/getOutEdges(). 2019-06-29 18:43:59 +02:00
Fabien Potencier 6eeec6506c minor #32268 [FrameworkBundle] better message for disabled sessions (Tobion)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] better message for disabled sessions

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32215
| License       | MIT
| Doc PR        |

Use correct exception class and make the message consistent with all the other exception messages in the FrameworkExtension.

Commits
-------

b3e3247557 [FrameworkBundle] better message for disabled sessions
2019-06-29 08:20:53 +02:00
Tobias Schultze b3e3247557 [FrameworkBundle] better message for disabled sessions 2019-06-28 18:44:52 +02:00