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 f21ee5f

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

File tree

3 files changed

+1
-52
lines changed
Filter options

3 files changed

+1
-52
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
-23Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class HelperSet implements \IteratorAggregate
2525
* @var Helper[]
2626
*/
2727
private $helpers = [];
28-
private $command;
2928

3029
/**
3130
* @param Helper[] $helpers An array of helper
@@ -69,28 +68,6 @@ public function get(string $name): HelperInterface
6968
return $this->helpers[$name];
7069
}
7170

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-
9471
/**
9572
* @return \Traversable<string, Helper>
9673
*/

‎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.