diff --git a/.github/expected-missing-return-types.diff b/.github/expected-missing-return-types.diff index 73d86100bdd53..d5326aec3d5e5 100644 --- a/.github/expected-missing-return-types.diff +++ b/.github/expected-missing-return-types.diff @@ -154,7 +154,7 @@ diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/Regist diff --git a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php -@@ -160,5 +160,5 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface +@@ -164,5 +164,5 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface * @return array{0:ClassMetadata, 1:string}|null */ - protected function getMetadata(string $class) @@ -653,7 +653,7 @@ diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExt + public function load(array $configs, ContainerBuilder $container): void { $loader = new PhpFileLoader($container, new FileLocator(\dirname(__DIR__).'/Resources/config')); -@@ -2995,5 +2995,5 @@ class FrameworkExtension extends Extension +@@ -3007,5 +3007,5 @@ class FrameworkExtension extends Extension * @return void */ - public static function registerRateLimiter(ContainerBuilder $container, string $name, array $limiterConfig) @@ -1339,14 +1339,14 @@ diff --git a/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php b/src/Symfo diff --git a/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php b/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php --- a/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php -@@ -283,5 +283,5 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac +@@ -287,5 +287,5 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac * @return void */ - public function reset() + public function reset(): void { $this->commit(); -@@ -299,5 +299,5 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac +@@ -303,5 +303,5 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac * @return void */ - public function __wakeup() @@ -1464,7 +1464,7 @@ diff --git a/src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php b/src/ + protected function doUnlink(string $file): bool { return @unlink($file); -@@ -176,5 +176,5 @@ trait FilesystemCommonTrait +@@ -181,5 +181,5 @@ trait FilesystemCommonTrait * @return void */ - public function __wakeup() @@ -1749,21 +1749,21 @@ diff --git a/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.p diff --git a/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php b/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php --- a/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php +++ b/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php -@@ -34,5 +34,5 @@ class YamlReferenceDumper +@@ -33,5 +33,5 @@ class YamlReferenceDumper * @return string */ - public function dump(ConfigurationInterface $configuration) + public function dump(ConfigurationInterface $configuration): string { return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree()); -@@ -42,5 +42,5 @@ class YamlReferenceDumper +@@ -41,5 +41,5 @@ class YamlReferenceDumper * @return string */ - public function dumpAtPath(ConfigurationInterface $configuration, string $path) + public function dumpAtPath(ConfigurationInterface $configuration, string $path): string { $rootNode = $node = $configuration->getConfigTreeBuilder()->buildTree(); -@@ -71,5 +71,5 @@ class YamlReferenceDumper +@@ -70,5 +70,5 @@ class YamlReferenceDumper * @return string */ - public function dumpNode(NodeInterface $node) @@ -5162,84 +5162,84 @@ diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Compo + public function copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false): void { $originIsLocal = stream_is_local($originFile) || 0 === stripos($originFile, 'file://'); -@@ -89,5 +89,5 @@ class Filesystem +@@ -92,5 +92,5 @@ class Filesystem * @throws IOException On any directory creation failure */ - public function mkdir(string|iterable $dirs, int $mode = 0777) + public function mkdir(string|iterable $dirs, int $mode = 0777): void { foreach ($this->toIterable($dirs) as $dir) { -@@ -132,5 +132,5 @@ class Filesystem +@@ -135,5 +135,5 @@ class Filesystem * @throws IOException When touch fails */ - public function touch(string|iterable $files, ?int $time = null, ?int $atime = null) + public function touch(string|iterable $files, ?int $time = null, ?int $atime = null): void { foreach ($this->toIterable($files) as $file) { -@@ -148,5 +148,5 @@ class Filesystem +@@ -151,5 +151,5 @@ class Filesystem * @throws IOException When removal fails */ - public function remove(string|iterable $files) + public function remove(string|iterable $files): void { if ($files instanceof \Traversable) { -@@ -216,5 +216,5 @@ class Filesystem +@@ -219,5 +219,5 @@ class Filesystem * @throws IOException When the change fails */ - public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool $recursive = false) + public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool $recursive = false): void { foreach ($this->toIterable($files) as $file) { -@@ -238,5 +238,5 @@ class Filesystem +@@ -241,5 +241,5 @@ class Filesystem * @throws IOException When the change fails */ - public function chown(string|iterable $files, string|int $user, bool $recursive = false) + public function chown(string|iterable $files, string|int $user, bool $recursive = false): void { foreach ($this->toIterable($files) as $file) { -@@ -266,5 +266,5 @@ class Filesystem +@@ -269,5 +269,5 @@ class Filesystem * @throws IOException When the change fails */ - public function chgrp(string|iterable $files, string|int $group, bool $recursive = false) + public function chgrp(string|iterable $files, string|int $group, bool $recursive = false): void { foreach ($this->toIterable($files) as $file) { -@@ -292,5 +292,5 @@ class Filesystem +@@ -295,5 +295,5 @@ class Filesystem * @throws IOException When origin cannot be renamed */ - public function rename(string $origin, string $target, bool $overwrite = false) + public function rename(string $origin, string $target, bool $overwrite = false): void { // we check that target does not exist -@@ -334,5 +334,5 @@ class Filesystem +@@ -337,5 +337,5 @@ class Filesystem * @throws IOException When symlink fails */ - public function symlink(string $originDir, string $targetDir, bool $copyOnWindows = false) + public function symlink(string $originDir, string $targetDir, bool $copyOnWindows = false): void { self::assertFunctionExists('symlink'); -@@ -373,5 +373,5 @@ class Filesystem +@@ -376,5 +376,5 @@ class Filesystem * @throws IOException When link fails, including if link already exists */ - public function hardlink(string $originFile, string|iterable $targetFiles) + public function hardlink(string $originFile, string|iterable $targetFiles): void { self::assertFunctionExists('link'); -@@ -531,5 +531,5 @@ class Filesystem +@@ -534,5 +534,5 @@ class Filesystem * @throws IOException When file type is unknown */ - public function mirror(string $originDir, string $targetDir, ?\Traversable $iterator = null, array $options = []) + public function mirror(string $originDir, string $targetDir, ?\Traversable $iterator = null, array $options = []): void { $targetDir = rtrim($targetDir, '/\\'); -@@ -657,5 +657,5 @@ class Filesystem +@@ -660,5 +660,5 @@ class Filesystem * @throws IOException if the file cannot be written to */ - public function dumpFile(string $filename, $content) + public function dumpFile(string $filename, $content): void { if (\is_array($content)) { -@@ -704,5 +704,5 @@ class Filesystem +@@ -707,5 +707,5 @@ class Filesystem * @throws IOException If the file is not writable */ - public function appendToFile(string $filename, $content/* , bool $lock = false */) @@ -8077,14 +8077,14 @@ diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/ + protected function getCasters(): array { $casters = [ -@@ -86,5 +86,5 @@ abstract class DataCollector implements DataCollectorInterface +@@ -98,5 +98,5 @@ abstract class DataCollector implements DataCollectorInterface * @return void */ - public function __wakeup() + public function __wakeup(): void { } -@@ -107,5 +107,5 @@ abstract class DataCollector implements DataCollectorInterface +@@ -119,5 +119,5 @@ abstract class DataCollector implements DataCollectorInterface * @return void */ - public function reset() @@ -8678,21 +8678,21 @@ diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component + protected function initializeContainer(): void { $class = $this->getContainerClass(); -@@ -618,5 +618,5 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl +@@ -626,5 +626,5 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl * @return void */ - protected function prepareContainer(ContainerBuilder $container) + protected function prepareContainer(ContainerBuilder $container): void { $extensions = []; -@@ -671,5 +671,5 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl +@@ -679,5 +679,5 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl * @return void */ - protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, string $class, string $baseClass) + protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, string $class, string $baseClass): void { // cache the container -@@ -849,5 +849,5 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl +@@ -857,5 +857,5 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl * @return void */ - public function __wakeup() @@ -9771,7 +9771,7 @@ diff --git a/src/Symfony/Component/Messenger/EventListener/SendFailedMessageToFa diff --git a/src/Symfony/Component/Messenger/Exception/ValidationFailedException.php b/src/Symfony/Component/Messenger/Exception/ValidationFailedException.php --- a/src/Symfony/Component/Messenger/Exception/ValidationFailedException.php +++ b/src/Symfony/Component/Messenger/Exception/ValidationFailedException.php -@@ -33,5 +33,5 @@ class ValidationFailedException extends RuntimeException +@@ -37,5 +37,5 @@ class ValidationFailedException extends RuntimeException implements EnvelopeAwar * @return object */ - public function getViolatingMessage() @@ -9919,7 +9919,7 @@ diff --git a/src/Symfony/Component/Mime/Message.php b/src/Symfony/Component/Mime - public function ensureValidity() + public function ensureValidity(): void { - if (!$this->headers->has('To') && !$this->headers->has('Cc') && !$this->headers->has('Bcc')) { + if (!$this->headers->get('To')?->getBody() && !$this->headers->get('Cc')?->getBody() && !$this->headers->get('Bcc')?->getBody()) { diff --git a/src/Symfony/Component/Mime/Part/DataPart.php b/src/Symfony/Component/Mime/Part/DataPart.php --- a/src/Symfony/Component/Mime/Part/DataPart.php +++ b/src/Symfony/Component/Mime/Part/DataPart.php @@ -9933,7 +9933,7 @@ diff --git a/src/Symfony/Component/Mime/Part/DataPart.php b/src/Symfony/Componen diff --git a/src/Symfony/Component/Mime/Part/TextPart.php b/src/Symfony/Component/Mime/Part/TextPart.php --- a/src/Symfony/Component/Mime/Part/TextPart.php +++ b/src/Symfony/Component/Mime/Part/TextPart.php -@@ -236,5 +236,5 @@ class TextPart extends AbstractPart +@@ -240,5 +240,5 @@ class TextPart extends AbstractPart * @return void */ - public function __wakeup() @@ -9943,7 +9943,7 @@ diff --git a/src/Symfony/Component/Mime/Part/TextPart.php b/src/Symfony/Componen diff --git a/src/Symfony/Component/Mime/RawMessage.php b/src/Symfony/Component/Mime/RawMessage.php --- a/src/Symfony/Component/Mime/RawMessage.php +++ b/src/Symfony/Component/Mime/RawMessage.php -@@ -76,5 +76,5 @@ class RawMessage +@@ -97,5 +97,5 @@ class RawMessage * @throws LogicException if the message is not valid */ - public function ensureValidity() @@ -10103,35 +10103,35 @@ diff --git a/src/Symfony/Component/Process/PhpProcess.php b/src/Symfony/Componen diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php -@@ -203,5 +203,5 @@ class Process implements \IteratorAggregate +@@ -204,5 +204,5 @@ class Process implements \IteratorAggregate * @return void */ - public function __wakeup() + public function __wakeup(): void { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); -@@ -294,5 +294,5 @@ class Process implements \IteratorAggregate +@@ -295,5 +295,5 @@ class Process implements \IteratorAggregate * @throws LogicException In case a callback is provided and output has been disabled */ - public function start(?callable $callback = null, array $env = []) + public function start(?callable $callback = null, array $env = []): void { if ($this->isRunning()) { -@@ -1145,5 +1145,5 @@ class Process implements \IteratorAggregate +@@ -1146,5 +1146,5 @@ class Process implements \IteratorAggregate * @throws ProcessTimedOutException In case the timeout was reached */ - public function checkTimeout() + public function checkTimeout(): void { if (self::STATUS_STARTED !== $this->status) { -@@ -1186,5 +1186,5 @@ class Process implements \IteratorAggregate +@@ -1187,5 +1187,5 @@ class Process implements \IteratorAggregate * @return void */ - public function setOptions(array $options) + public function setOptions(array $options): void { if ($this->isRunning()) { -@@ -1283,5 +1283,5 @@ class Process implements \IteratorAggregate +@@ -1284,5 +1284,5 @@ class Process implements \IteratorAggregate * @return void */ - protected function updateStatus(bool $blocking) @@ -10777,7 +10777,7 @@ diff --git a/src/Symfony/Component/Routing/Router.php b/src/Symfony/Component/Ro + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory): void { $this->configCacheFactory = $configCacheFactory; -@@ -318,5 +318,5 @@ class Router implements RouterInterface, RequestMatcherInterface +@@ -320,5 +320,5 @@ class Router implements RouterInterface, RequestMatcherInterface * @return void */ - public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) @@ -11544,43 +11544,43 @@ diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalize - public function normalize(mixed $object, ?string $format = null, array $context = []) + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - if (!isset($context['cache_key'])) { -@@ -233,5 +233,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer + $context['_read_attributes'] = true; +@@ -235,5 +235,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer * @return object */ - protected function instantiateObject(array &$data, string $class, array &$context, \ReflectionClass $reflectionClass, array|bool $allowedAttributes, ?string $format = null) + protected function instantiateObject(array &$data, string $class, array &$context, \ReflectionClass $reflectionClass, array|bool $allowedAttributes, ?string $format = null): object { if ($class !== $mappedClass = $this->getMappedClass($data, $class, $context)) { -@@ -284,5 +284,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer +@@ -286,5 +286,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer * @return string[] */ - abstract protected function extractAttributes(object $object, ?string $format = null, array $context = []); + abstract protected function extractAttributes(object $object, ?string $format = null, array $context = []): array; /** -@@ -291,5 +291,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer +@@ -293,5 +293,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer * @return mixed */ - abstract protected function getAttributeValue(object $object, string $attribute, ?string $format = null, array $context = []); + abstract protected function getAttributeValue(object $object, string $attribute, ?string $format = null, array $context = []): mixed; /** -@@ -298,5 +298,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer +@@ -300,5 +300,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer * @return bool */ - public function supportsDenormalization(mixed $data, string $type, ?string $format = null /* , array $context = [] */) + public function supportsDenormalization(mixed $data, string $type, ?string $format = null /* , array $context = [] */): bool { return class_exists($type) || (interface_exists($type, false) && null !== $this->classDiscriminatorResolver?->getMappingForClass($type)); -@@ -306,5 +306,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer +@@ -308,5 +308,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer * @return mixed */ - public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []) + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - if (!isset($context['cache_key'])) { -@@ -422,5 +422,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer + $context['_read_attributes'] = false; +@@ -430,5 +430,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer * @return void */ - abstract protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []); @@ -11625,16 +11625,16 @@ diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.p diff --git a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php --- a/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php -@@ -152,5 +152,5 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer +@@ -166,5 +166,5 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer * @return void */ - protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []) + protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []): void { - $setter = 'set'.ucfirst($attribute); -@@ -182,5 +182,5 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer + $setter = 'set'.$attribute; +@@ -180,5 +180,5 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer } - + - protected function isAllowedAttribute($classOrObject, string $attribute, ?string $format = null, array $context = []) + protected function isAllowedAttribute($classOrObject, string $attribute, ?string $format = null, array $context = []): bool { @@ -11678,20 +11678,20 @@ diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php diff --git a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php --- a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php -@@ -138,5 +138,5 @@ class ObjectNormalizer extends AbstractObjectNormalizer +@@ -150,5 +150,5 @@ class ObjectNormalizer extends AbstractObjectNormalizer * @return void */ - protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []) + protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []): void { try { -@@ -189,5 +189,5 @@ class ObjectNormalizer extends AbstractObjectNormalizer +@@ -183,5 +183,5 @@ class ObjectNormalizer extends AbstractObjectNormalizer } - + - protected function isAllowedAttribute($classOrObject, string $attribute, ?string $format = null, array $context = []) + protected function isAllowedAttribute($classOrObject, string $attribute, ?string $format = null, array $context = []): bool { - $ignoredAttributes = $context[self::IGNORED_ATTRIBUTES] ?? $this->defaultContext[self::IGNORED_ATTRIBUTES]; + if (!parent::isAllowedAttribute($classOrObject, $attribute, $format, $context)) { diff --git a/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php --- a/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php @@ -12164,8 +12164,8 @@ diff --git a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php b/src/Sy @@ -56,5 +56,5 @@ class CsvFileLoader extends FileLoader * @return void */ -- public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\') -+ public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\'): void +- public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '') ++ public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = ''): void { $this->delimiter = $delimiter; diff --git a/src/Symfony/Component/Translation/LoggingTranslator.php b/src/Symfony/Component/Translation/LoggingTranslator.php @@ -12581,7 +12581,7 @@ diff --git a/src/Symfony/Component/Validator/ConstraintViolationListInterface.ph diff --git a/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php b/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php --- a/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php +++ b/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php -@@ -38,5 +38,5 @@ abstract class AbstractComparisonValidator extends ConstraintValidator +@@ -39,5 +39,5 @@ abstract class AbstractComparisonValidator extends ConstraintValidator * @return void */ - public function validate(mixed $value, Constraint $constraint) @@ -12611,7 +12611,7 @@ diff --git a/src/Symfony/Component/Validator/Constraints/AtLeastOneOfValidator.p diff --git a/src/Symfony/Component/Validator/Constraints/BicValidator.php b/src/Symfony/Component/Validator/Constraints/BicValidator.php --- a/src/Symfony/Component/Validator/Constraints/BicValidator.php +++ b/src/Symfony/Component/Validator/Constraints/BicValidator.php -@@ -67,5 +67,5 @@ class BicValidator extends ConstraintValidator +@@ -68,5 +68,5 @@ class BicValidator extends ConstraintValidator * @return void */ - public function validate(mixed $value, Constraint $constraint) @@ -12778,7 +12778,7 @@ diff --git a/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php diff --git a/src/Symfony/Component/Validator/Constraints/File.php b/src/Symfony/Component/Validator/Constraints/File.php --- a/src/Symfony/Component/Validator/Constraints/File.php +++ b/src/Symfony/Component/Validator/Constraints/File.php -@@ -134,5 +134,5 @@ class File extends Constraint +@@ -135,5 +135,5 @@ class File extends Constraint * @return void */ - public function __set(string $option, mixed $value) @@ -13009,7 +13009,7 @@ diff --git a/src/Symfony/Component/Validator/Constraints/NotNullValidator.php b/ diff --git a/src/Symfony/Component/Validator/Constraints/RangeValidator.php b/src/Symfony/Component/Validator/Constraints/RangeValidator.php --- a/src/Symfony/Component/Validator/Constraints/RangeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/RangeValidator.php -@@ -35,5 +35,5 @@ class RangeValidator extends ConstraintValidator +@@ -36,5 +36,5 @@ class RangeValidator extends ConstraintValidator * @return void */ - public function validate(mixed $value, Constraint $constraint) @@ -13280,7 +13280,7 @@ diff --git a/src/Symfony/Component/Validator/ObjectInitializerInterface.php b/sr diff --git a/src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php b/src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php --- a/src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php +++ b/src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php -@@ -291,5 +291,5 @@ abstract class ConstraintValidatorTestCase extends TestCase +@@ -295,5 +295,5 @@ abstract class ConstraintValidatorTestCase extends TestCase * @psalm-return T */ - abstract protected function createValidator(); @@ -13399,63 +13399,63 @@ diff --git a/src/Symfony/Component/VarDumper/Caster/DOMCaster.php b/src/Symfony/ + public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0): array { $a += [ -@@ -188,5 +188,5 @@ class DOMCaster +@@ -184,5 +184,5 @@ class DOMCaster * @return array */ - public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested) + public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested): array { $a += [ -@@ -201,5 +201,5 @@ class DOMCaster +@@ -197,5 +197,5 @@ class DOMCaster * @return array */ - public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested) + public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested): array { $a += [ -@@ -217,5 +217,5 @@ class DOMCaster +@@ -213,5 +213,5 @@ class DOMCaster * @return array */ - public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested) + public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested): array { $a += [ -@@ -230,5 +230,5 @@ class DOMCaster +@@ -226,5 +226,5 @@ class DOMCaster * @return array */ - public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested) + public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested): array { $a += [ -@@ -242,5 +242,5 @@ class DOMCaster +@@ -238,5 +238,5 @@ class DOMCaster * @return array */ - public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested) + public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested): array { $a += [ -@@ -259,5 +259,5 @@ class DOMCaster +@@ -255,5 +255,5 @@ class DOMCaster * @return array */ - public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested) + public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested): array { $a += [ -@@ -272,5 +272,5 @@ class DOMCaster +@@ -268,5 +268,5 @@ class DOMCaster * @return array */ - public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested) + public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested): array { $a += [ -@@ -289,5 +289,5 @@ class DOMCaster +@@ -282,5 +282,5 @@ class DOMCaster * @return array */ - public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested) + public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested): array { $a += [ -@@ -302,5 +302,5 @@ class DOMCaster +@@ -295,5 +295,5 @@ class DOMCaster * @return array */ - public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $isNested) @@ -13826,78 +13826,78 @@ diff --git a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php b/src/S - public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested) + public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested): array { - self::addMap($a, $c, [ -@@ -140,5 +140,5 @@ class ReflectionCaster + $map = [ +@@ -146,5 +146,5 @@ class ReflectionCaster * @return array */ - public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, bool $isNested) + public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, bool $isNested): array { $prefix = Caster::PREFIX_VIRTUAL; -@@ -178,5 +178,5 @@ class ReflectionCaster +@@ -184,5 +184,5 @@ class ReflectionCaster * @return array */ - public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $isNested, int $filter = 0): array { $prefix = Caster::PREFIX_VIRTUAL; -@@ -212,5 +212,5 @@ class ReflectionCaster +@@ -218,5 +218,5 @@ class ReflectionCaster * @return array */ - public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, bool $isNested, int $filter = 0) + public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, bool $isNested, int $filter = 0): array { $prefix = Caster::PREFIX_VIRTUAL; -@@ -273,5 +273,5 @@ class ReflectionCaster +@@ -279,5 +279,5 @@ class ReflectionCaster * @return array */ - public static function castClassConstant(\ReflectionClassConstant $c, array $a, Stub $stub, bool $isNested) + public static function castClassConstant(\ReflectionClassConstant $c, array $a, Stub $stub, bool $isNested): array { $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); -@@ -286,5 +286,5 @@ class ReflectionCaster +@@ -292,5 +292,5 @@ class ReflectionCaster * @return array */ - public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bool $isNested) + public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bool $isNested): array { $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); -@@ -296,5 +296,5 @@ class ReflectionCaster +@@ -302,5 +302,5 @@ class ReflectionCaster * @return array */ - public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, bool $isNested) + public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, bool $isNested): array { $prefix = Caster::PREFIX_VIRTUAL; -@@ -339,5 +339,5 @@ class ReflectionCaster +@@ -345,5 +345,5 @@ class ReflectionCaster * @return array */ - public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, bool $isNested) + public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, bool $isNested): array { $a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers())); -@@ -352,5 +352,5 @@ class ReflectionCaster +@@ -358,5 +358,5 @@ class ReflectionCaster * @return array */ - public static function castReference(\ReflectionReference $c, array $a, Stub $stub, bool $isNested) + public static function castReference(\ReflectionReference $c, array $a, Stub $stub, bool $isNested): array { $a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId(); -@@ -362,5 +362,5 @@ class ReflectionCaster +@@ -368,5 +368,5 @@ class ReflectionCaster * @return array */ - public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, bool $isNested) + public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, bool $isNested): array { self::addMap($a, $c, [ -@@ -381,5 +381,5 @@ class ReflectionCaster +@@ -387,5 +387,5 @@ class ReflectionCaster * @return array */ - public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, bool $isNested) + public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, bool $isNested): array { self::addMap($a, $c, [ -@@ -396,5 +396,5 @@ class ReflectionCaster +@@ -402,5 +402,5 @@ class ReflectionCaster * @return string */ - public static function getSignature(array $a) @@ -14216,84 +14216,84 @@ diff --git a/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php b/src/Sym diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php -@@ -91,5 +91,5 @@ class CliDumper extends AbstractDumper +@@ -92,5 +92,5 @@ class CliDumper extends AbstractDumper * @return void */ - public function setColors(bool $colors) + public function setColors(bool $colors): void { $this->colors = $colors; -@@ -101,5 +101,5 @@ class CliDumper extends AbstractDumper +@@ -102,5 +102,5 @@ class CliDumper extends AbstractDumper * @return void */ - public function setMaxStringWidth(int $maxStringWidth) + public function setMaxStringWidth(int $maxStringWidth): void { $this->maxStringWidth = $maxStringWidth; -@@ -113,5 +113,5 @@ class CliDumper extends AbstractDumper +@@ -114,5 +114,5 @@ class CliDumper extends AbstractDumper * @return void */ - public function setStyles(array $styles) + public function setStyles(array $styles): void { $this->styles = $styles + $this->styles; -@@ -125,5 +125,5 @@ class CliDumper extends AbstractDumper +@@ -126,5 +126,5 @@ class CliDumper extends AbstractDumper * @return void */ - public function setDisplayOptions(array $displayOptions) + public function setDisplayOptions(array $displayOptions): void { $this->displayOptions = $displayOptions + $this->displayOptions; -@@ -133,5 +133,5 @@ class CliDumper extends AbstractDumper +@@ -134,5 +134,5 @@ class CliDumper extends AbstractDumper * @return void */ - public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value) + public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value): void { $this->dumpKey($cursor); -@@ -197,5 +197,5 @@ class CliDumper extends AbstractDumper +@@ -198,5 +198,5 @@ class CliDumper extends AbstractDumper * @return void */ - public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) + public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut): void { $this->dumpKey($cursor); -@@ -289,5 +289,5 @@ class CliDumper extends AbstractDumper +@@ -290,5 +290,5 @@ class CliDumper extends AbstractDumper * @return void */ - public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild) + public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild): void { $this->colors ??= $this->supportsColors(); -@@ -329,5 +329,5 @@ class CliDumper extends AbstractDumper +@@ -330,5 +330,5 @@ class CliDumper extends AbstractDumper * @return void */ - public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut) + public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut): void { if (empty($cursor->attr['cut_hash'])) { -@@ -347,5 +347,5 @@ class CliDumper extends AbstractDumper +@@ -348,5 +348,5 @@ class CliDumper extends AbstractDumper * @return void */ - protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut) + protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut): void { if ($cut) { -@@ -365,5 +365,5 @@ class CliDumper extends AbstractDumper +@@ -366,5 +366,5 @@ class CliDumper extends AbstractDumper * @return void */ - protected function dumpKey(Cursor $cursor) + protected function dumpKey(Cursor $cursor): void { if (null !== $key = $cursor->hashKey) { -@@ -576,5 +576,5 @@ class CliDumper extends AbstractDumper +@@ -577,5 +577,5 @@ class CliDumper extends AbstractDumper * @return void */ - protected function dumpLine(int $depth, bool $endOfValue = false) + protected function dumpLine(int $depth, bool $endOfValue = false): void { if (null === $this->colors) { -@@ -591,5 +591,5 @@ class CliDumper extends AbstractDumper +@@ -592,5 +592,5 @@ class CliDumper extends AbstractDumper * @return void */ - protected function endValue(Cursor $cursor) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index b699003177332..589a3c8cf6b65 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -23,6 +23,8 @@ EOF; return (new PhpCsFixer\Config()) + // @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777 + ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) ->setRules([ '@PHP71Migration' => true, '@PHPUnit75Migration:risky' => true, diff --git a/CHANGELOG-6.4.md b/CHANGELOG-6.4.md index 6171610473139..8059eaa560721 100644 --- a/CHANGELOG-6.4.md +++ b/CHANGELOG-6.4.md @@ -7,6 +7,32 @@ in 6.4 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v6.4.0...v6.4.1 +* 6.4.10 (2024-07-26) + + * bug #57803 [FrameworkBundle] move adding detailed JSON error messages to the validate phase (xabbuh) + * bug #57815 [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling (alexandre-daubois) + * bug #57828 [Translation] Fix CSV escape char in `CsvFileLoader` on PHP >= 7.4 (alexandre-daubois) + * bug #57812 [Validator] treat uninitialized properties referenced by property paths as null (xabbuh) + * bug #57816 [DoctrineBridge] fix messenger bus dispatch inside an active transaction (IndraGunawan) + * bug #57799 [ErrorHandler][VarDumper] Remove PHP 8.4 deprecations (alexandre-daubois) + * bug #57772 [WebProfilerBundle] Add word wrap in tables in dialog to see all the text in workflow listeners dialog (SpartakusMd) + * bug #57802 [PropertyInfo] Fix nullable value returned from extractFromMutator on CollectionType (benjilebon) + * bug #57832 [DependencyInjection] Do not try to load default method name on interface (lyrixx) + * bug #57748 [SecurityBundle] use firewall-specific user checkers when manually logging in users (xabbuh) + * bug #57753 [ErrorHandler] restrict the maximum length of the X-Debug-Exception header (xabbuh) + * bug #57674 [Cache] Improve `dbindex` DSN parameter parsing (constantable) + * bug #57679 [WebProfilerBundle] Change incorrect check for the `stateless` request attribute (themasch) + * bug #57663 [Cache] use copy() instead of rename() on Windows (xabbuh) + * bug #57617 [PropertyInfo] Handle collection in PhpStan same as PhpDoc (mtarld) + * bug #54057 [Messenger] Passing actual `Envelope` to `WorkerMessageRetriedEvent` (daffoxdev) + * bug #57645 [Routing] Discard in-memory cache of routes when writing the file-based cache (mpdude) + * bug #57621 [Mailer]  force HTTP 1.1 for Mailgun API requests (xabbuh) + * bug #57616 [String] Revert "Fixed u()->snake(), b()->snake() and s()->snake() methods" (nicolas-grekas) + * bug #57593 [SecurityBundle] Compare paths after realpath() has been applied to both (xabbuh) + * bug #57594 [String] Normalize underscores in snake() (xabbuh) + * bug #57585 [HttpFoundation] Fix MockArraySessionStorage to generate more conform ids (Seldaek) + * bug #57589 [FrameworkBundle] fix AssetMapper usage without assets enabled (xabbuh) + * 6.4.9 (2024-06-28) * bug #57553 [HttpKernel] Enable optional cache-warmers when cache-dir != build-dir (nicolas-grekas) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 92dac23ccbd1c..8542f255df6a1 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -33,9 +33,9 @@ The Symfony Connect username in parenthesis allows to get more information - Hugo Hamon (hhamon) - Tobias Nyholm (tobias) - Jérôme Tamarelle (gromnan) + - HypeMC (hypemc) - Samuel ROZE (sroze) - Antoine Lamirault (alamirault) - - HypeMC (hypemc) - Pascal Borreli (pborreli) - Romain Neutron - Joseph Bielawski (stloyd) @@ -54,8 +54,8 @@ The Symfony Connect username in parenthesis allows to get more information - Gabriel Ostrolucký (gadelat) - Matthias Pigulla (mpdude) - Jonathan Wage (jwage) - - Valentin Udaltsov (vudaltsov) - Vincent Langlet (deviling) + - Valentin Udaltsov (vudaltsov) - Alexandre Salomé (alexandresalome) - Grégoire Paris (greg0ire) - William DURAND @@ -72,11 +72,11 @@ The Symfony Connect username in parenthesis allows to get more information - Pierre du Plessis (pierredup) - David Maicher (dmaicher) - Bulat Shakirzyanov (avalanche123) + - Mathias Arlaud (mtarld) - Iltar van der Berg - Miha Vrhovnik (mvrhov) - Tomasz Kowalczyk (thunderer) - Gary PEGEOT (gary-p) - - Mathias Arlaud (mtarld) - Saša Stamenković (umpirsky) - Allison Guilhem (a_guilhem) - Mathieu Piot (mpiot) @@ -90,9 +90,9 @@ The Symfony Connect username in parenthesis allows to get more information - Bilal Amarni (bamarni) - Eriksen Costa - Florin Patan (florinpatan) + - Dariusz Ruminski - Vladimir Reznichenko (kalessil) - Peter Rehm (rpet) - - Dariusz Ruminski - Henrik Bjørnskov (henrikbjorn) - David Buchmann (dbu) - Ruud Kamphuis (ruudk) @@ -107,16 +107,16 @@ The Symfony Connect username in parenthesis allows to get more information - Douglas Greenshields (shieldo) - Frank A. Fiebig (fafiebig) - Baldini + - Tomas Norkūnas (norkunas) - Alex Pott - Fran Moreno (franmomu) - Charles Sarrazin (csarrazi) - - Tomas Norkūnas (norkunas) - Henrik Westphal (snc) - Dariusz Górecki (canni) - - Ener-Getick - Hubert Lenoir (hubert_lenoir) - - Graham Campbell (graham) + - Ener-Getick - Antoine Makdessi (amakdessi) + - Graham Campbell (graham) - Tugdual Saunier (tucksaun) - Lee McDermott - Brandon Turner @@ -171,17 +171,17 @@ The Symfony Connect username in parenthesis allows to get more information - Gordon Franke (gimler) - Malte Schlüter (maltemaltesich) - jeremyFreeAgent (jeremyfreeagent) + - Michael Babker (mbabker) + - Maximilian Beckers (maxbeckers) + - Valtteri R (valtzu) - Joshua Thijssen - Vasilij Dusko - Daniel Wehner (dawehner) - Maxime Helias (maxhelias) - Robert Schönthal (digitalkaoz) - Smaine Milianni (ismail1432) - - Michael Babker (mbabker) - François-Xavier de Guillebon (de-gui_f) - - Maximilian Beckers (maxbeckers) - noniagriconomie - - Valtteri R (valtzu) - Eric GELOEN (gelo) - Gabriel Caruso - Stefano Sala (stefano.sala) @@ -405,6 +405,7 @@ The Symfony Connect username in parenthesis allows to get more information - Danny Berger (dpb587) - Alif Rachmawadi - Anton Chernikov (anton_ch1989) + - Stiven Llupa (sllupa) - Pierre-Yves Lebecq (pylebecq) - Benjamin Leveque (benji07) - Jordan Samouh (jordansamouh) @@ -438,6 +439,7 @@ The Symfony Connect username in parenthesis allows to get more information - Dane Powell - Sebastien Morel (plopix) - Christopher Davis (chrisguitarguy) + - Jonathan H. Wage - Loïc Frémont (loic425) - Matthieu Auger (matthieuauger) - Sergey Belyshkin (sbelyshkin) @@ -468,11 +470,11 @@ The Symfony Connect username in parenthesis allows to get more information - Wouter Van Hecke - Baptiste Lafontaine (magnetik) - Iker Ibarguren (ikerib) + - Michael Hirschler (mvhirsch) - Michael Holm (hollo) - Blanchon Vincent (blanchonvincent) - Christian Schmidt - Ben Hakim - - Stiven Llupa (sllupa) - Marco Petersen (ocrampete16) - Bohan Yang (brentybh) - Vilius Grigaliūnas @@ -520,7 +522,6 @@ The Symfony Connect username in parenthesis allows to get more information - Thierry T (lepiaf) - Lorenz Schori - Lukáš Holeczy (holicz) - - Jonathan H. Wage - Jeremy Livingston (jeremylivingston) - ivan - SUMIDA, Ippei (ippey_s) @@ -541,7 +542,6 @@ The Symfony Connect username in parenthesis allows to get more information - Francesco Levorato - Vitaliy Zakharov (zakharovvi) - Tobias Sjösten (tobiassjosten) - - Michael Hirschler (mvhirsch) - Gyula Sallai (salla) - Hendrik Luup (hluup) - Inal DJAFAR (inalgnu) @@ -582,6 +582,7 @@ The Symfony Connect username in parenthesis allows to get more information - Sanpi (sanpi) - Eduardo Gulias (egulias) - giulio de donato (liuggio) + - Ivan Mezinov - ShinDarth - Stéphane PY (steph_py) - Cătălin Dan (dancatalin) @@ -649,6 +650,7 @@ The Symfony Connect username in parenthesis allows to get more information - quentin neyrat (qneyrat) - Chris Tanaskoski (devristo) - Steffen Roßkamp + - Andrey Lebedev (alebedev) - Alexandru Furculita (afurculita) - Michel Salib (michelsalib) - Ben Roberts (benr77) @@ -750,7 +752,6 @@ The Symfony Connect username in parenthesis allows to get more information - Roberto Espinoza (respinoza) - Pierre Rineau - Soufian EZ ZANTAR (soezz) - - Ivan Mezinov - Marek Zajac - Adam Harvey - ilyes kooli (skafandri) @@ -764,6 +765,7 @@ The Symfony Connect username in parenthesis allows to get more information - Patrick Reimers (preimers) - Brayden Williams (redstar504) - insekticid + - Kieran Brahney - Jérémy M (th3mouk) - Trent Steel (trsteel88) - boombatower @@ -785,6 +787,7 @@ The Symfony Connect username in parenthesis allows to get more information - Matthew Grasmick - Miroslav Šustek (sustmi) - Pablo Díez (pablodip) + - Kev - Kevin McBride - Sergio Santoro - Philipp Rieber (bicpi) @@ -909,7 +912,6 @@ The Symfony Connect username in parenthesis allows to get more information - Ramunas Pabreza (doobas) - Yuriy Vilks (igrizzli) - Terje Bråten - - Andrey Lebedev (alebedev) - Sebastian Krebs - Piotr Stankowski - Pierre-Emmanuel Tanguy (petanguy) @@ -1011,6 +1013,7 @@ The Symfony Connect username in parenthesis allows to get more information - Aurimas Niekis (gcds) - Vincent Chalamon - Matthieu Calie (matth--) + - Sem Schidler (xvilo) - Benjamin Schoch (bschoch) - Martins Sipenko - Guilherme Augusto Henschel @@ -1057,6 +1060,7 @@ The Symfony Connect username in parenthesis allows to get more information - Ivan Grigoriev (greedyivan) - Johann Saunier (prophet777) - Kevin SCHNEKENBURGER + - Geordie - Fabien Salles (blacked) - Andreas Erhard (andaris) - alexpozzi @@ -1135,11 +1139,11 @@ The Symfony Connect username in parenthesis allows to get more information - Aleksandr Volochnev (exelenz) - Robin van der Vleuten (robinvdvleuten) - Grinbergs Reinis (shima5) - - Kieran Brahney - Klaus Silveira (klaussilveira) - Michael Piecko (michael.piecko) - Toni Peric (tperic) - yclian + - Nicolas DOUSSON - radar3301 - Aleksey Prilipko - Jelle Raaijmakers (gmta) @@ -1148,7 +1152,6 @@ The Symfony Connect username in parenthesis allows to get more information - Wybren Koelmans (wybren_koelmans) - Roberto Nygaard - victor-prdh - - Kev - Davide Borsatto (davide.borsatto) - Florian Hermann (fhermann) - zenas1210 @@ -1182,6 +1185,7 @@ The Symfony Connect username in parenthesis allows to get more information - Mathias Brodala (mbrodala) - Robert Fischer (sandoba) - Tarjei Huse (tarjei) + - Travis Carden (traviscarden) - mfettig - Besnik Br - Issam Raouf (iraouf) @@ -1243,6 +1247,7 @@ The Symfony Connect username in parenthesis allows to get more information - Volodymyr Panivko - kick-the-bucket - fedor.f + - roman joly (eltharin) - Yosmany Garcia (yosmanyga) - Jeremiasz Major - Jibé Barth (jibbarth) @@ -1262,6 +1267,7 @@ The Symfony Connect username in parenthesis allows to get more information - possum - Denis Zunke (donalberto) - Adrien Roches (neirda24) + - Thomas Trautner (thomastr) - _sir_kane (waly) - Olivier Maisonneuve - Gálik Pál @@ -1292,6 +1298,7 @@ The Symfony Connect username in parenthesis allows to get more information - Zhuravlev Alexander (scif) - Stefano Degenkamp (steef) - James Michael DuPont + - Tinjo Schöni - Carlos Buenosvinos (carlosbuenosvinos) - Christian Gripp (core23) - Jake (jakesoft) @@ -1350,6 +1357,7 @@ The Symfony Connect username in parenthesis allows to get more information - Ana Raro - Ana Raro - Tony Malzhacker + - Cosmin Sandu - Andreas Lutro (anlutro) - DUPUCH (bdupuch) - Cyril Quintin (cyqui) @@ -1399,6 +1407,7 @@ The Symfony Connect username in parenthesis allows to get more information - Matthieu Mota (matthieumota) - Maxime Pinot (maximepinot) - Jean-Baptiste GOMOND (mjbgo) + - Jakub Podhorsky (podhy) - abdul malik ikhsan (samsonasik) - Henry Snoek (snoek09) - Morgan Auchede @@ -1430,6 +1439,7 @@ The Symfony Connect username in parenthesis allows to get more information - Johnson Page (jwpage) - Kuba Werłos (kuba) - Ruben Gonzalez (rubenruateltek) + - Mokhtar Tlili (sf-djuba) - Michael Roterman (wtfzdotnet) - Philipp Keck - Pavol Tuka @@ -1470,6 +1480,7 @@ The Symfony Connect username in parenthesis allows to get more information - Nicolas de Marqué (nicola) - Thiago Cordeiro (thiagocordeiro) - Matthieu Bontemps + - Ian Irlen - Rootie - Sébastien Santoro (dereckson) - Daniel Alejandro Castro Arellano (lexcast) @@ -1671,6 +1682,7 @@ The Symfony Connect username in parenthesis allows to get more information - Bruno Rodrigues de Araujo (brunosinister) - Máximo Cuadros (mcuadros) - Jacek Wilczyński (jacekwilczynski) + - Christoph Kappestein - Camille Baronnet - EXT - THERAGE Kevin - tamirvs @@ -1832,11 +1844,11 @@ The Symfony Connect username in parenthesis allows to get more information - Peter Smeets (darkspartan) - Julien Bianchi (jubianchi) - Michael Dawart (mdawart) - - Sem Schidler (xvilo) - Robert Meijers - Tijs Verkoyen - James Sansbury - Marcin Chwedziak + - Dan Kadera - hjkl - Dan Wilga - Thijs Reijgersberg @@ -2271,7 +2283,6 @@ The Symfony Connect username in parenthesis allows to get more information - DidierLmn - Pedro Silva - Chihiro Adachi (chihiro-adachi) - - Thomas Trautner (thomastr) - Jeroen de Graaf - Ulrik McArdle - BiaDd @@ -2292,6 +2303,7 @@ The Symfony Connect username in parenthesis allows to get more information - Fabian Haase - roog - parinz1234 + - seho-nl - Romain Geissler - Martin Auswöger - Adrien Moiruad @@ -2396,6 +2408,7 @@ The Symfony Connect username in parenthesis allows to get more information - Raphael Hardt - Ivan Nemets - Qingshan Luo + - Michael Olšavský - Ergie Gonzaga - Matthew J Mucklo - AnrDaemon @@ -2501,6 +2514,7 @@ The Symfony Connect username in parenthesis allows to get more information - Nicolas Badey (nico-b) - Olivier Scherler (oscherler) - Flo Gleixner (redflo) + - Romain Jacquart (romainjacquart) - Shane Preece (shane) - Stephan Wentz (temp) - Johannes Goslar @@ -2680,7 +2694,6 @@ The Symfony Connect username in parenthesis allows to get more information - Flinsch - Maciej Schmidt - botbotbot - - Cosmin Sandu - tatankat - Cláudio Cesar - Timon van der Vorm @@ -2846,7 +2859,6 @@ The Symfony Connect username in parenthesis allows to get more information - Boudry Julien - amcastror - Bram Van der Sype (brammm) - - roman joly (eltharin) - Guile (guile) - Mark Beech (jaybizzle) - Julien Moulin (lizjulien) @@ -2907,6 +2919,7 @@ The Symfony Connect username in parenthesis allows to get more information - J Bruni - Alexey Prilipko - vlakoff + - Anthony Tenneriello - thib92 - Yiorgos Kalligeros - Rudolf Ratusiński @@ -2923,6 +2936,7 @@ The Symfony Connect username in parenthesis allows to get more information - Frédéric G. Marand (fgm) - Freek Van der Herten (freekmurze) - Luca Genuzio (genuzio) + - Ben Gamra Housseine (hbgamra) - Andrew Marcinkevičius (ifdattic) - Ioana Hazsda (ioana-hazsda) - Jan Marek (janmarek) @@ -3175,13 +3189,11 @@ The Symfony Connect username in parenthesis allows to get more information - Olivier Laviale (olvlvl) - Pierre Gasté (pierre_g) - Pablo Monterde Perez (plebs) - - Jakub Podhorsky (podhy) - Pierre-Olivier Vares (povares) - Jimmy Leger (redpanda) - Ronny López (ronnylt) - Julius (sakalys) - Sébastien JEAN (sebastien76) - - Mokhtar Tlili (sf-djuba) - Dmitry (staratel) - Marcin Szepczynski (szepczynski) - Tito Miguel Costa (titomiguelcosta) @@ -3193,7 +3205,6 @@ The Symfony Connect username in parenthesis allows to get more information - Yorkie Chadwick (yorkie76) - Zakaria AMMOURA (zakariaamm) - Maxime Aknin (3m1x4m) - - Geordie - Pavel Barton - Exploit.cz - GuillaumeVerdon @@ -3203,7 +3214,6 @@ The Symfony Connect username in parenthesis allows to get more information - Youpie - Jason Stephens - srsbiz - - Tinjo Schöni - Taylan Kasap - Michael Orlitzky - Nicolas A. Bérard-Nault diff --git a/src/Symfony/Bridge/Doctrine/Messenger/DoctrineOpenTransactionLoggerMiddleware.php b/src/Symfony/Bridge/Doctrine/Messenger/DoctrineOpenTransactionLoggerMiddleware.php index 75187a1e490c5..76380154277c9 100644 --- a/src/Symfony/Bridge/Doctrine/Messenger/DoctrineOpenTransactionLoggerMiddleware.php +++ b/src/Symfony/Bridge/Doctrine/Messenger/DoctrineOpenTransactionLoggerMiddleware.php @@ -41,11 +41,12 @@ protected function handleForManager(EntityManagerInterface $entityManager, Envel } $this->isHandling = true; + $initialTransactionLevel = $entityManager->getConnection()->getTransactionNestingLevel(); try { return $stack->next()->handle($envelope, $stack); } finally { - if ($entityManager->getConnection()->isTransactionActive()) { + if ($entityManager->getConnection()->getTransactionNestingLevel() > $initialTransactionLevel) { $this->logger?->error('A handler opened a transaction but did not close it.', [ 'message' => $envelope->getMessage(), ]); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineOpenTransactionLoggerMiddlewareTest.php b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineOpenTransactionLoggerMiddlewareTest.php index 8d49caa38fa7e..56a5a6641bec9 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineOpenTransactionLoggerMiddlewareTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineOpenTransactionLoggerMiddlewareTest.php @@ -51,9 +51,9 @@ public function log($level, $message, $context = []): void public function testMiddlewareWrapsInTransactionAndFlushes() { - $this->connection->expects($this->exactly(1)) - ->method('isTransactionActive') - ->willReturn(true, true, false) + $this->connection->expects($this->exactly(2)) + ->method('getTransactionNestingLevel') + ->willReturn(0, 1) ; $this->middleware->handle(new Envelope(new \stdClass()), $this->getStackMock()); diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 2b1b590c33f31..3249f12e59e32 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -418,7 +418,7 @@ private static function hasColorSupport() } // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { return false; } diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/log_file.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/log_file.phpt index 7f114ab5e2e5a..51f8d6cb1b21e 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/log_file.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/log_file.phpt @@ -2,7 +2,7 @@ Test DeprecationErrorHandler with log file --FILE-- callCreateUploadedFile($uploadedFile); $size = $symfonyUploadedFile->getSize(); - $uniqid = uniqid(); + $uniqid = uniqid('', true); $symfonyUploadedFile->move($this->tmpDir, $uniqid); $this->assertEquals($uploadedFile->getSize(), $size); @@ -198,7 +198,7 @@ public function testCreateUploadedFileWithError() private function createUploadedFile(string $content, int $error, string $clientFileName, string $clientMediaType): UploadedFile { - $filePath = tempnam($this->tmpDir, uniqid()); + $filePath = tempnam($this->tmpDir, uniqid('', true)); file_put_contents($filePath, $content); return new UploadedFile($filePath, filesize($filePath), $error, $clientFileName, $clientMediaType); diff --git a/src/Symfony/Bridge/PsrHttpMessage/Tests/Factory/PsrHttpFactoryTest.php b/src/Symfony/Bridge/PsrHttpMessage/Tests/Factory/PsrHttpFactoryTest.php index 41629e8c69fc9..0c4122168449f 100644 --- a/src/Symfony/Bridge/PsrHttpMessage/Tests/Factory/PsrHttpFactoryTest.php +++ b/src/Symfony/Bridge/PsrHttpMessage/Tests/Factory/PsrHttpFactoryTest.php @@ -131,7 +131,7 @@ public function testGetContentCanBeCalledAfterRequestCreation() private function createUploadedFile(string $content, string $originalName, string $mimeType, int $error): UploadedFile { - $path = tempnam($this->tmpDir, uniqid()); + $path = tempnam($this->tmpDir, uniqid('', true)); file_put_contents($path, $content); return new UploadedFile($path, $originalName, $mimeType, $error, true); @@ -182,7 +182,7 @@ public function testCreateResponseFromStreamed() public function testCreateResponseFromBinaryFile() { - $path = tempnam($this->tmpDir, uniqid()); + $path = tempnam($this->tmpDir, uniqid('', true)); file_put_contents($path, 'Binary'); $response = new BinaryFileResponse($path); @@ -194,7 +194,7 @@ public function testCreateResponseFromBinaryFile() public function testCreateResponseFromBinaryFileWithRange() { - $path = tempnam($this->tmpDir, uniqid()); + $path = tempnam($this->tmpDir, uniqid('', true)); file_put_contents($path, 'Binary'); $request = new Request(); diff --git a/src/Symfony/Bridge/PsrHttpMessage/Tests/Functional/CovertTest.php b/src/Symfony/Bridge/PsrHttpMessage/Tests/Functional/CovertTest.php index b0ea766922db5..c350f2964d7d5 100644 --- a/src/Symfony/Bridge/PsrHttpMessage/Tests/Functional/CovertTest.php +++ b/src/Symfony/Bridge/PsrHttpMessage/Tests/Functional/CovertTest.php @@ -217,7 +217,7 @@ public static function responseProvider(): array private static function createUploadedFile(string $content, string $originalName, string $mimeType, int $error): UploadedFile { - $path = tempnam(sys_get_temp_dir(), uniqid()); + $path = tempnam(sys_get_temp_dir(), uniqid('', true)); file_put_contents($path, $content); return new UploadedFile($path, $originalName, $mimeType, $error, true); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php index ac711e3dbd850..5945c16cc7c0e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/SecretsDecryptToLocalCommand.php @@ -48,7 +48,7 @@ protected function configure(): void %command.full_name% -When the option --force is provided, secrets that already exist in the local vault are overriden. +When the --force option is provided, secrets that already exist in the local vault are overridden. %command.full_name% --force EOF diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index ad352160822ae..4f23d43964402 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -1197,7 +1197,7 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e ->arrayNode('default_context') ->normalizeKeys(false) ->useAttributeAsKey('name') - ->beforeNormalization() + ->validate() ->ifTrue(fn () => $this->debug && class_exists(JsonParser::class)) ->then(fn (array $v) => $v + [JsonDecode::DETAILED_ERROR_MESSAGES => true]) ->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 84dbeabe98bdd..83518061fed36 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -1334,6 +1334,10 @@ private function registerAssetMapperConfiguration(array $config, ContainerBuilde { $loader->load('asset_mapper.php'); + if (!$assetEnabled) { + $container->removeDefinition('asset_mapper.asset_package'); + } + if (!$httpClientEnabled) { $container->register('asset_mapper.http_client', HttpClientInterface::class) ->addTag('container.error') diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php index 6ff003b47d105..3b017dd0830f2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php @@ -34,7 +34,7 @@ class AnnotationsCacheWarmerTest extends TestCase protected function setUp(): void { - $this->cacheDir = sys_get_temp_dir().'/'.uniqid(); + $this->cacheDir = sys_get_temp_dir().'/'.uniqid('', true); $fs = new Filesystem(); $fs->mkdir($this->cacheDir); parent::setUp(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php index 294a3cd25c1de..66cf6b8d7f4c7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php @@ -37,7 +37,7 @@ class ConfigBuilderCacheWarmerTest extends TestCase protected function setUp(): void { - $this->varDir = sys_get_temp_dir().'/'.uniqid(); + $this->varDir = sys_get_temp_dir().'/'.uniqid('', true); $fs = new Filesystem(); $fs->mkdir($this->varDir); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index ca34ce1092e7d..171cfedc4c3f5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -13,6 +13,7 @@ use Doctrine\DBAL\Connection; use PHPUnit\Framework\TestCase; +use Seld\JsonLint\JsonParser; use Symfony\Bundle\FrameworkBundle\DependencyInjection\Configuration; use Symfony\Bundle\FullStack; use Symfony\Component\Cache\Adapter\DoctrineAdapter; @@ -566,6 +567,72 @@ public function testEnabledLockNeedsResources() ]); } + public function testSerializerJsonDetailedErrorMessagesEnabledWhenDefaultContextIsConfigured() + { + $processor = new Processor(); + $config = $processor->processConfiguration(new Configuration(true), [ + [ + 'http_method_override' => false, + 'handle_all_throwables' => true, + 'php_errors' => ['log' => true], + 'serializer' => [ + 'default_context' => [ + 'foo' => 'bar', + ], + ], + ], + ]); + + $this->assertSame(['foo' => 'bar', JsonDecode::DETAILED_ERROR_MESSAGES => true], $config['serializer']['default_context'] ?? []); + } + + public function testSerializerJsonDetailedErrorMessagesInDefaultContextCanBeDisabled() + { + $processor = new Processor(); + $config = $processor->processConfiguration(new Configuration(true), [ + [ + 'http_method_override' => false, + 'handle_all_throwables' => true, + 'php_errors' => ['log' => true], + 'serializer' => [ + 'default_context' => [ + 'foo' => 'bar', + JsonDecode::DETAILED_ERROR_MESSAGES => false, + ], + ], + ], + ]); + + $this->assertSame(['foo' => 'bar', JsonDecode::DETAILED_ERROR_MESSAGES => false], $config['serializer']['default_context'] ?? []); + } + + public function testSerializerJsonDetailedErrorMessagesInDefaultContextCanBeDisabledWithSeveralConfigsBeingMerged() + { + $processor = new Processor(); + $config = $processor->processConfiguration(new Configuration(true), [ + [ + 'http_method_override' => false, + 'handle_all_throwables' => true, + 'php_errors' => ['log' => true], + 'serializer' => [ + 'default_context' => [ + 'foo' => 'bar', + JsonDecode::DETAILED_ERROR_MESSAGES => false, + ], + ], + ], + [ + 'serializer' => [ + 'default_context' => [ + 'foobar' => 'baz', + ], + ], + ], + ]); + + $this->assertSame(['foo' => 'bar', JsonDecode::DETAILED_ERROR_MESSAGES => false, 'foobar' => 'baz'], $config['serializer']['default_context'] ?? []); + } + protected static function getBundleDefaultConfig() { return [ diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/asset_mapper_without_assets.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/asset_mapper_without_assets.php new file mode 100644 index 0000000000000..8a74333b19324 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/asset_mapper_without_assets.php @@ -0,0 +1,10 @@ +loadFromExtension('framework', [ + 'annotations' => false, + 'asset_mapper' => null, + 'assets' => false, + 'handle_all_throwables' => true, + 'http_method_override' => false, + 'php_errors' => ['log' => true], +]); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/asset_mapper_without_assets.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/asset_mapper_without_assets.xml new file mode 100644 index 0000000000000..3976b1064222d --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/asset_mapper_without_assets.xml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/asset_mapper_without_assets.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/asset_mapper_without_assets.yml new file mode 100644 index 0000000000000..51f302b668843 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/asset_mapper_without_assets.yml @@ -0,0 +1,8 @@ +framework: + annotations: false + asset_mapper: ~ + assets: false + handle_all_throwables: true + http_method_override: false + php_errors: + log: true diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php index 55de5cc247652..705ec5f3144e3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php @@ -2386,6 +2386,16 @@ public function testWebhookWithoutSerializer() ); } + public function testAssetMapperWithoutAssets() + { + $container = $this->createContainerFromFile('asset_mapper_without_assets'); + + $this->assertTrue($container->has('asset_mapper')); + $this->assertFalse($container->has('asset_mapper.asset_package')); + $this->assertFalse($container->has('assets.packages')); + $this->assertFalse($container->has('assets._default_package')); + } + protected function createContainer(array $data = []) { return new ContainerBuilder(new EnvPlaceholderParameterBag(array_merge([ diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index 3d00b30a06fc4..383f68d203aca 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -579,6 +579,9 @@ private function createFirewall(ContainerBuilder $container, string $id, array $ $container->setAlias('security.user_checker.'.$id, new Alias($firewall['user_checker'], false)); + $userCheckerLocator = $container->getDefinition('security.user_checker_locator'); + $userCheckerLocator->replaceArgument(0, array_merge($userCheckerLocator->getArgument(0), [$id => new ServiceClosureArgument(new Reference('security.user_checker.'.$id))])); + foreach ($this->getSortedFactories() as $factory) { $key = str_replace('-', '_', $factory->getKey()); if ('custom_authenticators' !== $key && \array_key_exists($key, $firewall)) { diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/security.php b/src/Symfony/Bundle/SecurityBundle/Resources/config/security.php index d17254892215c..ccd77ad0e914d 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/security.php +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security.php @@ -19,6 +19,7 @@ use Symfony\Bundle\SecurityBundle\Security\FirewallContext; use Symfony\Bundle\SecurityBundle\Security\FirewallMap; use Symfony\Bundle\SecurityBundle\Security\LazyFirewallContext; +use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage; use Symfony\Component\Ldap\Security\LdapUserProvider; use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver; @@ -88,7 +89,7 @@ 'security.authenticator.managers_locator' => service('security.authenticator.managers_locator')->ignoreOnInvalid(), 'request_stack' => service('request_stack'), 'security.firewall.map' => service('security.firewall.map'), - 'security.user_checker' => service('security.user_checker'), + 'security.user_checker_locator' => service('security.user_checker_locator'), 'security.firewall.event_dispatcher_locator' => service('security.firewall.event_dispatcher_locator'), 'security.csrf.token_manager' => service('security.csrf.token_manager')->ignoreOnInvalid(), ]), @@ -124,6 +125,8 @@ ->args(['none']) ->set('security.user_checker', InMemoryUserChecker::class) + ->set('security.user_checker_locator', ServiceLocator::class) + ->args([[]]) ->set('security.expression_language', ExpressionLanguage::class) ->args([service('cache.security_expression_language')->nullOnInvalid()]) diff --git a/src/Symfony/Bundle/SecurityBundle/Security.php b/src/Symfony/Bundle/SecurityBundle/Security.php index 0c6260356e615..acb30adba8adf 100644 --- a/src/Symfony/Bundle/SecurityBundle/Security.php +++ b/src/Symfony/Bundle/SecurityBundle/Security.php @@ -127,7 +127,8 @@ public function login(UserInterface $user, ?string $authenticatorName = null, ?s $authenticator = $this->getAuthenticator($authenticatorName, $firewallName); - $this->container->get('security.user_checker')->checkPreAuth($user); + $userCheckerLocator = $this->container->get('security.user_checker_locator'); + $userCheckerLocator->get($firewallName)->checkPreAuth($user); return $this->container->get('security.authenticator.managers_locator')->get($firewallName)->authenticateUser($user, $authenticator, $request, $badges); } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/SecurityTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/SecurityTest.php index 045dfc70a7c5e..35bd329b2297e 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/SecurityTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/SecurityTest.php @@ -142,7 +142,7 @@ public function testLogin() ['request_stack', $requestStack], ['security.firewall.map', $firewallMap], ['security.authenticator.managers_locator', $this->createContainer('main', $userAuthenticator)], - ['security.user_checker', $userChecker], + ['security.user_checker_locator', $this->createContainer('main', $userChecker)], ]) ; @@ -188,7 +188,7 @@ public function testLoginReturnsAuthenticatorResponse() ['request_stack', $requestStack], ['security.firewall.map', $firewallMap], ['security.authenticator.managers_locator', $this->createContainer('main', $userAuthenticator)], - ['security.user_checker', $userChecker], + ['security.user_checker_locator', $this->createContainer('main', $userChecker)], ]) ; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 23895f70bb6ec..a7c0644fdd1bf 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -180,7 +180,7 @@ public function searchBarAction(Request $request): Response $this->cspHandler?->disableCsp(); $session = null; - if ($request->attributes->getBoolean('_stateless') && $request->hasSession()) { + if (!$request->attributes->getBoolean('_stateless') && $request->hasSession()) { $session = $request->getSession(); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/workflow.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/workflow.html.twig index 377b74f609f21..522d93da32430 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/workflow.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/workflow.html.twig @@ -60,6 +60,7 @@ dialog table td { padding: .625em; text-align: center; + word-wrap: break-word; } dialog table th { diff --git a/src/Symfony/Component/AssetMapper/Tests/CompiledAssetMapperConfigReaderTest.php b/src/Symfony/Component/AssetMapper/Tests/CompiledAssetMapperConfigReaderTest.php index 355bf838e1c25..8619c2b3719d4 100644 --- a/src/Symfony/Component/AssetMapper/Tests/CompiledAssetMapperConfigReaderTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/CompiledAssetMapperConfigReaderTest.php @@ -23,8 +23,8 @@ class CompiledAssetMapperConfigReaderTest extends TestCase protected function setUp(): void { $this->filesystem = new Filesystem(); - $this->writableRoot = __DIR__.'/../Fixtures/importmaps_for_writing'; - if (!file_exists(__DIR__.'/../Fixtures/importmaps_for_writing')) { + $this->writableRoot = __DIR__.'/../Fixtures/compiled_asset_mapper_config_reader'; + if (!file_exists(__DIR__.'/../Fixtures/compiled_asset_mapper_config_reader')) { $this->filesystem->mkdir($this->writableRoot); } // realpath to help path comparisons in the tests diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php index fbfb8b4654664..a9737be5408fa 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapConfigReaderTest.php @@ -26,17 +26,14 @@ class ImportMapConfigReaderTest extends TestCase protected function setUp(): void { $this->filesystem = new Filesystem(); - if (!file_exists(__DIR__.'/../Fixtures/importmaps_for_writing')) { - $this->filesystem->mkdir(__DIR__.'/../Fixtures/importmaps_for_writing'); - } - if (!file_exists(__DIR__.'/../Fixtures/importmaps_for_writing/assets')) { - $this->filesystem->mkdir(__DIR__.'/../Fixtures/importmaps_for_writing/assets'); + if (!file_exists(__DIR__.'/../Fixtures/importmap_config_reader/assets')) { + $this->filesystem->mkdir(__DIR__.'/../Fixtures/importmap_config_reader/assets'); } } protected function tearDown(): void { - $this->filesystem->remove(__DIR__.'/../Fixtures/importmaps_for_writing'); + $this->filesystem->remove(__DIR__.'/../Fixtures/importmap_config_reader'); } public function testGetEntriesAndWriteEntries() @@ -63,7 +60,7 @@ public function testGetEntriesAndWriteEntries() ], ]; EOF; - file_put_contents(__DIR__.'/../Fixtures/importmaps_for_writing/importmap.php', $importMap); + file_put_contents(__DIR__.'/../Fixtures/importmap_config_reader/importmap.php', $importMap); $remotePackageStorage = $this->createMock(RemotePackageStorage::class); $remotePackageStorage->expects($this->any()) @@ -72,7 +69,7 @@ public function testGetEntriesAndWriteEntries() return '/path/to/vendor/'.$packageModuleSpecifier.'.'.$type->value; }); $reader = new ImportMapConfigReader( - __DIR__.'/../Fixtures/importmaps_for_writing/importmap.php', + __DIR__.'/../Fixtures/importmap_config_reader/importmap.php', $remotePackageStorage, ); $entries = $reader->getEntries(); @@ -100,11 +97,11 @@ public function testGetEntriesAndWriteEntries() $this->assertSame('package/with_file.js', $packageWithFileEntry->packageModuleSpecifier); // now save the original raw data from importmap.php and delete the file - $originalImportMapData = (static fn () => include __DIR__.'/../Fixtures/importmaps_for_writing/importmap.php')(); - unlink(__DIR__.'/../Fixtures/importmaps_for_writing/importmap.php'); + $originalImportMapData = (static fn () => eval('?>'.file_get_contents(__DIR__.'/../Fixtures/importmap_config_reader/importmap.php')))(); + unlink(__DIR__.'/../Fixtures/importmap_config_reader/importmap.php'); // dump the entries back to the file $reader->writeEntries($entries); - $newImportMapData = (static fn () => include __DIR__.'/../Fixtures/importmaps_for_writing/importmap.php')(); + $newImportMapData = (static fn () => eval('?>'.file_get_contents(__DIR__.'/../Fixtures/importmap_config_reader/importmap.php')))(); $this->assertSame($originalImportMapData, $newImportMapData); } diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapGeneratorTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapGeneratorTest.php index deafa38e2cef8..24289ff3d6740 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapGeneratorTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapGeneratorTest.php @@ -30,10 +30,9 @@ class ImportMapGeneratorTest extends TestCase private AssetMapperInterface&MockObject $assetMapper; private CompiledAssetMapperConfigReader&MockObject $compiledConfigReader; private ImportMapConfigReader&MockObject $configReader; - private ImportMapGenerator $importMapGenerator; private Filesystem $filesystem; - private static string $writableRoot = __DIR__.'/../Fixtures/importmaps_for_writing'; + private static string $writableRoot = __DIR__.'/../Fixtures/importmap_generator'; protected function setUp(): void { @@ -725,7 +724,7 @@ private function createImportMapGenerator(): ImportMapGenerator return ImportMapEntry::createRemote($importName, $type, $path, $version, $packageModuleSpecifier, $isEntrypoint); }); - return $this->importMapGenerator = new ImportMapGenerator( + return new ImportMapGenerator( $this->assetMapper, $this->compiledConfigReader, $this->configReader, diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php index 551a60492460d..51764e654f529 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapManagerTest.php @@ -32,18 +32,14 @@ class ImportMapManagerTest extends TestCase private PackageResolverInterface&MockObject $packageResolver; private ImportMapConfigReader&MockObject $configReader; private RemotePackageDownloader&MockObject $remotePackageDownloader; - private ImportMapManager $importMapManager; private Filesystem $filesystem; - private static string $writableRoot = __DIR__.'/../Fixtures/importmaps_for_writing'; + private static string $writableRoot = __DIR__.'/../Fixtures/importmap_manager'; protected function setUp(): void { $this->filesystem = new Filesystem(); - if (!file_exists(__DIR__.'/../Fixtures/importmaps_for_writing')) { - $this->filesystem->mkdir(self::$writableRoot); - } - if (!file_exists(__DIR__.'/../Fixtures/importmaps_for_writing/assets')) { + if (!file_exists(__DIR__.'/../Fixtures/importmap_manager/assets')) { $this->filesystem->mkdir(self::$writableRoot.'/assets'); } } @@ -386,7 +382,7 @@ private function createImportMapManager(): ImportMapManager return ImportMapEntry::createRemote($importName, $type, $path, $version, $packageModuleSpecifier, $isEntrypoint); }); - return $this->importMapManager = new ImportMapManager( + return new ImportMapManager( $this->assetMapper, $this->configReader, $this->remotePackageDownloader, diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageDownloaderTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageDownloaderTest.php index e3e8cff663894..b03d0dc63430d 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageDownloaderTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageDownloaderTest.php @@ -24,7 +24,7 @@ class RemotePackageDownloaderTest extends TestCase { private Filesystem $filesystem; - private static string $writableRoot = __DIR__.'/../Fixtures/importmaps_for_writing'; + private static string $writableRoot = __DIR__.'/../Fixtures/remote_package_downloader'; protected function setUp(): void { diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php index 0019f604cc8c5..9064eecc1856d 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php @@ -20,14 +20,14 @@ class RemotePackageStorageTest extends TestCase { private Filesystem $filesystem; - private static string $writableRoot = __DIR__.'/../Fixtures/importmaps_for_writing'; + private static string $writableRoot; + private static int $writableRootIndex = 0; protected function setUp(): void { + self::$writableRoot = sys_get_temp_dir().'/remote_package_storage'.++self::$writableRootIndex; $this->filesystem = new Filesystem(); - if (!$this->filesystem->exists(self::$writableRoot)) { - $this->filesystem->mkdir(self::$writableRoot); - } + $this->filesystem->mkdir(self::$writableRoot); } protected function tearDown(): void @@ -41,19 +41,24 @@ public function testGetStorageDir() $this->assertSame(realpath(self::$writableRoot.'/assets/vendor'), realpath($storage->getStorageDir())); } - public function testSaveThrowsWhenVendorDirectoryIsNotWritable() + public function testSaveThrowsWhenFailing() { - $this->filesystem->mkdir($vendorDir = self::$writableRoot.'/assets/acme/vendor'); - $this->filesystem->chmod($vendorDir, 0555); + $vendorDir = self::$writableRoot.'/assets/acme/vendor'; + $this->filesystem->mkdir($vendorDir.'/module_specifier'); + $this->filesystem->touch($vendorDir.'/module_specifier/module_specifier.index.js'); + $this->filesystem->chmod($vendorDir.'/module_specifier/module_specifier.index.js', 0555); $storage = new RemotePackageStorage($vendorDir); $entry = ImportMapEntry::createRemote('foo', ImportMapType::JS, '/does/not/matter', '1.0.0', 'module_specifier', false); $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('file_put_contents('.$vendorDir.'/module_specifier/module_specifier.index.js): Failed to open stream: No such file or directory'); - $storage->save($entry, 'any content'); + $this->expectExceptionMessage('file_put_contents('.$vendorDir.'/module_specifier/module_specifier.index.js): Failed to open stream: Permission denied'); - $this->filesystem->remove($vendorDir); + try { + $storage->save($entry, 'any content'); + } finally { + $this->filesystem->chmod($vendorDir.'/module_specifier/module_specifier.index.js', 0777); + } } public function testIsDownloaded() @@ -106,7 +111,7 @@ public function testSaveExtraFile() public function testGetDownloadedPath(string $packageModuleSpecifier, ImportMapType $importMapType, string $expectedPath) { $storage = new RemotePackageStorage(self::$writableRoot.'/assets/vendor'); - $this->assertSame($expectedPath, $storage->getDownloadPath($packageModuleSpecifier, $importMapType)); + $this->assertSame(self::$writableRoot.$expectedPath, $storage->getDownloadPath($packageModuleSpecifier, $importMapType)); } public static function getDownloadPathTests(): iterable @@ -114,25 +119,25 @@ public static function getDownloadPathTests(): iterable yield 'javascript bare package' => [ 'packageModuleSpecifier' => 'foo', 'importMapType' => ImportMapType::JS, - 'expectedPath' => self::$writableRoot.'/assets/vendor/foo/foo.index.js', + 'expectedPath' => '/assets/vendor/foo/foo.index.js', ]; yield 'javascript package with path' => [ 'packageModuleSpecifier' => 'foo/bar', 'importMapType' => ImportMapType::JS, - 'expectedPath' => self::$writableRoot.'/assets/vendor/foo/bar.js', + 'expectedPath' => '/assets/vendor/foo/bar.js', ]; yield 'javascript package with path and extension' => [ 'packageModuleSpecifier' => 'foo/bar.js', 'importMapType' => ImportMapType::JS, - 'expectedPath' => self::$writableRoot.'/assets/vendor/foo/bar.js', + 'expectedPath' => '/assets/vendor/foo/bar.js', ]; yield 'CSS package with path' => [ 'packageModuleSpecifier' => 'foo/bar', 'importMapType' => ImportMapType::CSS, - 'expectedPath' => self::$writableRoot.'/assets/vendor/foo/bar.css', + 'expectedPath' => '/assets/vendor/foo/bar.css', ]; } } diff --git a/src/Symfony/Component/AssetMapper/Tests/MapperAwareAssetPackageIntegrationTest.php b/src/Symfony/Component/AssetMapper/Tests/MapperAwareAssetPackageIntegrationTest.php index 28818fd7a6515..821e660c6aae4 100644 --- a/src/Symfony/Component/AssetMapper/Tests/MapperAwareAssetPackageIntegrationTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/MapperAwareAssetPackageIntegrationTest.php @@ -11,18 +11,31 @@ namespace Symfony\Component\AssetMapper\Tests; -use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use PHPUnit\Framework\TestCase; use Symfony\Component\Asset\Packages; use Symfony\Component\AssetMapper\Tests\Fixtures\AssetMapperTestAppKernel; +use Symfony\Component\Filesystem\Filesystem; -class MapperAwareAssetPackageIntegrationTest extends KernelTestCase +class MapperAwareAssetPackageIntegrationTest extends TestCase { - public function testDefaultAssetPackageIsDecorated() + private AssetMapperTestAppKernel $kernel; + private Filesystem $filesystem; + + protected function setUp(): void + { + $this->filesystem = new Filesystem(); + $this->kernel = new AssetMapperTestAppKernel('test', true); + $this->kernel->boot(); + } + + protected function tearDown(): void { - $kernel = new AssetMapperTestAppKernel('test', true); - $kernel->boot(); + $this->filesystem->remove($this->kernel->getProjectDir().'/var'); + } - $packages = $kernel->getContainer()->get('public.assets.packages'); + public function testDefaultAssetPackageIsDecorated() + { + $packages = $this->kernel->getContainer()->get('public.assets.packages'); \assert($packages instanceof Packages); $this->assertSame('/assets/file1-b3445cb7a86a0795a7af7f2004498aef.css', $packages->getUrl('file1.css')); $this->assertSame('/non-existent.css', $packages->getUrl('non-existent.css')); diff --git a/src/Symfony/Component/AssetMapper/Tests/Path/LocalPublicAssetsFilesystemTest.php b/src/Symfony/Component/AssetMapper/Tests/Path/LocalPublicAssetsFilesystemTest.php index 4363ccbf577a8..5e24546e0fbe8 100644 --- a/src/Symfony/Component/AssetMapper/Tests/Path/LocalPublicAssetsFilesystemTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/Path/LocalPublicAssetsFilesystemTest.php @@ -18,12 +18,12 @@ class LocalPublicAssetsFilesystemTest extends TestCase { private Filesystem $filesystem; - private static string $writableRoot = __DIR__.'/../Fixtures/importmaps_for_writing'; + private static string $writableRoot = __DIR__.'/../Fixtures/local_public_assets_filesystem'; protected function setUp(): void { $this->filesystem = new Filesystem(); - if (!file_exists(__DIR__.'/../Fixtures/importmaps_for_writing')) { + if (!file_exists(__DIR__.'/../Fixtures/local_public_assets_filesystem')) { $this->filesystem->mkdir(self::$writableRoot); } } diff --git a/src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php b/src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php index d12a2831fb484..4b144237ecd4b 100644 --- a/src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php +++ b/src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Relay\Relay; +use Symfony\Component\Cache\Traits\RelayProxy; use Symfony\Component\VarExporter\LazyProxyTrait; use Symfony\Component\VarExporter\ProxyHelper; @@ -62,14 +63,30 @@ public function testRelayProxy() { $proxy = file_get_contents(\dirname(__DIR__, 2).'/Traits/RelayProxy.php'); $proxy = substr($proxy, 0, 4 + strpos($proxy, '[];')); + $expectedProxy = $proxy; $methods = []; + $expectedMethods = []; + + foreach ((new \ReflectionClass(RelayProxy::class))->getMethods() as $method) { + if ('reset' === $method->name || method_exists(LazyProxyTrait::class, $method->name) || $method->isStatic()) { + continue; + } + + $return = $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return '; + $expectedMethods[$method->name] = "\n ".ProxyHelper::exportSignature($method, false, $args)."\n".<<lazyObjectState->realInstance ??= (\$this->lazyObjectState->initializer)())->{$method->name}({$args}); + } + + EOPHP; + } foreach ((new \ReflectionClass(Relay::class))->getMethods() as $method) { if ('reset' === $method->name || method_exists(LazyProxyTrait::class, $method->name) || $method->isStatic()) { continue; } $return = $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return '; - $methods[] = "\n ".ProxyHelper::exportSignature($method, false, $args)."\n".<<name] = "\n ".ProxyHelper::exportSignature($method, false, $args)."\n".<<lazyObjectState->realInstance ??= (\$this->lazyObjectState->initializer)())->{$method->name}({$args}); } @@ -80,6 +97,9 @@ public function testRelayProxy() uksort($methods, 'strnatcmp'); $proxy .= implode('', $methods)."}\n"; - $this->assertStringEqualsFile(\dirname(__DIR__, 2).'/Traits/RelayProxy.php', $proxy); + uksort($expectedMethods, 'strnatcmp'); + $expectedProxy .= implode('', $expectedMethods)."}\n"; + + $this->assertEquals($expectedProxy, $proxy); } } diff --git a/src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php b/src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php index 04665608c8f7f..51d933d028e32 100644 --- a/src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php +++ b/src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Cache\Tests\Traits; use PHPUnit\Framework\TestCase; +use Symfony\Component\Cache\Exception\InvalidArgumentException; use Symfony\Component\Cache\Traits\RedisTrait; /** @@ -132,4 +133,78 @@ public function testPconnectSelectsCorrectDatabase() ini_set('redis.pconnect.connection_limit', $prevPoolSize); } } + + /** + * @dataProvider provideDbIndexDsnParameter + */ + public function testDbIndexDsnParameter(string $dsn, int $expectedDb) + { + if (!getenv('REDIS_AUTHENTICATED_HOST')) { + self::markTestSkipped('REDIS_AUTHENTICATED_HOST env var is not defined.'); + } + + $mock = new class () { + use RedisTrait; + }; + $connection = $mock::createConnection($dsn); + self::assertSame($expectedDb, $connection->getDbNum()); + } + + public static function provideDbIndexDsnParameter(): array + { + return [ + [ + 'redis://:p%40ssword@'.getenv('REDIS_AUTHENTICATED_HOST'), + 0, + ], + [ + 'redis:?host['.getenv('REDIS_HOST').']', + 0, + ], + [ + 'redis:?host['.getenv('REDIS_HOST').']&dbindex=1', + 1, + ], + [ + 'redis://:p%40ssword@'.getenv('REDIS_AUTHENTICATED_HOST').'?dbindex=2', + 2, + ], + [ + 'redis://:p%40ssword@'.getenv('REDIS_AUTHENTICATED_HOST').'/4', + 4, + ], + [ + 'redis://:p%40ssword@'.getenv('REDIS_AUTHENTICATED_HOST').'/?dbindex=5', + 5, + ], + ]; + } + + /** + * @dataProvider provideInvalidDbIndexDsnParameter + */ + public function testInvalidDbIndexDsnParameter(string $dsn) + { + if (!getenv('REDIS_AUTHENTICATED_HOST')) { + self::markTestSkipped('REDIS_AUTHENTICATED_HOST env var is not defined.'); + } + $this->expectException(InvalidArgumentException::class); + + $mock = new class () { + use RedisTrait; + }; + $mock::createConnection($dsn); + } + + public static function provideInvalidDbIndexDsnParameter(): array + { + return [ + [ + 'redis://:p%40ssword@'.getenv('REDIS_AUTHENTICATED_HOST').'/abc' + ], + [ + 'redis://:p%40ssword@'.getenv('REDIS_AUTHENTICATED_HOST').'/3?dbindex=6' + ] + ]; + } } diff --git a/src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php b/src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php index a7a7ddd3fd9f3..3b976b66f697b 100644 --- a/src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php +++ b/src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php @@ -109,8 +109,13 @@ private function write(string $file, string $data, ?int $expiresAt = null): bool touch($tmp, $expiresAt ?: time() + 31556952); // 1 year in seconds } - $success = rename($tmp, $file); - $unlink = !$success; + if ('\\' === \DIRECTORY_SEPARATOR) { + $success = copy($tmp, $file); + $unlink = true; + } else { + $success = rename($tmp, $file); + $unlink = !$success; + } return $success; } finally { diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index d59d7ff031962..d1b7ae16c9ced 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -149,10 +149,10 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra if (isset($params['host']) || isset($params['path'])) { if (!isset($params['dbindex']) && isset($params['path'])) { if (preg_match('#/(\d+)?$#', $params['path'], $m)) { - $params['dbindex'] = $m[1] ?? '0'; + $params['dbindex'] = $m[1] ?? $query['dbindex'] ?? '0'; $params['path'] = substr($params['path'], 0, -\strlen($m[0])); } elseif (isset($params['host'])) { - throw new InvalidArgumentException('Invalid Redis DSN: query parameter "dbindex" must be a number.'); + throw new InvalidArgumentException('Invalid Redis DSN: parameter "dbindex" must be a number.'); } } @@ -167,6 +167,10 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra throw new InvalidArgumentException('Invalid Redis DSN: missing host.'); } + if (isset($params['dbindex'], $query['dbindex']) && $params['dbindex'] !== $query['dbindex']) { + throw new InvalidArgumentException('Invalid Redis DSN: path and query "dbindex" parameters mismatch.'); + } + $params += $query + $options + self::$defaultConnectionOptions; if (isset($params['redis_sentinel']) && !class_exists(\Predis\Client::class) && !class_exists(\RedisSentinel::class) && !class_exists(Sentinel::class)) { diff --git a/src/Symfony/Component/Cache/Traits/RelayProxy.php b/src/Symfony/Component/Cache/Traits/RelayProxy.php index ac839dfda9ca0..96d7d19b46785 100644 --- a/src/Symfony/Component/Cache/Traits/RelayProxy.php +++ b/src/Symfony/Component/Cache/Traits/RelayProxy.php @@ -28,6 +28,7 @@ class RelayProxy extends \Relay\Relay implements ResetInterface, LazyObjectInter use LazyProxyTrait { resetLazyObject as reset; } + use RelayProxyTrait; private const LAZY_OBJECT_PROPERTY_SCOPES = []; @@ -291,11 +292,6 @@ public function migrate($host, $port, $key, $dstdb, $timeout, $copy = false, $re return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->migrate(...\func_get_args()); } - public function copy($src, $dst, $options = null): \Relay\Relay|false|int - { - return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->copy(...\func_get_args()); - } - public function echo($arg): \Relay\Relay|bool|string { return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->echo(...\func_get_args()); diff --git a/src/Symfony/Component/Cache/Traits/RelayProxyTrait.php b/src/Symfony/Component/Cache/Traits/RelayProxyTrait.php new file mode 100644 index 0000000000000..a1d252b96d2bf --- /dev/null +++ b/src/Symfony/Component/Cache/Traits/RelayProxyTrait.php @@ -0,0 +1,156 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Traits; + +if (version_compare(phpversion('relay'), '0.8.1', '>=')) { + /** + * @internal + */ + trait RelayProxyTrait + { + public function copy($src, $dst, $options = null): \Relay\Relay|bool + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->copy(...\func_get_args()); + } + + public function jsonArrAppend($key, $value_or_array, $path = null): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrAppend(...\func_get_args()); + } + + public function jsonArrIndex($key, $path, $value, $start = 0, $stop = -1): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrIndex(...\func_get_args()); + } + + public function jsonArrInsert($key, $path, $index, $value, ...$other_values): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrInsert(...\func_get_args()); + } + + public function jsonArrLen($key, $path = null): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrLen(...\func_get_args()); + } + + public function jsonArrPop($key, $path = null, $index = -1): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrPop(...\func_get_args()); + } + + public function jsonArrTrim($key, $path, $start, $stop): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonArrTrim(...\func_get_args()); + } + + public function jsonClear($key, $path = null): \Relay\Relay|false|int + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonClear(...\func_get_args()); + } + + public function jsonDebug($command, $key, $path = null): \Relay\Relay|false|int + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonDebug(...\func_get_args()); + } + + public function jsonDel($key, $path = null): \Relay\Relay|false|int + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonDel(...\func_get_args()); + } + + public function jsonForget($key, $path = null): \Relay\Relay|false|int + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonForget(...\func_get_args()); + } + + public function jsonGet($key, $options = [], ...$paths): mixed + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonGet(...\func_get_args()); + } + + public function jsonMerge($key, $path, $value): \Relay\Relay|bool + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonMerge(...\func_get_args()); + } + + public function jsonMget($key_or_array, $path): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonMget(...\func_get_args()); + } + + public function jsonMset($key, $path, $value, ...$other_triples): \Relay\Relay|bool + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonMset(...\func_get_args()); + } + + public function jsonNumIncrBy($key, $path, $value): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonNumIncrBy(...\func_get_args()); + } + + public function jsonNumMultBy($key, $path, $value): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonNumMultBy(...\func_get_args()); + } + + public function jsonObjKeys($key, $path = null): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonObjKeys(...\func_get_args()); + } + + public function jsonObjLen($key, $path = null): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonObjLen(...\func_get_args()); + } + + public function jsonResp($key, $path = null): \Relay\Relay|array|false|int|string + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonResp(...\func_get_args()); + } + + public function jsonSet($key, $path, $value, $condition = null): \Relay\Relay|bool + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonSet(...\func_get_args()); + } + + public function jsonStrAppend($key, $value, $path = null): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonStrAppend(...\func_get_args()); + } + + public function jsonStrLen($key, $path = null): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonStrLen(...\func_get_args()); + } + + public function jsonToggle($key, $path): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonToggle(...\func_get_args()); + } + + public function jsonType($key, $path = null): \Relay\Relay|array|false + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->jsonType(...\func_get_args()); + } + } +} else { + /** + * @internal + */ + trait RelayProxyTrait + { + public function copy($src, $dst, $options = null): \Relay\Relay|false|int + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->copy(...\func_get_args()); + } + } +} diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php index 218bc9ef22937..ca90096a440ed 100644 --- a/src/Symfony/Component/Console/Output/StreamOutput.php +++ b/src/Symfony/Component/Console/Output/StreamOutput.php @@ -93,7 +93,7 @@ protected function doWrite(string $message, bool $newline) protected function hasColorSupport(): bool { // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { return false; } diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index d8e1ae8b97e5d..ac1d47245b1ef 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -71,12 +71,10 @@ protected function tearDown(): void if (\function_exists('pcntl_signal')) { // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } } diff --git a/src/Symfony/Component/Console/Tests/ConsoleEventsTest.php b/src/Symfony/Component/Console/Tests/ConsoleEventsTest.php index 93c228aa47eef..9c04d2706e8da 100644 --- a/src/Symfony/Component/Console/Tests/ConsoleEventsTest.php +++ b/src/Symfony/Component/Console/Tests/ConsoleEventsTest.php @@ -35,12 +35,10 @@ protected function tearDown(): void if (\function_exists('pcntl_signal')) { pcntl_async_signals(false); // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } } diff --git a/src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php b/src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php index 4cb4354163812..f997f7c1d8cee 100644 --- a/src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php +++ b/src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php @@ -23,12 +23,10 @@ protected function tearDown(): void { pcntl_async_signals(false); // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } public function testOneCallbackForASignalSignalIsHandled() diff --git a/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php b/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php index 701786245d91c..42410cebefdd7 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php @@ -133,6 +133,10 @@ public static function getDefault(ContainerBuilder $container, string $serviceId return null; } + if ($r->isInterface()) { + return null; + } + if (null !== $indexAttribute) { $service = $class !== $serviceId ? sprintf('service "%s"', $serviceId) : 'on the corresponding service'; $message = [sprintf('Either method "%s::%s()" should ', $class, $defaultMethod), sprintf(' or tag "%s" on %s is missing attribute "%s".', $tagName, $service, $indexAttribute)]; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/PriorityTaggedServiceTraitTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/PriorityTaggedServiceTraitTest.php index 726bfddd6d40f..bc7387ab4de44 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/PriorityTaggedServiceTraitTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/PriorityTaggedServiceTraitTest.php @@ -151,6 +151,8 @@ public function testTheIndexedTagsByDefaultIndexMethod() $container->register('service3', IntTagClass::class)->addTag('my_custom_tag'); + $container->register('service4', HelloInterface::class)->addTag('my_custom_tag'); + $priorityTaggedServiceTraitImplementation = new PriorityTaggedServiceTraitImplementation(); $tag = new TaggedIteratorArgument('my_custom_tag', 'foo', 'getFooBar'); @@ -158,6 +160,7 @@ public function testTheIndexedTagsByDefaultIndexMethod() 'bar_tab_class_with_defaultmethod' => new TypedReference('service2', BarTagClass::class), 'service1' => new TypedReference('service1', FooTagClass::class), '10' => new TypedReference('service3', IntTagClass::class), + 'service4' => new TypedReference('service4', HelloInterface::class), ]; $services = $priorityTaggedServiceTraitImplementation->test($tag, $container); $this->assertSame(array_keys($expected), array_keys($services)); @@ -247,3 +250,8 @@ class HelloNamedService extends \stdClass class HelloNamedService2 { } + +interface HelloInterface +{ + public static function getFooBar(): string; +} diff --git a/src/Symfony/Component/Dotenv/Tests/DotenvTest.php b/src/Symfony/Component/Dotenv/Tests/DotenvTest.php index 72d0d5630ec9a..644126d6b2ba1 100644 --- a/src/Symfony/Component/Dotenv/Tests/DotenvTest.php +++ b/src/Symfony/Component/Dotenv/Tests/DotenvTest.php @@ -430,16 +430,16 @@ public function testHttpVarIsPartiallyOverridden() $this->assertSame('http_value', $_SERVER['HTTP_TEST_ENV_VAR']); } - public function testEnvVarIsOverriden() + public function testEnvVarIsOverridden() { - putenv('TEST_ENV_VAR_OVERRIDEN=original_value'); + putenv('TEST_ENV_VAR_OVERRIDDEN=original_value'); $dotenv = (new Dotenv())->usePutenv(); - $dotenv->populate(['TEST_ENV_VAR_OVERRIDEN' => 'new_value'], true); + $dotenv->populate(['TEST_ENV_VAR_OVERRIDDEN' => 'new_value'], true); - $this->assertSame('new_value', getenv('TEST_ENV_VAR_OVERRIDEN')); - $this->assertSame('new_value', $_ENV['TEST_ENV_VAR_OVERRIDEN']); - $this->assertSame('new_value', $_SERVER['TEST_ENV_VAR_OVERRIDEN']); + $this->assertSame('new_value', getenv('TEST_ENV_VAR_OVERRIDDEN')); + $this->assertSame('new_value', $_ENV['TEST_ENV_VAR_OVERRIDDEN']); + $this->assertSame('new_value', $_SERVER['TEST_ENV_VAR_OVERRIDDEN']); } public function testMemorizingLoadedVarsNamesInSpecialVar() diff --git a/src/Symfony/Component/ErrorHandler/ErrorHandler.php b/src/Symfony/Component/ErrorHandler/ErrorHandler.php index d82ce6c7024cc..777833b95ff8b 100644 --- a/src/Symfony/Component/ErrorHandler/ErrorHandler.php +++ b/src/Symfony/Component/ErrorHandler/ErrorHandler.php @@ -55,7 +55,6 @@ class ErrorHandler \E_USER_DEPRECATED => 'User Deprecated', \E_NOTICE => 'Notice', \E_USER_NOTICE => 'User Notice', - \E_STRICT => 'Runtime Notice', \E_WARNING => 'Warning', \E_USER_WARNING => 'User Warning', \E_COMPILE_WARNING => 'Compile Warning', @@ -73,7 +72,6 @@ class ErrorHandler \E_USER_DEPRECATED => [null, LogLevel::INFO], \E_NOTICE => [null, LogLevel::WARNING], \E_USER_NOTICE => [null, LogLevel::WARNING], - \E_STRICT => [null, LogLevel::WARNING], \E_WARNING => [null, LogLevel::WARNING], \E_USER_WARNING => [null, LogLevel::WARNING], \E_COMPILE_WARNING => [null, LogLevel::WARNING], @@ -181,6 +179,11 @@ public static function call(callable $function, mixed ...$arguments): mixed public function __construct(?BufferingLogger $bootstrappingLogger = null, bool $debug = false) { + if (\PHP_VERSION_ID < 80400) { + $this->levels[\E_STRICT] = 'Runtime Notice'; + $this->loggers[\E_STRICT] = [null, LogLevel::WARNING]; + } + if ($bootstrappingLogger) { $this->bootstrappingLogger = $bootstrappingLogger; $this->setDefaultLogger($bootstrappingLogger); diff --git a/src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php b/src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php index 17745c8170818..032f194d2f542 100644 --- a/src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php +++ b/src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php @@ -61,7 +61,7 @@ public function render(\Throwable $exception): FlattenException { $headers = ['Content-Type' => 'text/html; charset='.$this->charset]; if (\is_bool($this->debug) ? $this->debug : ($this->debug)($exception)) { - $headers['X-Debug-Exception'] = rawurlencode($exception->getMessage()); + $headers['X-Debug-Exception'] = rawurlencode(substr($exception->getMessage(), 0, 2000)); $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); } diff --git a/src/Symfony/Component/ErrorHandler/ErrorRenderer/SerializerErrorRenderer.php b/src/Symfony/Component/ErrorHandler/ErrorRenderer/SerializerErrorRenderer.php index a42ce3f2b8138..b09a6e00c3a7b 100644 --- a/src/Symfony/Component/ErrorHandler/ErrorRenderer/SerializerErrorRenderer.php +++ b/src/Symfony/Component/ErrorHandler/ErrorRenderer/SerializerErrorRenderer.php @@ -47,7 +47,7 @@ public function render(\Throwable $exception): FlattenException $headers = ['Vary' => 'Accept']; $debug = \is_bool($this->debug) ? $this->debug : ($this->debug)($exception); if ($debug) { - $headers['X-Debug-Exception'] = rawurlencode($exception->getMessage()); + $headers['X-Debug-Exception'] = rawurlencode(substr($exception->getMessage(), 0, 2000)); $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); } diff --git a/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php b/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php index e6d3e7d5b95a5..55a2a6b34561f 100644 --- a/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php +++ b/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php @@ -203,7 +203,6 @@ public function testDefaultLogger() \E_USER_DEPRECATED => [null, LogLevel::INFO], \E_NOTICE => [$logger, LogLevel::WARNING], \E_USER_NOTICE => [$logger, LogLevel::CRITICAL], - \E_STRICT => [null, LogLevel::WARNING], \E_WARNING => [null, LogLevel::WARNING], \E_USER_WARNING => [null, LogLevel::WARNING], \E_COMPILE_WARNING => [null, LogLevel::WARNING], @@ -215,6 +214,11 @@ public function testDefaultLogger() \E_ERROR => [null, LogLevel::CRITICAL], \E_CORE_ERROR => [null, LogLevel::CRITICAL], ]; + + if (\PHP_VERSION_ID < 80400) { + $loggers[\E_STRICT] = [null, LogLevel::WARNING]; + } + $this->assertSame($loggers, $handler->setLoggers([])); } finally { restore_error_handler(); @@ -440,7 +444,6 @@ public function testBootstrappingLogger() \E_USER_DEPRECATED => [$bootLogger, LogLevel::INFO], \E_NOTICE => [$bootLogger, LogLevel::WARNING], \E_USER_NOTICE => [$bootLogger, LogLevel::WARNING], - \E_STRICT => [$bootLogger, LogLevel::WARNING], \E_WARNING => [$bootLogger, LogLevel::WARNING], \E_USER_WARNING => [$bootLogger, LogLevel::WARNING], \E_COMPILE_WARNING => [$bootLogger, LogLevel::WARNING], @@ -453,6 +456,10 @@ public function testBootstrappingLogger() \E_CORE_ERROR => [$bootLogger, LogLevel::CRITICAL], ]; + if (\PHP_VERSION_ID < 80400) { + $loggers[\E_STRICT] = [$bootLogger, LogLevel::WARNING]; + } + $this->assertSame($loggers, $handler->setLoggers([])); $handler->handleError(\E_DEPRECATED, 'Foo message', __FILE__, 123, []); diff --git a/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php index 3b3caa5e3f789..49144505f7883 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php @@ -27,7 +27,7 @@ protected function setUp(): void */ public function testRewindOnFtp() { - $i = new RecursiveDirectoryIterator('ftp://speedtest:speedtest@ftp.otenet.gr/', \RecursiveDirectoryIterator::SKIP_DOTS); + $i = new RecursiveDirectoryIterator('ftp://test.rebex.net/', \RecursiveDirectoryIterator::SKIP_DOTS); $i->rewind(); @@ -39,11 +39,11 @@ public function testRewindOnFtp() */ public function testSeekOnFtp() { - $i = new RecursiveDirectoryIterator('ftp://speedtest:speedtest@ftp.otenet.gr/', \RecursiveDirectoryIterator::SKIP_DOTS); + $i = new RecursiveDirectoryIterator('ftp://test.rebex.net/', \RecursiveDirectoryIterator::SKIP_DOTS); $contains = [ - 'ftp://speedtest:speedtest@ftp.otenet.gr'.\DIRECTORY_SEPARATOR.'test100Mb.db', - 'ftp://speedtest:speedtest@ftp.otenet.gr'.\DIRECTORY_SEPARATOR.'test100k.db', + 'ftp://test.rebex.net'.\DIRECTORY_SEPARATOR.'pub', + 'ftp://test.rebex.net'.\DIRECTORY_SEPARATOR.'readme.txt', ]; $actual = []; diff --git a/src/Symfony/Component/Form/Tests/Extension/DataCollector/FormDataExtractorTest.php b/src/Symfony/Component/Form/Tests/Extension/DataCollector/FormDataExtractorTest.php index ec01721c704b4..b8a1fee374035 100644 --- a/src/Symfony/Component/Form/Tests/Extension/DataCollector/FormDataExtractorTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/DataCollector/FormDataExtractorTest.php @@ -26,6 +26,7 @@ use Symfony\Component\Form\ResolvedFormType; use Symfony\Component\Form\ResolvedFormTypeFactory; use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer; +use Symfony\Component\Validator\Constraints\WordCount; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; @@ -300,35 +301,68 @@ public function testExtractSubmittedDataStoresErrorCause() $form->addError(new FormError('Invalid!', null, [], null, $violation)); $origin = spl_object_hash($form); - $this->assertDumpMatchesFormat(<< array:1 [ - "norm" => "Foobar" - ] - "errors" => array:1 [ - 0 => array:3 [ - "message" => "Invalid!" - "origin" => "$origin" - "trace" => array:2 [ - 0 => Symfony\Component\Validator\ConstraintViolation { - -message: "Foo" - -messageTemplate: "Foo" - -parameters: [] - -plural: null - -root: "Root" - -propertyPath: "property.path" - -invalidValue: "Invalid!" - -constraint: null - -code: null - -cause: Exception {%A} + if (class_exists(WordCount::class)) { + $expectedFormat = <<<"EODUMP" + array:3 [ + "submitted_data" => array:1 [ + "norm" => "Foobar" + ] + "errors" => array:1 [ + 0 => array:3 [ + "message" => "Invalid!" + "origin" => "$origin" + "trace" => array:2 [ + 0 => Symfony\Component\Validator\ConstraintViolation { + -message: "Foo" + -messageTemplate: "Foo" + -parameters: [] + -root: "Root" + -propertyPath: "property.path" + -invalidValue: "Invalid!" + -plural: null + -code: null + -constraint: null + -cause: Exception {%A} + } + 1 => Exception {#1} + ] + ] + ] + "synchronized" => true + ] + EODUMP; + } else { + $expectedFormat = <<<"EODUMP" + array:3 [ + "submitted_data" => array:1 [ + "norm" => "Foobar" + ] + "errors" => array:1 [ + 0 => array:3 [ + "message" => "Invalid!" + "origin" => "$origin" + "trace" => array:2 [ + 0 => Symfony\Component\Validator\ConstraintViolation { + -message: "Foo" + -messageTemplate: "Foo" + -parameters: [] + -plural: null + -root: "Root" + -propertyPath: "property.path" + -invalidValue: "Invalid!" + -constraint: null + -code: null + -cause: Exception {%A} + } + 1 => Exception {#1} + ] + ] + ] + "synchronized" => true + ] + EODUMP; } - 1 => Exception {#1} - ] - ] - ] - "synchronized" => true -] -EODUMP + $this->assertDumpMatchesFormat($expectedFormat , $this->dataExtractor->extractSubmittedData($form) ); diff --git a/src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php b/src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php index 20cf7ef48291b..1c3076324da02 100644 --- a/src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php @@ -115,7 +115,7 @@ public function testOverridingInternalAttributesUsingCurlOptions() $httpClient->request('POST', 'http://localhost:8057/', [ 'extra' => [ 'curl' => [ - \CURLOPT_PRIVATE => 'overriden private', + \CURLOPT_PRIVATE => 'overridden private', ], ], ]); diff --git a/src/Symfony/Component/HttpClient/Tests/HttplugClientTest.php b/src/Symfony/Component/HttpClient/Tests/HttplugClientTest.php index 182d52932f724..f5f6d8ddcf9be 100644 --- a/src/Symfony/Component/HttpClient/Tests/HttplugClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/HttplugClientTest.php @@ -37,6 +37,9 @@ public static function tearDownAfterClass(): void TestHttpServer::stop(); } + /** + * @requires function ob_gzhandler + */ public function testSendRequest() { $client = new HttplugClient(new NativeHttpClient()); @@ -51,6 +54,9 @@ public function testSendRequest() $this->assertSame('HTTP/1.1', $body['SERVER_PROTOCOL']); } + /** + * @requires function ob_gzhandler + */ public function testSendAsyncRequest() { $client = new HttplugClient(new NativeHttpClient()); diff --git a/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php b/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php index d1f4deb03a006..65b7f5b3f6794 100644 --- a/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php @@ -33,6 +33,9 @@ public static function tearDownAfterClass(): void TestHttpServer::stop(); } + /** + * @requires function ob_gzhandler + */ public function testSendRequest() { $factory = new Psr17Factory(); diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php index 5d18025616e93..f02793d3e813e 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php @@ -216,7 +216,7 @@ public function getMetadataBag(): MetadataBag */ protected function generateId(): string { - return hash('sha256', uniqid('ss_mock_', true)); + return bin2hex(random_bytes(16)); } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php index e8a194959d879..c7d47a4d70a35 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php @@ -344,7 +344,7 @@ public function testAcceptRangeOnUnsafeMethods() $this->assertEquals('none', $response->headers->get('Accept-Ranges')); } - public function testAcceptRangeNotOverriden() + public function testAcceptRangeNotOverridden() { $request = Request::create('/', 'POST'); $response = new BinaryFileResponse(__DIR__.'/File/Fixtures/test.gif', 200, ['Content-Type' => 'application/octet-stream']); diff --git a/src/Symfony/Component/HttpFoundation/Tests/InputBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/InputBagTest.php index 6a447a39ccd23..e2112726e21e2 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/InputBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/InputBagTest.php @@ -161,6 +161,24 @@ public function testFilterArrayWithoutArrayFlag() $bag->filter('foo', \FILTER_VALIDATE_INT); } + public function testAdd() + { + $bag = new InputBag(['foo' => 'bar']); + $bag->add(['baz' => 'qux']); + + $this->assertSame('bar', $bag->get('foo'), '->add() does not remove existing parameters'); + $this->assertSame('qux', $bag->get('baz'), '->add() adds new parameters'); + } + + public function testReplace() + { + $bag = new InputBag(['foo' => 'bar']); + $bag->replace(['baz' => 'qux']); + + $this->assertNull($bag->get('foo'), '->replace() removes existing parameters'); + $this->assertSame('qux', $bag->get('baz'), '->replace() adds new parameters'); + } + public function testGetEnum() { $bag = new InputBag(['valid-value' => 1]); diff --git a/src/Symfony/Component/HttpFoundation/Tests/RateLimiter/AbstractRequestRateLimiterTest.php b/src/Symfony/Component/HttpFoundation/Tests/RateLimiter/AbstractRequestRateLimiterTest.php index 4e102777a45c6..26f2fac90801e 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RateLimiter/AbstractRequestRateLimiterTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RateLimiter/AbstractRequestRateLimiterTest.php @@ -14,6 +14,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\RateLimiter\LimiterInterface; +use Symfony\Component\RateLimiter\Policy\NoLimiter; use Symfony\Component\RateLimiter\RateLimit; class AbstractRequestRateLimiterTest extends TestCase @@ -33,6 +34,34 @@ public function testConsume(array $rateLimits, ?RateLimit $expected) $this->assertSame($expected, $rateLimiter->consume(new Request())); } + public function testConsumeWithoutLimiterAddsSpecialNoLimiter() + { + $rateLimiter = new MockAbstractRequestRateLimiter([]); + + try { + $this->assertSame(\PHP_INT_MAX, $rateLimiter->consume(new Request())->getLimit()); + } catch (\TypeError $error) { + if (str_contains($error->getMessage(), 'RateLimit::__construct(): Argument #1 ($availableTokens) must be of type int, float given')) { + $this->markTestSkipped('This test cannot be run on a version of the RateLimiter component that uses \INF instead of \PHP_INT_MAX in NoLimiter.'); + } + + throw $error; + } + } + + public function testResetLimiters() + { + $rateLimiter = new MockAbstractRequestRateLimiter([ + $limiter1 = $this->createMock(LimiterInterface::class), + $limiter2 = $this->createMock(LimiterInterface::class), + ]); + + $limiter1->expects($this->once())->method('reset'); + $limiter2->expects($this->once())->method('reset'); + + $rateLimiter->reset(new Request()); + } + public static function provideRateLimits() { $now = new \DateTimeImmutable(); diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/MethodRequestMatcherTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/MethodRequestMatcherTest.php index d4af82cd985ff..19db917fe6bf5 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/MethodRequestMatcherTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/MethodRequestMatcherTest.php @@ -27,6 +27,13 @@ public function test(string $requestMethod, array|string $matcherMethod, bool $i $this->assertSame($isMatch, $matcher->matches($request)); } + public function testAlwaysMatchesOnEmptyMethod() + { + $matcher = new MethodRequestMatcher([]); + $request = Request::create('https://example.com', 'POST'); + $this->assertTrue($matcher->matches($request)); + } + public static function getData() { return [ diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/SchemeRequestMatcherTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/SchemeRequestMatcherTest.php index f8d83645f1089..6614bfcc210f9 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/SchemeRequestMatcherTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/SchemeRequestMatcherTest.php @@ -42,6 +42,13 @@ public function test(string $requestScheme, array|string $matcherScheme, bool $i } } + public function testAlwaysMatchesOnParamsHeaders() + { + $matcher = new SchemeRequestMatcher([]); + $request = Request::create('sftp://example.com'); + $this->assertTrue($matcher->matches($request)); + } + public static function getData() { return [ diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index d20596d9c3298..22c3bc2b3372e 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -76,11 +76,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.4.9'; - public const VERSION_ID = 60409; + public const VERSION = '6.4.10'; + public const VERSION_ID = 60410; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 9; + public const RELEASE_VERSION = 10; public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2026'; @@ -539,6 +539,7 @@ protected function initializeContainer() touch($oldContainerDir.'.legacy'); } + $buildDir = $this->container->getParameter('kernel.build_dir'); $cacheDir = $this->container->getParameter('kernel.cache_dir'); $preload = $this instanceof WarmableInterface ? (array) $this->warmUp($cacheDir, $buildDir) : []; diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php index 59872ec73c300..0ffa72fc3e0b3 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php @@ -205,7 +205,7 @@ public function testRequestNoLocaleFromAcceptLanguageHeader() $this->assertEquals('fr_FR', $request->getLocale()); } - public function testRequestAttributeLocaleNotOverridenFromAcceptLanguageHeader() + public function testRequestAttributeLocaleNotOverriddenFromAcceptLanguageHeader() { $request = Request::create('/'); $request->attributes->set('_locale', 'it'); diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php index 5837407abeb63..3064fca51f421 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php @@ -562,7 +562,7 @@ public function testUninitializedSessionWithoutInitializedSession() $this->assertSame('60', $response->headers->getCacheControlDirective('s-maxage')); } - public function testResponseHeadersMaxAgeAndExpiresNotBeOverridenIfSessionStarted() + public function testResponseHeadersMaxAgeAndExpiresNotBeOverriddenIfSessionStarted() { $session = $this->createMock(Session::class); $session->expects($this->once())->method('getUsageIndex')->willReturn(1); diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index fc5cffb6a7a48..94c498a0f2808 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -563,7 +563,7 @@ public function testWarmup() $kernel->boot(); $this->assertTrue($kernel->warmedUp); - $this->assertSame($kernel->getBuildDir(), $kernel->warmedUpBuildDir); + $this->assertSame(realpath($kernel->getBuildDir()), $kernel->warmedUpBuildDir); } public function testServicesResetter() diff --git a/src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php b/src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php index f516854226ba9..a7992e63baf5a 100644 --- a/src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php +++ b/src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php @@ -61,6 +61,7 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e $endpoint = sprintf('%s/v3/%s/messages', $this->getEndpoint(), urlencode($this->domain)); $response = $this->client->request('POST', 'https://'.$endpoint, [ + 'http_version' => '1.1', 'auth_basic' => 'api:'.$this->key, 'headers' => $headers, 'body' => $body->bodyToIterable(), diff --git a/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php b/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php index b563540893d7f..28a840e6bb4e4 100644 --- a/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php @@ -413,7 +413,7 @@ public function testInvalidSentinelMasterName() } $master = getenv('MESSENGER_REDIS_DSN'); - $uid = uniqid('sentinel_'); + $uid = uniqid('sentinel_', true); $exp = explode('://', $master, 2)[1]; $this->expectException(\InvalidArgumentException::class); diff --git a/src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php b/src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php index c14dd6c42fbec..e012a3871207c 100644 --- a/src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php +++ b/src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php @@ -78,7 +78,7 @@ public function onMessageFailed(WorkerMessageFailedEvent $event) $retryEnvelope = $this->withLimitedHistory($envelope, new DelayStamp($delay), new RedeliveryStamp($retryCount)); // re-send the message for retry - $this->getSenderForTransport($event->getReceiverName())->send($retryEnvelope); + $retryEnvelope = $this->getSenderForTransport($event->getReceiverName())->send($retryEnvelope); $this->eventDispatcher?->dispatch(new WorkerMessageRetriedEvent($retryEnvelope, $event->getReceiverName())); } else { diff --git a/src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageForRetryListenerTest.php b/src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageForRetryListenerTest.php index fccdae9bfa215..defa4cc4245df 100644 --- a/src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageForRetryListenerTest.php +++ b/src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageForRetryListenerTest.php @@ -14,13 +14,16 @@ use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\DependencyInjection\Container; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent; +use Symfony\Component\Messenger\Event\WorkerMessageRetriedEvent; use Symfony\Component\Messenger\EventListener\SendFailedMessageForRetryListener; use Symfony\Component\Messenger\Exception\RecoverableMessageHandlingException; use Symfony\Component\Messenger\Retry\RetryStrategyInterface; use Symfony\Component\Messenger\Stamp\DelayStamp; use Symfony\Component\Messenger\Stamp\RedeliveryStamp; +use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp; use Symfony\Component\Messenger\Transport\Sender\SenderInterface; class SendFailedMessageForRetryListenerTest extends TestCase @@ -190,4 +193,47 @@ public function testEnvelopeKeepOnlyTheLast10Stamps() $listener->onMessageFailed($event); } + + public function testRetriedEnvelopePassesToRetriedEvent() + { + $exception = new \Exception('no!'); + $envelope = new Envelope(new \stdClass()); + + $sender = $this->createMock(SenderInterface::class); + $sender->expects($this->once())->method('send')->willReturnCallback(static function (Envelope $envelope) { + return $envelope->with(new TransportMessageIdStamp(123)); + }); + + $eventDispatcher = $this->createMock(EventDispatcherInterface::class); + $eventDispatcher->expects($this->once())->method('dispatch')->willReturnCallback( + function (WorkerMessageRetriedEvent $retriedEvent) { + $envelope = $retriedEvent->getEnvelope(); + + $transportIdStamp = $envelope->last(TransportMessageIdStamp::class); + $this->assertNotNull($transportIdStamp); + + return $retriedEvent; + }); + + $senderLocator = new Container(); + $senderLocator->set('my_receiver', $sender); + + $retryStrategy = $this->createMock(RetryStrategyInterface::class); + $retryStrategy->expects($this->once())->method('isRetryable')->willReturn(true); + $retryStrategy->expects($this->once())->method('getWaitingTime')->willReturn(1000); + + $retryStrategyLocator = new Container(); + $retryStrategyLocator->set('my_receiver', $retryStrategy); + + $listener = new SendFailedMessageForRetryListener( + $senderLocator, + $retryStrategyLocator, + null, + $eventDispatcher + ); + + $event = new WorkerMessageFailedEvent($envelope, 'my_receiver', $exception); + + $listener->onMessageFailed($event); + } } diff --git a/src/Symfony/Component/Notifier/Bridge/Iqsms/IqsmsTransport.php b/src/Symfony/Component/Notifier/Bridge/Iqsms/IqsmsTransport.php index fbdac0d58f231..4cdb60c32fee3 100644 --- a/src/Symfony/Component/Notifier/Bridge/Iqsms/IqsmsTransport.php +++ b/src/Symfony/Component/Notifier/Bridge/Iqsms/IqsmsTransport.php @@ -64,7 +64,7 @@ protected function doSend(MessageInterface $message): SentMessage 'phone' => $message->getPhone(), 'text' => $message->getSubject(), 'sender' => $message->getFrom() ?: $this->from, - 'clientId' => uniqid(), + 'clientId' => uniqid('', true), ], ], 'login' => $this->login, diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php index a66a8dbda4c19..6a326c020fd8c 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php @@ -423,7 +423,7 @@ private function extractFromMutator(string $class, string $property): ?array $type = $this->extractFromReflectionType($reflectionType, $reflectionMethod->getDeclaringClass()); if (1 === \count($type) && \in_array($prefix, $this->arrayMutatorPrefixes)) { - $type = [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), $type[0])]; + $type = [new Type(Type::BUILTIN_TYPE_ARRAY, $this->isNullableProperty($class, $property), null, true, new Type(Type::BUILTIN_TYPE_INT), $type[0])]; } return $type; diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php index 9d7e69633d578..5aa2cd681caf3 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php @@ -14,6 +14,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor; use Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy; +use Symfony\Component\PropertyInfo\Tests\Fixtures\DummyCollection; use Symfony\Component\PropertyInfo\Tests\Fixtures\ParentDummy; use Symfony\Component\PropertyInfo\Tests\Fixtures\Php80Dummy; use Symfony\Component\PropertyInfo\Tests\Fixtures\PseudoTypeDummy; @@ -134,6 +135,7 @@ public static function typesProvider() ['arrayOfMixed', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_STRING), null)], null, null], ['listOfStrings', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING))], null, null], ['self', [new Type(Type::BUILTIN_TYPE_OBJECT, false, Dummy::class)], null, null], + ['collectionAsObject', [new Type(Type::BUILTIN_TYPE_OBJECT, false, DummyCollection::class, true, [new Type(Type::BUILTIN_TYPE_INT)], [new Type(Type::BUILTIN_TYPE_STRING)])], null, null], ]; } diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php index 0d1163d3ba295..b97032574ab86 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTest.php @@ -17,6 +17,7 @@ use Symfony\Component\PropertyInfo\Tests\Fixtures\ConstructorDummyWithoutDocBlock; use Symfony\Component\PropertyInfo\Tests\Fixtures\DefaultValue; use Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy; +use Symfony\Component\PropertyInfo\Tests\Fixtures\DummyCollection; use Symfony\Component\PropertyInfo\Tests\Fixtures\ParentDummy; use Symfony\Component\PropertyInfo\Tests\Fixtures\Php80Dummy; use Symfony\Component\PropertyInfo\Tests\Fixtures\Php80PromotedDummy; @@ -125,6 +126,7 @@ public static function typesProvider() ['self', [new Type(Type::BUILTIN_TYPE_OBJECT, false, Dummy::class)]], ['rootDummyItems', [new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, RootDummyItem::class))]], ['rootDummyItem', [new Type(Type::BUILTIN_TYPE_OBJECT, false, RootDummyItem::class)]], + ['collectionAsObject', [new Type(Type::BUILTIN_TYPE_OBJECT, false, DummyCollection::class, true, [new Type(Type::BUILTIN_TYPE_INT)], [new Type(Type::BUILTIN_TYPE_STRING)])]], ]; } diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php index 832db51c81690..2bc44c9e3f4a4 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php @@ -48,6 +48,7 @@ public function testGetProperties() 'bal', 'parent', 'collection', + 'collectionAsObject', 'nestedCollection', 'mixedCollection', 'B', @@ -113,6 +114,7 @@ public function testGetPropertiesWithCustomPrefixes() 'bal', 'parent', 'collection', + 'collectionAsObject', 'nestedCollection', 'mixedCollection', 'B', @@ -167,6 +169,7 @@ public function testGetPropertiesWithNoPrefixes() 'bal', 'parent', 'collection', + 'collectionAsObject', 'nestedCollection', 'mixedCollection', 'B', @@ -520,6 +523,7 @@ public function testTypedProperties() $this->assertEquals([new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING))], $this->extractor->getTypes(Php74Dummy::class, 'stringCollection')); $this->assertEquals([new Type(Type::BUILTIN_TYPE_INT, true)], $this->extractor->getTypes(Php74Dummy::class, 'nullableWithDefault')); $this->assertEquals([new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true)], $this->extractor->getTypes(Php74Dummy::class, 'collection')); + $this->assertEquals([new Type(Type::BUILTIN_TYPE_ARRAY, true, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_OBJECT, false, Dummy::class))], $this->extractor->getTypes(Php74Dummy::class, 'nullableTypedCollection')); } /** diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php index 1478c87f551b6..6c2ea073f2620 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php @@ -46,6 +46,11 @@ class Dummy extends ParentDummy #[Groups(['a', 'b'])] public $collection; + /** + * @var DummyCollection + */ + public $collectionAsObject; + /** * @var string[][] */ diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/DummyCollection.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/DummyCollection.php new file mode 100644 index 0000000000000..e8799d8f6be07 --- /dev/null +++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/DummyCollection.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\PropertyInfo\Tests\Fixtures; + +final class DummyCollection implements \IteratorAggregate +{ + public function getIterator(): \Traversable + { + return []; + } +} diff --git a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php74Dummy.php b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php74Dummy.php index 816b857b67b11..dc72d07756b88 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php74Dummy.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php74Dummy.php @@ -23,6 +23,9 @@ class Php74Dummy private ?int $nullableWithDefault = 1; public array $collection = []; + /** @var Dummy[]|null */ + public ?array $nullableTypedCollection = null; + public function addStringCollection(string $string): void { } @@ -30,4 +33,8 @@ public function addStringCollection(string $string): void public function removeStringCollection(string $string): void { } + + public function addNullableTypedCollection(Dummy $dummy): void + { + } } diff --git a/src/Symfony/Component/PropertyInfo/Util/PhpStanTypeHelper.php b/src/Symfony/Component/PropertyInfo/Util/PhpStanTypeHelper.php index f8cc166f3be99..7d439f55660dd 100644 --- a/src/Symfony/Component/PropertyInfo/Util/PhpStanTypeHelper.php +++ b/src/Symfony/Component/PropertyInfo/Util/PhpStanTypeHelper.php @@ -125,7 +125,7 @@ private function extractTypes(TypeNode $node, NameScope $nameScope): array return [$mainType]; } - $collection = $mainType->isCollection() || \in_array($mainType->getClassName(), [\Traversable::class, \Iterator::class, \IteratorAggregate::class, \ArrayAccess::class, \Generator::class], true); + $collection = $mainType->isCollection() || \is_a($mainType->getClassName(), \Traversable::class, true) || \is_a($mainType->getClassName(), \ArrayAccess::class, true); // it's safer to fall back to other extractors if the generic type is too abstract if (!$collection && !class_exists($mainType->getClassName())) { diff --git a/src/Symfony/Component/Routing/Router.php b/src/Symfony/Component/Routing/Router.php index f81d7b7f6b91b..b769caee6fc33 100644 --- a/src/Symfony/Component/Routing/Router.php +++ b/src/Symfony/Component/Routing/Router.php @@ -272,6 +272,7 @@ function (ConfigCacheInterface $cache) { } $cache->write($dumper->dump(), $this->getRouteCollection()->getResources()); + unset(self::$cache[$cache->getPath()]); } ); @@ -301,6 +302,7 @@ function (ConfigCacheInterface $cache) { $dumper = $this->getGeneratorDumperInstance(); $cache->write($dumper->dump(), $this->getRouteCollection()->getResources()); + unset(self::$cache[$cache->getPath()]); } ); diff --git a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php index 21016be35da02..644c908a19f6e 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php @@ -30,7 +30,7 @@ protected function setUp(): void { parent::setUp(); - $this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_matcher.'.uniqid('CompiledUrlMatcher').'.php'; + $this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_matcher.'.uniqid('CompiledUrlMatcher', true).'.php'; } protected function tearDown(): void diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.ar.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.ar.xlf index d90e830ff18f4..f75eb12c005eb 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.ar.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.ar.xlf @@ -64,7 +64,7 @@ Too many failed login attempts, please try again later. - عدد كبير جدا من محاولات الدخول الفاشلة، يرجى المحاولة مرة أخرى في وقت لاحق. + العديد من محاولات الدخول الفاشلة، يرجى المحاولة مرة أخرى في وقت لاحق. Invalid or expired login link. @@ -72,11 +72,11 @@ Too many failed login attempts, please try again in %minutes% minute. - عدد كبير جدا من محاولات الدخول الفاشلة، يرجى اعادة المحاولة بعد %minutes% دقيقة. + العديد من محاولات الدخول الفاشلة، يرجى اعادة المحاولة بعد %minutes% دقيقة. Too many failed login attempts, please try again in %minutes% minutes. - عدد محاولات تسجيل الدخول الفاشلة كثيرة، الرجاء المحاولة مرة أخرى بعد %minutes% دقيقة.|عدد محاولات تسجيل الدخول الفاشلة كثيرة، الرجاء المحاولة مرة أخرى بعد %minutes% دقائق. + العديد من محاولات الدخول الفاشلة ، يرجى اعادة المحاولة بعد %minutes% دقائق. diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.hu.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.hu.xlf index bdee5f6813fbf..06096dc4a2879 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.hu.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.hu.xlf @@ -76,7 +76,7 @@ Too many failed login attempts, please try again in %minutes% minutes. - Túl sok sikertelen bejelentkezési kísérlet, kérjük, próbálja újra %minutes% perc múlva. + Túl sok sikertelen bejelentkezési kísérlet, kérjük, próbálja újra %minutes% perc múlva. diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.pt.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.pt.xlf index 5ae30c96f8ca9..f9fda8d7b048e 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.pt.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.pt.xlf @@ -4,7 +4,7 @@ An authentication exception occurred. - Ocorreu uma excepção durante a autenticação. + Ocorreu uma exceção durante a autenticação. Authentication credentials could not be found. @@ -12,7 +12,7 @@ Authentication request could not be processed due to a system problem. - O pedido de autenticação não foi concluído devido a um problema no sistema. + A autenticação não foi concluída devido a um problema no sistema. Invalid credentials. @@ -24,7 +24,7 @@ Not privileged to request the resource. - Não possui privilégios para aceder a este recurso. + Sem privilégios para solicitar este recurso. Invalid CSRF token. @@ -36,7 +36,7 @@ No session available, it either timed out or cookies are not enabled. - Não existe sessão disponível, esta expirou ou os cookies estão desativados. + Nenhuma sessão disponível, esta expirou ou os cookies estão desativados. No token could be found. @@ -44,7 +44,7 @@ Username could not be found. - Nome de utilizador não encontrado. + Nome de usuário não encontrado. Account has expired. @@ -60,11 +60,11 @@ Account is locked. - A conta está trancada. + A conta está bloqueada. Too many failed login attempts, please try again later. - Várias tentativas de login falhadas, por favor tente mais tarde. + Muitas tentativas de login sem sucesso, por favor, tente mais tarde. Invalid or expired login link. @@ -72,11 +72,11 @@ Too many failed login attempts, please try again in %minutes% minute. - Demasiadas tentativas de login, tente novamente num minuto. + Muitas tentativas de login sem sucesso, por favor, tente novamente novamente em 1 minuto. Too many failed login attempts, please try again in %minutes% minutes. - Muitas tentativas de login sem sucesso, por favor tente novamente em %minutes% minutos. + Muitas tentativas de login sem sucesso, por favor, tente novamente em %minutes% minutos. diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.pt_BR.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.pt_BR.xlf index 675b600e83783..e3d7631db1474 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.pt_BR.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.pt_BR.xlf @@ -64,7 +64,7 @@ Too many failed login attempts, please try again later. - Muitas tentativas de login malsucedidas, tente novamente mais tarde. + Muitas tentativas de login malsucedidas, por favor, tente novamente mais tarde. Invalid or expired login link. @@ -76,7 +76,7 @@ Too many failed login attempts, please try again in %minutes% minutes. - Muitas tentativas de login sem sucesso, por favor tente novamente em %minutes% minutos. + Muitas tentativas de login sem sucesso, por favor, tente novamente em %minutes% minutos. diff --git a/src/Symfony/Component/Serializer/Debug/TraceableSerializer.php b/src/Symfony/Component/Serializer/Debug/TraceableSerializer.php index 2e375e08d610f..789ae65ca0aa8 100644 --- a/src/Symfony/Component/Serializer/Debug/TraceableSerializer.php +++ b/src/Symfony/Component/Serializer/Debug/TraceableSerializer.php @@ -41,7 +41,7 @@ public function __construct( public function serialize(mixed $data, string $format, array $context = []): string { - $context[self::DEBUG_TRACE_ID] = $traceId = uniqid(); + $context[self::DEBUG_TRACE_ID] = $traceId = uniqid('', true); $startTime = microtime(true); $result = $this->serializer->serialize($data, $format, $context); @@ -56,7 +56,7 @@ public function serialize(mixed $data, string $format, array $context = []): str public function deserialize(mixed $data, string $type, string $format, array $context = []): mixed { - $context[self::DEBUG_TRACE_ID] = $traceId = uniqid(); + $context[self::DEBUG_TRACE_ID] = $traceId = uniqid('', true); $startTime = microtime(true); $result = $this->serializer->deserialize($data, $type, $format, $context); @@ -71,7 +71,7 @@ public function deserialize(mixed $data, string $type, string $format, array $co public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null { - $context[self::DEBUG_TRACE_ID] = $traceId = uniqid(); + $context[self::DEBUG_TRACE_ID] = $traceId = uniqid('', true); $startTime = microtime(true); $result = $this->serializer->normalize($object, $format, $context); @@ -86,7 +86,7 @@ public function normalize(mixed $object, ?string $format = null, array $context public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed { - $context[self::DEBUG_TRACE_ID] = $traceId = uniqid(); + $context[self::DEBUG_TRACE_ID] = $traceId = uniqid('', true); $startTime = microtime(true); $result = $this->serializer->denormalize($data, $type, $format, $context); @@ -101,7 +101,7 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a public function encode(mixed $data, string $format, array $context = []): string { - $context[self::DEBUG_TRACE_ID] = $traceId = uniqid(); + $context[self::DEBUG_TRACE_ID] = $traceId = uniqid('', true); $startTime = microtime(true); $result = $this->serializer->encode($data, $format, $context); @@ -116,7 +116,7 @@ public function encode(mixed $data, string $format, array $context = []): string public function decode(string $data, string $format, array $context = []): mixed { - $context[self::DEBUG_TRACE_ID] = $traceId = uniqid(); + $context[self::DEBUG_TRACE_ID] = $traceId = uniqid('', true); $startTime = microtime(true); $result = $this->serializer->decode($data, $format, $context); diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php index ccada2ed69d1c..aeae375fba642 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php @@ -267,6 +267,8 @@ protected function getGroups(array $context): array /** * Is this attribute allowed? + * + * @return bool */ protected function isAllowedAttribute(object|string $classOrObject, string $attribute, ?string $format = null, array $context = []) { diff --git a/src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php b/src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php index 1826d3dc4d116..20b0572112e7b 100644 --- a/src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php @@ -27,7 +27,7 @@ final class ClassMetadataFactoryCompilerTest extends TestCase protected function setUp(): void { - $this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_serializer_metadata.'.uniqid('CompiledClassMetadataFactory').'.php'; + $this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_serializer_metadata.'.uniqid('CompiledClassMetadataFactory', true).'.php'; } protected function tearDown(): void diff --git a/src/Symfony/Component/String/AbstractUnicodeString.php b/src/Symfony/Component/String/AbstractUnicodeString.php index 4e0850108cb42..70598e4099d72 100644 --- a/src/Symfony/Component/String/AbstractUnicodeString.php +++ b/src/Symfony/Component/String/AbstractUnicodeString.php @@ -155,7 +155,7 @@ public function ascii(array $rules = []): self public function camel(): static { $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) { + $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?!\p{Lu})/u', static function ($m) { static $i = 0; return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); @@ -346,8 +346,8 @@ public function reverse(): static public function snake(): static { - $str = clone $this; - $str->string = str_replace(' ', '_', mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1 \2', $str->string), 'UTF-8')); + $str = $this->camel(); + $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); return $str; } diff --git a/src/Symfony/Component/String/ByteString.php b/src/Symfony/Component/String/ByteString.php index 6389dbd14cc7b..3ebe43c10a64a 100644 --- a/src/Symfony/Component/String/ByteString.php +++ b/src/Symfony/Component/String/ByteString.php @@ -342,8 +342,8 @@ public function slice(int $start = 0, ?int $length = null): static public function snake(): static { - $str = clone $this; - $str->string = str_replace(' ', '_', strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1 \2', $str->string))); + $str = $this->camel(); + $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); return $str; } diff --git a/src/Symfony/Component/String/Tests/AbstractAsciiTestCase.php b/src/Symfony/Component/String/Tests/AbstractAsciiTestCase.php index f8b0509ffa185..3e3d9709a96f4 100644 --- a/src/Symfony/Component/String/Tests/AbstractAsciiTestCase.php +++ b/src/Symfony/Component/String/Tests/AbstractAsciiTestCase.php @@ -1044,6 +1044,7 @@ public static function provideCamel() ['symfonyIsGreat', 'symfony_is_great'], ['symfony5IsGreat', 'symfony_5_is_great'], ['symfonyIsGreat', 'Symfony is great'], + ['SYMFONYISGREAT', 'SYMFONY_IS_GREAT'], ['symfonyIsAGreatFramework', 'Symfony is a great framework'], ['symfonyIsGREAT', '*Symfony* is GREAT!!'], ['SYMFONY', 'SYMFONY'], @@ -1067,6 +1068,8 @@ public static function provideSnake() ['x_y', 'x_y'], ['x_y', 'X_Y'], ['xu_yo', 'xu_yo'], + ['symfony_is_great', 'symfony-is-great'], + ['symfony_is_great', 'symfony.is.great'], ['symfony_is_great', 'symfonyIsGreat'], ['symfony5_is_great', 'symfony5IsGreat'], ['symfony5is_great', 'symfony5isGreat'], @@ -1075,8 +1078,13 @@ public static function provideSnake() ['symfony_is_great', 'symfonyIsGREAT'], ['symfony_is_really_great', 'symfonyIsREALLYGreat'], ['symfony', 'SYMFONY'], - ['symfony_is_great', 'SYMFONY IS GREAT'], - ['symfony_is_great', 'SYMFONY_IS_GREAT'], + ['symfonyisgreat', 'SYMFONY IS GREAT'], + ['symfonyisgreat', 'SYMFONY_IS_GREAT'], + ['symfony_is_great', 'symfony is great'], + ['symfonyisgreat', 'SYMFONY IS GREAT'], + ['symfonyisgreat', 'SYMFONY _ IS _ GREAT'], + ['symfony_isgreat', 'Symfony IS GREAT!'], + ['123_customer_with_special_name', '123-customer,with/special#name'], ]; } diff --git a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php index 7f2f96be64b59..93bee730bc657 100644 --- a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php @@ -22,7 +22,7 @@ class CsvFileLoader extends FileLoader { private string $delimiter = ';'; private string $enclosure = '"'; - private string $escape = '\\'; + private string $escape = ''; protected function loadResource(string $resource): array { @@ -55,7 +55,7 @@ protected function loadResource(string $resource): array * * @return void */ - public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\') + public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '') { $this->delimiter = $delimiter; $this->enclosure = $enclosure; diff --git a/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php b/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php index 4e2c27198b106..1424d3259e646 100644 --- a/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php +++ b/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\Validator\Constraint; @@ -56,6 +57,8 @@ public function validate(mixed $value, Constraint $constraint) $comparedValue = $this->getPropertyAccessor()->getValue($object, $path); } catch (NoSuchPropertyException $e) { throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } catch (UninitializedPropertyException) { + $comparedValue = null; } } else { $comparedValue = $constraint->value; diff --git a/src/Symfony/Component/Validator/Constraints/BicValidator.php b/src/Symfony/Component/Validator/Constraints/BicValidator.php index 6236da86d21f2..7be4dc400d719 100644 --- a/src/Symfony/Component/Validator/Constraints/BicValidator.php +++ b/src/Symfony/Component/Validator/Constraints/BicValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Intl\Countries; use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessor; use Symfony\Component\Validator\Constraint; @@ -130,6 +131,8 @@ public function validate(mixed $value, Constraint $constraint) $iban = $this->getPropertyAccessor()->getValue($object, $path); } catch (NoSuchPropertyException $e) { throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } catch (UninitializedPropertyException) { + $iban = null; } } if (!$iban) { diff --git a/src/Symfony/Component/Validator/Constraints/RangeValidator.php b/src/Symfony/Component/Validator/Constraints/RangeValidator.php index 3aae44dc8e105..449ddb383043a 100644 --- a/src/Symfony/Component/Validator/Constraints/RangeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/RangeValidator.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\Validator\Constraint; @@ -162,6 +163,8 @@ private function getLimit(?string $propertyPath, mixed $default, Constraint $con return $this->getPropertyAccessor()->getValue($object, $propertyPath); } catch (NoSuchPropertyException $e) { throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $propertyPath, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } catch (UninitializedPropertyException) { + return null; } } diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf index f975fc5164edb..e09d3fc06aa70 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Die URL mis 'n topvlakdomein. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf index 08012ac233bdd..94a91d42a71bb 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. هذا الرابط يفتقر إلى نطاق المستوى الأعلى. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf index 2eeae5f8a69ce..390e5f869c323 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Bu URL yuxarı səviyyəli domeni çatışmır. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf index a0665388e4bee..3ebae4cb6bb2f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.be.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Гэтаму URL бракуе дамен верхняга ўзроўню. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf index d2405339f0c35..dffefdb7d9056 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. На този URL липсва домейн от най-високо ниво. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf index 9fd444a59efff..f5e90aba54a7a 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Ovom URL-u nedostaje domena najvišeg nivoa. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf index 652c0a48d693c..60f747f62f715 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Aquesta URL no conté un domini de primer nivell. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Aquest valor és massa curt. Ha de contenir almenys una paraula.|Aquest valor és massa curt. Ha de contenir almenys {{ min }} paraules. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Aquest valor és massa llarg. Ha de contenir una paraula.|Aquest valor és massa llarg. Ha de contenir {{ max }} paraules o menys. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf index 2c4c54d9f60af..459d07fd727cc 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Této URL chybí doména nejvyššího řádu. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf index a1ebdf7f81e24..7f3357daf5398 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Mae'r URL hwn yn colli parth lefel uchaf. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf index 808d8c6ad66d9..d80251b2a7483 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Denne URL mangler et topdomæne. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index 3b65306314922..6a9919ddd36ad 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Dieser URL fehlt eine Top-Level-Domain. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Dieser Wert ist zu kurz. Er muss aus mindestens einem Wort bestehen.|Dieser Wert ist zu kurz. Er muss mindestens {{ min }} Wörter enthalten. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Dieser Wert ist zu lang. Er darf maximal aus einem Wort bestehen.|Dieser Wert ist zu lang. Er darf maximal {{ max }} Wörter enthalten. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf index a60471835745b..bb0ccb46e92ec 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.el.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Αυτή η διεύθυνση URL λείπει ένας τομέας ανώτατου επιπέδου. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index 721139011caec..cf08ea281938f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. This URL is missing a top-level domain. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf index d58045471c70c..f9b3277229c8a 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Esta URL no contiene una extensión de dominio (TLD). + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Este valor es demasiado corto. Debe contener al menos una palabra.|Este valor es demasiado corto. Debe contener al menos {{ min }} palabras. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Este valor es demasiado largo. Debe contener una palabra.|Este valor es demasiado largo. Debe contener {{ max }} palabras o menos. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf index d9d641322976b..988bb0aa07203 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Sellel URL-il puudub ülataseme domeen. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf index bdcbaa393e6a1..362dfa9c0cd34 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. URL honek ez du goi-mailako domeinurik. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf index 0f2cf5bbf1fed..fb8b629b4d1a3 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. این URL فاقد دامنه سطح بالا است. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf index e9ca6c83347a6..6b8902f014dc2 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Tästä URL-osoitteesta puuttuu ylätason verkkotunnus. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index 4e949d838cae7..f06189712e3a0 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Cette URL doit contenir un domaine de premier niveau. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Cette valeur est trop courte. Elle doit contenir au moins un mot.|Cette valeur est trop courte. Elle doit contenir au moins {{ min }} mots. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Cette valeur est trop longue. Elle doit contenir au maximum un mot.|Cette valeur est trop longue. Elle doit contenir au maximum {{ max }} mots. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf index 2a1199bed5c71..7885473fb2e84 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Esta URL non contén un dominio de nivel superior. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf index cd406b4eb86c8..6e5ab52297777 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. לכתובת URL זו חסר דומיין רמה עליונה. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf index a7542a9353293..0ddbeb6f20c81 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Ovom URL-u nedostaje vršna domena. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf index a31848c775fde..0c8002ae1ecc4 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Az URL-ből hiányzik a legfelső szintű tartomány (top-level domain). + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf index d8ff322e6ed76..29f916fff06d1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Այս URL-ը չունի վերին մակարդակի դոմեյն: + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf index b894c69d855d6..2814599a0fc64 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. URL ini tidak memiliki domain tingkat atas. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index 74f3a75b0c97e..1f409315e6dbf 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Questo URL è privo di un dominio di primo livello. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf index 9ec98ebbd47c4..d94a414e31998 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. このURLはトップレベルドメインがありません。 + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf index 28d1eff019aac..3c0a6f200e4f8 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Dësen URL feelt eng Top-Level-Domain. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf index e16daea93b80f..dc28eeba77223 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Šiam URL trūksta aukščiausio lygio domeno. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Per mažas žodžių skaičius. Turi susidaryti bent iš 1 žodžio.|Per mažas žodžių skaičius. Turi susidaryti iš {{ min }} arba daugiau žodžių. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Per didelis žodžių skaičius. Turi susidaryti iš 1 žodžio.|Per didelis žodžių skaičius. Turi susidaryti iš {{ max }} arba mažiau žodžių. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf index 66e370fea944d..9b2b9bd9f4485 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lv.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Šim URL trūkst augšējā līmeņa domēna. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.mk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.mk.xlf index d941f59ea8c8c..b891990799cd3 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.mk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.mk.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. На овој URL недостасува домен од највисоко ниво. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf index 4f997a7031592..987d73199ac09 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Энэ URL дээд түвшингийн домейн дутуу байна. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf index 57b6e276dc9c5..b7353e83a4c7d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.my.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. ဤ URL တွင် အမြင့်ဆုံးအဆင့်ဒိုမိန်း ပါဝင်မရှိပါ။ + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf index 27a4d3c55a1ef..2abe0fb7f0805 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Denne URL-en mangler et toppnivådomene. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf index aa4a3e2151f18..96e1d20d93d0f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Deze URL mist een top-level domein. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf index de400b7d5115c..e825815ced1b6 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nn.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Denne URL-en manglar eit toppnivådomene. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf index 27a4d3c55a1ef..2abe0fb7f0805 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Denne URL-en mangler et toppnivådomene. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf index 42b6e9571b349..337a5949501ce 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Podany URL nie zawiera domeny najwyższego poziomu. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + Podana wartość jest zbyt krótka. Powinna zawierać co najmniej jedno słowo.|Podana wartość jest zbyt krótka. Powinna zawierać co najmniej {{ min }} słów. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + Podana wartość jest zbyt długa. Powinna zawierać jedno słowo.|Podana wartość jest zbyt długa. Powinna zawierać {{ max }} słów lub mniej. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf index ed28ee31ea639..f771faa84f5de 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf @@ -88,7 +88,7 @@ This value should not be blank. - Este valor não deveria ser branco/vazio. + Este valor não deveria ser vazio. This value should not be null. @@ -108,7 +108,7 @@ This value is not a valid URL. - Este valor não é um URL válido. + Este valor não é uma URL válida. The two values should be equal. @@ -120,11 +120,11 @@ The file is too large. - O ficheiro é muito grande. + O arquivo é muito grande. The file could not be uploaded. - Não foi possível carregar o ficheiro. + Não foi possível enviar o arquivo. This value should be a valid number. @@ -132,7 +132,7 @@ This file is not a valid image. - Este ficheiro não é uma imagem. + Este arquivo não é uma imagem. This value is not a valid IP address. @@ -144,11 +144,11 @@ This value is not a valid locale. - Este valor não é um 'locale' válido. + Este valor não é uma localidade válida. This value is not a valid country. - Este valor não é um País válido. + Este valor não é um país válido. This value is already used. @@ -156,7 +156,7 @@ The size of the image could not be detected. - O tamanho da imagem não foi detetado. + O tamanho da imagem não foi detectado. The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. @@ -164,7 +164,7 @@ The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - A largura da imagem ({{ width }}px) é muito pequena. A largura miníma da imagem é de: {{ min_width }}px. + A largura da imagem ({{ width }}px) é muito pequena. A largura mínima da imagem é de: {{ min_width }}px. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. @@ -172,7 +172,7 @@ The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - A altura da imagem ({{ height }}px) é muito pequena. A altura miníma da imagem é de: {{ min_height }}px. + A altura da imagem ({{ height }}px) é muito pequena. A altura mínima da imagem é de: {{ min_height }}px. This value should be the user's current password. @@ -180,7 +180,7 @@ This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Este valor deve possuir exatamente {{ limit }} caracteres. + Este valor deve possuir exatamente {{ limit }} caractere.|Este valor deve possuir exatamente {{ limit }} caracteres. The file was only partially uploaded. @@ -308,7 +308,7 @@ This value does not match the expected {{ charset }} charset. - O valor não corresponde ao conjunto de caracteres {{ charset }} esperado. + Este valor não corresponde ao conjunto de caracteres {{ charset }} esperado. This value is not a valid Business Identifier Code (BIC). @@ -340,7 +340,7 @@ This value should be positive. - Este valor deve ser estritamente positivo. + Este valor deve ser positivo. This value should be either positive or zero. @@ -348,7 +348,7 @@ This value should be negative. - Este valor deve ser estritamente negativo. + Este valor deve ser negativo. This value should be either negative or zero. @@ -360,11 +360,11 @@ This password has been leaked in a data breach, it must not be used. Please use another password. - Esta senha foi divulgada durante uma fuga de dados, não deve ser usada de novamente. Por favor usar uma senha outra. + Esta senha foi divulgada durante um vazamento de dados, não deve ser usada de novamente. Por favor usar uma senha outra. This value should be between {{ min }} and {{ max }}. - Este valor deve situar-se entre {{ min }} e {{ max }}. + Este valor deve estar entre {{ min }} e {{ max }}. This value is not a valid hostname. @@ -376,7 +376,7 @@ This value should satisfy at least one of the following constraints: - Este valor deve satisfazer pelo menos uma das seguintes restrições : + Este valor deve satisfazer pelo menos uma das seguintes restrições: Each element of this collection should satisfy its own set of constraints. @@ -428,11 +428,11 @@ The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. - A extensão do ficheiro é inválida ({{ extension }}). As extensões permitidas são {{ extensions }}. + A extensão do arquivo é inválida ({{ extension }}). As extensões permitidas são {{ extensions }}. The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. - A codificação de carateres detetada é inválida ({{ detected }}). As codificações permitidas são {{ encodings }}. + A codificação de carateres detectada é inválida ({{ detected }}). As codificações permitidas são {{ encodings }}. This value is not a valid MAC address. @@ -440,7 +440,15 @@ This URL is missing a top-level domain. - Esta URL está faltando um domínio de topo. + Esta URL está faltando o domínio de nível superior. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf index e5fe095eace75..e600bb17ff7f6 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf @@ -440,7 +440,15 @@ This URL is missing a top-level domain. - Esta URL está faltando um domínio de topo. + Esta URL está faltando o domínio de nível superior. + + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf index 3c0ace5490efd..79cf6941acc57 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Acestui URL îi lipsește un domeniu de nivel superior. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf index dbee06a984b2c..70cb1144bf899 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. В этом URL отсутствует домен верхнего уровня. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf index 8886395e6e8c7..8785adcc18257 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Tomuto URL chýba doména najvyššej úrovne. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf index 03e750b8af75b..4926c1b4f815e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Temu URL manjka domena najvišje ravni. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf index e9b31b88258d9..9942b5cf26bc6 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf @@ -451,6 +451,14 @@ This URL is missing a top-level domain. Kësaj URL i mungon një domain i nivelit të lartë. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf index 0550626d03f4d..3aa3be49e8d45 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Овом URL недостаје домен највишег нивоа. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf index 5a85bd764d3cc..ac7d7186dfee7 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Ovom URL nedostaje domen najvišeg nivoa. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf index d7be868c10e96..01668a87d21b3 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Denna URL saknar en toppdomän. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf index 0d811ed040f88..c6f0b829a6af6 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.th.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. URL นี้ขาดโดเมนระดับสูงสุด. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf index 8e8146a0faade..1d831bd8ea0f3 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.tl.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Kulang ang URL na ito sa top-level domain. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf index 3553af7b74ddd..685e6ca1a928d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Bu URL bir üst düzey alan adı eksik. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf index 7b9918910b151..b67e3e604decc 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Цьому URL не вистачає домену верхнього рівня. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ur.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ur.xlf index f994cb57a84e2..d18604407c71c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ur.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ur.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. اس URL میں ٹاپ لیول ڈومین موجود نہیں ہے۔ + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.uz.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.uz.xlf index 1e43fb0fff8cf..d21bc24a3cc5b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.uz.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.uz.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. Bu URL yuqori darajali domenni o'z ichiga olmaydi. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf index b3073cc7370a0..e1cdb6d09fb91 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.vi.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. URL này thiếu miền cấp cao. + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf index fabf86d3b0e13..15b234fb0d4ef 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. 此URL缺少顶级域名。 + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf index feee108a1bd3d..3812029fcad81 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.zh_TW.xlf @@ -442,6 +442,14 @@ This URL is missing a top-level domain. 此URL缺少頂級域名。 + + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + This value is too short. It should contain at least one word.|This value is too short. It should contain at least {{ min }} words. + + + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + This value is too long. It should contain one word.|This value is too long. It should contain {{ max }} words or less. + diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php b/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php index 1b823eacb6d8d..fa44b8a4becba 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php @@ -16,6 +16,7 @@ use Symfony\Component\Validator\Constraints\AbstractComparison; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; +use Symfony\Component\Validator\Tests\Constraints\Fixtures\TypedDummy; class ComparisonTest_Class { @@ -265,6 +266,31 @@ public function testCompareWithNullValueAtPropertyAt($dirtyValue, $dirtyValueAsS } } + /** + * @dataProvider provideComparisonsToNullValueAtPropertyPath + */ + public function testCompareWithUninitializedPropertyAtPropertyPath($dirtyValue, $dirtyValueAsString, $isValid) + { + $this->setObject(new TypedDummy()); + + $this->validator->validate($dirtyValue, $this->createConstraint([ + 'message' => 'Constraint Message', + 'propertyPath' => 'value', + ])); + + if ($isValid) { + $this->assertNoViolation(); + } else { + $this->buildViolation('Constraint Message') + ->setParameter('{{ value }}', $dirtyValueAsString) + ->setParameter('{{ compared_value }}', 'null') + ->setParameter('{{ compared_value_type }}', 'null') + ->setParameter('{{ compared_value_path }}', 'value') + ->setCode($this->getErrorCode()) + ->assertRaised(); + } + } + public static function provideAllInvalidComparisons(): array { // The provider runs before setUp(), so we need to manually fix diff --git a/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php index 8b3c815423a48..7859400d6ee46 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php @@ -18,6 +18,7 @@ use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Mapping\Loader\AttributeLoader; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; +use Symfony\Component\Validator\Tests\Constraints\Fixtures\BicTypedDummy; class BicValidatorTest extends ConstraintValidatorTestCase { @@ -89,6 +90,15 @@ public function testInvalidComparisonToPropertyPathFromAttribute() ->assertRaised(); } + public function testPropertyPathReferencingUninitializedProperty() + { + $this->setObject(new BicTypedDummy()); + + $this->validator->validate('UNCRIT2B912', new Bic(['ibanPropertyPath' => 'iban'])); + + $this->assertNoViolation(); + } + public function testValidComparisonToValue() { $constraint = new Bic(['iban' => 'FR14 2004 1010 0505 0001 3M02 606']); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/BicTypedDummy.php b/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/BicTypedDummy.php new file mode 100644 index 0000000000000..90ad4009c15c1 --- /dev/null +++ b/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/BicTypedDummy.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints\Fixtures; + +class BicTypedDummy +{ + public string $iban; +} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/MinMaxTyped.php b/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/MinMaxTyped.php new file mode 100644 index 0000000000000..1595030fa6a63 --- /dev/null +++ b/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/MinMaxTyped.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints\Fixtures; + +class MinMaxTyped +{ + public int $min; + public int $max; +} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/TypedDummy.php b/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/TypedDummy.php new file mode 100644 index 0000000000000..73d2543376c43 --- /dev/null +++ b/src/Symfony/Component/Validator/Tests/Constraints/Fixtures/TypedDummy.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints\Fixtures; + +class TypedDummy +{ + public mixed $value; +} diff --git a/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php b/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php index 39e5405946ecc..92b21bd5e1405 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest.php @@ -23,7 +23,7 @@ class GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest extends Greate { protected static function createConstraint(?array $options = null): Constraint { - return new PositiveOrZero(); + return new PositiveOrZero($options); } public static function provideValidComparisons(): array @@ -86,6 +86,11 @@ public function testInvalidValuePath() $this->markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); } + public static function provideAllValidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the PositiveOrZero constraint'); + } + /** * @dataProvider provideValidComparisonsToPropertyPath */ @@ -94,6 +99,11 @@ public function testValidComparisonToPropertyPath($comparedValue) $this->markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); } + public function testNoViolationOnNullObjectWithPropertyPath() + { + $this->markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); + } + /** * @dataProvider throwsOnInvalidStringDatesProvider */ @@ -106,4 +116,19 @@ public function testInvalidComparisonToPropertyPathAddsPathAsParameter() { $this->markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); } + + public static function throwsOnInvalidStringDatesProvider(): array + { + self::markTestSkipped('The "value" option cannot be used in the PositiveOrZero constraint'); + } + + public static function provideAllInvalidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Negative constraint'); + } + + public static function provideComparisonsToNullValueAtPropertyPath(): array + { + self::markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); + } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php b/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php index b8738470db397..bd826e33f3bef 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorWithPositiveConstraintTest.php @@ -23,7 +23,7 @@ class GreaterThanValidatorWithPositiveConstraintTest extends GreaterThanValidato { protected static function createConstraint(?array $options = null): Constraint { - return new Positive(); + return new Positive($options); } public static function provideValidComparisons(): array @@ -89,6 +89,11 @@ public function testInvalidValuePath() $this->markTestSkipped('PropertyPath option is not used in Positive constraint'); } + public static function provideAllValidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Positive constraint'); + } + /** * @dataProvider provideValidComparisonsToPropertyPath */ @@ -109,4 +114,19 @@ public function testInvalidComparisonToPropertyPathAddsPathAsParameter() { $this->markTestSkipped('PropertyPath option is not used in Positive constraint'); } + + public static function throwsOnInvalidStringDatesProvider(): array + { + self::markTestSkipped('The "value" option cannot be used in the Positive constraint'); + } + + public static function provideAllInvalidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Positive constraint'); + } + + public static function provideComparisonsToNullValueAtPropertyPath(): array + { + self::markTestSkipped('PropertyPath option is not used in PositiveOrZero constraint'); + } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php index 406cb53e207b1..a85c5ae7d3e4d 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest.php @@ -23,7 +23,7 @@ class LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest extends LessThanO { protected static function createConstraint(?array $options = null): Constraint { - return new NegativeOrZero(); + return new NegativeOrZero($options); } public static function provideValidComparisons(): array @@ -89,6 +89,11 @@ public function testInvalidValuePath() $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } + public static function provideAllValidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the NegativeOrZero constraint'); + } + /** * @dataProvider provideValidComparisonsToPropertyPath */ @@ -97,12 +102,9 @@ public function testValidComparisonToPropertyPath($comparedValue) $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } - /** - * @dataProvider throwsOnInvalidStringDatesProvider - */ - public function testThrowsOnInvalidStringDates(AbstractComparison $constraint, $expectedMessage, $value) + public function testInvalidComparisonToPropertyPathAddsPathAsParameter() { - $this->markTestSkipped('The compared value cannot be an invalid string date because it is hardcoded to 0.'); + $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } /** @@ -113,8 +115,21 @@ public function testCompareWithNullValueAtPropertyAt($dirtyValue, $dirtyValueAsS $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } - public function testInvalidComparisonToPropertyPathAddsPathAsParameter() + /** + * @dataProvider provideComparisonsToNullValueAtPropertyPath + */ + public function testCompareWithUninitializedPropertyAtPropertyPath($dirtyValue, $dirtyValueAsString, $isValid) { $this->markTestSkipped('PropertyPath option is not used in NegativeOrZero constraint'); } + + public static function throwsOnInvalidStringDatesProvider(): array + { + self::markTestSkipped('The "value" option cannot be used in the NegativeOrZero constraint'); + } + + public static function provideAllInvalidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the NegativeOrZero constraint'); + } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php index a2e988257f5a3..46b6099b25b3e 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorWithNegativeConstraintTest.php @@ -23,7 +23,7 @@ class LessThanValidatorWithNegativeConstraintTest extends LessThanValidatorTest { protected static function createConstraint(?array $options = null): Constraint { - return new Negative(); + return new Negative($options); } public static function provideValidComparisons(): array @@ -89,6 +89,11 @@ public function testInvalidValuePath() $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } + public static function provideAllValidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Negative constraint'); + } + /** * @dataProvider provideValidComparisonsToPropertyPath */ @@ -97,18 +102,23 @@ public function testValidComparisonToPropertyPath($comparedValue) $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } + public static function throwsOnInvalidStringDatesProvider(): array + { + self::markTestSkipped('The "value" option cannot be used in the Negative constraint'); + } + /** - * @dataProvider throwsOnInvalidStringDatesProvider + * @dataProvider provideComparisonsToNullValueAtPropertyPath */ - public function testThrowsOnInvalidStringDates(AbstractComparison $constraint, $expectedMessage, $value) + public function testCompareWithNullValueAtPropertyAt($dirtyValue, $dirtyValueAsString, $isValid) { - $this->markTestSkipped('The compared value cannot be an invalid string date because it is hardcoded to 0.'); + $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } /** * @dataProvider provideComparisonsToNullValueAtPropertyPath */ - public function testCompareWithNullValueAtPropertyAt($dirtyValue, $dirtyValueAsString, $isValid) + public function testCompareWithUninitializedPropertyAtPropertyPath($dirtyValue, $dirtyValueAsString, $isValid) { $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } @@ -117,4 +127,9 @@ public function testInvalidComparisonToPropertyPathAddsPathAsParameter() { $this->markTestSkipped('PropertyPath option is not used in Negative constraint'); } + + public static function provideAllInvalidComparisons(): array + { + self::markTestSkipped('The "value" option cannot be used in the Negative constraint'); + } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php index c0eb5e61703a9..e0fff6f856935 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php @@ -16,6 +16,7 @@ use Symfony\Component\Validator\Constraints\RangeValidator; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; +use Symfony\Component\Validator\Tests\Constraints\Fixtures\MinMaxTyped; use Symfony\Component\Validator\Tests\IcuCompatibilityTrait; class RangeValidatorTest extends ConstraintValidatorTestCase @@ -1020,6 +1021,28 @@ public function testInvalidDatesCombinedMinPropertyPath($value, $dateTimeAsStrin ->assertRaised(); } + public function testMinPropertyPathReferencingUninitializedProperty() + { + $object = new MinMaxTyped(); + $object->max = 5; + $this->setObject($object); + + $this->validator->validate(5, new Range(['minPropertyPath' => 'min', 'maxPropertyPath' => 'max'])); + + $this->assertNoViolation(); + } + + public function testMaxPropertyPathReferencingUninitializedProperty() + { + $object = new MinMaxTyped(); + $object->min = 5; + $this->setObject($object); + + $this->validator->validate(5, new Range(['minPropertyPath' => 'min', 'maxPropertyPath' => 'max'])); + + $this->assertNoViolation(); + } + public static function provideMessageIfMinAndMaxSet(): array { $notInRangeMessage = (new Range(['min' => '']))->notInRangeMessage; diff --git a/src/Symfony/Component/VarDumper/Caster/DOMCaster.php b/src/Symfony/Component/VarDumper/Caster/DOMCaster.php index d2d3fc1294442..4135fbfee5061 100644 --- a/src/Symfony/Component/VarDumper/Caster/DOMCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/DOMCaster.php @@ -23,7 +23,7 @@ class DOMCaster { private const ERROR_CODES = [ - \DOM_PHP_ERR => 'DOM_PHP_ERR', + 0 => 'DOM_PHP_ERR', \DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR', \DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR', \DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR', @@ -156,16 +156,12 @@ public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, boo 'doctype' => $dom->doctype, 'implementation' => $dom->implementation, 'documentElement' => new CutStub($dom->documentElement), - 'actualEncoding' => $dom->actualEncoding, 'encoding' => $dom->encoding, 'xmlEncoding' => $dom->xmlEncoding, - 'standalone' => $dom->standalone, 'xmlStandalone' => $dom->xmlStandalone, - 'version' => $dom->version, 'xmlVersion' => $dom->xmlVersion, 'strictErrorChecking' => $dom->strictErrorChecking, 'documentURI' => $dom->documentURI ? new LinkStub($dom->documentURI) : $dom->documentURI, - 'config' => $dom->config, 'formatOutput' => $dom->formatOutput, 'validateOnParse' => $dom->validateOnParse, 'resolveExternals' => $dom->resolveExternals, @@ -277,9 +273,6 @@ public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $i 'publicId' => $dom->publicId, 'systemId' => $dom->systemId, 'notationName' => $dom->notationName, - 'actualEncoding' => $dom->actualEncoding, - 'encoding' => $dom->encoding, - 'version' => $dom->version, ]; return $a; diff --git a/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php b/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php index 02efb1b023d9d..dab14b724d4df 100644 --- a/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php @@ -42,7 +42,7 @@ class ExceptionCaster \E_USER_ERROR => 'E_USER_ERROR', \E_USER_WARNING => 'E_USER_WARNING', \E_USER_NOTICE => 'E_USER_NOTICE', - \E_STRICT => 'E_STRICT', + 2048 => 'E_STRICT', ]; private static array $framesCache = []; diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index 5bd42529e7115..e0b17eecafdc9 100644 --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php @@ -621,7 +621,7 @@ private function hasColorSupport(mixed $stream): bool } // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { return false; } diff --git a/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php b/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php index ec87d06d1f883..39fd701f6abf0 100644 --- a/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php +++ b/src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php @@ -25,6 +25,10 @@ abstract class HttpClientTestCase extends TestCase { public static function setUpBeforeClass(): void { + if (!function_exists('ob_gzhandler')) { + static::markTestSkipped('The "ob_gzhandler" function is not available.'); + } + TestHttpServer::start(); }