8000 Add missing imports and remove useless · symfony/symfony-docs@a89cfa3 · GitHub
[go: up one dir, main page]

Skip to content

Commit a89cfa3

Browse files
committed
Add missing imports and remove useless
1 parent e3acce7 commit a89cfa3

19 files changed

+41
-5
lines changed

components/console/helpers/questionhelper.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Suppose you want to confirm an action before actually executing it. Add
2525
the following to your command::
2626

2727
// ...
28+
use Symfony\Component\Console\Command\Command;
2829
use Symfony\Component\Console\Input\InputInterface;
2930
use Symfony\Component\Console\Output\OutputInterface;
3031
use Symfony\Component\Console\Question\ConfirmationQuestion;

components/console/helpers/table.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ When building a console application it may be useful to display tabular data:
2020
To display a table, use :class:`Symfony\\Component\\Console\\Helper\\Table`,
2121
set the headers, set the rows and then render the table::
2222

23+
use Symfony\Component\Console\Command\Command;
2324
use Symfony\Component\Console\Helper\Table;
25+
use Symfony\Component\Console\Input\InputInterface;
26+
use Symfony\Component\Console\Output\OutputInterface;
2427
// ...
2528

2629
class SomeCommand extends Command

console.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ constructor. If your command defines its own constructor, set the properties
6666
first and then call to the parent constructor, to make those properties
6767
available in the ``configure()`` method::
6868

69+
// ...
70+
use Symfony\Component\Console\Command\Command;
71+
use Symfony\Component\Console\Input\InputArgument;
72+
6973
class CreateUserCommand extends Command
7074
{
7175
// ...

console/calling_commands.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ generating Doctrine2 proxies, dumping Assetic assets, ...).
1111
Calling a command from another one is straightforward::
1212

1313
use Symfony\Component\Console\Input\ArrayInput;
14+
use Symfony\Component\Console\Input\InputInterface;
15+
use Symfony\Component\Console\Output\OutputInterface;
1416
// ...
1517

1618
protected function execute(InputInterface $input, OutputInterface $output)

console/input.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ or required. For example, to add an optional ``last_name`` argument to the comma
1414
and make the ``name`` argument required::
1515

1616
// ...
17+
use Symfony\Component\Console\Command\Command;
1718
use Symfony\Component\Console\Input\InputArgument;
1819

1920
class GreetCommand extends Command
@@ -33,6 +34,10 @@ and make the ``name`` argument required::
3334
You now have access to a ``last_name`` argument in your command::
3435

