Skip to content

Update performance.rst to use $container->getParameterBag() #19087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

gnumoksha
Copy link
Contributor

@gnumoksha gnumoksha commented Oct 26, 2023

there is no $container->parameters()

performance.rst Outdated
$container->parameters()->set('.container.dumper.inline_factories', true);
$container->getParameterBag()->set('.container.dumper.inline_factories', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here $container is a ContainerConfigurator and not ContainerInterface

If i'm right, we should probably update example like is done in the following sample

.. code-block:: php
// config/services.php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
return static function (ContainerConfigurator $container): void {
$container->parameters()
->set('url_pattern', 'http://symfony.com/?foo=%%s&bar=%%d');
};

@OskarStark
Copy link
Contributor

Friendly ping @gnumoksha

@gnumoksha
Copy link
Contributor Author

I've changed the variable name, but I don't know how to verify if the statement was successful.

@@ -81,7 +81,7 @@ container into a single file, which could improve performance when using
// config/services.php

// ...
$container->parameters()->set('.container.dumper.inline_factories', true);
$configurator->parameters()->set('.container.dumper.inline_factories', true);
Copy link
Member

@xabbuh xabbuh Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the whole example needs to look like this:

    .. code-block:: php

        // config/services.php
        namespace Symfony\Component\DependencyInjection\Loader\Configurator;

        return function(ContainerConfigurator $container): void {
            $container->parameters()->set('.container.dumper.inline_factories', true);
        };

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done this change while merging. Thanks!

@javiereguiluz
Copy link
Member

@gnumoksha thanks and congrats on your first Symfony Docs contribution 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants