Update dependencies

This commit is contained in:
Chris Hunt
2024-02-16 21:36:54 +00:00
parent 22d7a59e59
commit d52ae0d3c3
9569 changed files with 460443 additions and 282416 deletions

View File

@@ -11,7 +11,6 @@
namespace Symfony\Component\Console\Helper;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Exception\InvalidArgumentException;
/**
@@ -19,16 +18,15 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @implements \IteratorAggregate<string, Helper>
* @implements \IteratorAggregate<string, HelperInterface>
*/
class HelperSet implements \IteratorAggregate
{
/** @var array<string, Helper> */
private $helpers = [];
private $command;
/** @var array<string, HelperInterface> */
private array $helpers = [];
/**
* @param Helper[] $helpers An array of helper
* @param HelperInterface[] $helpers
*/
public function __construct(array $helpers = [])
{
@@ -37,7 +35,10 @@ class HelperSet implements \IteratorAggregate
}
}
public function set(HelperInterface $helper, string $alias = null)
/**
* @return void
*/
public function set(HelperInterface $helper, ?string $alias = null)
{
$this->helpers[$helper->getName()] = $helper;
if (null !== $alias) {
@@ -49,10 +50,8 @@ class HelperSet implements \IteratorAggregate
/**
* Returns true if the helper if defined.
*
* @return bool
*/
public function has(string $name)
public function has(string $name): bool
{
return isset($this->helpers[$name]);
}
@@ -60,11 +59,9 @@ class HelperSet implements \IteratorAggregate
/**
* Gets a helper value.
*
* @return HelperInterface
*
* @throws InvalidArgumentException if the helper is not defined
*/
public function get(string $name)
public function get(string $name): HelperInterface
{
if (!$this->has($name)) {
throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
@@ -73,35 +70,7 @@ class HelperSet implements \IteratorAggregate
return $this->helpers[$name];
}
/**
* @deprecated since Symfony 5.4
*/
public function setCommand(Command $command = null)
{
trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__);
$this->command = $command;
}
/**
* Gets the command associated with this helper set.
*
* @return Command
*
* @deprecated since Symfony 5.4
*/
public function getCommand()
{
trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__);
return $this->command;
}
/**
* @return \Traversable<string, Helper>
*/
#[\ReturnTypeWillChange]
public function getIterator()
public function getIterator(): \Traversable
{
return new \ArrayIterator($this->helpers);
}