3536
// ...
37+
use Symfony\Component\Console\Command\Command;
38+
use Symfony\Component\Console\Input\InputInterface;
39+
use Symfony\Component\Console\Output\OutputInterface;
40+
3641
B41A class GreetCommand extends Command
3742
{
3843
// ...

console/lockable_trait.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ In addition, the Console component provides a PHP trait called ``LockableTrait``
1414
that adds two convenient methods to lock and release commands::
1515

1616
// ...
17+
use Symfony\Component\Console\Command\Command;
1718
use Symfony\Component\Console\Command\LockableTrait;
19+
use Symfony\Component\Console\Input\InputInterface;
20+
use Symfony\Component\Console\Output\OutputInterface;
1821

1922
class UpdateContentsCommand extends Command
2023
{

console/verbosity.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ It is possible to print a message in a command for only a specific verbosity
4141
level. For example::
4242

4343
// ...
44+
use Symfony\Component\Console\Command\Command;
45+
use Symfony\Component\Console\Input\InputInterface;
46+
use Symfony\Component\Console\Output\OutputInterface;
47+
4448
class CreateUserCommand extends Command
4549
{
4650
// ...

event_dispatcher.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ or a "sub request"::
200200
namespace AppBundle\EventListener;
201201

202202
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
203-
use Symfony\Component\HttpKernel\HttpKernel;
204-
use Symfony\Component\HttpKernel\HttpKernelInterface;
205203

206204
class RequestListener
207205
{

http_cache/validation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ To see a simple implementation, generate the ETag as the md5 of the content::
6262
// src/AppBundle/Controller/DefaultController.php
6363
namespace AppBundle\Controller;
6464

65+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6566
use Symfony\Component\HttpFoundation\Request;
6667

6768
class DefaultController extends Controller

security/ldap.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ An LDAP client can be simply configured using the built-in
100100
// app/config/services.php
101101
use Symfony\Component\Ldap\Ldap;
102102
use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter;
103-
use Symfony\Component\DependencyInjection\Definition;
10000
104103
105104
$container->register(Ldap::class)
106105
->addArgument(new Reference(Adapter::class);

security/voters.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ A custom voter needs to implement
3636
or extend :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\Voter`,
3737
which makes creating a voter even easier::
3838

39+
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
40+
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
41+
3942
abstract class Voter implements VoterInterface
4043
{
4144
abstract protected function supports($attribute, $subject);

service_container/definitions.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Getting and Setting Service Definitions
2121

2222
There are some helpful methods for working with the service definitions::
2323

24+
use Symfony\Component\DependencyInjection\Definition;
25+
2426
// finds out if there is an "app.mailer" definition
2527
$container->hasDefinition('app.mailer');
2628
// finds out if there is an "app.mailer" definition or alias

service_container/factories.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Configuration of the service container then looks like this:
142142
143143
use AppBundle\Email\NewsletterManager;
144144
use AppBundle\Email\NewsletterManagerFactory;
145+
use Symfony\Component\DependencyInjection\Reference;
145146
// ...
146147
147148
$container->register(NewsletterManagerFactory::class);

service_container/parent_services.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ you may have multiple repository classes which need the
1212
// src/AppBundle/Repository/BaseDoctrineRepository.php
1313
namespace AppBundle\Repository;
1414

15+
use Doctrine\Common\Persistence\ObjectManager;
16+
use Psr\Log\LoggerInterface;
17+
1518
// ...
1619
abstract class BaseDoctrineRepository
1720
{

service_container/synthetic_services.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ For instance, the ``kernel`` service in Symfony is injected into the container
1111
from within the ``Kernel`` class::
1212

1313
// ...
14+
use Symfony\Component\HttpKernel\KernelInterface;
15+
use Symfony\Component\HttpKernel\TerminableInterface;
16+
1417
abstract class Kernel implements KernelInterface, TerminableInterface
1518
{
1619
// ...

session/proxy_examples.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ can intercept the session before it is written::
108108
// src/AppBundle/Session/ReadOnlySessionProxy.php
109109
namespace AppBundle\Session;
110110

111-
use AppBundle\Entity\User;
112111
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
113112
use Symfony\Component\Security\Core\Security;
114113

Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ If you need to simulate an interaction between different clients (think of a
88
chat for instance), create several clients::
99

1010
// ...
11+
use Symfony\Component\HttpFoundation\Response;
1112

1213
$harry = static::createClient();
1314
$sally = static::createClient();
@@ -23,6 +24,7 @@ a third-party library that has some kind of global state. In such a case, you
2324
can insulate your clients::
2425

2526
// ...
27+
use Symfony\Component\HttpFoundation\Response;
2628

2729
$harry = static::createClient();
2830
$sally = static::createClient();

testing/profiling.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ spent in the framework, etc. But before writing assertions, enable the profiler
1515
and check that the profiler is indeed available (it is enabled by default in
1616
the ``test`` environment)::
1717

18+
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
19+
1820
class LuckyControllerTest extends WebTestCase
1921
{
2022
public function testNumberAction()

validation/sequence_provider.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ that group are valid, the second group, ``Strict``, will be validated.
142142

143143
You can also define a group sequence in the ``validation_groups`` form option::
144144

145-
use Symfony\Component\Validator\Constraints\GroupSequence;
146145
use Symfony\Component\Form\AbstractType;
146+
use Symfony\Component\OptionsResolver\OptionsResolver;
147+
use Symfony\Component\Validator\Constraints\GroupSequence;
147148
// ...
148149

149150
class MyType extends AbstractType

0 commit comments

Comments
 (0)
0