Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] Add ArgvInput::getRawTokens() #54238

Merged
merged 1 commit into from Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Symfony/Component/Console/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========

7.1
---

* Add `ArgvInput::getRawTokens()`

7.0
---

Expand Down
10 changes: 10 additions & 0 deletions src/Symfony/Component/Console/Input/ArgvInput.php
Expand Up @@ -66,7 +66,7 @@
protected function parse(): void
{
$parseOptions = true;
$this->parsed = $this->tokens;

Check failure on line 69 in src/Symfony/Component/Console/Input/ArgvInput.php

View workflow job for this annotation

GitHub Actions / Psalm

InaccessibleProperty

src/Symfony/Component/Console/Input/ArgvInput.php:69:25: InaccessibleProperty: Cannot access private property Symfony\Component\Console\Completion\CompletionInput::$tokens from context Symfony\Component\Console\Input\ArgvInput (see https://psalm.dev/054)

Check failure on line 69 in src/Symfony/Component/Console/Input/ArgvInput.php

View workflow job for this annotation

GitHub Actions / Psalm

InaccessibleProperty

src/Symfony/Component/Console/Input/ArgvInput.php:69:25: InaccessibleProperty: Cannot access private property Symfony\Component\Console\Completion\CompletionInput::$tokens from context Symfony\Component\Console\Input\ArgvInput (see https://psalm.dev/054)
while (null !== $token = array_shift($this->parsed)) {
$parseOptions = $this->parseToken($token, $parseOptions);
}
Expand Down Expand Up @@ -345,6 +345,16 @@
return $default;
}

/**
* Returns un-parsed and not validated tokens.
xabbuh marked this conversation as resolved.
Show resolved Hide resolved
*
* @return list<string>
*/
public function getRawTokens(): array
{
return $this->tokens;
}

/**
* Returns a stringified representation of the args passed to the command.
*/
Expand Down