diff --git a/README.md b/README.md index 5c063058c02..84f91fbbbbc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- + Symfony Logo

diff --git a/bundles/best_practices.rst b/bundles/best_practices.rst index 8049ebb9a1c..34bf24308ef 100644 --- a/bundles/best_practices.rst +++ b/bundles/best_practices.rst @@ -188,7 +188,7 @@ the ``tests/`` directory. Tests should follow the following principles: .. note:: A test suite must not contain ``AllTests.php`` scripts, but must rely on the - existence of a ``phpunit.xml.dist`` file. + existence of a ``phpunit.dist.xml`` file. Continuous Integration ---------------------- diff --git a/components/cache/adapters/redis_adapter.rst b/components/cache/adapters/redis_adapter.rst index c0295b487a0..ac32e1bbd39 100644 --- a/components/cache/adapters/redis_adapter.rst +++ b/components/cache/adapters/redis_adapter.rst @@ -9,7 +9,7 @@ Redis Cache Adapter article if you are using it in a Symfony application. This adapter stores the values in-memory using one (or more) `Redis server`_ -of `Valkey`_ server instances. +or `Valkey`_ server instances. Unlike the :doc:`APCu adapter `, and similarly to the :doc:`Memcached adapter `, it is not limited to the current server's diff --git a/contributing/code/bc.rst b/contributing/code/bc.rst index ad394d2720c..ee3f72a0333 100644 --- a/contributing/code/bc.rst +++ b/contributing/code/bc.rst @@ -285,6 +285,7 @@ Make final No Move to parent class Yes :ref:`Add argument without a default value ` No :ref:`Add argument with a default value ` No :ref:`[7] ` :ref:`[8] ` +Rename argument Yes :ref:`[10] ` Remove argument No :ref:`[3] ` Add default value to an argument No :ref:`[7] ` :ref:`[8] ` Remove default value of an argument No @@ -304,6 +305,7 @@ Make public No Move to parent class Yes :ref:`Add argument without a default value ` No :ref:`Add argument with a default value ` No :ref:`[7] ` :ref:`[8] ` +Rename argument Yes :ref:`[10] ` Remove argument No :ref:`[3] ` Add default value to an argument No :ref:`[7] ` :ref:`[8] ` Remove default value of an argument No :ref:`[7] ` @@ -320,6 +322,7 @@ Change name Yes Make public or protected Yes Add argument without a default value Yes Add argument with a default value Yes +Rename argument Yes Remove argument Yes Add default value to an argument Yes Remove default value of an argument Yes diff --git a/create_framework/unit_testing.rst b/create_framework/unit_testing.rst index 9c179cd3152..55220dad31f 100644 --- a/create_framework/unit_testing.rst +++ b/create_framework/unit_testing.rst @@ -14,7 +14,7 @@ using `PHPUnit`_. At first, install PHPUnit as a development dependency: $ composer require --dev phpunit/phpunit:^11.0 -Then, create a PHPUnit configuration file in ``example.com/phpunit.xml.dist``: +Then, create a PHPUnit configuration file in ``example.com/phpunit.dist.xml``: .. code-block:: xml diff --git a/mailer.rst b/mailer.rst index bdc50757cdd..6979c91bc31 100644 --- a/mailer.rst +++ b/mailer.rst @@ -180,9 +180,9 @@ party provider: +------------------------+---------------------------------------------------------+ | Provider | Formats | +========================+=========================================================+ -| `AhaSend`_ | - API ``ahasend+api://KEY@default`` | +| `AhaSend`_ | - SMTP ``ahasend+smtp://USERNAME:PASSWORD@default`` | | | - HTTP n/a | -| | - SMTP ``ahasend+smtp://USERNAME:PASSWORD@default`` | +| | - API ``ahasend+api://KEY@default`` | +------------------------+---------------------------------------------------------+ | `Amazon SES`_ | - SMTP ``ses+smtp://USERNAME:PASSWORD@default`` | | | - HTTP ``ses+https://ACCESS_KEY:SECRET_KEY@default`` | diff --git a/page_creation.rst b/page_creation.rst index 3315dff279d..0e2fd78e180 100644 --- a/page_creation.rst +++ b/page_creation.rst @@ -18,7 +18,7 @@ two-step process: .. admonition:: Screencast :class: screencast - Do you prefer video tutorials? Check out the `Harmonious Development with Symfony`_ + Do you prefer video tutorials? Check out the `Cosmic Coding with Symfony`_ screencast series. .. seealso:: @@ -302,5 +302,5 @@ Go Deeper with HTTP & Framework Fundamentals .. _`Twig`: https://twig.symfony.com .. _`Composer`: https://getcomposer.org -.. _`Harmonious Development with Symfony`: https://symfonycasts.com/screencast/symfony/setup +.. _`Cosmic Coding with Symfony`: https://symfonycasts.com/screencast/symfony/setup .. _`attributes`: https://www.php.net/manual/en/language.attributes.overview.php diff --git a/reference/formats/expression_language.rst b/reference/formats/expression_language.rst index dfed9c74398..02d36ba318f 100644 --- a/reference/formats/expression_language.rst +++ b/reference/formats/expression_language.rst @@ -171,7 +171,7 @@ This also works with class constants:: } var_dump($expressionLanguage->evaluate( - 'constant("App\\\SomeNamespace\\\Foo::API_ENDPOINT")' + 'constant("App\\\\SomeNamespace\\\\Foo::API_ENDPOINT")' )); This will print out ``/api``. @@ -189,7 +189,7 @@ This function will return the case of an enumeration:: } var_dump(App\Enum\Foo::Bar === $expressionLanguage->evaluate( - 'enum("App\\\SomeNamespace\\\Foo::Bar")' + 'enum("App\\\\SomeNamespace\\\\Foo::Bar")' )); This will print out ``true``. diff --git a/routing.rst b/routing.rst index 4f34e084d61..c093040e780 100644 --- a/routing.rst +++ b/routing.rst @@ -279,10 +279,10 @@ given value: .. code-block:: yaml # config/routes.yaml - tools: - path: /tools - controller: App\Controller\DefaultController::developerTools - env: dev + when@dev: + tools: + path: /tools + controller: App\Controller\DefaultController::developerTools .. code-block:: xml @@ -293,9 +293,9 @@ given value: xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd"> - - dev - + + + .. code-block:: php @@ -305,10 +305,11 @@ given value: use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; return function (RoutingConfigurator $routes): void { - $routes->add('tools', '/tools') - ->controller([DefaultController::class, 'developerTools']) - ->env('dev') - ; + if('dev' === $routes->env()) { + $routes->add('tools', '/tools') + ->controller([DefaultController::class, 'developerTools']) + ; + } }; .. _routing-matching-expressions: @@ -1559,6 +1560,7 @@ This way, the ``product_show`` alias could be deprecated. namespace App\Controller; use Symfony\Component\HttpFoundation\Response; + use Symfony\Component\Routing\Attribute\DeprecatedAlias; use Symfony\Component\Routing\Attribute\Route; class ProductController @@ -1660,6 +1662,10 @@ This way, the ``product_show`` alias could be deprecated. ) ; +.. versionadded:: 7.3 + + The ``DeprecatedAlias`` class for PHP attributes was introduced in Symfony 7.3. + In this example, every time the ``product_show`` alias is used, a deprecation warning is triggered, advising you to stop using this route and prefer using ``product_details``. diff --git a/setup.rst b/setup.rst index 48d66c387b9..a7fa8c66826 100644 --- a/setup.rst +++ b/setup.rst @@ -4,7 +4,7 @@ Installing & Setting up the Symfony Framework .. admonition:: Screencast :class: screencast - Do you prefer video tutorials? Check out the `Harmonious Development with Symfony`_ + Do you prefer video tutorials? Check out the `Cosmic Coding with Symfony`_ screencast series. .. _symfony-tech-requirements: @@ -311,7 +311,7 @@ Learn More setup/web_server_configuration setup/* -.. _`Harmonious Development with Symfony`: https://symfonycasts.com/screencast/symfony +.. _`Cosmic Coding with Symfony`: https://symfonycasts.com/screencast/symfony .. _`Install Composer`: https://getcomposer.org/download/ .. _`install the Symfony CLI`: https://symfony.com/download .. _`symfony-cli/symfony-cli GitHub repository`: https://github.com/symfony-cli/symfony-cli diff --git a/setup/symfony_cli.rst b/setup/symfony_cli.rst index e0e05d951d3..7b20c871558 100644 --- a/setup/symfony_cli.rst +++ b/setup/symfony_cli.rst @@ -155,7 +155,7 @@ Enabling PHP-FPM PHP-FPM must be installed locally for the Symfony server to utilize. When the server starts, it checks for ``web/index_dev.php``, ``web/index.php``, -``public/app_dev.php``, ``public/app.php`` in that order. If one is found, the +``public/app_dev.php``, ``public/app.php``, ``public/index.php`` in that order. If one is found, the server will automatically start with PHP-FPM enabled. Otherwise the server will start without PHP-FPM and will show a ``Page not found`` page when trying to access a ``.php`` file in the browser. diff --git a/setup/upgrade_major.rst b/setup/upgrade_major.rst index 9c4db187d51..128fd46df73 100644 --- a/setup/upgrade_major.rst +++ b/setup/upgrade_major.rst @@ -114,7 +114,7 @@ done! .. code-block:: xml - + diff --git a/testing.rst b/testing.rst index efba4efb21e..64ee65ccdf1 100644 --- a/testing.rst +++ b/testing.rst @@ -55,16 +55,16 @@ This command automatically runs your application tests. Each test is a PHP class ending with "Test" (e.g. ``BlogControllerTest``) that lives in the ``tests/`` directory of your application. -PHPUnit is configured by the ``phpunit.xml.dist`` file in the root of your -application. The default configuration provided by Symfony Flex will be -enough in most cases. Read the `PHPUnit documentation`_ to discover all -possible configuration options (e.g. to enable code coverage or to split -your test into multiple "test suites"). +PHPUnit is configured by the ``phpunit.dist.xml`` file in the root of your +application (in PHPUnit versions older than 10, the file is named ``phpunit.xml.dist``). +The default configuration provided by Symfony Flex will be enough in most cases. +Read the `PHPUnit documentation`_ to discover all possible configuration options +(e.g. to enable code coverage or to split your test into multiple "test suites"). .. note:: :ref:`Symfony Flex ` automatically creates - ``phpunit.xml.dist`` and ``tests/bootstrap.php``. If these files are + ``phpunit.dist.xml`` and ``tests/bootstrap.php``. If these files are missing, you can try running the recipe again using ``composer recipes:install phpunit/phpunit --force -v``. @@ -81,7 +81,7 @@ By convention, the ``tests/`` directory should replicate the directory of your application for unit tests. So, if you're testing a class in the ``src/Form/`` directory, put the test in the ``tests/Form/`` directory. Autoloading is automatically enabled via the ``vendor/autoload.php`` file -(as configured by default in the ``phpunit.xml.dist`` file). +(as configured by default in the ``phpunit.dist.xml`` file). You can run tests using the ``bin/phpunit`` command: @@ -113,7 +113,7 @@ to use the Symfony Kernel to fetch a service from the dependency injection container. Symfony provides a :class:`Symfony\\Bundle\\FrameworkBundle\\Test\\KernelTestCase` -class to help you creating and booting the kernel in your tests using +class to help you create and boot the kernel in your tests using ``bootKernel()``:: // tests/Service/NewsletterGeneratorTest.php @@ -386,11 +386,14 @@ Now, enable it as a PHPUnit extension: .. code-block:: xml - + + + + diff --git a/testing/bootstrap.rst b/testing/bootstrap.rst index 59fc289f0be..83e8e55149b 100644 --- a/testing/bootstrap.rst +++ b/testing/bootstrap.rst @@ -35,11 +35,11 @@ You can modify this file to add custom logic: .. note:: If you don't use Symfony Flex, make sure this file is configured as - bootstrap file in your ``phpunit.xml.dist`` file: + bootstrap file in your ``phpunit.dist.xml`` file: .. code-block:: xml - + + + + + @@ -868,12 +872,12 @@ Another option is to create a file called ``tests/router.php`` and add the follo require $script; -Then declare it as a router for Panther server in ``phpunit.xml.dist`` using the +Then declare it as a router for Panther server in ``phpunit.dist.xml`` using the ``PANTHER_WEB_SERVER_ROUTER`` environment variable: .. code-block:: xml - + diff --git a/translation.rst b/translation.rst index ed656c62848..47f9124a5f2 100644 --- a/translation.rst +++ b/translation.rst @@ -52,6 +52,12 @@ First, run this command to install the translator before using it: $ composer require symfony/translation +Symfony includes several internationalization polyfills (``symfony/polyfill-intl-icu``, +``symfony/polyfill-intl-messageformatter``, etc.) that allow you to use translation +features even without the `PHP intl extension`_. However, these polyfills only +support English translations, so you must install the PHP ``intl`` extension +when translating into other languages. + .. _translation-configuration: Configuration @@ -1675,6 +1681,7 @@ Learn more .. _`ICU MessageFormat`: https://unicode-org.github.io/icu/userguide/format_parse/messages/ .. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes .. _`ISO 639-1`: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes +.. _`PHP intl extension`: https://php.net/book.intl .. _`Translatable Extension`: https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/doc/translatable.md .. _`Custom Language Name setting`: https://docs.lokalise.com/en/articles/1400492-uploading-files#custom-language-codes .. _`ICU resource bundle`: https://github.com/unicode-org/icu-docs/blob/main/design/bnf_rb.txt