Commit Graph

47720 Commits

Author SHA1 Message Date
Diogo Peralta Cordeiro c1e604a2dc
[HttpFoundation] File: Add settable permissions and adopt stricter defaults 2022-01-20 13:05:19 +00:00
Nicolas Grekas 2c91390bce Merge branch '5.4' into 6.0
* 5.4:
  [VarDumper] fix tests
2022-01-17 17:30:44 +01:00
Nicolas Grekas 6cf0ee2cd4 Merge branch '5.3' into 5.4
* 5.3:
  [VarDumper] fix tests
2022-01-17 17:30:37 +01:00
Nicolas Grekas 7578cfa4a8 [VarDumper] fix tests 2022-01-17 17:28:15 +01:00
Nicolas Grekas c44b9fc1f9 Merge branch '5.4' into 6.0
* 5.4:
  [Cache] fix tests with RedisArray
2022-01-17 17:16:34 +01:00
Nicolas Grekas 8c83ae595b Merge branch '5.3' into 5.4
* 5.3:
  [Cache] fix tests with RedisArray
2022-01-17 17:16:19 +01:00
Nicolas Grekas b778acc083 Merge branch '4.4' into 5.3
* 4.4:
  [Cache] fix tests with RedisArray
2022-01-17 17:15:49 +01:00
Nicolas Grekas c0879ecd65 [Cache] fix tests with RedisArray 2022-01-17 17:11:43 +01:00
Nicolas Grekas adc8a55bad Merge branch '5.4' into 6.0
* 5.4:
  [HttpClient] fix resetting DNS/etc when calling CurlHttpClient::reset()
  Fix invalid guess with enumType
  [HttpClient] Remove deprecated usage of GuzzleHttp\Promise\promise_for
2022-01-17 11:54:40 +01:00
Nicolas Grekas a4d5fb87c5 Merge branch '5.3' into 5.4
* 5.3:
  [HttpClient] fix resetting DNS/etc when calling CurlHttpClient::reset()
  Fix invalid guess with enumType
  [HttpClient] Remove deprecated usage of GuzzleHttp\Promise\promise_for
2022-01-17 11:51:41 +01:00
Nicolas Grekas 54df0f7b78 Merge branch '4.4' into 5.3
* 4.4:
  [HttpClient] fix resetting DNS/etc when calling CurlHttpClient::reset()
  Fix invalid guess with enumType
2022-01-17 11:48:48 +01:00
Nicolas Grekas 3974dc112a bug #45012 [DoctrineBridge] Fix invalid guess with enumType (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Fix invalid guess with enumType

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

Since https://github.com/doctrine/orm/pull/9304 doctrine allows Enums with the new `enumType` option.
ie.

```php
#[ORM\Column(type: 'string', enumType: Status::class, length: 1)]
public Status $status;
```

The issue is, it break validations at several places:
- `doctrinerExtractor` guess it's a `string` (Because of `type = string`), and validation adds the constraint `Assert\Type(string)`
- `doctrineLoader` guess it's a string with a maxLength and validation adds a constrain `Assert\Length(max=1)`
-

Commits
-------

