diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index be833bfec1a14..00a24cbcfc13c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ | Q | A | ------------- | --- -| Branch? | 7.1 for features / 5.4, 6.3, 6.4, or 7.0 for bug fixes +| Branch? | 7.1 for features / 5.4, 6.4, or 7.0 for bug fixes | Bug fix? | yes/no | New feature? | yes/no | Deprecations? | yes/no diff --git a/.github/expected-missing-return-types.diff b/.github/expected-missing-return-types.diff index 0317f66f3222a..36cf1d6177550 100644 --- a/.github/expected-missing-return-types.diff +++ b/.github/expected-missing-return-types.diff @@ -22,7 +22,7 @@ diff --git a/src/Symfony/Component/BrowserKit/AbstractBrowser.php b/src/Symfony/ */ - abstract protected function doRequest(object $request); + abstract protected function doRequest(object $request): object; - + /** @@ -451,5 +451,5 @@ abstract class AbstractBrowser * @throws LogicException When this abstract class is not implemented @@ -146,21 +146,21 @@ diff --git a/src/Symfony/Component/DependencyInjection/Extension/ExtensionInterf */ - public function load(array $configs, ContainerBuilder $container); + public function load(array $configs, ContainerBuilder $container): void; - + /** @@ -37,5 +37,5 @@ interface ExtensionInterface * @return string */ - public function getNamespace(); + public function getNamespace(): string; - + /** @@ -44,5 +44,5 @@ interface ExtensionInterface * @return string|false */ - public function getXsdValidationBasePath(); + public function getXsdValidationBasePath(): string|false; - + /** @@ -53,4 +53,4 @@ interface ExtensionInterface * @return string @@ -249,35 +249,35 @@ diff --git a/src/Symfony/Component/Form/FormTypeInterface.php b/src/Symfony/Comp */ - public function getParent(); + public function getParent(): ?string; - + /** @@ -34,5 +34,5 @@ interface FormTypeInterface * @return void */ - public function configureOptions(OptionsResolver $resolver); + public function configureOptions(OptionsResolver $resolver): void; - + /** @@ -48,5 +48,5 @@ interface FormTypeInterface * @see FormTypeExtensionInterface::buildForm() */ - public function buildForm(FormBuilderInterface $builder, array $options); + public function buildForm(FormBuilderInterface $builder, array $options): void; - + /** @@ -66,5 +66,5 @@ interface FormTypeInterface * @see FormTypeExtensionInterface::buildView() */ - public function buildView(FormView $view, FormInterface $form, array $options); + public function buildView(FormView $view, FormInterface $form, array $options): void; - + /** @@ -85,5 +85,5 @@ interface FormTypeInterface * @see FormTypeExtensionInterface::finishView() */ - public function finishView(FormView $view, FormInterface $form, array $options); + public function finishView(FormView $view, FormInterface $form, array $options): void; - + /** @@ -95,4 +95,4 @@ interface FormTypeInterface * @return string @@ -324,21 +324,21 @@ diff --git a/src/Symfony/Component/HttpKernel/Bundle/BundleInterface.php b/src/S */ - public function boot(); + public function boot(): void; - + /** @@ -35,5 +35,5 @@ interface BundleInterface * @return void */ - public function shutdown(); + public function shutdown(): void; - + /** @@ -44,5 +44,5 @@ interface BundleInterface * @return void */ - public function build(ContainerBuilder $container); + public function build(ContainerBuilder $container): void; - + /** diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php --- a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php @@ -358,7 +358,7 @@ diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterfa */ - public function collect(Request $request, Response $response, ?\Throwable $exception = null); + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void; - + /** @@ -35,4 +35,4 @@ interface DataCollectorInterface extends ResetInterface * @return string @@ -383,21 +383,21 @@ diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/ */ - public function registerContainerConfiguration(LoaderInterface $loader); + public function registerContainerConfiguration(LoaderInterface $loader): void; - + /** @@ -44,5 +44,5 @@ interface KernelInterface extends HttpKernelInterface * @return void */ - public function boot(); + public function boot(): void; - + /** @@ -53,5 +53,5 @@ interface KernelInterface extends HttpKernelInterface * @return void */ - public function shutdown(); + public function shutdown(): void; - + /** diff --git a/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php b/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php --- a/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php @@ -414,7 +414,7 @@ diff --git a/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php b/src */ - abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot); + abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void; - + /** diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php b/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php --- a/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php @@ -424,21 +424,21 @@ diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/Token */ - public function loadTokenBySeries(string $series); + public function loadTokenBySeries(string $series): PersistentTokenInterface; - + /** @@ -35,5 +35,5 @@ interface TokenProviderInterface * @return void */ - public function deleteTokenBySeries(string $series); + public function deleteTokenBySeries(string $series): void; - + /** @@ -44,5 +44,5 @@ interface TokenProviderInterface * @throws TokenNotFoundException if the token is not found */ - public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed); + public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed): void; - + /** @@ -51,4 +51,4 @@ interface TokenProviderInterface * @return void @@ -485,7 +485,7 @@ diff --git a/src/Symfony/Component/Translation/Extractor/ExtractorInterface.php */ - public function extract(string|iterable $resource, MessageCatalogue $catalogue); + public function extract(string|iterable $resource, MessageCatalogue $catalogue): void; - + /** @@ -36,4 +36,4 @@ interface ExtractorInterface * @return void @@ -501,7 +501,7 @@ diff --git a/src/Symfony/Component/Validator/ConstraintValidatorInterface.php b/ */ - public function initialize(ExecutionContextInterface $context); + public function initialize(ExecutionContextInterface $context): void; - + /** @@ -31,4 +31,4 @@ interface ConstraintValidatorInterface * @return void @@ -526,7 +526,7 @@ diff --git a/src/Symfony/Contracts/Translation/LocaleAwareInterface.php b/src/Sy */ - public function setLocale(string $locale); + public function setLocale(string $locale): void; - + /** diff --git a/src/Symfony/Contracts/Translation/TranslatorTrait.php b/src/Symfony/Contracts/Translation/TranslatorTrait.php --- a/src/Symfony/Contracts/Translation/TranslatorTrait.php diff --git a/.github/sync-translations.php b/.github/sync-translations.php index eb3f8e840ab4a..13f05d1459c86 100644 --- a/.github/sync-translations.php +++ b/.github/sync-translations.php @@ -12,7 +12,7 @@ require __DIR__.'/../vendor/autoload.php'; -function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, string $domain) +function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, string $domain, ?\DOMElement $header = null) { $dom = new \DOMDocument('1.0', 'utf-8'); $dom->formatOutput = true; @@ -27,6 +27,10 @@ function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, string $d $xliffFile->setAttribute('datatype', 'plaintext'); $xliffFile->setAttribute('original', 'file.ext'); + if (null !== $header) { + mergeDom($dom, $xliffFile, $header); + } + $xliffBody = $xliffFile->appendChild($dom->createElement('body')); foreach ($messages->all($domain) as $source => $target) { $translation = $dom->createElement('trans-unit'); @@ -62,6 +66,24 @@ function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, string $d return preg_replace('/^ +/m', '$0$0', $dom->saveXML()); } +function mergeDom(\DOMDocument $dom, \DOMNode $tree, \DOMNode $input) +{ + $new = $dom->createElement($input->tagName); + foreach ($input->attributes as $key => $value) { + $new->setAttribute($key, $value); + } + $tree->appendChild($new); + foreach ($input->childNodes as $child) { + if ($child instanceof \DOMText) { + $new->appendChild($dom->createTextNode(str_replace(' ', ' ', $child->textContent))); + } elseif ($child instanceof \DOMNode) { + mergeDom($dom, $new, $child); + } else { + // We just need to update our script to handle this node types + throw new \LogicException('Unsupported node type: '.get_class($child)); + } + } +} foreach (['Security/Core' => 'security', 'Form' => 'validators', 'Validator' => 'validators'] as $component => $domain) { $dir = __DIR__.'/../src/Symfony/Component/'.$component.'/Resources/translations'; @@ -95,6 +117,13 @@ function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, string $d $localeCatalogue->setMetadata($source, $metadata, $domain); } - file_put_contents($file, dumpXliff1('en', $localeCatalogue, $domain)); + $inputDom = new \DOMDocument(); + $inputDom->loadXML(file_get_contents($file->getRealPath())); + $header = null; + if (1 === $inputDom->getElementsByTagName('header')->count()) { + $header = $inputDom->getElementsByTagName('header')->item(0); + } + + file_put_contents($file, dumpXliff1('en', $localeCatalogue, $domain, $header)); } } diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 609079bcf2a8b..9375b946fe856 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -110,6 +110,16 @@ jobs: KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1 KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181' KAFKA_ADVERTISED_PORT: 9092 + frankenphp: + image: dunglas/frankenphp:1.1.0 + ports: + - 80:80 + volumes: + - ${{ github.workspace }}:/symfony + env: + SERVER_NAME: 'http://localhost' + CADDY_SERVER_EXTRA_DIRECTIVES: | + root * /symfony/src/Symfony/Component/HttpFoundation/Tests/Fixtures/response-functional/ steps: - name: Checkout @@ -130,6 +140,14 @@ jobs: sudo service redis-server restart echo "::endgroup::" + - name: Install pgbouncer + run: | + sudo apt-get install -y pgbouncer + sudo cp src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Fixtures/pgbouncer/pgbouncer.ini /etc/pgbouncer/pgbouncer.ini + sudo cp src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Fixtures/pgbouncer/userlist.txt /etc/pgbouncer/userlist.txt + sudo service pgbouncer restart + sudo su - postgres -c "PGPASSWORD=password psql -Atq -h localhost -p 5432 -U postgres -d postgres -c \"SELECT usename, passwd FROM pg_shadow\"" + - name: Configure Couchbase run: | curl -s -u 'username=Administrator&password=111111' -X POST http://localhost:8091/node/controller/setupServices -d 'services=kv%2Cn1ql%2Cindex%2Cfts' @@ -186,6 +204,7 @@ jobs: MESSENGER_SQS_FIFO_QUEUE_DSN: "sqs://localhost:4566/messages.fifo?sslmode=disable&poll_timeout=0.01" KAFKA_BROKER: 127.0.0.1:9092 POSTGRES_HOST: localhost + PGBOUNCER_HOST: localhost:6432 #- name: Run HTTP push tests # if: matrix.php == '8.2' diff --git a/CHANGELOG-7.0.md b/CHANGELOG-7.0.md index 6edcfe85bf1f4..833ffb3f6f964 100644 --- a/CHANGELOG-7.0.md +++ b/CHANGELOG-7.0.md @@ -7,6 +7,68 @@ in 7.0 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/v7.0.0...v7.0.1 +* 7.0.4 (2024-02-27) + + * bug #53985 [HttpKernel] Allow tagged controllers in ControllerResolver (marein) + * bug #54054 [VarExporter] Bugfix/workaround jit issue (verfriemelt-dot-org) + * bug #54050 [Messenger] Revert "Resend failed retries back to failure transport " (ro0NL) + * bug #54045 [Config][Messenger][Security] Don't turn deprecations into exceptions when unserializing (nicolas-grekas) + * bug #54035 [DependencyInjection] Fix computing error messages involving service locators (nicolas-grekas) + * bug #53959 [Serializer] Fix unknown types normalization type when know type (Myks92) + * bug #53960 [Messenger] the 'use_notify' option is on the factory, not on the postgres connection (dbu) + * bug #54031 [ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3 (nicolas-grekas) + * bug #54014 [AssetMapper] Fix enquoted string pattern (smnandre) + * bug #54010 [Translation] Fix extracting qualified `t()` function calls (rvanvelzen) + * bug #53967 [ErrorHandler] return the unchanged text if preg_replace_callback() fails (xabbuh) + * bug #54009 [Console] Fix display of vertical Table on Windows OS (VincentLanglet) + * bug #54001 [Console] Fix display of Table on Windows OS (VincentLanglet) + * bug #53989 [FrameworkBundle] Fix config builder with extensions extended in `build()` (HypeMC) + * bug #54005 Fix a minor design issue in the Welcome Page (javiereguiluz) + * bug #54004 [WebProfilerBundle] disable turbo in web profiler toolbar to avoid link prefetching (davidgorges) + * bug #54006 [Process] Fix the `command -v` exception (kayw-geek) + * bug #53975 [Cache] explicitly cast boolean SSL stream options (xabbuh) + * bug #53926 [TwigBridge] foundation 5 layout: use form_label_content block for checkbox and radio labels (wetternest) + * bug #53913 [TwigBridge] Fix compat with Twig v3.9 (nicolas-grekas) + * bug #53819 [Doctrine Messenger] Fix support for pgsql + pgbouncer. (jwage) + * bug #53944 [Messenger] Gracefully fallback to empty queue config (Wirone) + * bug #53935 [Mailer] [Mailgun] Fix expecting payload without tags or user variables (norkunas) + * bug #53934 [Mailer] Fix signed emails breaking the profiler (HypeMC) + * bug #53924 [FrameworkBundle] Check if the _route attribute exists on the request (xvilo) + * bug #53910 [Messenger] Fix SQS visibility_timeout type (valtzu) + * bug #53891 [PropertyAccess] Fixes getValue() on an unitialized object property on a lazy ghost (priyadi) + * bug #53889 [HttpClient] Make retry strategy work again (Nyholm) + * bug #53906 [VarDumper] Fix serialization of stubs with null or uninitialized values (derrabus) + * bug #53890 [VarExporter] Uniform unitialized property error message under ghost and non-ghost objects (priyadi) + * bug #53893 [AssetMapper] Ignore comment lines in JavaScriptImportPathCompiler (smnandre) + * bug #53826 [DomCrawler][Form] Fix the exclusion of