1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 02:39:46 +02:00

Update composer

This commit is contained in:
Daniel Neto 2024-03-05 19:29:45 -03:00
parent 330cdbe615
commit 0c83c9a678
442 changed files with 9523 additions and 10793 deletions

View file

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