8000 Merge branch '5.4' into 6.0 · symfony/symfony@a6d8468 · GitHub
[go: up one dir, main page]

Skip to content

Commit a6d8468

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: (33 commits) do not pass a boolean to the constructor of the Dotenv class [Notifier] Fix low-deps tests Deprecate Composer 1 [Filesystem] Add third argument `$lockFile` to `Filesystem::appendToFile()` [TwigBundle] fix auto-enabling assets/expression/routing/yaml/workflow extensions [PhpUnitBridge] fix symlink to bridge in docker by making its path relative [Dotenv] Duplicate $_SERVER values in $_ENV if they don't exist Fix markup [Notifier] Add Expo bridge Add polish translations (#43725) Rename translation:update to translation:extract [String] Add PLURAL_MAP "zombies" -- fix #43789 Added support for `statusCode` default parameter when loading a template directly from route using the `Symfony\Bundle\FrameworkBundle\Controller\TemplateController` controller. [Validator] Update validators.bs.xlf Cache voters that will always abstain [Messenger] Fix `TraceableMessageBus` implementation so it can compute caller even when used within a callback [Validator] Add the missing translations for Russian (ru) [Validator] Added missing translations for Latvian (lv) [Validator] Added missing translations [Validator] Add missing translations for Vietnamese (VI) ...
2 parents da87fc3 + d859d89 commit a6d8468

File tree

70 files changed

