Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/Symfony/Component/Console/Completion/CompletionInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ final class CompletionInput extends ArgvInput

private $tokens;
private $currentIndex;
private $indexToArgumentIndex = [];
private $completionType;
private $completionName = null;
private $completionValue = '';
Expand All @@ -58,7 +57,7 @@ public static function fromString(string $inputStr, int $currentIndex): self
*/
public static function fromTokens(array $tokens, int $currentIndex): self
{
$input = new static($tokens);
$input = new self($tokens);
$input->tokens = $tokens;
$input->currentIndex = $currentIndex;

Expand Down Expand Up @@ -187,17 +186,6 @@ protected function parseToken(string $token, bool $parseOptions): bool
return $parseOptions;
}

private function getOptionValueFromToken(string $optionToken): string
{
if (str_starts_with($optionToken, '--')) {
// long option name
return $this->getParameterOption($optionToken) ?: '';
}

// short option name (might include value already if it directly followed the name)
return $this->getParameterOption(substr($optionToken, 0, 2)) ?: '';
}

private function getOptionFromToken(string $optionToken): ?InputOption
{
$optionName = ltrim($optionToken, '-');
Expand Down