Skip to content

Commit 8b45bd0

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: ordered use statements in code examples
2 parents f83b88a + 93be6df commit 8b45bd0

File tree

154 files changed

+316
-314
lines changed

Some content is hidden

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

154 files changed

+316
-314
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ looking for mapping information::
163163

164164
namespace App\Entity;
165165

166-
use Doctrine\ORM\Mapping as ORM;
167166
use Doctrine\Common\Collections\ArrayCollection;
167+
use Doctrine\ORM\Mapping as ORM;
168168

169169
/**
170170
* @ORM\Entity

best_practices/forms.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ PHP class::
2121

2222
use App\Entity\Post;
2323
use Symfony\Component\Form\AbstractType;
24+
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
25+
use Symfony\Component\Form\Extension\Core\Type\EmailType;
26+
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
2427
use Symfony\Component\Form\FormBuilderInterface;
2528
use Symfony\Component\OptionsResolver\OptionsResolver;
26-
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
27-
use Symfony\Component\Form\Extension\Core\Type\EmailType;
28-
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
2929

3030
class PostType extends AbstractType
3131
{
@@ -103,9 +103,9 @@ some developers configure form buttons in the controller::
103103

104104
use App\Entity\Post;
105105
use App\Form\PostType;
106-
use Symfony\Component\HttpFoundation\Request;
107106
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
108107
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
108+
use Symfony\Component\HttpFoundation\Request;
109109

110110
class PostController extends AbstractController
111111
{

bundles/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ In your extension, you can load this and dynamically set its arguments::
255255
// src/Acme/SocialBundle/DependencyInjection/AcmeSocialExtension.php
256256
// ...
257257

258-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
259258
use Symfony\Component\Config\FileLocator;
259+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
260260

261261
public function load(array $configs, ContainerBuilder $container)
262262
{

bundles/extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ but it is more common if you put these definitions in a configuration file
8888
For instance, assume you have a file called ``services.xml`` in the
8989
``Resources/config/`` directory of your bundle, your ``load()`` method looks like::
9090

91-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9291
use Symfony\Component\Config\FileLocator;
92+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9393

9494
// ...
9595
public function load(array $configs, ContainerBuilder $container)

bundles/prepend_extension.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ To give an Extension the power to do this, it needs to implement
2727
// src/Acme/HelloBundle/DependencyInjection/AcmeHelloExtension.php
2828
namespace Acme\HelloBundle\DependencyInjection;
2929

30-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
31-
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
3230
use Symfony\Component\DependencyInjection\ContainerBuilder;
31+
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
32+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
3333

3434
class AcmeHelloExtension extends Extension implements PrependExtensionInterface
3535
{

components/asset.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ If you are also using the :doc:`HttpFoundation </components/http_foundation>`
223223
component in your project (for instance, in a Symfony application), the ``PathPackage``
224224
class can take into account the context of the current request::
225225

226-
use Symfony\Component\Asset\PathPackage;
227226
use Symfony\Component\Asset\Context\RequestStackContext;
227+
use Symfony\Component\Asset\PathPackage;
228228
// ...
229229

230230
$pathPackage = new PathPackage(
@@ -313,8 +313,8 @@ account the context of the current request. In this case, only the request
313313
scheme is considered, in order to select the appropriate base URL (HTTPs or
314314
protocol-relative URLs for HTTPs requests, any base URL for HTTP requests)::
315315

316-
use Symfony\Component\Asset\UrlPackage;
317316
use Symfony\Component\Asset\Context\RequestStackContext;
317+
use Symfony\Component\Asset\UrlPackage;
318318
// ...
319319

320320
$urlPackage = new UrlPackage(
@@ -339,9 +339,9 @@ In the following example, all packages use the same versioning strategy, but
339339
they all have different base paths::
340340

341341
use Symfony\Component\Asset\Package;
342+
use Symfony\Component\Asset\Packages;
342343
use Symfony\Component\Asset\PathPackage;
343344
use Symfony\Component\Asset\UrlPackage;
344-
use Symfony\Component\Asset\Packages;
345345
// ...
346346

347347
$versionStrategy = new StaticVersionStrategy('v1');

components/cache/adapters/php_array_cache_adapter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Php Array Cache Adapter
88
This adapter is a high performance cache for static data (e.g. application configuration)
99
that is optimized and preloaded into OPcache memory storage::
1010

11-
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
1211
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
12+
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
1313

1414
// somehow, decide it's time to warm up the cache!
1515
if ($needsWarmup) {

components/cache/cache_invalidation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ in the same place. By using two adapters, you can e.g. store some big cached ite
6969
on the filesystem or in the database and keep tags in a Redis database to sync all
7070
your fronts and have very fast invalidation checks::
7171

72-
use Symfony\Component\Cache\Adapter\TagAwareAdapter;
7372
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
7473
use Symfony\Component\Cache\Adapter\RedisAdapter;
74+
use Symfony\Component\Cache\Adapter\TagAwareAdapter;
7575

7676
$cache = new TagAwareAdapter(
7777
// Adapter for cached items

components/cache/psr6_psr16_adapters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ instead. No problem! The Cache component provides the
3636
:class:`Symfony\\Component\\Cache\\Adapter\\SimpleCacheAdapter` class for exactly
3737
this use-case::
3838

39-
use Symfony\Component\Cache\Simple\FilesystemCache;
4039
use Symfony\Component\Cache\Adapter\SimpleCacheAdapter;
40+
use Symfony\Component\Cache\Simple\FilesystemCache;
4141

4242
// the PSR-16 cache object that you want to use
4343
$psr16Cache = new FilesystemCache();

components/config/definition.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ implements the :class:`Symfony\\Component\\Config\\Definition\\ConfigurationInte
5252

5353
namespace Acme\DatabaseConfiguration;
5454

55-
use Symfony\Component\Config\Definition\ConfigurationInterface;
5655
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
56+
use Symfony\Component\Config\Definition\ConfigurationInterface;
5757

5858
class DatabaseConfiguration implements ConfigurationInterface
5959
{
@@ -838,9 +838,9 @@ any value is not of the expected type, is mandatory and yet undefined, or
838838
could not be validated in some other way, an exception will be thrown.
839839
Otherwise the result is a clean array of configuration values::
840840

841-
use Symfony\Component\Yaml\Yaml;
842-
use Symfony\Component\Config\Definition\Processor;
843841
use Acme\DatabaseConfiguration;
842+
use Symfony\Component\Config\Definition\Processor;
843+
use Symfony\Component\Yaml\Yaml;
844844

845845
$config = Yaml::parse(
846846
file_get_contents(__DIR__.'/src/Matthias/config/config.yaml')

0 commit comments

Comments
 (0)