+1263
-94
lines changed
  • Filesystem
  • Form/Resources/translations
  • Messenger
  • Notifier
  • Security/Core
  • String
  • Translation
  • Validator/Resources/translations
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    70 files changed

    +1263
    -94
    lines changed

    src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php

    Lines changed: 5 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -122,7 +122,7 @@
    122122
    }
    123123

    124124
    $oldPwd = getcwd();
    125-
    $PHPUNIT_DIR = $getEnvVar('SYMFONY_PHPUNIT_DIR', $root.'/vendor/bin/.phpunit');
    125+
    $PHPUNIT_DIR = rtrim($getEnvVar('SYMFONY_PHPUNIT_DIR', $root.'/vendor/bin/.phpunit'), '/'.\DIRECTORY_SEPARATOR);
    126126
    $PHP = defined('PHP_BINARY') ? \PHP_BINARY : 'php';
    127127
    $PHP = escapeshellarg($PHP);
    128128
    if ('phpdbg' === \PHP_SAPI) {
    @@ -239,6 +239,10 @@
    239239
    $passthruOrFail("$COMPOSER config --unset platform.php");
    240240
    }
    241241
    if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
    242+
    $p = str_repeat('../', substr_count("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR", '/', strlen($root))).'vendor/symfony/phpunit-bridge';
    243+
    if (realpath($p) === realpath($path)) {
    244+
    $path = $p;
    245+
    }
    242246
    $passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
    243247
    $passthruOrFail("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', \DIRECTORY_SEPARATOR, $path)));
    244248
    if ('\\' === \DIRECTORY_SEPARATOR) {

    src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -38,6 +38,8 @@ CHANGELOG
    3838
    * Add `configureContainer()`, `configureRoutes()`, `getConfigDir()` and `getBundlesPath()` to `MicroKernelTrait`
    3939
    * Add support for configuring log level, and status code by exception class
    4040
    * Bind the `default_context` parameter onto serializer's encoders and normalizers
    41+
    * Add support for `statusCode` default parameter when loading a template directly from route using the `Symfony\Bundle\FrameworkBundle\Controller\TemplateController` controller
    42+
    * Deprecate `translation:update` command, use `translation:extract` instead
    4143

    4244
    5.3
    4345
    ---

    src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

    Lines changed: 11 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -17,6 +17,7 @@
    1717
    use Symfony\Component\Console\Input\InputArgument;
    1818
    use Symfony\Component\Console\Input\InputInterface;
    1919
    use Symfony\Component\Console\Input\InputOption;
    20+
    use Symfony\Component\Console\Output\ConsoleOutputInterface;
    2021
    use Symfony\Component\Console\Output\OutputInterface;
    2122
    use Symfony\Component\Console\Style\SymfonyStyle;
    2223
    use Symfony\Component\HttpKernel\KernelInterface;
    @@ -36,7 +37,7 @@
    3637
    *
    3738
    * @final
    3839
    */
    39-
    #[AsCommand(name: 'translation:update', description: 'Update the translation file')]
    40+
    #[AsCommand(name: 'translation:extract', description: 'Extract missing translations keys from code to translation files.')]
    4041
    class TranslationUpdateCommand extends Command
    4142
    {
    4243
    private const ASC = 'asc';
    @@ -78,9 +79,9 @@ protected function configure()
    7879
    new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'),
    7980
    new InputOption('format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format', 'xlf12'),
    8081
    new InputOption('dump-messages', null, InputOption::VALUE_NONE, 'Should the messages be dumped in the console'),
    81-
    new InputOption('force', null, InputOption::VALUE_NONE, 'Should the update be done'),
    82+
    new InputOption('force', null, InputOption::VALUE_NONE, 'Should the extract be done'),
    8283
    new InputOption('clean', null, InputOption::VALUE_NONE, 'Should clean not found messages'),
    83-
    new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'Specify the domain to update'),
    84+
    new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'Specify the domain to extract'),
    8485
    new InputOption('sort', null, InputOption::VALUE_OPTIONAL, 'Return list of messages sorted alphabetically', 'asc'),
    8586
    new InputOption('as-tree', null, InputOption::VALUE_OPTIONAL, 'Dump the messages as a tree-like structure: The given value defines the level where to switch to inline YAML'),
    8687
    ])
    @@ -122,6 +123,13 @@ protected function configure()
    122123
    */
    123124
    protected function execute(InputInterface $input, OutputInterface $output): int
    124125
    {
    126+
    $io = new SymfonyStyle($input, $output);
    127+
    $errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
    128+
    129+
    if ('translation:update' === $input->getFirstArgument()) {
    130+
    $errorIo->caution('Command "translation:update" is deprecated since version 5.4 and will be removed in Symfony 6.0. Use "translation:extract" instead.');
    131+
    }
    132+
    125133
    $io = new SymfonyStyle($input, $output);
    126134
    $errorIo = $io->getErrorStyle();
    127135

    src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php

    Lines changed: 10 additions & 9 deletions
    Original file line numberDiff line numberDiff line change
    @@ -33,19 +33,20 @@ public function __construct(Environment $twig = null)
    3333
    /**
    3434
    * Renders a template.
    3535
    *
    36-
    * @param string $template The template name
    37-
    * @param int|null $maxAge Max age for client caching
    38-
    * @param int|null $sharedAge Max age for shared (proxy) caching
    39-
    * @param bool|null $private Whether or not caching should apply for client caches only
    40-
    * @param array $context The context (arguments) of the template
    36+
    * @param string $template The template name
    37+
    * @param int|null $maxAge Max age for client caching
    38+
    * @param int|null $sharedAge Max age for shared (proxy) caching
    39+
    * @param bool|null $private Whether or not caching should apply for client caches only
    40+
    * @param array $context The context (arguments) of the template
    41+
    * @param int $statusCode The HTTP status code to return with the response. Defaults to 200
    4142
    */
    42-
    public function templateAction(string $template, int $maxAge = null, int $sharedAge = null, bool $private = null, array $context = []): Response
    43+
    public function templateAction(string $template, int $maxAge = null, int $sharedAge = null, bool $private = null, array $context = [], int $statusCode = 200): Response
    4344
    {
    4445
    if (null === $this->twig) {
    4546
    throw new \LogicException('You cannot use the TemplateController if the Twig Bundle is not available.');
    4647
    }
    4748

    48-
    $response = new Response($this->twig->render($template, $context));
    49+
    $response = new Response($this->twig->render($template, $context), $statusCode);
    4950

    5051
    if ($maxAge) {
    5152
    $response->setMaxAge($maxAge);
    @@ -64,8 +65,8 @@ public function templateAction(string $template, int $maxAge = null, int $shared
    6465
    return $response;
    6566
    }
    6667

    67-
    public function __invoke(string $template, int $maxAge = null, int $sharedAge = null, bool $private = null, array $context = []): Response
    68+
    public function __invoke(string $template, int $maxAge = null, int $sharedAge = null, bool $private = null, array $context = [], int $statusCode = 200): Response
    6869
    {
    69-
    return $this->templateAction($template, $maxAge, $sharedAge, $private, $context);
    70+
    return $this->templateAction($template, $maxAge, $sharedAge, $private, $context, $statusCode);
    7071
    }
    7172
    }

    src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -122,7 +122,7 @@ public function getConfigTreeBuilder(): TreeBuilder
    122122
    $parentPackages = (array) $parentPackage;
    123123
    $parentPackages[] = 'symfony/framework-bundle';
    124124

    125-
    return ContainerBuilder::willBeAvailable($package, $class, $parentPackages);
    125+
    return ContainerBuilder::willBeAvailable($package, $class, $parentPackages, true);
    126126
    };
    127127

    128128
    $enableIfStandalone = static function (string $package, string $class) use ($willBeAvailable) {

    0 commit comments

    Comments
     (0)
    0