Skip to content

Commit e164c81

Browse files
committed
ordered use statements in code examples
1 parent f104ecd commit e164c81

File tree

181 files changed

+385
-380
lines changed

Some content is hidden

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

181 files changed

+385
-380
lines changed

best_practices/business-logic.rst

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

230230
namespace AppBundle\Entity;
231231

232-
use Doctrine\ORM\Mapping as ORM;
233232
use Doctrine\Common\Collections\ArrayCollection;
233+
use Doctrine\ORM\Mapping as ORM;
234234

235235
/**
236236
* @ORM\Entity

best_practices/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ whereas they cannot access the container parameters::
137137

138138
namespace AppBundle\Repository;
139139

140-
use Doctrine\ORM\EntityRepository;
141140
use AppBundle\Entity\Post;
141+
use Doctrine\ORM\EntityRepository;
142142

143143
class PostRepository extends EntityRepository
144144
{

best_practices/forms.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ form in its own PHP class::
2121

2222
use AppBundle\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
{
@@ -109,11 +109,11 @@ some developers configure form buttons in the controller::
109109

110110
namespace AppBundle\Controller\Admin;
111111

112-
use Symfony\Component\HttpFoundation\Request;
113-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
114-
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
115112
use AppBundle\Entity\Post;
116113
use AppBundle\Form\PostType;
114+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
115+
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
116+
use Symfony\Component\HttpFoundation\Request;
117117

118118
class PostController extends Controller
119119
{

best_practices/security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ the same ``getAuthorEmail()`` logic you used above::
259259

260260
namespace AppBundle\Security;
261261

262+
use AppBundle\Entity\Post;
262263
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
263264
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
264265
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
265266
use Symfony\Component\Security\Core\User\UserInterface;
266-
use AppBundle\Entity\Post;
267267

268268
class PostVoter extends Voter
269269
{

bundles/configuration.rst

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

266-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
267266
use Symfony\Component\Config\FileLocator;
267+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
268268

269269
public function load(array $configs, ContainerBuilder $container)
270270
{

bundles/extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ the extension!
9393
For instance, assume you have a file called ``services.xml`` in the
9494
``Resources/config`` directory of your bundle, your ``load()`` method looks like::
9595

96-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9796
use Symfony\Component\Config\FileLocator;
97+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9898

9999
// ...
100100
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
@@ -28,9 +28,9 @@ To give an Extension the power to do this, it needs to implement
2828
// src/Acme/HelloBundle/DependencyInjection/AcmeHelloExtension.php
2929
namespace Acme\HelloBundle\DependencyInjection;
3030

31-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
32-
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
3331
use Symfony\Component\DependencyInjection\ContainerBuilder;
32+
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
33+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
3434

3535
class AcmeHelloExtension extends Extension implements PrependExtensionInterface
3636
{

components/asset.rst

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

228-
use Symfony\Component\Asset\PathPackage;
229228
use Symfony\Component\Asset\Context\RequestStackContext;
229+
use Symfony\Component\Asset\PathPackage;
230230
// ...
231231

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

318-
use Symfony\Component\Asset\UrlPackage;
319318
use Symfony\Component\Asset\Context\RequestStackContext;
319+
use Symfony\Component\Asset\UrlPackage;
320320
// ...
321321

322322
$urlPackage = new UrlPackage(
@@ -341,9 +341,9 @@ In the following example, all packages use the same versioning strategy, but
341341
they all have different base paths::
342342

343343
use Symfony\Component\Asset\Package;
344+
use Symfony\Component\Asset\Packages;
344345
use Symfony\Component\Asset\PathPackage;
345346
use Symfony\Component\Asset\UrlPackage;
346-
use Symfony\Component\Asset\Packages;
347347
// ...
348348

349349
$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
@@ -73,9 +73,9 @@ in the same place. By using two adapters, you can e.g. store some big cached ite
7373
on the filesystem or in the database and keep tags in a Redis database to sync all
7474
your fronts and have very fast invalidation checks::
7575

76-
use Symfony\Component\Cache\Adapter\TagAwareAdapter;
7776
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
7877
use Symfony\Component\Cache\Adapter\RedisAdapter;
78+
use Symfony\Component\Cache\Adapter\TagAwareAdapter;
7979

8080
$cache = new TagAwareAdapter(
8181
// Adapter for cached items

0 commit comments

Comments
 (0)