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
* 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
* 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
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
* 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
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
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
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
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
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
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
- 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()`
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
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