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

@@ -14,6 +14,8 @@ namespace Symfony\Component\Console\Command;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Completion\Suggestion;
use Symfony\Component\Console\Helper\HelperInterface;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
@@ -24,8 +26,8 @@ use Symfony\Component\Console\Output\OutputInterface;
*/
final class LazyCommand extends Command
{
private $command;
private $isEnabled;
private \Closure|Command $command;
private ?bool $isEnabled;
public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true)
{
@@ -45,6 +47,9 @@ final class LazyCommand extends Command
public function setApplication(Application $application = null): void
{
if (1 > \func_num_args()) {
trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
}
if ($this->command instanceof parent) {
$this->command->setApplication($application);
}
@@ -76,10 +81,7 @@ final class LazyCommand extends Command
$this->getCommand()->complete($input, $suggestions);
}
/**
* @return $this
*/
public function setCode(callable $code): self
public function setCode(callable $code): static
{
$this->getCommand()->setCode($code);
@@ -94,10 +96,7 @@ final class LazyCommand extends Command
$this->getCommand()->mergeApplicationDefinition($mergeArgs);
}
/**
* @return $this
*/
public function setDefinition($definition): self
public function setDefinition(array|InputDefinition $definition): static
{
$this->getCommand()->setDefinition($definition);
@@ -115,39 +114,35 @@ final class LazyCommand extends Command
}
/**
* @return $this
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*/
public function addArgument(string $name, int $mode = null, string $description = '', $default = null): self
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static
{
$this->getCommand()->addArgument($name, $mode, $description, $default);
$suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : [];
$this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues);
return $this;
}
/**
* @return $this
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*/
public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null): self
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static
{
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default);
$suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : [];
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues);
return $this;
}
/**
* @return $this
*/
public function setProcessTitle(string $title): self
public function setProcessTitle(string $title): static
{
$this->getCommand()->setProcessTitle($title);
return $this;
}
/**
* @return $this
*/
public function setHelp(string $help): self
public function setHelp(string $help): static
{
$this->getCommand()->setHelp($help);
@@ -169,10 +164,7 @@ final class LazyCommand extends Command
return $this->getCommand()->getSynopsis($short);
}
/**
* @return $this
*/
public function addUsage(string $usage): self
public function addUsage(string $usage): static
{
$this->getCommand()->addUsage($usage);
@@ -184,10 +176,7 @@ final class LazyCommand extends Command
return $this->getCommand()->getUsages();
}
/**
* @return mixed
*/
public function getHelper(string $name)
public function getHelper(string $name): HelperInterface
{
return $this->getCommand()->getHelper($name);
}