Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 536e51e

Browse filesBrowse files
committed
remove deprecated code
1 parent 3c86ff1 commit 536e51e
Copy full SHA for 536e51e

24 files changed

+45
-518
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

14+
use Symfony\Component\Console\Command\Command;
1415
use Symfony\Component\Console\Helper\Helper;
1516
use Symfony\Component\Console\Helper\TableSeparator;
1617
use Symfony\Component\Console\Input\InputInterface;
@@ -26,7 +27,7 @@
2627
*
2728
* @final since version 3.4
2829
*/
29-
class AboutCommand extends ContainerAwareCommand
30+
class AboutCommand extends Command
3031
{
3132
/**
3233
* {@inheritdoc}

‎src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php
+4-20Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

14+
use Symfony\Component\Console\Command\Command;
1415
use Symfony\Component\Console\Input\InputArgument;
1516
use Symfony\Component\Console\Input\InputInterface;
1617
use Symfony\Component\Console\Input\InputOption;
@@ -29,27 +30,16 @@
2930
*
3031
* @final since version 3.4
3132
*/
32-
class AssetsInstallCommand extends ContainerAwareCommand
33+
class AssetsInstallCommand extends Command
3334
{
3435
const METHOD_COPY = 'copy';
3536
const METHOD_ABSOLUTE_SYMLINK = 'absolute symlink';
3637
const METHOD_RELATIVE_SYMLINK = 'relative symlink';
3738

3839
private $filesystem;
3940

40-
/**
41-
* @param Filesystem $filesystem
42-
*/
43-
public function __construct($filesystem = null)
41+
public function __construct(Filesystem $filesystem)
4442
{
45-
if (!$filesystem instanceof Filesystem) {
46-
@trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
47-
48-
parent::__construct($filesystem);
49-
50-
return;
51-
}
52-
5343
parent::__construct();
5444

5545
$this->filesystem = $filesystem;
@@ -96,17 +86,11 @@ protected function configure()
9686
*/
9787
protected function execute(InputInterface $input, OutputInterface $output)
9888
{
99-
// BC to be removed in 4.0
100-
if (null === $this->filesystem) {
101-
$this->filesystem = $this->getContainer()->get('filesystem');
102-
$baseDir = $this->getContainer()->getParameter('kernel.project_dir');
103-
}
104-
10589
$kernel = $this->getApplication()->getKernel();
10690
$targetArg = rtrim($input->getArgument('target'), '/');
10791

10892
if (!is_dir($targetArg)) {
109-
$targetArg = (isset($baseDir) ? $baseDir : $kernel->getContainer()->getParameter('kernel.project_dir')).'/'.$targetArg;
93+
$targetArg = $kernel->getContainer()->getParameter('kernel.project_dir').'/'.$targetArg;
11094

11195
if (!is_dir($targetArg)) {
11296
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));

‎src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

14+
use Symfony\Component\Console\Command\Command;
1415
use Symfony\Component\Console\Input\InputInterface;
1516
use Symfony\Component\Console\Input\InputOption;
1617
use Symfony\Component\Console\Output\OutputInterface;
@@ -26,7 +27,7 @@
2627
*
2728
* @final since version 3.4
2829
*/
29-
class CacheClearCommand extends ContainerAwareCommand
30+
class CacheClearCommand extends Command
3031
{
3132
private $cacheClearer;
3233
private $filesystem;

‎src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php
+4-20Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

1414
use Psr\Cache\CacheItemPoolInterface;
15+
use Symfony\Component\Console\Command\Command;
1516
use Symfony\Component\Console\Input\InputInterface;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Output\OutputInterface;
@@ -23,23 +24,12 @@
2324
*
2425
* @author Nicolas Grekas <p@tchwork.com>
2526
*/
26-
final class CachePoolClearCommand extends ContainerAwareCommand
27+
final class CachePoolClearCommand extends Command
2728
{
2829
private $poolClearer;
2930

30-
/**
31-
* @param Psr6CacheClearer $poolClearer
32-
*/
33-
public function __construct($poolClearer = null)
31+
public function __construct(Psr6CacheClearer $poolClearer)
3432
{
35-
if (!$poolClearer instanceof Psr6CacheClearer) {
36-
@trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
37-
38-
parent::__construct($poolClearer);
39-
40-
return;
41-
}
42-
4333
parent::__construct();
4434

4535
$this->poolClearer = $poolClearer;
@@ -70,12 +60,6 @@ protected function configure()
7060
*/
7161
protected function execute(InputInterface $input, OutputInterface $output)
7262
{
73-
// BC to be removed in 4.0
74-
if (null === $this->poolClearer) {
75-
$this->poolClearer = $this->getContainer()->get('cache.global_clearer');
76-
$cacheDir = $this->getContainer()->getParameter('kernel.cache_dir');
77-
}
78-
7963
$io = new SymfonyStyle($input, $output);
8064
$kernel = $this->getApplication()->getKernel();
8165
$pools = array();
@@ -99,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9983

10084
foreach ($clearers as $id => $clearer) {
10185
$io->comment(sprintf('Calling cache clearer: <info>%s</info>', $id));
102-
$clearer->clear(isset($cacheDir) ? $cacheDir : $kernel->getContainer()->getParameter('kernel.cache_dir'));
86+
$clearer->clear($kernel->getContainer()->getParameter('kernel.cache_dir'));
10387
}
10488

10589
foreach ($pools as $id => $pool) {

‎src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php
+4-20Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

14+
use Symfony\Component\Console\Command\Command;
1415
use Symfony\Component\Console\Input\InputInterface;
1516
use Symfony\Component\Console\Input\InputOption;
1617
use Symfony\Component\Console\Output\OutputInterface;
@@ -24,23 +25,12 @@
2425
*
2526
* @final since version 3.4
2627
*/
27-
class CacheWarmupCommand extends ContainerAwareCommand
28+
class CacheWarmupCommand extends Command
2829
{
2930
private $cacheWarmer;
3031

31-
/**
32-
* @param CacheWarmerAggregate $cacheWarmer
33-
*/
34-
public function __construct($cacheWarmer = null)
32+
public function __construct(CacheWarmerAggregate $cacheWarmer)
3533
{
36-
if (!$cacheWarmer instanceof CacheWarmerAggregate) {
37-
@trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
38-
39-
parent::__construct($cacheWarmer);
40-
41-
return;
42-
}
43-
4434
parent::__construct();
4535

4636
$this->cacheWarmer = $cacheWarmer;
@@ -77,12 +67,6 @@ protected function configure()
7767
*/
7868
protected function execute(InputInterface $input, OutputInterface $output)
7969
{
80-
// BC to be removed in 4.0
81-
if (null === $this->cacheWarmer) {
82-
$this->cacheWarmer = $this->getContainer()->get('cache_warmer');
83-
$cacheDir = $this->getContainer()->getParameter('kernel.cache_dir');
84-
}
85-
8670
$io = new SymfonyStyle($input, $output);
8771

8872
$kernel = $this->getApplication()->getKernel();
@@ -92,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9276
$this->cacheWarmer->enableOptionalWarmers();
9377
}
9478

95-
$this->cacheWarmer->warmUp(isset($cacheDir) ? $cacheDir : $kernel->getContainer()->getParameter('kernel.cache_dir'));
79+
$this->cacheWarmer->warmUp($kernel->getContainer()->getParameter('kernel.cache_dir'));
9680

9781
$io->success(sprintf('Cache for the "%s" environment (debug=%s) was successfully warmed.', $kernel->getEnvironment(), var_export($kernel->isDebug(), true)));
9882
}

‎src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\Console\Helper\DescriptorHelper;
1515
use Symfony\Component\Config\ConfigCache;
16+
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputOption;
1819
use Symfony\Component\Console\Input\InputInterface;
@@ -30,7 +31,7 @@
3031
*
3132
* @internal since version 3.4
3233
*/
33-
class ContainerDebugCommand extends ContainerAwareCommand
34+
class ContainerDebugCommand extends Command
3435
{
3536
/**
3637
* @var ContainerBuilder|null

‎src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php
+3-30Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

1414
use Symfony\Bundle\FrameworkBundle\Console\Helper\DescriptorHelper;
15+
use Symfony\Component\Console\Command\Command;
1516
use Symfony\Component\Console\Input\InputArgument;
1617
use Symfony\Component\Console\Input\InputOption;
1718
use Symfony\Component\Console\Input\InputInterface;
@@ -26,23 +27,12 @@
2627
*
2728
* @final since version 3.4
2829
*/
29-
class EventDispatcherDebugCommand extends ContainerAwareCommand
30+
class EventDispatcherDebugCommand extends Command
3031
{
3132
private $dispatcher;
3233

33-
/**
34-
* @param EventDispatcherInterface $dispatcher
35-
*/
36-
public function __construct($dispatcher = null)
34+
public function __construct(EventDispatcherInterface $dispatcher)
3735
{
38-
if (!$dispatcher instanceof EventDispatcherInterface) {
39-
@trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
40-
41-
parent::__construct($dispatcher);
42-
43-
return;
44-
}
45-
4636
parent::__construct();
4737

4838
$this->dispatcher = $dispatcher;
@@ -81,11 +71,6 @@ protected function configure()
8171
*/
8272
protected function execute(InputInterface $input, OutputInterface $output)
8373
{
84-
// BC to be removed in 4.0
85-
if (null === $this->dispatcher) {
86-
$this->dispatcher = $this->getEventDispatcher();
87-
}
88-
8974
$io = new SymfonyStyle($input, $output);
9075

9176
$options = array();
@@ -105,16 +90,4 @@ protected function execute(InputInterface $input, OutputInterface $output)
10590
$options['output'] = $io;
10691
$helper->describe($io, $this->dispatcher, $options);
10792
}
108-
109-
/**
110-
* Loads the Event Dispatcher from the container.
111-
*
112-
* BC to removed in 4.0
113-
*
114-
* @return EventDispatcherInterface
115-
*/
116-
protected function getEventDispatcher()
117-
{
118-
return $this->getContainer()->get('event_dispatcher');
119-
}
12093
}

‎src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
+3-39Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\Console\Helper\DescriptorHelper;
1515
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
16+
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
1819
use Symfony\Component\Console\Input\InputOption;
@@ -30,49 +31,17 @@
3031
*
3132
* @final since version 3.4
3233
*/
33-
class RouterDebugCommand extends ContainerAwareCommand
34+
class RouterDebugCommand extends Command
3435
{
3536
private $router;
3637

37-
/**
38-
* @param RouterInterface $router
39-
*/
40-
public function __construct($router = null)
38+
public function __construct(RouterInterface $router)
4139
{
42-
if (!$router instanceof RouterInterface) {
43-
@trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
44-
45-
parent::__construct($router);
46-
47-
return;
48-
}
49-
5040
parent::__construct();
5141

5242
$this->router = $router;
5343
}
5444

55-
/**
56-
* {@inheritdoc}
57-
*
58-
* BC to be removed in 4.0
59-
*/
60-
public function isEnabled()
61-
{
62-
if (null !== $this->router) {
63-
return parent::isEnabled();
64-
}
65-
if (!$this->getContainer()->has('router')) {
66-
return false;
67-
}
68-
$router = $this->getContainer()->get('router');
69-
if (!$router instanceof RouterInterface) {
70-
return false;
71-
}
72-
73-
return parent::isEnabled();
74-
}
75-
7645
/**
7746
* {@inheritdoc}
7847
*/
@@ -104,11 +73,6 @@ protected function configure()
10473
*/
10574
protected function execute(InputInterface $input, OutputInterface $output)
10675
{
107-
// BC to be removed in 4.0
108-
if (null === $this->router) {
109-
$this->router = $this->getContainer()->get('router');
110-
}
111-
11276
$io = new SymfonyStyle($input, $output);
11377
$name = $input->getArgument('name');
11478
$helper = new DescriptorHelper();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.