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 1d352cf

Browse filesBrowse files
committed
Remove HelperSet::setCommand() and getCommand()
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent 7a3ab9e commit 1d352cf
Copy full SHA for 1d352cf

File tree

3 files changed

+1
-53
lines changed
Filter options

3 files changed

+1
-53
lines changed

‎src/Symfony/Component/Console/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CHANGELOG
88
* Remove `Helper::strlen()`, use `Helper::width()` instead
99
* Remove `Helper::strlenWithoutDecoration()`, use `Helper::removeDecoration()` instead
1010
* `AddConsoleCommandPass` can not be configured anymore
11+
* Remove `HelperSet::setCommand()` and `getCommand()` without replacement
1112

1213
5.4
1314
---

‎src/Symfony/Component/Console/Helper/HelperSet.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/HelperSet.php
-24Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Console\Helper;
1313

14-
use Symfony\Component\Console\Command\Command;
1514
use Symfony\Component\Console\Exception\InvalidArgumentException;
1615

1716
/**
@@ -25,7 +24,6 @@ class HelperSet implements \IteratorAggregate
2524
* @var Helper[]
2625
*/
2726
private $helpers = [];
28-
private $command;
2927

3028
/**
3129
* @param Helper[] $helpers An array of helper
@@ -69,28 +67,6 @@ public function get(string $name): HelperInterface
6967
return $this->helpers[$name];
7068
}
7169

72-
/**
73-
* @deprecated since Symfony 5.4
74-
*/
75-
public function setCommand(Command $command = null)
76-
{
77-
trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__);
78-
79-
$this->command = $command;
80-
}
81-
82-
/**
83-
* Gets the command associated with this helper set.
84-
*
85-
* @deprecated since Symfony 5.4
86-
*/
87-
public function getCommand(): Command
88-
{
89-
trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__);
90-
91-
return $this->command;
92-
}
93-
9470
/**
9571
* @return \Traversable<string, Helper>
9672
*/

‎src/Symfony/Component/Console/Tests/Helper/HelperSetTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Helper/HelperSetTest.php
-29Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -74,35 +74,6 @@ public function testGet()
7474
}
7575
}
7676

77-
/**
78-
* @group legacy
79-
*/
80-
public function testSetCommand()
81-
{
82-
$cmd_01 = new Command('foo');
83-
$cmd_02 = new Command('bar');
84-
85-
$helperset = new HelperSet();
86-
$helperset->setCommand($cmd_01);
87-
$this->assertEquals($cmd_01, $helperset->getCommand(), '->setCommand() stores given command');
88-
89-
$helperset = new HelperSet();
90-
$helperset->setCommand($cmd_01);
91-
$helperset->setCommand($cmd_02);
92-
$this->assertEquals($cmd_02, $helperset->getCommand(), '->setCommand() overwrites stored command with consecutive calls');
93-
}
94-
95-
/**
96-
* @group legacy
97-
*/
98-
public function testGetCommand()
99-
{
100-
$cmd = new Command('foo');
101-
$helperset = new HelperSet();
102-
$helperset->setCommand($cmd);
103-
$this->assertEquals($cmd, $helperset->getCommand(), '->getCommand() retrieves stored command');
104-
}
105-
10677
public function testIteration()
10778
{
10879
$helperset = new HelperSet();

0 commit comments

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