package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 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 = [])
{
@@ -49,10 +47,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 +56,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 +67,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);
}