68dd21881f Fix invalid guess with enumType
2022-01-14 11:28:02 +01:00
Nicolas Grekas d4266464fe [HttpClient] fix resetting DNS/etc when calling CurlHttpClient::reset() 2022-01-13 19:40:34 +01:00
Jérémy Derussé 68dd21881f
Fix invalid guess with enumType 2022-01-13 15:51:07 +01:00
plozmun 3d2ed700eb [HttpClient] Remove deprecated usage of GuzzleHttp\Promise\promise_for 2022-01-12 23:27:38 +01:00
Nicolas Grekas 97d36c6b62 Merge branch '5.4' into 6.0
* 5.4:
  [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue`
  [PropertyAccess] Fix handling of uninitialized property of anonymous class
  [FrameworkBundle] Allow default cache pools to be overwritten by user
  [DependencyInjection] fix test
  ResolveBindingsPass remove loading of class iterable
  [FrameworkBundle] Avoid calling rtrim(null, '/') in AssetsInstallCommand
  Optimization of resolveEnvPlaceholders
  Fix incorrect format
  [DependencyInjection] Fix nested env var with resolve processor
  Allow OutputFormatter::escape() to be used for escaping URLs used in <href>
  allow a zero time-limit
  Use correct tag for ExpoTransportFactory service
  [DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory
  [Validators] Add translations for Slovak #43735
2022-01-12 19:59:56 +01:00
Nicolas Grekas bbe4105fe9 Merge branch '5.3' into 5.4
* 5.3:
  [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue`
  [PropertyAccess] Fix handling of uninitialized property of anonymous class
  [FrameworkBundle] Allow default cache pools to be overwritten by user
  [DependencyInjection] fix test
  ResolveBindingsPass remove loading of class iterable
  [FrameworkBundle] Avoid calling rtrim(null, '/') in AssetsInstallCommand
  [DependencyInjection] Fix nested env var with resolve processor
  Allow OutputFormatter::escape() to be used for escaping URLs used in <href>
  allow a zero time-limit
  [DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory
  [Validators] Add translations for Slovak #43735
2022-01-12 19:55:10 +01:00
Nicolas Grekas 01640e874a bug #44998 [FrameworkBundle] Allow default cache pools to be overwritten by user (Seldaek)
This PR was merged into the 5.3 branch.

Discussion
----------

[FrameworkBundle] Allow default cache pools to be overwritten by user

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fixes https://github.com/symfony/symfony/issues/44984
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - 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 the latest branch.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

Commits
-------

cc7cf5a4a6 [FrameworkBundle] Allow default cache pools to be overwritten by user
2022-01-12 19:38:22 +01:00
Nicolas Grekas bf75321462 Merge branch '4.4' into 5.3
* 4.4:
  [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue`
  [PropertyAccess] Fix handling of uninitialized property of anonymous class
  [DependencyInjection] fix test
  ResolveBindingsPass remove loading of class iterable
  [FrameworkBundle] Avoid calling rtrim(null, '/') in AssetsInstallCommand
  [DependencyInjection] Fix nested env var with resolve processor
  Allow OutputFormatter::escape() to be used for escaping URLs used in <href>
  allow a zero time-limit
  [DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory
  [Validators] Add translations for Slovak #43735
2022-01-12 19:37:36 +01:00
Graham Campbell 5130dd590a [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue` 2022-01-12 19:28:55 +01:00
“Filip 27d5edf3d2 [PropertyAccess] Fix handling of uninitialized property of anonymous class 2022-01-12 19:05:29 +01:00
Jordi Boggiano cc7cf5a4a6
[FrameworkBundle] Allow default cache pools to be overwritten by user 2022-01-12 15:43:39 +01:00
Nicolas Grekas 4d04a2dd57 [DependencyInjection] fix test 2022-01-12 13:54:05 +01:00
vladimir.panivko f9f78c7c2a ResolveBindingsPass remove loading of class iterable 2022-01-12 13:48:08 +01:00
Thomas Calvet 3b7df9ad65 bug #44908 [Serializer] Fix AbstractObjectNormalizer TypeError on denormalization (JustDylan23)
This PR was squashed before being merged into the 6.0 branch.

Discussion
----------

[Serializer] Fix AbstractObjectNormalizer TypeError on denormalization

| Q             | A
| ------------- | ---
| Branch?       | 6.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #44872
| License       | MIT
| Doc PR        |

When using dependency injection to get the serializer (instead of manually instantiating it) the object normalizer that is injected into that serializer throws a value exception when doing denormalizing the following:

```php
class ObjectOuter {
  public ObjectInner $inner;
}

class ObjectInner {
  public $foo;
}

public function testDenormalizeRecursiveWithObjectAttributeWithStringValue()
{
    $extractor = new ReflectionExtractor();
    $normalizer = new ObjectNormalizer(null, null, null, $extractor);
    $serializer = new Serializer([$normalizer]);

    $obj = $serializer->denormalize(['inner' => 'foo'], ObjectOuter::class);
    $this->assertInstanceOf(ObjectInner::class, $obj->getInner());
    }
```

This throws
```php
TypeError:
Symfony\Component\Serializer\Normalizer\AbstractNormalizer::prepareForDenormalization(): Argument #1 ($data) must be of type object|array|null, string given, called in /var/www/symfony/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php on line 368

  at vendor/symfony/serializer/Normalizer/AbstractNormalizer.php:299
  at Symfony\Component\Serializer\Normalizer\AbstractNormalizer->prepareForDenormalization('test string')
     (vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:368)
  at Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->denormalize('test string', 'App\\Entity\\User', null, array('cache_key' => 'c93a6d4efa206ea58a62cc6b7fab8dfb', 'deserialization_path' => 'author'))
     (vendor/symfony/serializer/Serializer.php:238)
  at Symfony\Component\Serializer\Serializer->denormalize('test string', 'App\\Entity\\User', null, array('cache_key' => 'c93a6d4efa206ea58a62cc6b7fab8dfb', 'deserialization_path' => 'author'))
     (vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:559)
  at Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->validateAndDenormalize(array(object(Type)), 'App\\Entity\\Blog', 'author', 'test string', null, array('cache_key' => '44db5a926a1544b1a8585af40107ca3a', 'deserialization_path' => 'author'))
     (vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:401)
  at Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->denormalize(array('author' => 'test string'), 'App\\Entity\\Blog', null, array('cache_key' => '44db5a926a1544b1a8585af40107ca3a'))
     (vendor/symfony/serializer/Serializer.php:238)
  at Symfony\Component\Serializer\Serializer->denormalize(array('author' => 'test string'), 'App\\Entity\\Blog')
     (src/Controller/BugReproductionController.php:18)
  at App\Controller\BugReproductionController->test(object(Serializer))
     (vendor/symfony/http-kernel/HttpKernel.php:152)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/var/www/symfony/vendor/autoload_runtime.php')
     (public/index.php:5)
```

Refer to: https://github.com/symfony/symfony/pull/44881 for the description.
Was in the middle of changing the base branch and accidentally pushed when the branch was deleted.

`@fancyweb` I implemented the requested changes

Commits
-------

89092ea279 [Serializer] Fix AbstractObjectNormalizer TypeError on denormalization
2022-01-12 13:47:11 +01:00
JustDylan23 89092ea279 [Serializer] Fix AbstractObjectNormalizer TypeError on denormalization 2022-01-12 13:46:58 +01:00
Nicolas Grekas 6bffe4127a minor #44876 [DependencyInjection] Optimization of resolveEnvPlaceholders (vladimir.panivko)
This PR was merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] Optimization of resolveEnvPlaceholders

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

When you have to much env variables and many services in your container, container compilаtion can take much time due to the function stripos which is called much time.
Look at the bottom of picture https://i2.piccy.info/i9/cdc413af9aecce8f7ed5ca0fe69b6c7c/1640950765/149173/1453384/6833Screenshot_from_2021_12_31_13_38_20.png

It happens because function resolveEnvPlaceholders try to find env placeholders in any value, even when there is no possible env in string.

So i offer to check value on strings env_ or env( and if they are present than look for placeholders.

In my project it helps me to save 10 seconds in container building.

Commits
-------

f73b5aa479 Optimization of resolveEnvPlaceholders
2022-01-12 13:43:31 +01:00
Pavol Tuka 3d92f987dc [FrameworkBundle] Avoid calling rtrim(null, '/') in AssetsInstallCommand 2022-01-12 12:20:14 +01:00
vladimir.panivko f73b5aa479 Optimization of resolveEnvPlaceholders 2022-01-11 14:42:14 +02:00
Fabien Potencier c3674b4e7f bug #44879 [DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  |  no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/35599, https://github.com/symfony/symfony/issues/44515
| License       | MIT
| Doc PR        | -

When a definition uses a factory, we don't know what it returns.

Commits
-------

b9095e6c09 [DependencyInjection] Ignore argument type check in CheckTypeDeclarationsPass if it's a Definition with a factory
2022-01-09 11:54:01 +01:00
Fabien Potencier b626db7565 bug #44920 Use correct tag for ExpoTransportFactory service (jschaedl)
This PR was merged into the 5.4 branch.

Discussion
----------

Use correct tag for ExpoTransportFactory service

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #44833 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | -
<!--
Replace this notice by a short README for your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - 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 the latest branch.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

Commits
-------

1d06c4e5de Use correct tag for ExpoTransportFactory service
2022-01-09 08:58:32 +01:00
Jérôme Tamarelle ddfaf70a33 bug #44931 Allow a zero time-limit for messenger:consume (fritzmg)
This PR was merged into the 4.4 branch.

Discussion
----------

Allow a zero time-limit for messenger:consume

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

By default `messenger:consume` will run indefinitely and as the docs mention you should monitor the process via Supervisor for example. However on shared hostings this is usually not an option and thus this command will be run via a cronjob there (at least I assume that's the intended best practise in such a case). To ensure the worker exits for each cronjob run, you can use the `--time-limit` option, e.g.

```
bin/console messenger:consume --time-limit=1
```

However, this would allow the worker to consume multiple message for the duration of 1000ms - so technically if you want the worker to _immediately_ exit each time after it processed the current message queue it should actually be

```
bin/console messenger:consume --time-limit=0
```

But this does not currently work, as the zero is falsey and thus the `StopWorkerOnTimeLimitListener` will not actually be added.

This PR fixes that by checking whether the option was actually supplied or not.

Commits
-------

2668c0db2f allow a zero time-limit
2022-01-08 23:39:07 +01:00
Jérôme Tamarelle 7b32f97172 bug #44932 [DependencyInjection] Fix nested env var with resolve processor (Laurent Moreau)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix nested env var with resolve processor

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #44756
| License       | MIT
| Doc PR        |

This PR fixes the issue raised by `@ro0NL`. (see Description)
I added some tests but i'm not confident about how to check with real environment variables.

This is my first PR, i hope i'm not doing it wrong.

Commits
-------

b2a61eec71 [DependencyInjection] Fix nested env var with resolve processor
2022-01-07 18:13:16 +01:00
Laurent Moreau b2a61eec71 [DependencyInjection] Fix nested env var with resolve processor 2022-01-07 18:13:10 +01:00
Jordi Boggiano cfa8910dc7
Allow OutputFormatter::escape() to be used for escaping URLs used in <href>
- escape() now escapes `>` as well as `<`
- URLs containing escaped `<` and `>` are rendered correctly as is
- user-provided URLs should now be safe to use (as in they cannot break the formatting) as long as they're piped through `escape()`
2022-01-07 09:38:32 +01:00
Robin Chalas 1a02d0c233
Merge branch '5.4' into 6.0
* 5.4:
  [String] Add conflict for translation-contracts v3
  fixed help text
2022-01-07 01:29:03 +01:00
Robin Chalas 33d4c4314d
Merge branch '5.3' into 5.4
* 5.3:
  [String] Add conflict for translation-contracts v3
  fixed help text
2022-01-07 01:28:17 +01:00
Fritz Michael Gschwantner 2668c0db2f
allow a zero time-limit 2022-01-06 12:44:55 +00:00
Fabien Potencier 93ed7c3e38 minor #44852 [Validators] Add translations for Slovak #43735 (bhavin-nakrani)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validators] Add translations for Slovak #43735

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #43735 <!-- 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 -->
<!--
Replace this notice by a short README for your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - 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 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

Commits
-------

35351998e3 [Validators] Add translations for Slovak #43735
2022-01-06 13:39:17 +01:00
Jan Schädlich 1d06c4e5de Use correct tag for ExpoTransportFactory service
fixes #44833
2022-01-05 14:06:27 +00:00
Robin Chalas 51b3a1ca67
[String] Add conflict for translation-contracts v3 2022-01-05 14:47:22 +01:00
Martin Mandl 533aac8adc fixed help text 2022-01-03 20:49:08 +01:00
Thomas Calvet 435edf242f Merge branch '5.4' into 6.0
* 5.4:
  Update ExprBuilder.php
2022-01-03 10:53:43 +01:00
Thomas Calvet 2a4d24d01f Merge branch '5.3' into 5.4
* 5.3:
  Update ExprBuilder.php
2022-01-03 10:50:52 +01:00
Thomas Calvet 0cf83bd5de Merge branch '4.4' into 5.3
* 4.4:
  Update ExprBuilder.php
2022-01-03 10:49:07 +01:00
Thomas Calvet dcc1ffe875 minor #44888 [Config] Fix return type of `ExprBuilder::ifEmpty()` (gassan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Config] Fix return type of `ExprBuilder::ifEmpty()`

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| License       | MIT
| Doc PR        | N/A

phpstan probably moans otherwise: Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeParentInterface::scalarNode().

The following code part does not cause any errors:
```php
->ifTrue(function ($v) {return empty($v);})
```

Commits
-------

a525715a8b Update ExprBuilder.php
2022-01-03 10:46:22 +01:00
Fabien Potencier 1ca521d54c Merge branch '5.4' into 6.0
* 5.4:
  Bump license year
  Bump license year
2022-01-02 10:59:35 +01:00
Fabien Potencier de843eab34 Bump license year 2022-01-02 10:59:27 +01:00
Fabien Potencier fdf598d27f Merge branch '5.3' into 5.4
* 5.3:
  Bump license year
2022-01-02 10:59:14 +01:00
Fabien Potencier 2c95b3063d Bump license year 2022-01-02 10:59:06 +01:00