diff --git a/best_practices/configuration.rst b/best_practices/configuration.rst index 5f390f0e6b9..55d3d4c840e 100644 --- a/best_practices/configuration.rst +++ b/best_practices/configuration.rst @@ -210,10 +210,5 @@ through environment variables: # ... password: "%env(DB_PASSWORD)%" -.. versionadded:: 3.2 - Support for runtime environment variables via the ``%env(...)%`` syntax - was added in Symfony 3.2. Prior to version 3.2, you needed to use the - :doc:`special SYMFONY__ variables `. - .. _`feature toggles`: https://en.wikipedia.org/wiki/Feature_toggle .. _`constant() function`: http://twig.sensiolabs.org/doc/functions/constant.html diff --git a/bundles/extension.rst b/bundles/extension.rst index 116f969e357..9492bb0de12 100644 --- a/bundles/extension.rst +++ b/bundles/extension.rst @@ -129,17 +129,10 @@ read more about it, see the ":doc:`/bundles/configuration`" article. Adding Classes to Compile ------------------------- -.. versionadded:: 3.3 - This technique is discouraged and the ``addClassesToCompile()`` method was - deprecated in Symfony 3.3 because modern PHP versions make it unnecessary. - Symfony creates a big ``classes.php`` file in the cache directory to aggregate the contents of the PHP classes that are used in every request. This reduces the I/O operations and increases the application performance. -.. versionadded:: 3.2 - The ``addAnnotatedClassesToCompile()`` method was added in Symfony 3.2. - Your bundles can also add their own classes into this file thanks to the ``addClassesToCompile()`` and ``addAnnotatedClassesToCompile()`` methods (both work in the same way, but the second one is for classes that contain PHP @@ -173,9 +166,6 @@ class names:: If some class extends from other classes, all its parents are automatically included in the list of classes to compile. -.. versionadded:: 3.2 - The option to add classes to compile using patterns was introduced in Symfony 3.2. - The classes to compile can also be added using file path patterns:: // ... diff --git a/bundles/inheritance.rst b/bundles/inheritance.rst index 7a4f720289e..d8ce372adb4 100644 --- a/bundles/inheritance.rst +++ b/bundles/inheritance.rst @@ -6,107 +6,6 @@ How to Use Bundle Inheritance to Override Parts of a Bundle .. caution:: - Bundle inheritance is deprecated since Symfony 3.4 and will be removed in - 4.0. - -When working with third-party bundles, you'll probably come across a situation -where you want to override a file in that third-party bundle with a file -in one of your own bundles. Symfony gives you a very convenient way to override -things like controllers, templates, and other files in a bundle's -``Resources/`` directory. - -For example, suppose that you have installed `FOSUserBundle`_, but you want to -override its base ``layout.html.twig`` template, as well as one of its -controllers. - -First, create a new bundle called UserBundle and enable it in your application. -Then, register the third-party FOSUserBundle as the "parent" of your bundle:: - - // src/UserBundle/UserBundle.php - namespace UserBundle; - - use Symfony\Component\HttpKernel\Bundle\Bundle; - - class UserBundle extends Bundle - { - public function getParent() - { - return 'FOSUserBundle'; - } - } - -By making this simple change, you can now override several parts of the FOSUserBundle -simply by creating a file with the same name. - -.. note:: - - Despite the method name, there is no parent/child relationship between - the bundles, it is just a way to extend and override an existing bundle. - -Overriding Controllers -~~~~~~~~~~~~~~~~~~~~~~ - -Suppose you want to add some functionality to the ``registerAction()`` of a -``RegistrationController`` that lives inside FOSUserBundle. To do so, -just create your own ``RegistrationController.php`` file, override the bundle's -original method, and change its functionality:: - - // src/UserBundle/Controller/RegistrationController.php - namespace UserBundle\Controller; - - use FOS\UserBundle\Controller\RegistrationController as BaseController; - - class RegistrationController extends BaseController - { - public function registerAction() - { - $response = parent::registerAction(); - - // ... do custom stuff - return $response; - } - } - -.. tip:: - - Depending on how severely you need to change the behavior, you might - call ``parent::registerAction()`` or completely replace its logic with - your own. - -.. note:: - - Overriding controllers in this way only works if the bundle refers to - the controller using the standard ``FOSUserBundle:Registration:register`` - syntax in routes and templates. This is the best practice. - -Overriding Resources: Templates, Routing, etc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Most resources can also be overridden, simply by creating a file in the same -location as your parent bundle. - -For example, it's very common to need to override the FOSUserBundle's -``layout.html.twig`` template so that it uses your application's base layout. -Since the file lives at ``Resources/views/layout.html.twig`` in the FOSUserBundle, -you can create your own file in the same location of UserBundle. Symfony will -ignore the file that lives inside the FOSUserBundle entirely, and use your file -instead. - -The same goes for routing files and some other resources. - -.. note:: - - The overriding of resources only works when you refer to resources with - the ``@FOSUserBundle/Resources/config/routing/security.xml`` method. - You need to use the ``@BundleName`` shortcut when referring to resources - so they can be successfully overridden (except templates, which are - overridden in a different way, as explained in :doc:`/templating/overriding`). - -.. caution:: - - Translation and validation files do not work in the same way as described - above. Read ":ref:`override-translations`" if you want to learn how to - override translations and see ":ref:`override-validation`" for tricks to - override the validation. - -.. _`FOSUserBundle`: https://github.com/friendsofsymfony/fosuserbundle + Bundle inheritance was removed in Symfony 4.0, but you can + :doc:`override any part of a bundle ` without + using bundle inheritance. diff --git a/bundles/override.rst b/bundles/override.rst index 0b1455c5984..a4f6aea787e 100644 --- a/bundles/override.rst +++ b/bundles/override.rst @@ -4,9 +4,9 @@ How to Override any Part of a Bundle ==================================== -This document is a quick reference for how to override different parts of -third-party bundles without using :doc:`/bundles/inheritance`, which is -deprecated since Symfony 3.4. +When using a third-party bundle, you might want to customize or override some of +its features. This document describes ways of overriding the most common +features of a bundle. .. tip:: diff --git a/components/cache.rst b/components/cache.rst index 4b940850853..79b5b2a6ad9 100644 --- a/components/cache.rst +++ b/components/cache.rst @@ -13,9 +13,6 @@ The Cache Component It is designed to have a low overhead and it ships with ready to use adapters for the most common caching backends. -.. versionadded:: 3.3 - The PSR-16 "Simple Cache" implementation was introduced in Symfony 3.3. - Installation ------------ @@ -78,7 +75,7 @@ Now you can create, retrieve, update and delete items using this object:: // remove the cache key $cache->delete('stats.num_products'); - + // clear *all* cache keys $cache->clear(); diff --git a/components/cache/adapters/memcached_adapter.rst b/components/cache/adapters/memcached_adapter.rst index 413db7d89fa..843a384b2f3 100644 --- a/components/cache/adapters/memcached_adapter.rst +++ b/components/cache/adapters/memcached_adapter.rst @@ -7,10 +7,6 @@ Memcached Cache Adapter ======================= -.. versionadded:: 3.3 - - The Memcached adapter was introduced in Symfony 3.3. - This adapter stores the values in-memory using one (or more) `Memcached server`_ instances. Unlike the :ref:`APCu adapter `, and similarly to the :ref:`Redis adapter `, it is not limited to the current server's diff --git a/components/cache/adapters/pdo_doctrine_dbal_adapter.rst b/components/cache/adapters/pdo_doctrine_dbal_adapter.rst index 76ac5860e89..ab039baae5e 100644 --- a/components/cache/adapters/pdo_doctrine_dbal_adapter.rst +++ b/components/cache/adapters/pdo_doctrine_dbal_adapter.rst @@ -7,11 +7,6 @@ PDO & Doctrine DBAL Cache Adapter ================================= -.. versionadded:: 3.2 - - The PDO & Doctrine DBAL adapter was introduced in Symfony 3.2. - - This adapter stores the cache items in an SQL database. It requires a `PDO`_, `Doctrine DBAL Connection`_, or `Data Source Name (DSN)`_ as its first parameter, and optionally a namespace, default cache lifetime, and options array as its second, diff --git a/components/cache/cache_invalidation.rst b/components/cache/cache_invalidation.rst index 0ec6b8ba02b..367ce906500 100644 --- a/components/cache/cache_invalidation.rst +++ b/components/cache/cache_invalidation.rst @@ -20,9 +20,6 @@ The Symfony Cache component provides two mechanisms to help solving this problem Using Cache Tags ---------------- -.. versionadded:: 3.2 - Tags based invalidation was introduced in Symfony 3.2. - To benefit from tags based invalidation, you need to attach the proper tags to each cached item. Each tag is a plain string identifier that you can use at any time to trigger the removal of all items associated with this tag. diff --git a/components/config/definition.rst b/components/config/definition.rst index 0f28337c2d3..f66a2127298 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -186,20 +186,11 @@ Or you may define a prototype for each node inside an array node:: ->end() ; -.. versionadded:: 3.3 - The ``arrayPrototype()`` method (and the related ``booleanPrototype()`` - ``integerPrototype()``, ``floatPrototype()``, ``scalarPrototype()`` and - ``enumPrototype()``) was introduced in Symfony 3.3. In previous versions, - you needed to use ``prototype('array')``, ``prototype('boolean')``, etc. - A prototype can be used to add a definition which may be repeated many times inside the current node. According to the prototype definition in the example above, it is possible to have multiple connection arrays (containing a ``driver``, ``host``, etc.). -.. versionadded:: 3.3 - The ``castToArray()`` helper was added in Symfony 3.3. - Sometimes, to improve the user experience of your application or bundle, you may allow to use a simple string or numeric value where an array value is required. Use the ``castToArray()`` helper to turn those variables into arrays:: diff --git a/components/console/events.rst b/components/console/events.rst index ad268bba0fd..cc358aca2eb 100644 --- a/components/console/events.rst +++ b/components/console/events.rst @@ -83,27 +83,24 @@ C/C++ standard.:: } }); -The ``ConsoleEvents::EXCEPTION`` Event --------------------------------------- - -.. versionadded:: 3.3 - The ``ConsoleEvents::EXCEPTION`` event was deprecated in Symfony 3.3. Use - the ``ConsoleEvents::ERROR`` event instead. +The ``ConsoleEvents::ERROR`` Event +---------------------------------- **Typical Purposes**: Handle exceptions thrown during the execution of a command. -Whenever an exception is thrown by a command, the ``ConsoleEvents::EXCEPTION`` -event is dispatched. A listener can wrap or change the exception or do -anything useful before the exception is thrown by the application. +Whenever an exception is thrown by a command, including those triggered from +event listeners, the ``ConsoleEvents::ERROR`` event is dispatched. A listener +can wrap or change the exception or do anything useful before the exception is +thrown by the application. Listeners receive a :class:`Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent` event:: - use Symfony\Component\Console\Event\ConsoleExceptionEvent; + use Symfony\Component\Console\Event\ConsoleErrorEvent; use Symfony\Component\Console\ConsoleEvents; - $dispatcher->addListener(ConsoleEvents::EXCEPTION, function (ConsoleExceptionEvent $event) { + $dispatcher->addListener(ConsoleEvents::ERROR, function (ConsoleErrorEvent $event) { $output = $event->getOutput(); $command = $event->getCommand(); @@ -114,22 +111,9 @@ Listeners receive a $exitCode = $event->getExitCode(); // change the exception to another one - $event->setException(new \LogicException('Caught exception', $exitCode, $event->getException())); + $event->setException(new \LogicException('Caught exception', $exitCode, $event->getError())); }); -The ``ConsoleEvents::ERROR`` Event ----------------------------------- - -.. versionadded:: 3.3 - The ``ConsoleEvents::ERROR`` event was introduced in Symfony 3.3. - -**Typical Purposes**: Handle exceptions thrown during the execution of a -command. - -This event is an improved version of the ``ConsoleEvents::EXCEPTION`` event, -because it can handle every exception thrown during the execution of a command, -including those triggered from event listeners. - The ``ConsoleEvents::TERMINATE`` Event -------------------------------------- diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index 9b9a9187f5c..69b6ee74ac8 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -170,7 +170,7 @@ will be autocompleted as the user types:: { // ... $helper = $this->getHelper('question'); - + $bundles = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle'); $question = new Question('Please enter the name of a bundle', 'FooBundle'); $question->setAutocompleterValues($bundles); @@ -191,7 +191,7 @@ convenient for passwords:: { // ... $helper = $this->getHelper('question'); - + $question = new Question('What is the database password?'); $question->setHidden(true); $question->setHiddenFallback(false); @@ -229,9 +229,6 @@ convenient for passwords:: // ... } - .. versionadded:: 3.3 - The ``QuestionHelper::disableStty()`` method was introduced in Symfony 3.3. - Normalizing the Answer ---------------------- @@ -249,7 +246,7 @@ method:: { // ... $helper = $this->getHelper('question'); - + $question = new Question('Please enter the name of the bundle', 'AppBundle'); $question->setNormalizer(function ($value) { // $value can be null here @@ -369,9 +366,6 @@ from the command line, you need to set the inputs that the command expects:: // $this->assertRegExp('/.../', $commandTester->getDisplay()); } -.. versionadded:: 3.2 - The ``CommandTester::setInputs()`` method was introduced in Symfony 3.2. - By calling :method:`Symfony\\Component\\Console\\Tester\\CommandTester::setInputs`, you imitate what the console would do internally with all user input through the CLI. This method takes an array as only argument with, for each input that the command expects, diff --git a/components/console/logger.rst b/components/console/logger.rst index 0a1386c52ef..6d8f345e33f 100644 --- a/components/console/logger.rst +++ b/components/console/logger.rst @@ -106,9 +106,6 @@ constructor:: Errors ------ -.. versionadded:: 3.2 - The ``hasErrored()`` method was introduced in Symfony 3.2. - The Console logger includes a ``hasErrored()`` method which returns ``true`` as soon as any error message has been logged during the execution of the command. This is useful to decide which status code to return as the result of executing diff --git a/components/console/usage.rst b/components/console/usage.rst index bf77b3d6e91..f8a7c0283df 100644 --- a/components/console/usage.rst +++ b/components/console/usage.rst @@ -156,8 +156,3 @@ can run it with: If you enter a short command that's ambiguous (i.e. there are more than one command that match), then no command will be run and some suggestions of the possible commands to choose from will be output. - -.. versionadded:: 3.4 - Case-insensitivity of command shortcuts was introduced in Symfony 3.4. In - previous Symfony versions, shortcuts had to match the case of the original - command name (e.g. ``d:g`` was not the same shortcut as ``D:G``). diff --git a/components/dependency_injection/compilation.rst b/components/dependency_injection/compilation.rst index e1af120adce..d2b494ab4ca 100644 --- a/components/dependency_injection/compilation.rst +++ b/components/dependency_injection/compilation.rst @@ -423,9 +423,6 @@ been run, use:: PassConfig::TYPE_AFTER_REMOVING ); -.. versionadded:: 3.2 - The option to prioritize compiler passes was added in Symfony 3.2. - You can also control the order in which compiler passes are run for each compilation phase. Use the optional third argument of ``addCompilerPass()`` to set the priority as an integer number. The default priority is ``0`` and the higher diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 8a85cdb8e68..e4848d01b02 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -246,11 +246,6 @@ The crawler supports multiple ways of adding the content:: guesses the best charset according to the given contents and defaults to ``ISO-8859-1`` in case no charset can be guessed. - .. versionadded:: 3.4 - The charset guessing mechanism of the ``addContent()`` method was - introduced in Symfony 3.4. In previous Symfony versions, the ``ISO-8859-1`` - charset was always used. - As the Crawler's implementation is based on the DOM extension, it is also able to interact with native :phpclass:`DOMDocument`, :phpclass:`DOMNodeList` and :phpclass:`DOMNode` objects: @@ -294,10 +289,6 @@ and :phpclass:`DOMNode` objects: Expression Evaluation ~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 3.2 - The :method:`Symfony\\Component\\DomCrawler\\Crawler::evaluate` method was - introduced in Symfony 3.2. - The ``evaluate()`` method evaluates the given XPath expression. The return value depends on the XPath expression. If the expression evaluates to a scalar value (e.g. HTML attributes), an array of results will be returned. If the @@ -433,11 +424,12 @@ than just return the ``action`` attribute of the form. If the form method is GET, then it mimics the browser's behavior and returns the ``action`` attribute followed by a query string of all of the form's values. -.. versionadded:: 3.3 - Starting from Symfony 3.3, the optional ``formaction`` and ``formmethod`` - button attributes are supported. The ``getUri()`` and ``getMethod()`` - methods take into account those attributes to always return the right action - and method depending on the button used to get the form. +.. note:: + + The optional ``formaction`` and ``formmethod`` button attributes are + supported. The ``getUri()`` and ``getMethod()`` methods take into account + those attributes to always return the right action and method depending on + the button used to get the form. You can virtually set and get values on the form:: diff --git a/components/dotenv.rst b/components/dotenv.rst index 6d7a4adffba..2b71e0f0606 100644 --- a/components/dotenv.rst +++ b/components/dotenv.rst @@ -8,9 +8,6 @@ The Dotenv Component The Dotenv Component parses ``.env`` files to make environment variables stored in them accessible via ``getenv()``, ``$_ENV`` or ``$_SERVER``. -.. versionadded:: 3.3 - The Dotenv component was introduced in Symfony 3.3. - Installation ------------ diff --git a/components/event_dispatcher/container_aware_dispatcher.rst b/components/event_dispatcher/container_aware_dispatcher.rst index fd04a73daf3..659a94cee7a 100644 --- a/components/event_dispatcher/container_aware_dispatcher.rst +++ b/components/event_dispatcher/container_aware_dispatcher.rst @@ -4,103 +4,7 @@ The Container Aware Event Dispatcher ==================================== -.. versionadded:: 3.3 - The ``ContainerAwareEventDispatcher`` class has been deprecated in Symfony 3.3 - and it will be removed in Symfony 4.0. Use ``EventDispatcher`` with - closure-proxy injection instead. +.. caution:: -Introduction ------------- - -The :class:`Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher` -is a special ``EventDispatcher`` implementation which is coupled to the -service container that is part of -:doc:`the DependencyInjection component `. -It allows services to be specified as event listeners making the ``EventDispatcher`` -extremely powerful. - -Services are lazy loaded meaning the services attached as listeners will -only be created if an event is dispatched that requires those listeners. - -Setup ------ - -Setup is straightforward by injecting a :class:`Symfony\\Component\\DependencyInjection\\ContainerInterface` -into the :class:`Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher`:: - - use Symfony\Component\DependencyInjection\ContainerBuilder; - use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher; - - $container = new ContainerBuilder(); - $dispatcher = new ContainerAwareEventDispatcher($container); - -Adding Listeners ----------------- - -The ``ContainerAwareEventDispatcher`` can either load specified services -directly or services that implement :class:`Symfony\\Component\\EventDispatcher\\EventSubscriberInterface`. - -The following examples assume the service container has been loaded with -any services that are mentioned. - -.. note:: - - Services must be marked as public in the container. - -Adding Services -~~~~~~~~~~~~~~~ - -To connect existing service definitions, use the -:method:`Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher::addListenerService` -method where the ``$callback`` is an array of ``array($serviceId, $methodName)``:: - - $dispatcher->addListenerService($eventName, array('foo', 'logListener')); - -Adding Subscriber Services -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Event subscribers can be added using the -:method:`Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher::addSubscriberService` -method where the first argument is the service ID of the subscriber service, -and the second argument is the service's class name (which must implement -:class:`Symfony\\Component\\EventDispatcher\\EventSubscriberInterface`) as follows:: - - $dispatcher->addSubscriberService( - 'kernel.store_subscriber', - 'StoreSubscriber' - ); - -The ``EventSubscriberInterface`` is exactly as you would expect:: - - use Symfony\Component\EventDispatcher\EventSubscriberInterface; - use Symfony\Component\HttpKernel\KernelEvents; - // ... - - class StoreSubscriber implements EventSubscriberInterface - { - public static function getSubscribedEvents() - { - return array( - KernelEvents::RESPONSE => array( - array('onKernelResponsePre', 10), - array('onKernelResponsePost', 0), - ), - 'store.order' => array('onStoreOrder', 0), - ); - } - - public function onKernelResponsePre(FilterResponseEvent $event) - { - // ... - } - - public function onKernelResponsePost(FilterResponseEvent $event) - { - // ... - } - - public function onStoreOrder(FilterOrderEvent $event) - { - // ... - } - } + The ``ContainerAwareEventDispatcher`` was removed in Symfony 4.0. Use + ``EventDispatcher`` with closure-proxy injection instead. diff --git a/components/expression_language/caching.rst b/components/expression_language/caching.rst index ac504a26534..cd60c3c4e36 100644 --- a/components/expression_language/caching.rst +++ b/components/expression_language/caching.rst @@ -37,12 +37,6 @@ ones and injecting this using the constructor:: $cache = new RedisAdapter(...); $language = new ExpressionLanguage($cache); -.. versionadded:: 3.2 - PSR-6 caching support was introduced in Symfony 3.2. Prior to version 3.2, - a - :class:`Symfony\\Component\\ExpressionLanguage\\ParserCache\\ParserCacheInterface` - instance had to be injected. - .. seealso:: See the :doc:`/components/cache` documentation for more information about diff --git a/components/expression_language/extending.rst b/components/expression_language/extending.rst index 20a6aa9e188..eecf556e75b 100644 --- a/components/expression_language/extending.rst +++ b/components/expression_language/extending.rst @@ -61,7 +61,7 @@ to add custom functions. To do so, you can create a new expression provider by creating a class that implements :class:`Symfony\\Component\\ExpressionLanguage\\ExpressionFunctionProviderInterface`. -This interface requires one method: +This interface requires one method: :method:`Symfony\\Component\\ExpressionLanguage\\ExpressionFunctionProviderInterface::getFunctions`, which returns an array of expression functions (instances of :class:`Symfony\\Component\\ExpressionLanguage\\ExpressionFunction`) to @@ -102,9 +102,6 @@ register. ExpressionFunction::fromPhp('My\strtoupper', 'my_strtoupper'); - .. versionadded:: 3.3 - The ``ExpressionFunction::fromPhp()`` method was introduced in Symfony 3.3. - You can register providers using :method:`Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage::registerProvider` or by using the second argument of the constructor:: diff --git a/components/filesystem.rst b/components/filesystem.rst index 1445a48cc7d..0cc1c20669d 100644 --- a/components/filesystem.rst +++ b/components/filesystem.rst @@ -211,9 +211,6 @@ support symbolic links, a third boolean argument is available:: readlink ~~~~~~~~ -.. versionadded:: 3.2 - The :method:`Symfony\\Component\\Filesystem\\Filesystem::readlink` method was introduced in Symfony 3.2. - :method:`Symfony\\Component\\Filesystem\\Filesystem::readlink` read links targets. PHP's ``readlink()`` function returns the target of a symbolic link. However, its behavior @@ -297,10 +294,6 @@ The ``file.txt`` file contains ``Hello World`` now. appendToFile ~~~~~~~~~~~~ -.. versionadded:: 3.3 - The :method:`Symfony\\Component\\Filesystem\\Filesystem::appendToFile` - method was introduced in Symfony 3.3. - :method:`Symfony\\Component\\Filesystem\\Filesystem::appendToFile` adds new contents at the end of some file:: diff --git a/components/finder.rst b/components/finder.rst index 6662f3f0a0a..4786c025d3e 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -79,9 +79,6 @@ There are lots of ways to filter and sort your results. You can also use the :method:`Symfony\\Component\\Finder\\Finder::hasResults` method to check if there's any file or directory matching the search criteria. -.. versionadded:: 3.4 - The ``hasResults()`` method was introduced in Symfony 3.4. - Location ~~~~~~~~ diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 88f7b336b58..7b56d953981 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -382,9 +382,6 @@ Note you can create a :class:`Symfony\\Component\\HttpFoundation\\Cookie` object from a raw header value using :method:`Symfony\\Component\\HttpFoundation\\Cookie::fromString`. -.. versionadded:: 3.3 - The ``Cookie::fromString()`` method was introduced in Symfony 3.3. - Managing the HTTP Cache ~~~~~~~~~~~~~~~~~~~~~~~ @@ -530,9 +527,6 @@ It is possible to delete the file after the request is sent with the :method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::deleteFileAfterSend` method. Please note that this will not work when the ``X-Sendfile`` header is set. -.. versionadded:: 3.3 - The ``Stream`` class was introduced in Symfony 3.3. - If the size of the served file is unknown (e.g. because it's being generated on the fly, or because a PHP stream filter is registered on it, etc.), you can pass a ``Stream`` instance to ``BinaryFileResponse``. This will disable ``Range`` and ``Content-Length`` @@ -584,10 +578,6 @@ class, which can make this even easier:: // if the data to send is already encoded in JSON $response = JsonResponse::fromJsonString('{ "data": 123 }'); -.. versionadded:: 3.2 - The :method:`Symfony\\Component\\HttpFoundation\\JsonResponse::fromJsonString` - method was added in Symfony 3.2. - The ``JsonResponse`` class sets the ``Content-Type`` header to ``application/json`` and encodes your data to JSON when needed. diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 0b2539efe7d..1a62e472b7f 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -414,10 +414,6 @@ namespaces in the ``phpunit.xml`` file, as done for example in the Modified PHPUnit script ----------------------- -.. versionadded:: 3.2 - This modified PHPUnit script was introduced in the 3.2 version of - this component. - This bridge provides a modified version of PHPUnit that you can call by using its ``bin/simple-phpunit`` command. It has the following features: diff --git a/components/process.rst b/components/process.rst index 69bb6ddeb49..44fa8a26216 100644 --- a/components/process.rst +++ b/components/process.rst @@ -78,9 +78,6 @@ for new output before going to the next iteration:: echo $data."\n"; } - .. versionadded:: 3.2 - The ``getIterator()`` method was introduced in Symfony 3.2. - The ``mustRun()`` method is identical to ``run()``, except that it will throw a :class:`Symfony\\Component\\Process\\Exception\\ProcessFailedException` if the process couldn't be executed successfully (i.e. the process exited @@ -410,10 +407,6 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and However, it is possible to pass a callback to the ``start``, ``run`` or ``mustRun`` methods to handle process output in a streaming fashion. - .. versionadded:: 3.1 - The ability to pass a callback to these methods when output is disabled - was added in Symfony 3.1. - .. _`Symfony Issue#5759`: https://github.com/symfony/symfony/issues/5759 .. _`PHP Bug#39992`: https://bugs.php.net/bug.php?id=39992 .. _`exec`: https://en.wikipedia.org/wiki/Exec_(operating_system) diff --git a/components/routing.rst b/components/routing.rst index 03a2ed62c17..4afb1c663c5 100644 --- a/components/routing.rst +++ b/components/routing.rst @@ -352,10 +352,6 @@ automatically in the background if you want to use it. A basic example of the Unicode Routing Support ~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 3.2 - UTF-8 support for route paths and requirements was introduced in - Symfony 3.2. - The Routing component supports UTF-8 characters in route paths and requirements. Thanks to the ``utf8`` route option, you can make Symfony match and generate routes with UTF-8 characters: @@ -509,13 +505,6 @@ You can also include UTF-8 strings as routing requirements: character in any language, ``\p{Greek}`` matches any Greek character, ``\P{Han}`` matches any character not included in the Chinese Han script. -.. note:: - - In Symfony 3.2, there is no need to explicitly set the ``utf8`` option. - As soon as Symfony finds a UTF-8 character in the route path or requirements, - it will automatically turn on the UTF-8 support. However, this behavior - is deprecated and setting the option will be required in Symfony 4.0. - Learn more ---------- diff --git a/components/serializer.rst b/components/serializer.rst index d9011365a8a..8d53069e3fd 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -152,10 +152,6 @@ needs three parameters: #. The name of the class this information will be decoded to #. The encoder used to convert that information into an array -.. versionadded:: 3.3 - Support for the ``allow_extra_attributes`` key in the context was introduced - in Symfony 3.3. - By default, additional attributes that are not mapped to the denormalized object will be ignored by the Serializer component. Set the ``allow_extra_attributes`` key of the deserialization context to ``false`` to let the serializer throw @@ -555,10 +551,6 @@ There are several types of normalizers available: :phpclass:`DateTime` and :phpclass:`DateTimeImmutable`) into strings. By default it uses the RFC3339_ format. - .. versionadded:: 3.2 - Support for specifying datetime format during denormalization was - introduced in the ``DateTimeNormalizer`` in Symfony 3.2. - :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` This normalizer converts :phpclass:`SplFileInfo` objects into a data URI string (``data:...``) such that files can be embedded into serialized data. @@ -567,9 +559,6 @@ There are several types of normalizers available: This normalizer converts :phpclass:`DateInterval` objects into strings. By default it uses the ``P%yY%mM%dDT%hH%iM%sS`` format. - .. versionadded:: 3.4 - The ``DateIntervalNormalizer`` normalizer was added in Symfony 3.4. - Encoders -------- @@ -591,9 +580,6 @@ The Serializer component supports many formats out of the box: All these encoders are enabled by default when using the Symfony Standard Edition with the serializer enabled. -.. versionadded:: 3.2 - The ``YamlEncoder`` and ``CsvEncoder`` encoders were introduced in Symfony 3.2 - .. _component-serializer-handling-circular-references: Handling Circular References diff --git a/components/stopwatch.rst b/components/stopwatch.rst index 190b19e04bc..325cc4ceffd 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -49,9 +49,6 @@ while it is still running. $stopwatch = new Stopwatch(true); - .. versionadded:: 3.4 - Full precision support was introduced in Symfony 3.4. - The stopwatch can be reset to its original state at any given time with the :method:`Symfony\\Component\\Stopwatch\\Stopwatch::reset` method, which deletes all the data measured so far. diff --git a/components/translation/usage.rst b/components/translation/usage.rst index b85ca5773a0..d7069d4b050 100644 --- a/components/translation/usage.rst +++ b/components/translation/usage.rst @@ -271,21 +271,6 @@ The second argument (``10`` in this example) is the *number* of objects being described and is used to determine which translation to use and also to populate the ``%count%`` placeholder. -.. versionadded:: 3.2 - - Before Symfony 3.2, the placeholder used to select the plural (``%count%`` - in this example) must be included in the third optional argument of the - ``transChoice()`` method:: - - $translator->transChoice( - 'There is one apple|There are %count% apples', - 10, - array('%count%' => 10) - ); - - Starting from Symfony 3.2, when the only placeholder is ``%count%``, you - don't have to pass this third argument. - Based on the given number, the translator chooses the right plural form. In English, most words have a singular form when there is exactly one object and a plural form for all other numbers (0, 2, 3...). So, if ``count`` is diff --git a/components/var_dumper.rst b/components/var_dumper.rst index 189beb980c6..98b0a35b68d 100644 --- a/components/var_dumper.rst +++ b/components/var_dumper.rst @@ -107,9 +107,6 @@ option. Read more about this and other options in .. tip:: - .. versionadded:: 3.3 - The local search box was introduced in Symfony 3.3. - If the dumped contents are complex, consider using the local search box to look for specific variables or values. First, click anywhere on the dumped contents and then press :kbd:`Ctrl. + F` or :kbd:`Cmd. + F` to make the local diff --git a/components/var_dumper/advanced.rst b/components/var_dumper/advanced.rst index b54eed95bfa..05bc55c74e7 100644 --- a/components/var_dumper/advanced.rst +++ b/components/var_dumper/advanced.rst @@ -77,9 +77,6 @@ Before dumping it, you can further limit the resulting Removes internal objects' handles for sparser output (useful for tests). :method:`Symfony\\Component\\VarDumper\\Cloner\\Data::seek` - .. versionadded:: 3.2 - The ``seek()`` method was introduced in Symfony 3.2. - Selects only subparts of already cloned arrays, objects or resources. Unlike the previous limits on cloners that remove data on purpose, these can @@ -170,9 +167,6 @@ Another option for doing the same could be:: $output = $dumper->dump($cloner->cloneVar($variable), true); - .. versionadded:: 3.2 - The ability to return a string was introduced in Symfony 3.2. - Dumpers implement the :class:`Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface` interface that specifies the :method:`dump(Data $data) ` @@ -198,21 +192,13 @@ method:: 'maxStringLength' => 160 )); -.. versionadded:: 3.2 - Support for passing display options to the ``dump()`` method was introduced - in Symfony 3.2. - -The output format of a dumper can be fine tuned by the two flags +The output format of a dumper can be fine tuned by the two flags ``DUMP_STRING_LENGTH`` and ``DUMP_LIGHT_ARRAY`` which are passed as a bitmap -in the third constructor argument. They can also be set via environment +in the third constructor argument. They can also be set via environment variables when using :method:`assertDumpEquals($dump, $data, $message) ` during unit testing. -.. versionadded:: 3.1 - The ``DUMP_STRING_LENGTH`` and ``DUMP_LIGHT_ARRAY`` flags were introduced - in Symfony 3.1. - If ``DUMP_STRING_LENGTH`` is set, then the length of a string is displayed next to its content: @@ -363,11 +349,6 @@ properties not in the class declaration). Adding Semantics with Metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 3.2 - As of Symfony 3.2, casters can attach metadata attributes to - :class:`Symfony\\Component\\VarDumper\\Cloner\\Stub` objects to inform - dumpers about the precise type of the dumped values. - Since casters are hooked on specific classes or interfaces, they know about the objects they manipulate. By altering the ``$stub`` object (the third argument of any caster), one can transfer this knowledge to the resulting ``Data`` object, diff --git a/components/workflow.rst b/components/workflow.rst index f6af36e6d96..bfb5f857230 100644 --- a/components/workflow.rst +++ b/components/workflow.rst @@ -8,9 +8,6 @@ The Workflow Component The Workflow component provides tools for managing a workflow or finite state machine. -.. versionadded:: 3.2 - The Workflow component was introduced in Symfony 3.2. - Installation ------------ @@ -56,11 +53,6 @@ these statuses are called **places**. You can define the workflow like this:: $marking = new SingleStateMarkingStore('currentState'); $workflow = new Workflow($definition, $marking); -.. versionadded:: 3.3 - The fluent interface for the ``DefinitionBuilder`` class was introduced in - Symfony 3.3. Before you had to call the ``addPlaces()``, ``addTransition()`` - and ``build()`` methods separately. - The ``Workflow`` can now help you to decide what actions are allowed on a blog post depending on what *place* it is in. This will keep your domain logic in one place and not spread all over your application. diff --git a/components/yaml.rst b/components/yaml.rst index e8ed85e123f..6dc5be378cd 100644 --- a/components/yaml.rst +++ b/components/yaml.rst @@ -130,9 +130,6 @@ contents of the given file path and converts them to a PHP value:: $value = Yaml::parseFile('/path/to/file.yml'); -.. versionadded:: 3.4 - The ``parseFile()`` method was introduced in Symfony 3.4. - If an error occurs during parsing, the parser throws a ``ParseException`` exception. .. _components-yaml-dump: @@ -216,10 +213,6 @@ changed using the third argument as follows:: Numeric Literals ................ -.. versionadded:: 3.2 - Support for parsing integers grouped by underscores was introduced in - Symfony 3.2. - Long numeric literals, being integer, float or hexadecimal, are known for their poor readability in code and configuration files. That's why YAML files allow to add underscores to improve their readability: diff --git a/components/yaml/yaml_format.rst b/components/yaml/yaml_format.rst index 01b601360b9..69bed7e2a5e 100644 --- a/components/yaml/yaml_format.rst +++ b/components/yaml/yaml_format.rst @@ -316,9 +316,6 @@ The YAML specification defines some tags to set the type of any data explicitly: Pz7Y6OjuDg4J+fn5OTk6enp 56enmleECcgggoBADs= -.. versionadded:: 3.4 - Support for the ``!!str`` tag was introduced in Symfony 3.4. - .. _YAML: http://yaml.org/ Unsupported YAML Features diff --git a/configuration/external_parameters.rst b/configuration/external_parameters.rst index 248404dd242..8788cb4c47c 100644 --- a/configuration/external_parameters.rst +++ b/configuration/external_parameters.rst @@ -13,9 +13,6 @@ do this. Environment Variables --------------------- -.. versionadded:: 3.2 - ``env()`` parameters were introduced in Symfony 3.2. - You can reference environment variables by using special parameters named after the variables you want to use enclosed between ``env()``. Their actual values will be resolved at runtime (once per request), so that dumped containers can be @@ -122,12 +119,6 @@ of the following: .. tip:: - .. versionadded:: 3.3 - The support of the special ``SYMFONY__`` environment variables was - deprecated in Symfony 3.3 and it will be removed in 4.0. Instead of - using those variables, define regular environment variables and get - their values using the ``%env(...)%`` syntax in your config files. - You can also define the default value of any existing parameters using special environment variables named after their corresponding parameter prefixed with ``SYMFONY__`` after replacing dots by double underscores diff --git a/configuration/micro_kernel_trait.rst b/configuration/micro_kernel_trait.rst index 8e834079271..4ca338def85 100644 --- a/configuration/micro_kernel_trait.rst +++ b/configuration/micro_kernel_trait.rst @@ -201,12 +201,6 @@ hold the kernel. Now it looks like this:: } } - -.. versionadded:: 3.4 - Support for annotation routing without an external bundle was added in - Symfony 3.4. Prior to version 3.4, you needed to install the - SensioFrameworkExtraBundle. - Unlike the previous kernel, this loads an external ``app/config/config.yml`` file, because the configuration started to get bigger: diff --git a/console.rst b/console.rst index 0c8a3f92706..8086b0e45fd 100644 --- a/console.rst +++ b/console.rst @@ -78,12 +78,6 @@ terminal: You can also manually register your command as a service by configuring the service and :doc:`tagging it ` with ``console.command``. -.. caution:: - - Symfony also looks in the ``Command/`` directory of bundles for commands - that are not registered as a service. But this auto discovery is deprecated - since Symfony 3.4 and won't be supported anymore in Symfony 4.0. - As you might expect, this command will do nothing as you didn't write any logic yet. Add your own logic inside the ``execute()`` method, which has access to the input stream (e.g. options and arguments) and the output stream (to write diff --git a/console/commands_as_services.rst b/console/commands_as_services.rst index a5e01ddb3da..217698bced8 100644 --- a/console/commands_as_services.rst +++ b/console/commands_as_services.rst @@ -8,11 +8,6 @@ If you're using the :ref:`default services.yaml configuration ` class that eases the diff --git a/controller.rst b/controller.rst index d0eb709837a..3418956d9ef 100644 --- a/controller.rst +++ b/controller.rst @@ -152,9 +152,6 @@ and many others that you'll learn about next. more robust code to access services. But if you *do* need direct access to the container, using ``Controller`` is fine. -.. versionadded:: 3.3 - The ``AbstractController`` class was added in Symfony 3.3. - .. index:: single: Controller; Redirecting @@ -243,10 +240,6 @@ The Symfony templating system and Twig are explained more in the Fetching Services as Controller Arguments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 3.3 - The ability to type-hint a controller argument in order to receive a service - was added in Symfony 3.3. - Symfony comes *packed* with a lot of useful objects, called :doc:`services `. These are used for rendering templates, sending emails, querying the database and any other "work" you can think of. @@ -457,10 +450,6 @@ Symfony provides a nice session object that you can use to store information about the user between requests. By default, Symfony stores the token in a cookie and writes the attributes to a file by using native PHP sessions. -.. versionadded:: 3.3 - The ability to request a ``Session`` instance in controllers was introduced - in Symfony 3.3. - To retrieve the session, add the :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionInterface` type-hint to your argument and Symfony will provide you with a session:: @@ -568,10 +557,6 @@ read any flash messages from the session using ``app.flashes()``: -.. versionadded:: 3.3 - The ``app.flashes()`` Twig function was introduced in Symfony 3.3. Prior, - you had to use ``app.session.flashBag()``. - .. note:: It's common to use ``notice``, ``warning`` and ``error`` as the keys of the @@ -683,9 +668,6 @@ the :phpfunction:`json_encode` function is used. File helper ~~~~~~~~~~~ -.. versionadded:: 3.2 - The ``file()`` helper was introduced in Symfony 3.2. - You can use the :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::file` helper to serve a file from inside a controller:: diff --git a/controller/argument_value_resolver.rst b/controller/argument_value_resolver.rst index c69c81b4bbd..8ca6af7179d 100644 --- a/controller/argument_value_resolver.rst +++ b/controller/argument_value_resolver.rst @@ -15,9 +15,6 @@ functionality. Functionality Shipped with the HttpKernel ----------------------------------------- -.. versionadded:: 3.3 - The ``SessionValueResolver`` and ``ServiceValueResolver`` were both added in Symfony 3.3. - Symfony ships with five value resolvers in the HttpKernel component: :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver` diff --git a/form/create_form_type_extension.rst b/form/create_form_type_extension.rst index d2ef0bea408..cc2eefd8fa5 100644 --- a/form/create_form_type_extension.rst +++ b/form/create_form_type_extension.rst @@ -109,21 +109,14 @@ the ``getExtendedType()`` method. As *soon* as you do this, any method that you' overridden (e.g. ``buildForm()``) will be called whenever *any* field of the given type (``FileType``) is built. Let's see an example next. -.. versionadded:: 3.3 - Prior to Symfony 3.3, you needed to define type extension services as ``public``. - Starting from Symfony 3.3, you can also define them as ``private``. - .. tip:: - There is an optional tag attribute called ``priority``, which - defaults to ``0`` and controls the order in which the form - type extensions are loaded (the higher the priority, the earlier - an extension is loaded). This is useful when you need to guarantee + There is an optional tag attribute called ``priority``, which + defaults to ``0`` and controls the order in which the form + type extensions are loaded (the higher the priority, the earlier + an extension is loaded). This is useful when you need to guarantee that one extension is loaded before or after another extension. - .. versionadded:: 3.2 - The ``priority`` attribute was introduced in Symfony 3.2. - Adding the extension Business Logic ----------------------------------- diff --git a/form/form_customization.rst b/form/form_customization.rst index 3578b4c3df5..a80de5f7f50 100644 --- a/form/form_customization.rst +++ b/form/form_customization.rst @@ -121,9 +121,6 @@ fragment needed to render every part of a form: with the appropriate CSS classes to apply the default `Foundation CSS framework`_ styles. -.. versionadded:: 3.4 - The Bootstrap 4 form themes were introduced in Symfony 3.4. - .. caution:: When you use the Bootstrap form themes and render the fields manually, diff --git a/form/form_dependencies.rst b/form/form_dependencies.rst index 0a01af74553..b953156923f 100644 --- a/form/form_dependencies.rst +++ b/form/form_dependencies.rst @@ -139,10 +139,6 @@ manually and tag it with ``form.type``: ->addTag('form.type') ; -.. versionadded:: 3.3 - Prior to Symfony 3.3, you needed to define form type services as ``public``. - Starting from Symfony 3.3, you can also define them as ``private``. - That's it! Your controller - where you create the form - doesn't need to change at all: Symfony is smart enough to load the ``TaskType`` from the container. diff --git a/form/type_guesser.rst b/form/type_guesser.rst index 4ec50fc9712..073183d9c0f 100644 --- a/form/type_guesser.rst +++ b/form/type_guesser.rst @@ -216,10 +216,6 @@ and tag it with ``form.type_guesser``: ->addTag('form.type_guesser') ; -.. versionadded:: 3.3 - Prior to Symfony 3.3, you needed to define type guesser services as ``public``. - Starting from Symfony 3.3, you can also define them as ``private``. - .. sidebar:: Registering a Type Guesser in the Component If you're using the Form component standalone in your PHP project, use diff --git a/form/unit_testing.rst b/form/unit_testing.rst index b869eea2c26..5adf754b6eb 100644 --- a/form/unit_testing.rst +++ b/form/unit_testing.rst @@ -209,10 +209,6 @@ guessers using the :method:`Symfony\\Component\\Form\\Test\\FormIntegrationTestC and :method:`Symfony\\Component\\Form\\Test\\FormIntegrationTestCase::getTypeGuessers` methods. -.. versionadded:: 3.3 - The ``getTypes()``, ``getTypeExtensions()`` and ``getTypeGuessers()`` - methods were introduced in Symfony 3.3. - Testing against Different Sets of Data -------------------------------------- diff --git a/profiler/matchers.rst b/profiler/matchers.rst index 2e92a52a440..6c4a2c0974e 100644 --- a/profiler/matchers.rst +++ b/profiler/matchers.rst @@ -6,158 +6,26 @@ How to Use Matchers to Enable the Profiler Conditionally .. caution:: - The possibility to use a matcher to enable the profiler conditionally is - deprecated since Symfony 3.4 and will be removed in 4.0. + The possibility to use a matcher to enable the profiler conditionally was + removed in Symfony 4.0. -The Symfony profiler is only activated in the development environment to not hurt -your application performance. However, sometimes it may be useful to conditionally -enable the profiler in the production environment to assist you in debugging -issues. This behavior is implemented with the **Request Matchers**. +Symfony Profiler cannot be enabled/disabled conditionally using matchers, because +that feature was removed in Symfony 4.0. However, you can use the ``enable()`` +and ``disable()`` methods of the :class:`Symfony\\Component\\HttpKernel\\Profiler\\Profiler` +class in your controllers to manage the profiler programmatically:: -Using the built-in Matcher --------------------------- + use Symfony\Component\HttpKernel\Profiler\Profiler; + // ... -A request matcher is a class that checks whether a given ``Request`` instance -matches a set of conditions. Symfony provides a -:class:`built-in matcher ` -which matches paths and IPs. For example, if you want to only show the profiler -when accessing the page with the ``168.0.0.1`` IP, then you can use this -configuration: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - framework: - # ... - profiler: - matcher: - ip: 168.0.0.1 - - .. code-block:: xml - - - - - - - - - - - - - - .. code-block:: php - - // app/config/config.php - $container->loadFromExtension('framework', array( - // ... - 'profiler' => array( - 'matcher' => array( - 'ip' => '168.0.0.1', - ) - ), - )); - -You can also set a ``path`` option to define the path on which the profiler -should be enabled. For instance, setting it to ``^/admin/`` will enable the -profiler only for the URLs which start with ``/admin/``. - -Creating a Custom Matcher -------------------------- - -Leveraging the concept of Request Matchers you can define a custom matcher to -enable the profiler conditionally in your application. To do so, create a class -which implements -:class:`Symfony\\Component\\HttpFoundation\\RequestMatcherInterface`. This -interface requires one method: -:method:`Symfony\\Component\\HttpFoundation\\RequestMatcherInterface::matches`. -This method returns ``false`` when the request doesn't match the conditions and -``true`` otherwise. Therefore, the custom matcher must return ``false`` to -disable the profiler and ``true`` to enable it. - -Suppose that the profiler must be enabled whenever a user with a -``ROLE_SUPER_ADMIN`` is logged in. This is the only code needed for that custom -matcher:: - - // src/Profiler/SuperAdminMatcher.php - namespace App\Profiler; - - use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; - use Symfony\Component\HttpFoundation\Request; - use Symfony\Component\HttpFoundation\RequestMatcherInterface; - - class SuperAdminMatcher implements RequestMatcherInterface + class DefaultController { - protected $authorizationChecker; + // ... - public function __construct(AuthorizationCheckerInterface $authorizationChecker) + public function someMethod(Profiler $profiler) { - $this->authorizationChecker = $authorizationChecker; - } + // for this particular controller action, the profiler is disabled + $profiler->disable(); - public function matches(Request $request) - { - return $this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN'); + // ... } } - -Then, you'll need to make sure your class is defined as as service. If you're using -the :ref:`default services.yaml configuration `, -you don't need to do anything! - -Once the service is registered, the only thing left to do is configure the -profiler to use this service as the matcher: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - framework: - # ... - profiler: - matcher: - service: App\Profiler\SuperAdminMatcher - - .. code-block:: xml - - - - - - - - - - - - - - .. code-block:: php - - // app/config/config.php - use App\Profiler\SuperAdminMatcher; - - $container->loadFromExtension('framework', array( - // ... - 'profiler' => array( - 'matcher' => array( - 'service' => SuperAdminMatcher::class, - ) - ), - )); diff --git a/quick_tour/the_controller.rst b/quick_tour/the_controller.rst index edd21d87aa2..a91929a2f03 100644 --- a/quick_tour/the_controller.rst +++ b/quick_tour/the_controller.rst @@ -334,10 +334,6 @@ And you can display the flash message in the template like this: {% endfor %} -.. versionadded:: 3.3 - The ``app.flashes()`` Twig function was introduced in Symfony 3.3. Prior, - you had to use ``app.session.flashBag()``. - Final Thoughts -------------- diff --git a/reference/configuration/debug.rst b/reference/configuration/debug.rst index 223879b486a..b9185488a68 100644 --- a/reference/configuration/debug.rst +++ b/reference/configuration/debug.rst @@ -41,9 +41,6 @@ be cloned. After this depth is reached, only ``max_items`` items will be cloned. The default value is ``1``, which is consistent with older Symfony versions. -.. versionadded:: 3.4 - The ``min_depth`` option was introduced in Symfony 3.4. - max_string_length ~~~~~~~~~~~~~~~~~ diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 2ed76242b59..374edd23263 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -46,10 +46,6 @@ Configuration * `only_exceptions`_ * `only_master_requests`_ * `dsn`_ - * `matcher`_ - * `ip`_ - * :ref:`path ` - * `service`_ * `request`_: * `formats`_ * `router`_ @@ -277,9 +273,6 @@ need to escape the percent signs (``%``) by doubling them. // and /foo/.../file as /bar/.../file also 'myide://%f:%l&/path/to/guest/>/path/to/host/&/foo/>/bar/&...' - .. versionadded:: 3.2 - Guest to host mappings were introduced in Symfony 3.2. - .. _reference-framework-test: test @@ -540,11 +533,10 @@ collect **type**: ``boolean`` **default**: ``true`` -This option configures the way the profiler behaves when it is enabled. -If set to ``true``, the profiler collects data for all requests (unless -you configure otherwise, like a custom `matcher`_). If you want to only -collect information on-demand, you can set the ``collect`` flag to ``false`` -and activate the data collectors manually:: +This option configures the way the profiler behaves when it is enabled. If set +to ``true``, the profiler collects data for all requests. If you want to only +collect information on-demand, you can set the ``collect`` flag to ``false`` and +activate the data collectors manually:: $profiler->enable(); @@ -576,44 +568,6 @@ The DSN where to store the profiling information. See :doc:`/profiler/storage` for more information about the profiler storage. -matcher -....... - -.. caution:: - - This option is deprecated since Symfony 3.4 and will be removed in 4.0. - -Matcher options are configured to dynamically enable the profiler. For -instance, based on the `ip`_ or :ref:`path `. - -.. seealso:: - - See :doc:`/profiler/matchers` for more information about using - matchers to enable/disable the profiler. - -ip -"" - -**type**: ``string`` - -If set, the profiler will only be enabled when the current IP address matches. - -.. _reference-profiler-matcher-path: - -path -"""" - -**type**: ``string`` - -If set, the profiler will only be enabled when the current path matches. - -service -""""""" - -**type**: ``string`` - -This setting contains the service id of a custom matcher. - request ~~~~~~~ @@ -1300,10 +1254,6 @@ json_manifest_path **type**: ``string`` **default**: ``null`` -.. versionadded:: 3.3 - - The ``json_manifest_path`` option was introduced in Symfony 3.3. - The file path to a ``manifest.json`` file containing an associative array of asset names and their respective compiled names. A common cache-busting technique using a "manifest" file works by writing out assets with a "hash" appended to their @@ -1772,9 +1722,6 @@ php_errors log ... -.. versionadded:: 3.2 - The ``log`` option was introduced in Symfony 3.2. - **type**: ``boolean`` **default**: ``false`` Use the application logger instead of the PHP logger for logging PHP errors. @@ -1782,9 +1729,6 @@ Use the application logger instead of the PHP logger for logging PHP errors. throw ..... -.. versionadded:: 3.2 - The ``throw`` option was introduced in Symfony 3.2. - **type**: ``boolean`` **default**: ``%kernel.debug%`` Throw PHP errors as ``\ErrorException`` instances. The parameter @@ -1854,9 +1798,6 @@ service. default_memcached_provider .......................... -.. versionadded:: 3.3 - The ``default_memcached_provider`` option was introduced in Symfony 3.3. - **type**: ``string`` **default**: ``memcached://localhost`` The DSN to use by the Memcached provider. The provider is available as the ``cache.memcached`` @@ -1988,12 +1929,6 @@ Full Default Configuration only_exceptions: false only_master_requests: false dsn: file:%kernel.cache_dir%/profiler - matcher: - ip: ~ - - # use the urldecoded format - path: ~ # Example: ^/path to resource/ - service: ~ # router configuration router: diff --git a/reference/configuration/kernel.rst b/reference/configuration/kernel.rst index 3a0e51fbda3..63d4ee42af6 100644 --- a/reference/configuration/kernel.rst +++ b/reference/configuration/kernel.rst @@ -13,7 +13,7 @@ Configuration * `Charset`_ * `Kernel Name`_ -* `Root Directory`_ +* `Project Directory`_ * `Cache Directory`_ * `Log Directory`_ @@ -53,40 +53,9 @@ generation of cache files. If you have an application with multiple kernels, the easiest way to make each have a unique name is to duplicate the ``app`` directory and rename it to something else (e.g. ``foo``). -Root Directory -~~~~~~~~~~~~~~ - -.. versionadded:: 3.3 - The ``getRootDir()`` method is deprecated since Symfony 3.3. Use the new - ``getProjectDir()`` method instead. - -**type**: ``string`` **default**: the directory of ``AppKernel`` - -This returns the root directory of your kernel. If you use the Symfony Standard -edition, the root directory refers to the ``app`` directory. - -To change this setting, override the -:method:`Symfony\\Component\\HttpKernel\\Kernel::getRootDir` method:: - - // app/AppKernel.php - - // ... - class AppKernel extends Kernel - { - // ... - - public function getRootDir() - { - return realpath(parent::getRootDir().'/../'); - } - } - Project Directory ~~~~~~~~~~~~~~~~~ -.. versionadded:: 3.3 - The ``getProjectDir()`` method was introduced in Symfony 3.3. - **type**: ``string`` **default**: the directory of the project ``composer.json`` This returns the root directory of your Symfony project. It's calculated as diff --git a/reference/configuration/security.rst b/reference/configuration/security.rst index 9e2fd48bb88..b533460fd94 100644 --- a/reference/configuration/security.rst +++ b/reference/configuration/security.rst @@ -31,24 +31,6 @@ Each part will be explained in the next section. allow_if_all_abstain: false allow_if_equal_granted_denied: true - # ACL support was deprecated in Symfony 3.4 and removed in Symfony 4.0 - # Use https://github.com/symfony/acl-bundle instead - acl: - # any name configured in doctrine.dbal section - connection: ~ - cache: - id: ~ - prefix: sf2_acl_ - provider: ~ - tables: - class: acl_classes - entry: acl_entries - object_identity: acl_object_identities - object_identity_ancestors: acl_object_identity_ancestors - security_identity: acl_security_identities - voter: - allow_if_object_identity_unavailable: true - encoders: # Examples: Acme\DemoBundle\Entity\User1: sha512 diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst index f0338e68857..c5c2a0acf54 100644 --- a/reference/configuration/twig.rst +++ b/reference/configuration/twig.rst @@ -141,12 +141,6 @@ TwigBundle Configuration ("twig") 'default_path' => '%kernel.project_dir%/templates', )); -.. caution:: - - The ``twig.form`` (```` tag for xml) configuration key - has been deprecated and will be removed in 3.0. Instead, use the ``twig.form_themes`` - option. - Configuration ------------- @@ -346,9 +340,6 @@ default_path **type**: ``string`` **default**: ``'%kernel.project_dir%/templates'`` -.. versionadded:: 3.4 - The ``default_path`` option was introduced in Symfony 3.4. - The default directory where Symfony will look for Twig templates. .. _config-twig-paths: diff --git a/reference/configuration/web_profiler.rst b/reference/configuration/web_profiler.rst index 2512142b239..2943b476cb6 100644 --- a/reference/configuration/web_profiler.rst +++ b/reference/configuration/web_profiler.rst @@ -15,10 +15,8 @@ Configuration ------------- * `toolbar`_ -* `position`_ * `intercept_redirects`_ * `excluded_ajax_paths`_ -* `verbose`_ toolbar ~~~~~~~ @@ -29,14 +27,6 @@ It enables and disables the toolbar entirely. Usually you set this to ``true`` in the ``dev`` and ``test`` environments and to ``false`` in the ``prod`` environment. -position -~~~~~~~~ - -**type**: ``string`` **default**: ``bottom`` - -It defines the location of the browser window where the toolbar is displayed. -the only allowed values are ``bottom`` and ``top``. - intercept_redirects ~~~~~~~~~~~~~~~~~~~ @@ -61,14 +51,6 @@ expression. If the URL matches, the request is not displayed in the toolbar. Thi is useful when the application makes lots of Ajax requests or they are heavy and you want to exclude some of them. -verbose -~~~~~~~ - -**type**: ``boolean`` **default**: ``true`` - -This option is **deprecated** and has no effect on the toolbar or the profiler, -so you can safely remove it from your configuration. - Full Default Configuration -------------------------- @@ -79,13 +61,9 @@ Full Default Configuration # app/config/config.yml web_profiler: toolbar: false - position: bottom intercept_redirects: false excluded_ajax_paths: ^/bundles|^/_wdt - # DEPRECATED, it can be removed safely from your configuration - verbose: true - .. code-block:: xml @@ -100,7 +78,6 @@ Full Default Configuration diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index c4b4931f8ef..777b174fb80 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -144,9 +144,6 @@ form element. } } -.. versionadded:: 3.2 - As of Symfony 3.2 the callback no longer needs to be static. - You can pass the name of this method to the `callback`_ option of the ``Choice`` constraint. @@ -374,9 +371,4 @@ The validator will also check the type of the input value. Specifically, this value is passed to as the third argument to the PHP :phpfunction:`in_array` method when checking to see if a value is in the valid choices array. -.. caution:: - - Setting the strict option of the Choice Constraint to ``false`` has been - deprecated as of Symfony 3.2 and the option will be changed to ``true`` as of 4.0. - .. include:: /reference/constraints/_payload-option.rst.inc diff --git a/reference/constraints/Image.rst b/reference/constraints/Image.rst index df968e316ef..5fe3c57c3a2 100644 --- a/reference/constraints/Image.rst +++ b/reference/constraints/Image.rst @@ -277,9 +277,6 @@ value in pixels. minPixels ~~~~~~~~~ -.. versionadded:: 3.4 - The ``minPixels`` option has been introduced in Symfony 3.4. - **type**: ``integer`` If set, the amount of pixels of the image file must be greater than or equal to this @@ -288,9 +285,6 @@ value. maxPixels ~~~~~~~~~ -.. versionadded:: 3.4 - The ``maxPixels`` option has been introduced in Symfony 3.4. - **type**: ``integer`` If set, the amount of pixels of the image file must be less than or equal to this @@ -388,9 +382,6 @@ The error message if the height of the image is less than `minHeight`_. maxPixelsMessage ~~~~~~~~~~~~~~~~ -.. versionadded:: 3.4 - The ``maxPixelsMessage`` option has been introduced in Symfony 3.4. - **type**: ``string`` **default**: ``The image has to many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels.`` @@ -399,9 +390,6 @@ The error message if the amount of pixels of the image exceeds `maxPixels`_. minPixelsMessage ~~~~~~~~~~~~~~~~ -.. versionadded:: 3.4 - The ``minPixelsMessage`` option has been introduced in Symfony 3.4. - **type**: ``string`` **default**: ``The image has to few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels.`` diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index d95547d9275..b56025be2aa 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -164,9 +164,6 @@ This method should return a countable result. entityClass ~~~~~~~~~~~ -.. versionadded:: 3.2 - The ``entityClass`` option was introduced in Symfony 3.2. - **type**: ``string`` By default, the query performed to ensure the uniqueness uses the repository of diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 162fa9d0282..b979da368f9 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -506,11 +506,6 @@ Cache warming occurs whenever you run the ``cache:warmup`` or ``cache:clear`` command (unless you pass ``--no-warmup`` to ``cache:clear``). It is also run when handling the request, if it wasn't done by one of the commands yet. -.. versionadded:: 3.3 - Starting from Symfony 3.3, the warm-up part of the ``cache:clear`` command - is deprecated. You must always pass the ``--no-warmup`` option to - ``cache:clear`` and use ``cache:warmup`` instead to warm-up the cache. - The purpose is to initialize any cache that will be needed by the application and prevent the first user from any significant "cache hit" where the cache is generated dynamically. diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index e59f0b56a5c..fe5e2b8d6da 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -19,7 +19,6 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op | | - `choice_name`_ | | | - `choice_translation_domain`_ | | | - `choice_value`_ | -| | - `choices_as_values`_ (deprecated) | | | - `expanded`_ | | | - `group_by`_ | | | - `multiple`_ | @@ -184,11 +183,7 @@ The ``choice_loader`` can be used to only partially load the choices in cases wh a fully-loaded list is not necessary. This is only needed in advanced cases and would replace the ``choices`` option. -.. versionadded:: 3.2 - The :class:`Symfony\\Component\\Form\\ChoiceList\\Loader\\CallbackChoiceLoader` - was introduced in Symfony 3.2. - -You can use an instance of :class:`Symfony\\Component\\Form\\ChoiceList\\Loader\\CallbackChoiceLoader` +You can use an instance of :class:`Symfony\\Component\\Form\\ChoiceList\\Loader\\CallbackChoiceLoader` if you want to take advantage of lazy loading:: use Symfony\Component\Form\ChoiceList\Loader\CallbackChoiceLoader; @@ -211,12 +206,6 @@ the choice options would need to be resolved thus triggering the callback. .. include:: /reference/forms/types/options/choice_value.rst.inc -choices_as_values -~~~~~~~~~~~~~~~~~ - -This option is deprecated and you should remove it from your 3.x projects (removing -it will have *no* effect). For its purpose in 2.x, see the 2.7 documentation. - .. include:: /reference/forms/types/options/expanded.rst.inc .. include:: /reference/forms/types/options/group_by.rst.inc diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index 8b5d2cbb4dc..6887093ab3d 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -304,10 +304,6 @@ the value is removed from the collection. For example:: Using a callable is particularly useful in case of compound form types, which may define complex conditions for considering them empty. -.. versionadded:: 3.4 - Support for using a callable for the ``delete_empty`` option was introduced - in Symfony 3.4. - entry_options ~~~~~~~~~~~~~ diff --git a/reference/forms/types/country.rst b/reference/forms/types/country.rst index 49d9d121f01..cbb052716e7 100644 --- a/reference/forms/types/country.rst +++ b/reference/forms/types/country.rst @@ -63,8 +63,7 @@ The locale is used to translate the countries names. .. caution:: If you want to override the built-in choices of the country type, you - will also have to set the ``choice_loader`` option to ``null``. Not doing - so is deprecated since Symfony 3.3. + will also have to set the ``choice_loader`` option to ``null``. Inherited Options ----------------- diff --git a/reference/forms/types/currency.rst b/reference/forms/types/currency.rst index 2dc15904105..af0f623a3b7 100644 --- a/reference/forms/types/currency.rst +++ b/reference/forms/types/currency.rst @@ -54,8 +54,7 @@ The choices option defaults to all currencies. .. caution:: If you want to override the built-in choices of the currency type, you - will also have to set the ``choice_loader`` option to ``null``. Not doing - so is deprecated since Symfony 3.3. + will also have to set the ``choice_loader`` option to ``null``. Inherited Options ----------------- diff --git a/reference/forms/types/dateinterval.rst b/reference/forms/types/dateinterval.rst index 6cb573cc3da..fdd6a6f19ac 100644 --- a/reference/forms/types/dateinterval.rst +++ b/reference/forms/types/dateinterval.rst @@ -4,9 +4,6 @@ DateIntervalType Field ====================== -.. versionadded:: 3.2 - The DateIntervalType field type was introduced in Symfony 3.2. - This field allows the user to select an *interval* of time. For example, if you want to allow the user to choose *how often* they receive a status email, they could use this field to choose intervals like every "10 minutes" or "3 days". @@ -132,9 +129,6 @@ this format. labels ~~~~~~ -.. versionadded:: 3.3 - The ``labels`` option was introduced in Symfony 3.3. - **type**: ``array`` **default**: (see below) The labels displayed for each of the elements of this type. The default values diff --git a/reference/forms/types/language.rst b/reference/forms/types/language.rst index 2d221738b46..5d4a281eb6a 100644 --- a/reference/forms/types/language.rst +++ b/reference/forms/types/language.rst @@ -65,8 +65,7 @@ The default locale is used to translate the languages names. .. caution:: If you want to override the built-in choices of the language type, you - will also have to set the ``choice_loader`` option to ``null``. Not doing - so is deprecated since Symfony 3.3. + will also have to set the ``choice_loader`` option to ``null``. Inherited Options ----------------- diff --git a/reference/forms/types/locale.rst b/reference/forms/types/locale.rst index ca9c02e55f7..af77364e79d 100644 --- a/reference/forms/types/locale.rst +++ b/reference/forms/types/locale.rst @@ -66,8 +66,7 @@ specify the language. .. caution:: If you want to override the built-in choices of the locale type, you - will also have to set the ``choice_loader`` option to ``null``. Not doing - so is deprecated since Symfony 3.3. + will also have to set the ``choice_loader`` option to ``null``. Inherited Options ----------------- diff --git a/reference/forms/types/timezone.rst b/reference/forms/types/timezone.rst index b3fbfb2ff29..9c99f6c5c82 100644 --- a/reference/forms/types/timezone.rst +++ b/reference/forms/types/timezone.rst @@ -59,8 +59,7 @@ The Timezone type defaults the choices to all timezones returned by .. caution:: If you want to override the built-in choices of the timezone type, you - will also have to set the ``choice_loader`` option to ``null``. Not doing - so is deprecated since Symfony 3.3. + will also have to set the ``choice_loader`` option to ``null``. Inherited Options ----------------- diff --git a/reference/twig_reference.rst b/reference/twig_reference.rst index 54fd4369cfd..0d802775b01 100644 --- a/reference/twig_reference.rst +++ b/reference/twig_reference.rst @@ -293,11 +293,6 @@ Returns ``true`` if the current user has the required role. Optionally, an object can be pasted to be used by the voter. More information can be found in :ref:`security-template`. -.. note:: - - You can also pass in the field to use ACE for a specific field. Read - more about this in :ref:`security-acl-field_scope`. - logout_path ~~~~~~~~~~~ diff --git a/routing.rst b/routing.rst index d6bcbc65637..843cd507808 100644 --- a/routing.rst +++ b/routing.rst @@ -488,9 +488,6 @@ that are special: each adds a unique piece of functionality inside your applicat Used to set the fragment identifier, the optional last part of a URL that starts with a ``#`` character and is used to identify a portion of a document. - .. versionadded:: 3.2 - The ``_fragment`` parameter was introduced in Symfony 3.2. - ``_locale`` Used to set the locale on the request (:ref:`read more `). diff --git a/routing/requirements.rst b/routing/requirements.rst index 78383d28c1b..4a6dd5a8592 100644 --- a/routing/requirements.rst +++ b/routing/requirements.rst @@ -161,14 +161,9 @@ Path Parameters .. note:: - Since Symfony 3.2, you can enable UTF-8 route matching by setting the ``utf8`` - option when declaring or importing routes. This will make e.g. a ``.`` in - requirements match any UTF-8 characters instead of just a single byte. - The option is automatically enabled whenever a route or a requirement uses any - non-ASCII UTF-8 characters or a `PCRE Unicode property`_ (``\p{xx}``, - ``\P{xx}`` or ``\X``). Note that this behavior is deprecated and a - ``LogicException`` will be thrown instead in 4.0 unless you explicitly turn - on the ``utf8`` option. + You can enable UTF-8 route matching by setting the ``utf8`` option when + declaring or importing routes. This will make e.g. a ``.`` in requirements + match any UTF-8 characters instead of just a single byte. .. tip:: diff --git a/security.rst b/security.rst index 4038d031d3f..9a2b607f63e 100644 --- a/security.rst +++ b/security.rst @@ -969,29 +969,17 @@ For more details on expressions and security, see :doc:`/security/expressions`. Access Control Lists (ACLs): Securing individual Database Objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 3.4 - ACL support was deprecated in Symfony 3.4 and will be removed in 4.0. Install - the `Symfony ACL bundle`_ if you want to keep using ACL. - Imagine you are designing a blog where users can comment on your posts. You also want a user to be able to edit their own comments, but not those of other users. Also, as the admin user, you yourself want to be able to edit *all* comments. -To accomplish this you have 2 options: - -* :doc:`Voters ` allow you to write own business logic - (e.g. the user can edit this post because they were the creator) to determine - access. You'll probably want this option - it's flexible enough to solve the - above situation. +:doc:`Voters ` allow you to write own business logic (e.g. the +user can edit this post because they were the creator) to determine access. +That's why voters are officially recommended by Symfony to create ACL-like +security systems. -* :doc:`ACLs ` allow you to create a database structure - where you can assign *any* arbitrary user *any* access (e.g. EDIT, VIEW) - to *any* object in your system. Use this if you need an admin user to be - able to grant customized access across your system via some admin interface. - -In both cases, you'll still deny access using methods similar to what was -shown above. +If you still prefer to use traditional ACLs, refer to the `Symfony ACL bundle`_. 3) Retrieving the User Object ----------------------------- @@ -1015,10 +1003,6 @@ look like:: The user will be an object and the class of that object will depend on your :ref:`user provider `. -.. versionadded:: 3.2 - The ability to get the user by type-hinting an argument with UserInterface - was introduced in Symfony 3.2. - Now you can call whatever methods are on *your* User object. For example, if your User object has a ``getFirstName()`` method, you could use that:: diff --git a/security/acl.rst b/security/acl.rst index 8f06329fc39..b09c6364b46 100644 --- a/security/acl.rst +++ b/security/acl.rst @@ -4,251 +4,9 @@ How to Use Access Control Lists (ACLs) ====================================== -.. versionadded:: 3.4 - ACL support was deprecated in Symfony 3.4 and will be removed in 4.0. Install - the `Symfony ACL bundle`_ if you wan to keep using ACL. +.. caution:: -In complex applications, you will often face the problem that access decisions -cannot only be based on the person (``Token``) who is requesting access, but -also involve a domain object that access is being requested for. This is where -the ACL system comes in. - -.. sidebar:: Alternatives to ACLs - - Using ACL's isn't trivial, and for simpler use cases, it may be overkill. - If your permission logic could be described by just writing some code (e.g. - to check if a Blog is owned by the current User), then consider using - :doc:`voters `. A voter is passed the object - being voted on, which you can use to make complex decisions and effectively - implement your own ACL. Enforcing authorization (e.g. the ``isGranted()`` - part) will look similar to what you see in this entry, but your voter - class will handle the logic behind the scenes, instead of the ACL system. - -Imagine you are designing a blog system where your users can comment on your -posts. Now, you want a user to be able to edit their own comments, but not those -of other users; besides, you want to be able to edit all comments. In -this scenario, ``Comment`` would be the domain object that you want to -restrict access to. You could take several approaches to accomplish this using -Symfony, two basic approaches are (non-exhaustive): - -- *Enforce security in your business methods*: Basically, that means keeping a - reference inside each ``Comment`` to all users who have access, and then - compare these users to the provided ``Token``. -- *Enforce security with roles*: In this approach, you would add a role for - each ``Comment`` object, i.e. ``ROLE_COMMENT_1``, ``ROLE_COMMENT_2``, etc. - -Both approaches are perfectly valid. However, they couple your authorization -logic to your business code which makes it less reusable elsewhere, and also -increases the difficulty of unit testing. Besides, you could run into -performance issues if many users would have access to a single domain object. - -Fortunately, there is a better way, which you will find out about now. - -Bootstrapping -------------- - -Now, before you can finally get into action, you need to do some bootstrapping. -First, you need to configure the connection the ACL system is supposed to use: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/security.yml - security: - # ... - - acl: - connection: default - - .. code-block:: xml - - - - - - - - - - - - - .. code-block:: php - - // app/config/security.php - $container->loadFromExtension('security', array( - // ... - - 'acl' => array( - 'connection' => 'default', - ), - )); - -.. note:: - - The ACL system requires a connection from either Doctrine DBAL (usable by - default) or Doctrine MongoDB (usable with `MongoDBAclBundle`_). However, - that does not mean that you have to use Doctrine ORM or ODM for mapping your - domain objects. You can use whatever mapper you like for your objects, be it - Doctrine ORM, MongoDB ODM, Propel, raw SQL, etc. The choice is yours. - -After the connection is configured, you have to import the database structure -running the following command: - -.. code-block:: terminal - - $ php bin/console init:acl - -Getting Started ---------------- - -Coming back to the small example from the beginning, you can now implement -ACL for it. - -Once the ACL is created, you can grant access to objects by creating an -Access Control Entry (ACE) to solidify the relationship between the entity -and your user. - -Creating an ACL and Adding an ACE -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: php - - // src/Controller/BlogController.php - namespace App\Controller; - - use Symfony\Bundle\FrameworkBundle\Controller\Controller; - use Symfony\Component\Security\Core\Exception\AccessDeniedException; - use Symfony\Component\Security\Acl\Domain\ObjectIdentity; - use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity; - use Symfony\Component\Security\Acl\Permission\MaskBuilder; - - class BlogController extends Controller - { - // ... - - public function addCommentAction(Post $post) - { - $comment = new Comment(); - - // ... setup $form, and submit data - - if ($form->isSubmitted() && $form->isValid()) { - $entityManager = $this->getDoctrine()->getManager(); - $entityManager->persist($comment); - $entityManager->flush(); - - // creating the ACL - $aclProvider = $this->get('security.acl.provider'); - $objectIdentity = ObjectIdentity::fromDomainObject($comment); - $acl = $aclProvider->createAcl($objectIdentity); - - // retrieving the security identity of the currently logged-in user - $tokenStorage = $this->get('security.token_storage'); - $user = $tokenStorage->getToken()->getUser(); - $securityIdentity = UserSecurityIdentity::fromAccount($user); - - // grant owner access - $acl->insertObjectAce($securityIdentity, MaskBuilder::MASK_OWNER); - $aclProvider->updateAcl($acl); - } - } - } - -There are a couple of important implementation decisions in this code snippet. -For now, I only want to highlight two: - -First, you may have noticed that ``->createAcl()`` does not accept domain -objects directly, but only implementations of the ``ObjectIdentityInterface``. -This additional step of indirection allows you to work with ACLs even when you -have no actual domain object instance at hand. This will be extremely helpful -if you want to check permissions for a large number of objects without -actually hydrating these objects. - -The other interesting part is the ``->insertObjectAce()`` call. In the -example, you are granting the user who is currently logged in owner access to -the Comment. The ``MaskBuilder::MASK_OWNER`` is a pre-defined integer bitmask; -don't worry the mask builder will abstract away most of the technical details, -but using this technique you can store many different permissions in one -database row which gives a considerable boost in performance. - -.. tip:: - - The order in which ACEs are checked is significant. As a general rule, you - should place more specific entries at the beginning. - -Checking Access -~~~~~~~~~~~~~~~ - -.. code-block:: php - - // src/Controller/BlogController.php - - // ... - - class BlogController - { - // ... - - public function editCommentAction(Comment $comment) - { - $authorizationChecker = $this->get('security.authorization_checker'); - - // check for edit access - if (false === $authorizationChecker->isGranted('EDIT', $comment)) { - throw new AccessDeniedException(); - } - - // ... retrieve actual comment object, and do your editing here - } - } - -In this example, you check whether the user has the ``EDIT`` permission. -Internally, Symfony maps the permission to several integer bitmasks, and -checks whether the user has any of them. - -.. note:: - - You can define up to 32 base permissions (depending on your OS PHP might - vary between 30 to 32). In addition, you can also define cumulative - permissions. - -Cumulative Permissions ----------------------- - -In the first example above, you only granted the user the ``OWNER`` base -permission. While this effectively also allows the user to perform any -operation such as view, edit, etc. on the domain object, there are cases where -you may want to grant these permissions explicitly. - -The ``MaskBuilder`` can be used for creating bit masks easily by combining -several base permissions: - -.. code-block:: php - - $builder = new MaskBuilder(); - $builder - ->add('view') - ->add('edit') - ->add('delete') - ->add('undelete') - ; - $mask = $builder->get(); // int(29) - -This integer bitmask can then be used to grant a user the base permissions you -added above: - -.. code-block:: php - - $identity = new UserSecurityIdentity('johannes', 'App\Entity\User'); - $acl->insertObjectAce($identity, $mask); - -The user is now allowed to view, edit, delete, and un-delete objects. + ACL support was removed in Symfony 4.0. Install the `Symfony ACL bundle`_ + and refer to its documentation if you want to keep using ACL. .. _`Symfony ACL bundle`: https://github.com/symfony/acl-bundle -.. _`MongoDBAclBundle`: https://github.com/IamPersistent/MongoDBAclBundle diff --git a/security/acl_advanced.rst b/security/acl_advanced.rst index ca88be07c31..062d69a8b8a 100644 --- a/security/acl_advanced.rst +++ b/security/acl_advanced.rst @@ -4,200 +4,9 @@ How to Use advanced ACL Concepts ================================ -.. versionadded:: 3.4 - ACL support was deprecated in Symfony 3.4 and will be removed in 4.0. Install - the `Symfony ACL bundle`_ if you wan to keep using ACL. - -The aim of this article is to give a more in-depth view of the ACL system, and -also explain some of the design decisions behind it. - -Design Concepts ---------------- - -Symfony's object instance security capabilities are based on the concept of -an Access Control List. Every domain object **instance** has its own ACL. The -ACL instance holds a detailed list of Access Control Entries (ACEs) which are -used to make access decisions. Symfony's ACL system focuses on two main -objectives: - -- providing a way to efficiently retrieve a large amount of ACLs/ACEs for your - domain objects, and to modify them; -- providing a way to easily make decisions of whether a person is allowed to - perform an action on a domain object or not. - -As indicated by the first point, one of the main capabilities of Symfony's -ACL system is a high-performance way of retrieving ACLs/ACEs. This is -extremely important since each ACL might have several ACEs, and inherit from -another ACL in a tree-like fashion. Therefore, no ORM is leveraged, instead -the default implementation interacts with your connection directly using Doctrine's -DBAL. - -Object Identities -~~~~~~~~~~~~~~~~~ - -The ACL system is completely decoupled from your domain objects. They don't -even have to be stored in the same database, or on the same server. In order -to achieve this decoupling, in the ACL system your objects are represented -through object identity objects. Every time you want to retrieve the ACL for a -domain object, the ACL system will first create an object identity from your -domain object, and then pass this object identity to the ACL provider for -further processing. - -Security Identities -~~~~~~~~~~~~~~~~~~~ - -This is analog to the object identity, but represents a user, or a role in -your application. Each role, or user has its own security identity. - .. caution:: - For users, the security identity is based on the username. This means that, - if for any reason, a user's username was to change, you must ensure its - security identity is updated too. The - :method:`MutableAclProvider::updateUserSecurityIdentity() ` - method is there to handle the update. - -Database Table Structure ------------------------- - -The default implementation uses five database tables as listed below. The -tables are ordered from least rows to most rows in a typical application: - -- *acl_security_identities*: This table records all security identities (SID) - which hold ACEs. The default implementation ships with two security - identities: - :class:`Symfony\\Component\\Security\\Acl\\Domain\\RoleSecurityIdentity` and - :class:`Symfony\\Component\\Security\\Acl\\Domain\\UserSecurityIdentity`. -- *acl_classes*: This table maps class names to a unique ID which can be - referenced from other tables. -- *acl_object_identities*: Each row in this table represents a single domain - object instance. -- *acl_object_identity_ancestors*: This table allows all the ancestors of - an ACL to be determined in a very efficient way. -- *acl_entries*: This table contains all ACEs. This is typically the table - with the most rows. It can contain tens of millions without significantly - impacting performance. - -.. _security-acl-field_scope: - -Scope of Access Control Entries -------------------------------- - -Access control entries can have different scopes in which they apply. In -Symfony, there are basically two different scopes: - -- Class-Scope: These entries apply to all objects with the same class. -- Object-Scope: This was the scope solely used in the previous article, and - it only applies to one specific object. - -Sometimes, you will find the need to apply an ACE only to a specific field of -the object. Suppose you want the ID only to be viewable by an administrator, -but not by your customer service. To solve this common problem, two more sub-scopes -have been added: - -- Class-Field-Scope: These entries apply to all objects with the same class, - but only to a specific field of the objects. -- Object-Field-Scope: These entries apply to a specific object, and only to a - specific field of that object. - -Pre-Authorization Decisions ---------------------------- - -For pre-authorization decisions, that is decisions made before any secure method (or -secure action) is invoked, the proven AccessDecisionManager service is used. -The AccessDecisionManager is also used for reaching authorization decisions based -on roles. Just like roles, the ACL system adds several new attributes which may be -used to check for different permissions. - -Built-in Permission Map -~~~~~~~~~~~~~~~~~~~~~~~ - -+------------------+----------------------------+-----------------------------+ -| Attribute | Intended Meaning | Integer Bitmasks | -+==================+============================+=============================+ -| VIEW | Whether someone is allowed | VIEW, EDIT, OPERATOR, | -| | to view the domain object. | MASTER, or OWNER | -+------------------+----------------------------+-----------------------------+ -| EDIT | Whether someone is allowed | EDIT, OPERATOR, MASTER, | -| | to make changes to the | or OWNER | -| | domain object. | | -+------------------+----------------------------+-----------------------------+ -| CREATE | Whether someone is allowed | CREATE, OPERATOR, MASTER, | -| | to create the domain | or OWNER | -| | object. | | -+------------------+----------------------------+-----------------------------+ -| DELETE | Whether someone is allowed | DELETE, OPERATOR, MASTER, | -| | to delete the domain | or OWNER | -| | object. | | -+------------------+----------------------------+-----------------------------+ -| UNDELETE | Whether someone is allowed | UNDELETE, OPERATOR, MASTER, | -| | to restore a previously | or OWNER | -| | deleted domain object. | | -+------------------+----------------------------+-----------------------------+ -| OPERATOR | Whether someone is allowed | OPERATOR, MASTER, or OWNER | -| | to perform all of the above| | -| | actions. | | -+------------------+----------------------------+-----------------------------+ -| MASTER | Whether someone is allowed | MASTER, or OWNER | -| | to perform all of the above| | -| | actions, and in addition is| | -| | allowed to grant | | -| | any of the above | | -| | permissions to others. | | -+------------------+----------------------------+-----------------------------+ -| OWNER | Whether someone owns the | OWNER | -| | domain object. An owner can| | -| | perform any of the above | | -| | actions *and* grant master | | -| | and owner permissions. | | -+------------------+----------------------------+-----------------------------+ - -Permission Attributes vs. Permission Bitmasks -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Attributes are used by the AccessDecisionManager, just like roles. Often, these -attributes represent in fact an aggregate of integer bitmasks. Integer bitmasks on -the other hand, are used by the ACL system internally to efficiently store your -users' permissions in the database, and perform access checks using extremely -fast bitmask operations. - -Extensibility -~~~~~~~~~~~~~ - -The above permission map is by no means static, and theoretically could be -completely replaced at will. However, it should cover most problems you -encounter, and for interoperability with other bundles, you are encouraged to -stick to the meaning envisaged for them. - -Post Authorization Decisions ----------------------------- - -Post authorization decisions are made after a secure method has been invoked, -and typically involve the domain object which is returned by such a method. -After invocation providers also allow to modify, or filter the domain object -before it is returned. - -Due to current limitations of the PHP language, there are no -post-authorization capabilities build into the core Security component. -However, there is an experimental JMSSecurityExtraBundle_ which adds these -capabilities. See its documentation for further information on how this is -accomplished. - -Process for Reaching Authorization Decisions --------------------------------------------- - -The ACL class provides two methods for determining whether a security identity -has the required bitmasks, ``isGranted()`` and ``isFieldGranted()``. When the ACL -receives an authorization request through one of these methods, it delegates -this request to an implementation of -:class:`Symfony\\Component\\Security\\Acl\\Domain\\PermissionGrantingStrategy`. -This allows you to replace the way access decisions are reached without actually -modifying the ACL class itself. - -The ``PermissionGrantingStrategy`` first checks all your object-scope ACEs. If one -is applicable, the class-scope ACEs will be checked. If none is applicable, -then the process will be repeated with the ACEs of the parent ACL. If no -parent ACL exists, an exception will be thrown. + ACL support was removed in Symfony 4.0. Install the `Symfony ACL bundle`_ + and refer to its documentation if you want to keep using ACL. .. _`Symfony ACL bundle`: https://github.com/symfony/acl-bundle -.. _JMSSecurityExtraBundle: https://github.com/schmittjoh/JMSSecurityExtraBundle diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index ac5ebf7d6ee..b09dbfbcd46 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -249,10 +249,6 @@ This requires you to implement several methods:: } } -.. versionadded:: 3.4 - ``AuthenticatorInterface`` was introduced in Symfony 3.4. In previous Symfony - versions, authenticators needed to implement ``GuardAuthenticatorInterface``. - Nice work! Each method is explained below: :ref:`The Guard Authenticator Methods`. Step 2) Configure the Authenticator @@ -370,11 +366,6 @@ Each authenticator needs the following methods: authenticator should be used for this request (return ``true``) or if it should be skipped (return ``false``). - .. versionadded:: 3.4 - The ``supports()`` method was introduced in Symfony 3.4. In previous Symfony - versions, the authenticator could be skipped returning ``null`` in the - ``getCredentials()`` method. - **getCredentials(Request $request)** This will be called on *every* request and your job is to read the token (or whatever your "authentication" information is) from the request and return it. diff --git a/serializer/encoders.rst b/serializer/encoders.rst index f205efec5c0..0675378aecc 100644 --- a/serializer/encoders.rst +++ b/serializer/encoders.rst @@ -30,11 +30,6 @@ The Serializer component provides built-in encoders: * :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder` to encode/decode XML * :class:`Symfony\\Component\\Serializer\\Encoder\\YamlEncoder` to encode/decode Yaml -.. versionadded:: 3.2 - The :class:`Symfony\\Component\\Serializer\\Encoder\\CsvEncoder` and the - :class:`Symfony\\Component\\Serializer\\Encoder\\YamlEncoder` were introduced in - Symfony 3.2. - The ``JsonEncoder`` ~~~~~~~~~~~~~~~~~~~ diff --git a/service_container.rst b/service_container.rst index cb203e6068c..95812ec3930 100644 --- a/service_container.rst +++ b/service_container.rst @@ -43,11 +43,6 @@ service's class or interface name. Want to :doc:`log ` something? No p // ... } -.. versionadded:: 3.3 - The ability to type-hint a service in order to receive it was added in Symfony 3.3. - See the :ref:`controller chapter ` for more - details. - .. _container-debug-container: What other services are available? Find out by running: @@ -242,10 +237,6 @@ each time you ask for it. If you'd prefer to manually wire your service, that's totally possible: see :ref:`services-explicitly-configure-wire-services`. - .. versionadded:: 3.3 - The ``_defaults`` key *and* ability to load services from a directory were added - in Symfony 3.3. - You can also fetch a service directly from the container via its "id", which will be its class name in this case:: @@ -267,12 +258,6 @@ be its class name in this case:: However, this only works if you make your service :ref:`public `. -.. caution:: - - Service ids are case-insensitive (e.g. ``App\Service\MessageGenerator`` - and ``App\service\messagegenerator`` refer to the same service). But this - was deprecated in Symfony 3.3. Starting in 4.0, service ids will be case sensitive. - .. _services-constructor-injection: Injecting Services/Config into a Service @@ -504,11 +489,6 @@ pass here. No problem! In your configuration, you can explicitly set this argume $container->getDefinition(SiteUpdateManager::class) ->setArgument('$adminEmail', 'manager@example.com'); -.. versionadded:: 3.3 - The ability to configure an argument by its name (``$adminEmail``) was added - in Symfony 3.3. Previously, you could configure it only by its index (``2`` in - this case) or by using empty quotes for the other arguments. - Thanks to this, the container will pass ``manager@example.com`` as the third argument to ``__construct`` when creating the ``SiteUpdateManager`` service. The other arguments will still be autowired. @@ -715,9 +695,6 @@ For more details about autowiring, check out :doc:`/service_container/autowiring The autoconfigure Option ------------------------ -.. versionadded:: 3.3 - The ``autoconfigure`` option was added in Symfony 3.3. - Above, the ``services.yaml`` file has ``autoconfigure: true`` in the ``_defaults`` section so that it applies to all services defined in that file. With this setting, the container will automatically apply certain configuration to your services, based diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 1b6b2335ff5..b5ba004db6c 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -325,9 +325,7 @@ was designed with that in mind. Specifically: * The container determines *which* service to pass in an explicit way: it looks for a service whose id matches the type-hint exactly. It does *not* scan all services - looking for objects that have that class/interface (actually, it *does* do this - in Symfony 3.3, but has been deprecated. If you rely on this, you will see a clear - deprecation warning). + looking for objects that have that class/interface. Autowiring aims to *automate* configuration without magic. diff --git a/service_container/autowiring.rst b/service_container/autowiring.rst index a96cabb2f4d..eafb2682898 100644 --- a/service_container/autowiring.rst +++ b/service_container/autowiring.rst @@ -180,9 +180,8 @@ If there are **0** services in the container that have the type, then: .. _autowiring-single-matching-service: If there is exactly **1** service in the container that has the type, then: - (deprecated) This service is used for the argument. In Symfony 4.0, this - will be removed. The proper solution is to create an :ref:`alias ` - from the type to the service id so that normal autowiring works. + Create an :ref:`alias ` from the type to the + service id so that normal autowiring works. If there are **2 or more** services in the container that have the type, then: A clear exception is thrown. You need to *choose* which service should @@ -435,10 +434,6 @@ with this interface will be passed the ``App\Util\Rot13Transformer`` service. But, you can also manually wire the *other* service by specifying the argument under the arguments key. -.. versionadded:: 3.3 - Using FQCN aliases to fix autowiring ambiguities was introduced in Symfony - 3.3. Prior to version 3.3, you needed to use the ``autowiring_types`` key. - Fixing Non-Autowireable Arguments --------------------------------- diff --git a/service_container/configurators.rst b/service_container/configurators.rst index 637fc0633d3..20ceaeed18c 100644 --- a/service_container/configurators.rst +++ b/service_container/configurators.rst @@ -184,11 +184,6 @@ all the classes are already loaded as services. All you need to do is specify th $container->getDefinition(GreetingCardManager::class) ->setConfigurator(array(new Reference(EmailConfigurator::class), 'configure')); - -.. versionadded:: 3.2 - The ``service_id:method_name`` syntax for the YAML configuration format - was introduced in Symfony 3.2. - The traditional configurator syntax in YAML files used an array to define the service id and the method name: diff --git a/service_container/debug.rst b/service_container/debug.rst index 0838cb5ed7f..9e00b322981 100644 --- a/service_container/debug.rst +++ b/service_container/debug.rst @@ -24,9 +24,6 @@ To see a list of all of the available types that can be used for autowiring, run $ php bin/console debug:autowiring -.. versionadded:: 3.4 - The ``debug:autowiring`` command was introduced in Symfony 3.3. - Detailed Info about a Single Service ------------------------------------ @@ -39,6 +36,3 @@ its id: # to show the service arguments: $ php bin/console debug:container 'App\Service\Mailer' --show-arguments - -.. versionadded:: 3.3 - The ``--show-arguments`` option was introduced in Symfony 3.3. diff --git a/service_container/parameters.rst b/service_container/parameters.rst index 27dda5e6519..224684e84b9 100644 --- a/service_container/parameters.rst +++ b/service_container/parameters.rst @@ -148,7 +148,7 @@ Getting and Setting Container Parameters in PHP Working with container parameters is straightforward using the container's accessor methods for parameters:: - // check if a parameter is defined + // check if a parameter is defined (parameter names are case-sensitive) $container->hasParameter('mailer.transport'); // get value of a parameter @@ -170,11 +170,6 @@ accessor methods for parameters:: To learn more about compiling the container see :doc:`/components/dependency_injection/compilation`. -.. versionadded:: 3.4 - Container parameters are case sensitive starting from Symfony 3.4. In - previous Symfony versions, parameters were case insensitive, meaning that - ``mailer.transport`` and ``Mailer.Transport`` were considered the same parameter. - .. _component-di-parameters-array: Array Parameters diff --git a/service_container/tags.rst b/service_container/tags.rst index fd0276fc818..34d6c852de9 100644 --- a/service_container/tags.rst +++ b/service_container/tags.rst @@ -371,10 +371,6 @@ To answer this, change the service declaration: tags: - { name: app.mail_transport } - .. versionadded:: 3.3 - Support for the compact tag notation in the YAML format was introduced - in Symfony 3.3. - Notice that you've added a generic ``alias`` key to the tag. To actually use this, update the compiler:: @@ -409,10 +405,6 @@ tags set for the current service and gives you the attributes. Reference Tagged Services ~~~~~~~~~~~~~~~~~~~~~~~~~ -.. versionadded:: 3.4 - Support for the tagged service notation in YAML, XML and PHP was introduced - in Symfony 3.4. - Symfony provides a shortcut to inject all services tagged with a specific tag, which is a common need in some applications, so you don't have to write a compiler pass just for that. diff --git a/session/avoid_session_start.rst b/session/avoid_session_start.rst index 57cc3226ff4..e19498184cf 100644 --- a/session/avoid_session_start.rst +++ b/session/avoid_session_start.rst @@ -36,7 +36,3 @@ access the flash messages: {% endfor %} {% endif %} - -.. versionadded:: 3.3 - The ``app.flashes()`` Twig function was introduced in Symfony 3.3. Prior, - you had to use ``app.session.flashBag()``. diff --git a/setup/built_in_web_server.rst b/setup/built_in_web_server.rst index 220d25c6d40..3f22bdbc3d7 100644 --- a/setup/built_in_web_server.rst +++ b/setup/built_in_web_server.rst @@ -75,9 +75,6 @@ can change the socket passing an IP address and a port as a command-line argumen # passing '*' as the IP means to use 0.0.0.0 (i.e. any local IP address) $ php bin/console server:start *:8080 -.. versionadded:: 3.4 - The support of ``*`` as a valid IP address was introduced in Symfony 3.4. - .. note:: You can use the ``server:status`` command to check if a web server is diff --git a/testing.rst b/testing.rst index 3aab9e737bc..96bc16cdc1b 100644 --- a/testing.rst +++ b/testing.rst @@ -421,10 +421,10 @@ The Client supports many operations that can be done in a real browser:: // Clears all cookies and the history $client->restart(); -.. versionadded:: 3.4 - Starting from Symfony 3.4, the ``back()`` and ``forward()`` methods skip the - redirects that may have occurred when requesting a URL, as normal browsers - do. In previous Symfony versions they weren't skipped. +.. note:: + + The ``back()`` and ``forward()`` methods skip the redirects that may have + occurred when requesting a URL, as normal browsers do. Accessing Internal Objects ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/translation/lint.rst b/translation/lint.rst index dd2bc1c7228..0c64e4a427e 100644 --- a/translation/lint.rst +++ b/translation/lint.rst @@ -26,9 +26,6 @@ translation file using the ``lint:yaml`` and ``lint:xliff`` commands: $ ./bin/console lint:yaml @AppBundle $ ./bin/console lint:xliff @AppBundle -.. versionadded:: 3.3 - The ``lint:xliff`` command was introduced in Symfony 3.3. - The linter results can be exported to JSON using the ``--format`` option: .. code-block:: terminal diff --git a/workflow/usage.rst b/workflow/usage.rst index e949d279cff..9e0124d904a 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -233,7 +233,7 @@ order: ``workflow.entered`` Similar to ``workflow.enter``, except the marking store is updated before this - event (making it a good place to flush data in Doctrine). + event (making it a good place to flush data in Doctrine). The three events being dispatched are: @@ -343,9 +343,6 @@ This means that each event has access to the following information: :method:`Symfony\\Component\\Workflow\\Event\\Event::getWorkflowName` Returns a string with the name of the workflow that triggered the event. - .. versionadded:: 3.3 - The ``getWorkflowName()`` method was introduced in Symfony 3.3. - For Guard Events, there is an extended class :class:`Symfony\\Component\\Workflow\\Event\\GuardEvent`. This class has two more methods: @@ -373,10 +370,6 @@ of domain logic in your templates: ``workflow_has_marked_place()`` Returns ``true`` if the marking of the given object has the given state. -.. versionadded:: 3.3 - The ``workflow_marked_places()`` and ``workflow_has_marked_place()`` - functions were introduced in Symfony 3.3. - The following example shows these functions in action: .. code-block:: twig